Forked from lilrogalski/gist:1f4b3bc4886557d73b24
Last active
August 29, 2015 14:13
-
-
Save charlieschwabacher/d23f53da89c720b5660c to your computer and use it in GitHub Desktop.
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
# setup variables | |
$window = $ window | |
$section = $ '.tour-section' | |
$intro = $ '.tour-intro' | |
adjustWindow = -> | |
winH = $window.height() | |
win2 = winH * 2 | |
winH = 550 if winH <= 550 | |
$intro.height winH | |
$section.height winH * 2 | |
$body = $ "body" | |
$body.attr "data-#{winH}", $body.attr("data-intro") | |
for i in [1..8] | |
$body.attr "data-#{win2 * i}", $body.attr "data-section-#{i}" | |
$body.removeAttr "data-section-#{i}" | |
$body.attr "data-#{winH}", $body.attr 'data-intro' | |
$body.removeAttr 'data-intro' | |
adjustWindow() | |
$window.on "resize", -> | |
adjustWindow() |
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
%body{"data-intro" => "background: rgb(81, 86, 109)", | |
"data-section-1" => "background: rgb(69, 82, 121)", | |
"data-section-2" => "background: rgb(94, 107, 151)", | |
"data-section-3" => "background: rgb(68, 74, 100)", | |
"data-section-4" => "background: rgb(94, 108, 154)", | |
"data-section-5" => "background: rgb(67, 72, 95)", | |
"data-section-6" => "background: rgb(65, 73, 104)", | |
"data-section-7" => "background: rgb(41, 50, 71)", | |
"data-section-8" => "background: rgb(94, 109, 157)"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment