This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<title>Example of FormData</title> | |
</head> | |
<body> | |
<form name="subscription"> | |
<p><input type="text" name="first_name" placeholder="First name"></p> | |
<p><input type="text" name="last_name" placeholder="Last name"></p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function dom(selector, context) { | |
let nodes = (context || document).querySelectorAll(selector); | |
return (nodes.length === 1) ? nodes[0] : Array.prototype.slice.call(nodes); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function ($, Hammer) { | |
'use strict'; | |
var Carousel = function (element) { | |
this.container = element; | |
this.paneGroup = $('.Carousel-paneGroup', this.container)[0]; | |
this.direction = Hammer.DIRECTION_HORIZONTAL; | |
this.panes = $('.Carousel-pane', this.container); | |
this.paneGroupSize = this.paneGroup.offsetWidth; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* From http://thatemil.com/blog/2015/01/03/reset-your-fieldset/ by Emil Björklund */ | |
legend { | |
display: table; | |
padding: 0; | |
} | |
fieldset { | |
border: 0; | |
margin: 0; | |
min-width: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
'use strict'; | |
var BlockLink = function (element) { | |
this.block = element; | |
this.link = $('a', this.block).attr('href'); | |
this.init(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="Doughnut js-doughnut" data-percent="55"> | |
<div class="Doughnut-slice"> | |
<span class="Doughnut-pie"></span> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
var Placeholder = function (element) { | |
this.field = element; | |
this.password = (this.field.attr('type') === 'password'); | |
this.placeholder = this.field.attr('placeholder'); | |
this.init(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.u-verticalAlign { | |
&:before { | |
content: ''; | |
display: inline-block; | |
height: 100%; | |
margin-right: -0.25em; | |
vertical-align: middle; | |
} | |
} | |
.u-verticalAlign-content { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<video poster="poster.jpg" controls> | |
<source type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"' src="video.mp4"> | |
<source type='video/webm; codecs="vp8.0, vorbis"' src="video.webm"> | |
</video> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function validateEmailAddress(email) { | |
let regexEmailPattern = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/igm; | |
return regexEmailPattern.test(email); | |
} |