1
Fork 0

Add rotation animation on settings button when loading

This commit is contained in:
Guillaume Gomez 2022-05-04 15:39:18 +02:00
parent 12d3f107c1
commit 13b45aa6c6
3 changed files with 14 additions and 1 deletions

View file

@ -1401,6 +1401,18 @@ pre.rust {
cursor: pointer; cursor: pointer;
} }
@keyframes rotating {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
#settings-menu.rotate img {
animation: rotating 2s linear infinite;
}
#help-button { #help-button {
font-family: "Fira Sans", Arial, sans-serif; font-family: "Fira Sans", Arial, sans-serif;
text-align: center; text-align: center;

View file

@ -300,8 +300,8 @@ function loadCss(cssFileName) {
document.head.append(script); document.head.append(script);
} }
getSettingsButton().onclick = event => { getSettingsButton().onclick = event => {
addClass(getSettingsButton(), "rotate");
event.preventDefault(); event.preventDefault();
loadScript(window.settingsJS); loadScript(window.settingsJS);
}; };

View file

@ -272,5 +272,6 @@
if (!isSettingsPage) { if (!isSettingsPage) {
switchDisplayedElement(settingsMenu); switchDisplayedElement(settingsMenu);
} }
removeClass(getSettingsButton(), "rotate");
}, 0); }, 0);
})(); })();