From 6eaa37b7768a365c4128cd184a7193951cccf51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Tue, 9 Jun 2015 22:11:43 +0200 Subject: [PATCH] BACKGROUND IS BASED ON DOMINANT COLOR OF THUMBNAIL HOLYSHIT --- php/footer.php | 2 +- static/css/style.css | 17 ++++++++++++++++- static/js/youtube.js | 19 +++++++------------ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/php/footer.php b/php/footer.php index a7c27b69..c1a74d93 100755 --- a/php/footer.php +++ b/php/footer.php @@ -59,7 +59,7 @@ - + diff --git a/static/css/style.css b/static/css/style.css index 180b23e1..226f3a77 100755 --- a/static/css/style.css +++ b/static/css/style.css @@ -827,4 +827,19 @@ ul #chat-log{ .rc{ display: none; -} \ No newline at end of file +} + +#search::-webkit-input-placeholder { /* WebKit browsers */ + color: #FFF; +} +#search:-moz-placeholder { /* Mozilla Firefox 4 to 18 */ + color: #FFF; + opacity: 1; +} +#search::-moz-placeholder { /* Mozilla Firefox 19+ */ + color: #FFF; + opacity: 1; +} +#search:-ms-input-placeholder { /* Internet Explorer 10+ */ + color: #FFF; +} diff --git a/static/js/youtube.js b/static/js/youtube.js index 693e8e93..31500bcf 100755 --- a/static/js/youtube.js +++ b/static/js/youtube.js @@ -77,15 +77,6 @@ function setup_youtube_listener(channel) $(document).ready(function() { - /* - var img = new Image(); - img.onload = function () { - var colorThief = new ColorThief(); - colorThief.getColor(img); - }; - img.crossOrigin = 'Anonymous'; - img.src = 'http://img.youtube.com/vi/NuEfvIca0XU/mqdefault.jpg'; -*/ setup_youtube_listener(chan); //Materialize.toast("Passwords have been reset. If anything is not right, please send us a mail @ contact@zoff.no", 10000); $("#settings").sideNav({ @@ -258,9 +249,13 @@ function readyLooks() } function setBGimage(id){ - var hsl=[getRandomInt(0,360), getRandomInt(60,80)] - var colorTxt = "hsl("+hsl[0]+", 50%, 30%);"; - $("body").css("background-color", colorTxt); + var img = new Image(); + img.onload = function () { + var colorThief = new ColorThief(); + $("body").css("background-color", colorThief.getColor(img)); + }; + img.crossOrigin = 'Anonymous'; + img.src = 'http://cors-anywhere.herokuapp.com/http://img.youtube.com/vi/'+id+'/mqdefault.jpg'; } function notifyUser(id, title) {