From 73b57eac3c4de4a8a5e502117a009baa06ca24a2 Mon Sep 17 00:00:00 2001 From: Lexter <44911576+Lexterl33t@users.noreply.github.com> Date: Thu, 24 Mar 2022 01:08:13 +0100 Subject: [PATCH] add highlight in url when i click in bar url --- Windows-DarkMode-Delay/script.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Windows-DarkMode-Delay/script.js b/Windows-DarkMode-Delay/script.js index c61afbe..974c4a0 100644 --- a/Windows-DarkMode-Delay/script.js +++ b/Windows-DarkMode-Delay/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: @@ -95,4 +117,4 @@ function enlarge(){ //// Pop-up appear on click with delay //// $("#clickme").click(function(){ $("#window").fadeIn(300); - }); \ No newline at end of file + });