diff --git a/modules/rainbow-background.css b/modules/rainbow-background.css new file mode 100644 index 0000000..b7eda0a --- /dev/null +++ b/modules/rainbow-background.css @@ -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); } +} diff --git a/modules/readmes/rainbow-background.css b/modules/readmes/rainbow-background.css new file mode 120000 index 0000000..62801fe --- /dev/null +++ b/modules/readmes/rainbow-background.css @@ -0,0 +1 @@ +rainbow.txt \ No newline at end of file diff --git a/modules/readmes/rainbow.txt b/modules/readmes/rainbow.txt index 374a059..3afb6b1 100644 --- a/modules/readmes/rainbow.txt +++ b/modules/readmes/rainbow.txt @@ -2,10 +2,14 @@ in the css @import url("https://styles.alv.cx/modules/rainbow.css"); +or + + @import url("https://styles.alv.cx/modules/rainbow-background.css"); + variables: --rainbow-duration: 8s; 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.