split lights from enthusiast to add to each page

This commit is contained in:
Walker Waylon Scott 2017-07-23 13:44:25 -05:00
parent cda0865203
commit 203889aba4
2 changed files with 37 additions and 39 deletions

View file

@ -343,45 +343,6 @@ function update_sentiment_year(year)
}
$(document).ready(function() {
var top_movementStrength = 50;
var top_width = top_movementStrength / $(window).width();
var top_height = top_movementStrength / $(window).height();
$("#top-image").mousemove(function(e){
var pageX = e.pageX - ($(window).width() / 2);
var pageY = e.pageY - ($(window).height() / 2);
var topX = top_width * pageX * -1 - 25;
var topY = top_height * pageY * -1 - 50;
$('#top-image').css("background-position", topX+"px "+topY+"px");
});
var middle_movementStrength = 15;
var middle_width = middle_movementStrength / $(window).width();
var middle_height = middle_movementStrength / $(window).height();
$("#middle-image").mousemove(function(e){
var pageX = e.pageX - ($(window).width() / 2);
var pageY = e.pageY - ($(window).height() / 2);
var middle_X = middle_width * pageX * -1 - 25;
var middle_Y = middle_height * pageY * -1 - 50;
$('#middle-image').css("background-position", middle_X+"px "+middle_Y+"px");
});
var movementStrength = 5;
var width = movementStrength / $(window).width();
var height = movementStrength / $(window).height();
$("#bottom-image").mousemove(function(e){
var pageX = e.pageX - ($(window).width() / 2);
var pageY = e.pageY - ($(window).height() / 2);
var bottom_X = width * pageX * -1 - 25;
var bottom_Y = height * pageY * -1 - 50;
$('#bottom-image').css("background-position", bottom_X+"px "+bottom_Y+"px");
});
});
$(window).resize(function(){
var settings = update_word_cloud_settings()
console.log(settings)

37
src/static/js/lights.js Normal file
View file

@ -0,0 +1,37 @@
$(document).ready(function() {
var top_movementStrength = 50;
var top_width = top_movementStrength / $(window).width();
var top_height = top_movementStrength / $(window).height();
$("#top-image").mousemove(function(e){
var pageX = e.pageX - ($(window).width() / 2);
var pageY = e.pageY - ($(window).height() / 2);
var topX = top_width * pageX * -1 - 25;
var topY = top_height * pageY * -1 - 50;
$('#top-image').css("background-position", topX+"px "+topY+"px");
});
var middle_movementStrength = 15;
var middle_width = middle_movementStrength / $(window).width();
var middle_height = middle_movementStrength / $(window).height();
$("#middle-image").mousemove(function(e){
var pageX = e.pageX - ($(window).width() / 2);
var pageY = e.pageY - ($(window).height() / 2);
var middle_X = middle_width * pageX * -1 - 25;
var middle_Y = middle_height * pageY * -1 - 50;
$('#middle-image').css("background-position", middle_X+"px "+middle_Y+"px");
});
var movementStrength = 5;
var width = movementStrength / $(window).width();
var height = movementStrength / $(window).height();
$("#bottom-image").mousemove(function(e){
var pageX = e.pageX - ($(window).width() / 2);
var pageY = e.pageY - ($(window).height() / 2);
var bottom_X = width * pageX * -1 - 25;
var bottom_Y = height * pageY * -1 - 50;
$('#bottom-image').css("background-position", bottom_X+"px "+bottom_Y+"px");
});
});