create rainbow background

This commit is contained in:
2026-11-18 20:13:43 +00:00
parent f9ec3b89d5
commit f97599ffab
3 changed files with 21 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
:root {
--rainbow-duration: 8s;
}
.rainbow-background { animation: rainbow-animation var(--rainbow-duration) infinite alternate; }
@keyframes rainbow-animation {
0% { background-color: var(--blue); }
16.7% { background-color: var(--green); }
33.3% { background-color: var(--yellow); }
50.0% { background-color: var(--orange); }
66.7% { background-color: var(--red); }
83.3% { background-color: var(--purple); }
100% { background-color: var(--blue); }
}
+1
View File
@@ -0,0 +1 @@
rainbow.txt
+5 -1
View File
@@ -2,10 +2,14 @@ in the css
@import url("https://styles.alv.cx/modules/rainbow.css"); @import url("https://styles.alv.cx/modules/rainbow.css");
or
@import url("https://styles.alv.cx/modules/rainbow-background.css");
variables: variables:
--rainbow-duration: 8s; --rainbow-duration: 8s;
and add the class `rainbow` to any element you want. and add the class `rainbow` to any element you want.
it works by changing the `color` property of the element. it works by changing the `color` or `background-color` property of the element.