Skip to content

Commit 0631930

Browse files
Rollup merge of rust-lang#96704 - GuillaumeGomez:rotation-animation, r=jsha
Add rotation animation on settings button when loading As discussed, I added an animation when the settings JS file is loading (I voluntarily made the timeout at the end of the `settings.js` super long so we can see what the animation looks like): https://user-images.githubusercontent.com/3050060/166693243-816a08b7-5e39-4142-acd3-686ad9950d8e.mp4 r? ```@jsha```
2 parents 149ab39 + 13b45aa commit 0631930

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/librustdoc/html/static/css/rustdoc.css

+12
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,18 @@ pre.rust {
14061406
cursor: pointer;
14071407
}
14081408

1409+
@keyframes rotating {
1410+
from {
1411+
transform: rotate(0deg);
1412+
}
1413+
to {
1414+
transform: rotate(360deg);
1415+
}
1416+
}
1417+
#settings-menu.rotate img {
1418+
animation: rotating 2s linear infinite;
1419+
}
1420+
14091421
#help-button {
14101422
font-family: "Fira Sans", Arial, sans-serif;
14111423
text-align: center;

src/librustdoc/html/static/js/main.js

+1
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ function loadCss(cssFileName) {
301301
}
302302

303303
getSettingsButton().onclick = event => {
304+
addClass(getSettingsButton(), "rotate");
304305
event.preventDefault();
305306
loadScript(window.settingsJS);
306307
};

src/librustdoc/html/static/js/settings.js

+1
Original file line numberDiff line numberDiff line change
@@ -274,5 +274,6 @@
274274
if (!isSettingsPage) {
275275
switchDisplayedElement(settingsMenu);
276276
}
277+
removeClass(getSettingsButton(), "rotate");
277278
}, 0);
278279
})();

0 commit comments

Comments
 (0)