This file contains 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
$('a[href^="#"]').on('click', function(event) { | |
var target = $( $(this).attr('href') ); | |
if( target.length ) { | |
event.preventDefault(); | |
$('html, body').animate({ | |
scrollTop: target.offset().top | |
}, 6500); | |
} | |
}); |
This file contains 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
// Requires jquery color | |
$(document).ready(function() { | |
spectrum(); | |
function spectrum(){ | |
var hue = 'rgb(' + | |
(Math.floor(Math.random() * 256)) + | |
',' + (Math.floor(Math.random() * 256)) | |
+ ',' + (Math.floor(Math.random() * 256)) |
This file contains 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).mousemove(function (e) { | |
var mousePosX = (e.pageX / $(window).width()) * 100; | |
var mousePosY = (e.pageY / $(window).height()) * 100; | |
// console.log(mousePosY) | |
$('.thumbs-block').css('backgroundPosition', mousePosX + '% ' + mousePosY +'%'); | |
}); |
This file contains 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
// Define the breakpoints | |
$breakpoint-small: 600px; | |
$breakpoint-med-small: 960px; | |
$breakpoint-med: 1175px; | |
@mixin screen($size, $type: max, $pixels: $breakpoint-small) { | |
@if $size == 'small' { | |
@media screen and ($type + -width: $breakpoint-small) { | |
@content; | |
} |
This file contains 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
//Create the mixin for theme colors | |
@mixin theme($name, $color) { | |
// Define colors in your theme | |
$primary: $color; | |
$secondary: lighten(adjust-hue($color, 20), 10%); | |
// Add your classes with css colors added | |
.#{$name} { | |
.element { | |
color: $primary; | |
} |
This file contains 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
// Define vertical, horizontal, or both position | |
@mixin center($position) { | |
position: absolute; | |
@if $position == 'vertical' { | |
top: 50%; | |
-webkit-transform: translateY(-50%); | |
-ms-transform: translateY(-50%); | |
transform: translateY(-50%); | |
} |
This file contains 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
// Clearfix mixin | |
%clearfix { | |
*zoom: 1; | |
&:before, &:after { | |
content: " "; | |
display: table; | |
} | |
&:after { | |
clear: both; | |
} |
This file contains 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
// Define default font size | |
@function calculateRem($size) { | |
$remSize: $size / 16px; | |
@return $remSize * 1rem; | |
} | |
@mixin font-size($size) { | |
font-size: $size; | |
font-size: calculateRem($size); | |
} |
This file contains 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
//Animation mixin setup | |
@mixin keyframes($animation-name) { | |
@-webkit-keyframes #{$animation-name} { | |
@content; | |
} | |
@-moz-keyframes #{$animation-name} { | |
@content; | |
} | |
@-ms-keyframes #{$animation-name} { | |
@content; |
This file contains 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 image-2x($image, $width, $height) { | |
@media (min--moz-device-pixel-ratio: 1.3), | |
(-o-min-device-pixel-ratio: 2.6/2), | |
(-webkit-min-device-pixel-ratio: 1.3), | |
(min-device-pixel-ratio: 1.3), | |
(min-resolution: 1.3dppx) { | |
background-image: url($image); | |
background-size: $width $height; | |
} | |
} |
OlderNewer