Skip to content

Commit 13b45aa

Browse files
Add rotation animation on settings button when loading
1 parent 12d3f10 commit 13b45aa

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

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

+12
Original file line numberDiff line numberDiff line change
@@ -1401,6 +1401,18 @@ pre.rust {
14011401
cursor: pointer;
14021402
}
14031403

1404+
@keyframes rotating {
1405+
from {
1406+
transform: rotate(0deg);
1407+
}
1408+
to {
1409+
transform: rotate(360deg);
1410+
}
1411+
}
1412+
#settings-menu.rotate img {
1413+
animation: rotating 2s linear infinite;
1414+
}
1415+
14041416
#help-button {
14051417
font-family: "Fira Sans", Arial, sans-serif;
14061418
text-align: center;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ function loadCss(cssFileName) {
300300
document.head.append(script);
301301
}
302302

303-
304303
getSettingsButton().onclick = event => {
304+
addClass(getSettingsButton(), "rotate");
305305
event.preventDefault();
306306
loadScript(window.settingsJS);
307307
};

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

+1
Original file line numberDiff line numberDiff line change
@@ -272,5 +272,6 @@
272272
if (!isSettingsPage) {
273273
switchDisplayedElement(settingsMenu);
274274
}
275+
removeClass(getSettingsButton(), "rotate");
275276
}, 0);
276277
})();

0 commit comments

Comments
 (0)