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 heightEqualizer($row) { | |
var $columns = $row.find('> *'); | |
function calculateHeight($el) { | |
var height = 0; | |
$el.each(function() { | |
var heightVal = $(this).css('height'); | |
$(this).css('height', ''); |
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
$(window) | |
.on('scroll', onScroll); | |
function onScroll() { | |
var sticky = $('.js-sticky-nav').filter(':visible'); | |
if (sticky.length) { | |
toggleSticky(sticky); | |
} | |
} |
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 inputValidations() { | |
function isAlphaNumeric(val) { | |
var letter = /[a-zA-Z]/, | |
number = /[0-9]/; | |
var valid = number.test(val) && letter.test(val); | |
return valid; | |
} | |
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 drawCircle(text, size, color) { | |
var textSize = Math.ceil(size / 2.5); | |
var font = 'Proxima Nova, proxima-nova, HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif'; | |
var colors = ["#1abc9c", "#16a085", "#f1c40f", "#f39c12", "#2ecc71", "#27ae60", "#e67e22", "#d35400", "#3498db", "#2980b9", "#e74c3c", "#c0392b", "#9b59b6", "#8e44ad", "#bdc3c7", "#34495e", "#2c3e50", "#95a5a6", "#7f8c8d", "#ec87bf", "#d870ad", "#f69785", "#9ba37e", "#b49255", "#b49255", "#a94136"]; | |
var colorIndex = Math.floor((text.charCodeAt(0) - 65) % colors.length); | |
var finalColor = color || colors[colorIndex]; | |
var template = [ | |
'<svg height="' + size + '" width="' + size + '" style="background: ' + finalColor + '">', | |
'<text text-anchor="middle" x="50%" y="50%" dy="0.35em" fill="white" font-size="' + textSize + '" font-family="' + font + '">' + text.toUpperCase() + '</text>', |
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
Avatar Generator from Name | |
-------------------------- | |
A name (first name and surname) is input and output using the initials from the name and a background colour (based on the first name first letter). The background colors are from from http://flatuicolors.com/ |
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 scrollAnimated(to, duration) { | |
var start = $(window).scrollTop(), | |
change = to - start, | |
currentTime = 0, | |
increment = 20; | |
function easeInOut(currentTime, startValue, change, duration) { | |
currentTime /= duration / 2; | |
if (currentTime < 1) { |
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 debounce(func, wait, immediate) { | |
var timeout; | |
return function() { | |
var context = this, args = arguments; | |
var later = function() { | |
timeout = null; | |
if (!immediate) func.apply(context, args); | |
}; | |
var callNow = immediate && !timeout; |
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
{ | |
transitionSpeed: 300, | |
transitionEasing: 'ease', | |
controlElement: '[data-control]', | |
contentElement: '[data-content]', | |
groupElement: '[data-accordion-group]', | |
singleOpen: true | |
} |
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
@mixin grid($cols: 1, $gutter: 0, $childs: ".item") { | |
width: auto; | |
margin-right: -$gutter; | |
#{$childs} { | |
float: left; | |
width: (100% / $cols); | |
padding-right: $gutter; | |
background-clip: content-box; |
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
// Group class for clearing floats | |
.group { | |
&:before, | |
&:after { | |
content: " "; | |
display: table; | |
} | |
&:after { |
NewerOlder