From 23c3242330902e8afd182623d7237628fe795eca Mon Sep 17 00:00:00 2001 From: Lexter <44911576+Lexterl33t@users.noreply.github.com> Date: Thu, 24 Mar 2022 01:10:27 +0100 Subject: [PATCH] Add higlight when i click to url 2 --- Windows-Chrome-DarkMode/script.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Windows-Chrome-DarkMode/script.js b/Windows-Chrome-DarkMode/script.js index e54d82b..6256f30 100644 --- a/Windows-Chrome-DarkMode/script.js +++ b/Windows-Chrome-DarkMode/script.js @@ -2,7 +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() { minimize.style.backgroundColor = '#272727'; @@ -42,6 +43,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 +111,4 @@ function enlarge(){ $("#content").css("width", "100%"); $("#square").addClass("enlarged"); } -} \ No newline at end of file +}