|
|
@ -7,9 +7,7 @@ window.App ||= {} |
|
|
content_top = content_left = width_delta = height_delta = 0 |
|
|
content_top = content_left = width_delta = height_delta = 0 |
|
|
|
|
|
|
|
|
App.init = -> |
|
|
App.init = -> |
|
|
content_left = parseFloat($('#content').css("left")) |
|
|
|
|
|
content_top = parseFloat($('#content').css("top")) |
|
|
content_top = parseFloat($('#content').css("top")) |
|
|
width_delta = ($(document).width()-$(window).width())/2 |
|
|
|
|
|
height_delta = ($(document).height()-$(window).height())/2 |
|
|
height_delta = ($(document).height()-$(window).height())/2 |
|
|
### |
|
|
### |
|
|
window.scrollTo(width_delta, height_delta) |
|
|
window.scrollTo(width_delta, height_delta) |
|
|
@ -17,11 +15,9 @@ App.init = -> |
|
|
|
|
|
|
|
|
App.scroll = -> |
|
|
App.scroll = -> |
|
|
v_scroll = $(document).scrollTop() |
|
|
v_scroll = $(document).scrollTop() |
|
|
h_scroll = $(document).scrollLeft() |
|
|
|
|
|
### |
|
|
|
|
|
$("#content").css("left", content_left-((h_scroll-width_delta)/8)) |
|
|
|
|
|
$("#content").css("top", content_top-((v_scroll-height_delta)/8)) |
|
|
|
|
|
### |
|
|
|
|
|
|
|
|
section = Math.floor(v_scroll / 1000) |
|
|
|
|
|
$(".background").css("top", 0) |
|
|
|
|
|
$($(".background")[section]).css("top", (v_scroll-(section*1000))/2) |
|
|
|
|
|
|
|
|
$(document).on "page:change", -> |
|
|
$(document).on "page:change", -> |
|
|
App.init() |
|
|
App.init() |
|
|
|