diff --git a/src/static/bottom.pdn b/src/static/bottom.pdn index 662c1a7..b4f520f 100644 Binary files a/src/static/bottom.pdn and b/src/static/bottom.pdn differ diff --git a/src/static/bottom.png b/src/static/bottom.png index 40870ac..2e101fa 100644 Binary files a/src/static/bottom.png and b/src/static/bottom.png differ diff --git a/src/static/css/custom.css b/src/static/css/custom.css index 43ef666..d6d71f0 100644 --- a/src/static/css/custom.css +++ b/src/static/css/custom.css @@ -19,6 +19,11 @@ body{ background-repeat: repeat; } +#middle-image{ + background-image: url("/static/middle.png"); + background-repeat: repeat; +} + #bottom-image{ background-image: url("/static/bottom.png"); background-repeat: repeat; @@ -73,6 +78,7 @@ body{ font-size:16px; } .kpi-value { + text-align:center; /* color: #B80000; */ font-weight:8; font-size:18px; @@ -82,13 +88,14 @@ body{ } .kpi-row{ + text-align:center; float: none; margin: 0 auto; } #score{ color: var(--score-color); - color: var(--light-blue); + /*color: var(--light-blue);*/ } #gross{ @@ -129,7 +136,8 @@ body{ } .centered{ - float: none; + text-align:center; + float: center; margin: 0 auto; } @@ -140,6 +148,9 @@ body{ } .note{ + text-align:center; + float: center; + margin: auto; color:var(--dark-blue); } diff --git a/src/static/js/enthusiast.js b/src/static/js/enthusiast.js index bd7486f..26a5aba 100644 --- a/src/static/js/enthusiast.js +++ b/src/static/js/enthusiast.js @@ -135,6 +135,10 @@ var sentiment_data = { } + +function update_word_cloud_settings(){ + +console.log('update') if (window.innerWidth > 1000){ wc_width = 500 wc_height = 350 @@ -160,6 +164,9 @@ word_coud_settings = { to: 0.02 } } + + return word_coud_settings; +} @@ -183,7 +190,7 @@ jQuery(document).ready(function(){ jQuery(".chosen").chosen(); score_timeseries = c3.generate(data); sentiment_chart = c3.generate(sentiment_data) - $('#word_cloud').jQCloud([{'text':'pyDataVizDay', 'weight':1}], word_coud_settings) + $('#word_cloud').jQCloud([{'text':'pyDataVizDay', 'weight':1}], update_word_cloud_settings()) update_all() @@ -311,7 +318,7 @@ function update_words_year(year) words.done(function(data) { // $('#word_cloud').html('') - $('#word_cloud').jQCloud('update', words.responseJSON); + $('#word_cloud').jQCloud('update', words.responseJSON, update_word_cloud_settings()); }) } @@ -334,28 +341,49 @@ function update_sentiment_year(year) } $(document).ready(function() { -var movementStrength = 30; -var top_height = movementStrength / $(window).height(); -var top_width = movementStrength / $(window).width(); +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 newvalueX = top_width * pageX * -1 - 25; - var newvalueY = top_height * pageY * -1 - 50; - $('#top-image').css("background-position", newvalueX+"px "+newvalueY+"px"); + var topX = top_width * pageX * -1 - 25; + var topY = top_height * pageY * -1 - 50; + $('#top-image').css("background-position", topX+"px "+topY+"px"); }); -var movementStrength = 10; -var height = movementStrength / $(window).height(); +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 newvalueX = width * pageX * -1 - 25; - var newvalueY = height * pageY * -1 - 50; - $('#bottom-image').css("background-position", newvalueX+"px "+newvalueY+"px"); + 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"); }); -}); \ No newline at end of file +}); + + +$(window).resize(function(){ + var settings = update_word_cloud_settings() + console.log(settings) + $('#word_cloud').empty(); + $('#word_cloud').jQCloud('destroy') + $('#word_cloud').jQCloud([{'text':'pyDataVizDay', 'weight':1}], settings) + update_words() +}) \ No newline at end of file diff --git a/src/static/middle.png b/src/static/middle.png new file mode 100644 index 0000000..4fb4fae Binary files /dev/null and b/src/static/middle.png differ diff --git a/src/static/top.png b/src/static/top.png index 02950c2..8838ed8 100644 Binary files a/src/static/top.png and b/src/static/top.png differ diff --git a/src/templates/data_form.html b/src/templates/data_form.html index 780395c..5791662 100644 --- a/src/templates/data_form.html +++ b/src/templates/data_form.html @@ -26,7 +26,7 @@ {% endfor %}