From f60e9ccd5b046101903a79bf6afa0cf87fdd956c Mon Sep 17 00:00:00 2001 From: joak Date: Mon, 17 Aug 2020 11:55:24 +0200 Subject: init --- assets/static/script.js | 75 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 assets/static/script.js (limited to 'assets/static/script.js') diff --git a/assets/static/script.js b/assets/static/script.js new file mode 100644 index 0000000..ea7a927 --- /dev/null +++ b/assets/static/script.js @@ -0,0 +1,75 @@ +window.addEventListener('mousemove', event => { + var x = event.clientX; + var y = event.clientY; + var move = document.getElementsByClassName("workthumb"); + for (i = 0; i < move.length; i++) { + move[i].style.left = x+'px'; + move[i].style.top = y+'px'; + } +}); + + +var background = document.getElementById("background"); +background.addEventListener("change", function() { + if(background.value == "white"){ + document.body.style.background = "#ffffff"; + } else if (background.value == "black"){ + document.body.style.background = "#000000"; + } else if (background.value == "red"){ + document.body.style.background = "#ff0000"; + } else if (background.value == "green"){ + document.body.style.background = "#00ff00"; + } else if (background.value == "blue"){ + document.body.style.background = "#0000ff"; + }else if (background.value == "windowsxp"){ + document.body.style.backgroundImage = "url('/static/images/windowsxp.jpeg')"; + }else if (background.value == "osxgalaxy"){ + document.body.style.backgroundImage = "url('/static/images/osxgalaxy.jpeg')"; + }else if (background.value == "ubuntu1010"){ + document.body.style.backgroundImage = "url('/static/images/ubuntu1010.jpeg')"; + }else if (background.value == "windows98"){ + document.body.style.backgroundImage = "url('/static/images/windows98.jpeg')"; + }else if (background.value == "windows10"){ + document.body.style.backgroundImage = "url('/static/images/windows10.jpeg')"; + } +}); + +var foregroundimg = document.getElementById("foregroundimg"); +var foreground = document.getElementById("foreground"); +foreground.addEventListener("change", function() { + if(foreground.value == "malevich"){ + foregroundimg.removeAttribute("width"); + foregroundimg.setAttribute('height', '100%'); + foregroundimg.src = "/static/images/malevich.png"; + } else if (foreground.value == "bruegel"){ + foregroundimg.removeAttribute("height"); + foregroundimg.setAttribute('width', '100%'); + foregroundimg.src = "/static/images/bruegel.png"; + } else if (foreground.value == "luegt"){ + foregroundimg.removeAttribute("height"); + foregroundimg.setAttribute('width', '100%'); + foregroundimg.src = "/static/images/luegt.png"; + } else if (foreground.value == "metzger"){ + foregroundimg.removeAttribute("height"); + foregroundimg.setAttribute('width', '100%'); + foregroundimg.src = "/static/images/metzger.png"; + } else if (foreground.value == "grupaTOK"){ + foregroundimg.removeAttribute("height"); + foregroundimg.setAttribute('width', '100%'); + foregroundimg.src = "/static/images/grupaTOK.png"; + }else if (foreground.value == "steiger"){ + foregroundimg.removeAttribute("height"); + foregroundimg.setAttribute('width', '97%'); + foregroundimg.src = "/static/images/steiger.png"; + } else if (foreground.value == "social"){ + foregroundimg.removeAttribute("height"); + foregroundimg.setAttribute('width', '100%'); + foregroundimg.src = "/static/images/social.png"; + } else if (foreground.value == "flynt" ){ + foregroundimg.removeAttribute("height"); + foregroundimg.setAttribute('width', '100%'); + foregroundimg.src = "/static/images/flynt.png"; + } else if (foreground.value == "none"){ + foregroundimg.src = " "; + } +}); -- cgit v1.2.3