diff --git a/Windows-Chrome-LightMode/script.js b/Windows-Chrome-LightMode/script.js index 9d248c7..22e7ea3 100644 --- a/Windows-Chrome-LightMode/script.js +++ b/Windows-Chrome-LightMode/script.js @@ -2,6 +2,8 @@ var minimize = document.getElementById("minimize"); var square = document.getElementById("square"); var exit = document.getElementById("exit"); var titleBar = document.getElementById("title-bar"); +var urlBar = document.getElementById("url-bar") +var open = true ////////////////// Hover listeners ////////////////// minimize.addEventListener('mouseover', function handleMouseOver() { @@ -42,6 +44,27 @@ titleBar.addEventListener('mouseout', function handleMouseOver() { titleBar.style.cursor = 'default'; }); +urlBar.addEventListener('click', function handleMouseClick(){ + if(open == false) { + $("#domain-name").css("background-color", "#83AFE3") + $("#domain-name").css("-webkit-tap-highlight-color", "transparent") + $("#domain-path").css("background-color", "#83AFE3") + $("#domain-path").css("-webkit-tap-highlight-color", "transparent") + urlBar.style.cursor = 'text' + open = true + } else { + urlBar.style.cursor = 'default' + $("#domain-name").css("background-color", "unset") + $("#domain-path").css("background-color", "unset") + open = false + } + +}) + +urlBar.addEventListener('mouseover', function handleMouseOverUrl() { + urlBar.style.cursor = 'text' +}) + //////////////// Make window draggable start //////////////// // Make the DIV element draggable: @@ -89,4 +112,4 @@ function enlarge(){ $("#content").css("width", "100%"); $("#square").addClass("enlarged"); } -} \ No newline at end of file +}