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
####################### | |
# Smooth scroll | |
####################### | |
scrollio = (target, speed) -> | |
$("html, body").animate | |
scrollTop: $(target).offset().top | |
, speed, "easeInOutExpo" | |
## Set up an event trigger for scrollio |
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
/** | |
* scrollEvents.js | |
* | |
* Licensed under the MIT license. | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
*/ | |
// http://tympanus.net/codrops/2013/06/06/on-scroll-animated-header/ | |
var scrollEvents = (function() { |
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
####################### | |
# Email subscribe | |
####################### | |
form = $("#subscribe") | |
form.submit (e) -> | |
e.preventDefault() | |
form.removeClass('shake') | |
$.getJSON @action + "?callback=?", $(this).serialize(), (data) -> | |
messageNode = $('.message') |
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
// Converts px to ems | |
// http://www.pjmccormick.com/sweet-sass-function-convert-px-em | |
@function em($target, $context: $base-font-size) | |
@if $target == 0 | |
@return 0 | |
@return $target / $context + 0em | |
$base-font-size: 16px |
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
@import compass/css3/font-face | |
$font-name: "myfont" | |
+font-face("#{$font-name}", font-files( "#{$font-name}.woff", "#{$font-name}.ttf", "#{$font-name}.svg"), "#{$font-name}.eot", 300, normal) | |
@mixin myfont | |
font-family: 'myfont', arial, sans-serif | |
font-weight: normal | |
// Usage | |
h1 |
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
// -------------------------------------------------------- | |
// arrows | |
// -------------------------------------------------------- | |
// $direction: top, left, right, bottom, top-left, top-right, bottom-left, bottom-right | |
// $color: hex, rgb or rbga | |
// $size: px or em | |
// @example | |
// .element{ | |
// @include arrow(top, #000, 50px); | |
// } |
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
####################################### | |
## Prevent widows on headlines! | |
####################################### | |
widowSelector = $('header h2') | |
widowSelector.each -> | |
wordArray = $(this).text().split(" ") | |
finalTitle = "" | |
i = 0 | |
while i <= wordArray.length - 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
document.onkeydown = (event)-> | |
left = 37 | |
up = 38 | |
right = 39 | |
down = 40 | |
switch event.keyCode | |
when left then | |
when right then | |
when up then | |
when down then |
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
.already-visible | |
+opacity(1) | |
img | |
+opacity(0) | |
@include animated(1s, .3s) |
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
if (document.documentElement.clientWidth > 640) |
OlderNewer