Skip to content

Commit

Permalink
fixed blinking on page reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
giwih committed Dec 11, 2024
1 parent 73b23cc commit 6fa436a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
6 changes: 5 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,10 @@ document.addEventListener("DOMContentLoaded", () => {
selectedRadioButton.checked = true;
}
}
// it is necessary for some elements not to blink when the page is reloaded
setTimeout(() => {
document.documentElement.classList.add('theme-transition');
}, 25); //
});

// -----------Voice Search------------
Expand Down Expand Up @@ -1298,7 +1302,7 @@ const applySelectedTheme = (colorValue) => {
color: #c2c2c2;
}
.dark-theme#menuButton::before{
.dark-theme #menuButton::before{
background-color: #bfbfbf;
}
Expand Down
20 changes: 16 additions & 4 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -900,10 +900,14 @@ body {
padding: 3px;
box-sizing: border-box;
background-color: var(--whitishColor-blue);
transition: all 0.5s;
/* transition: all 0.5s; */
border: 2px solid transparent;
}

.theme-transition .micIcon {
transition: all 0.5s;
}

.micIcon::after {
content: "";
position: absolute;
Expand Down Expand Up @@ -955,7 +959,7 @@ body {
font-size: 1.1rem;
background-color: var(--darkColor-blue);
color: white;
transition: all 0.3s;
/* transition: all 0.3s; */
}

#enterBtn:hover {
Expand All @@ -968,6 +972,10 @@ body {
transform: scale(0.9);
}

.theme-transition #enterBtn {
transition: all 0.3s;
}

/* ________________End of Searchbar______________________ */

.searchWithCont {
Expand Down Expand Up @@ -1046,13 +1054,17 @@ body {
outline: none;
margin-right: 8px;
cursor: pointer;
transition: 0.2s;
/* transition: 0.2s; */
}

.search-engine input[type="radio"]:checked {
background-color: var(--darkColor-blue);
}

.theme-transition .search-engine input[type="radio"] {
transition: 0.2s;
}

/* -----------end of Radio Button Customizing------------ */

/* ----------Shortcuts----------------- */
Expand Down Expand Up @@ -1511,7 +1523,7 @@ body {
display: flex;
align-items: center;
text-decoration: none;
transition: background-color 0.3s ease;;
transition: background-color 0.3s ease;
}

.tilesCont .tiles:hover {
Expand Down

0 comments on commit 6fa436a

Please sign in to comment.