Skip to content

Commit

Permalink
Add rotation animation on settings button when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 5, 2022
1 parent 12d3f10 commit 13b45aa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1401,6 +1401,18 @@ pre.rust {
cursor: pointer;
}

@keyframes rotating {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
#settings-menu.rotate img {
animation: rotating 2s linear infinite;
}

#help-button {
font-family: "Fira Sans", Arial, sans-serif;
text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ function loadCss(cssFileName) {
document.head.append(script);
}


getSettingsButton().onclick = event => {
addClass(getSettingsButton(), "rotate");
event.preventDefault();
loadScript(window.settingsJS);
};
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/html/static/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,5 +272,6 @@
if (!isSettingsPage) {
switchDisplayedElement(settingsMenu);
}
removeClass(getSettingsButton(), "rotate");
}, 0);
})();

0 comments on commit 13b45aa

Please sign in to comment.