Skip to content

Instantly share code, notes, and snippets.

@albertodelax
Created August 5, 2015 17:09
Show Gist options
  • Save albertodelax/856e67e9ba5905c051db to your computer and use it in GitHub Desktop.
Save albertodelax/856e67e9ba5905c051db to your computer and use it in GitHub Desktop.
Rainbow Background Animation
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
body {
background-color: red;
transition: background-color 7s;
}
</style>
</head>
<body>
<script type="text/javascript">
var colors = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"];
var i = 1;
window.setInterval(function(){
document.body.style.backgroundColor = colors[i];
i++;
if (i === colors.length){
i=0;
}
}, 5000);
</script>
</body>
</html>
@azbenny
Copy link

azbenny commented Aug 1, 2018

cool!! I like it!

@haininj
Copy link

haininj commented Sep 5, 2020

doesnt work :(

@haininj
Copy link

haininj commented Sep 5, 2020

nevermind

@janwillem2020
Copy link

how to make faster plz

@janwillem2020
Copy link

quick

@janwillem2020
Copy link

how to make faster

@janwillem2020
Copy link

plez quickly for shcol

@citizen46
Copy link

how to make faster plz

transition: background-color 1s;

**-> change the seconds as per your taste.**

@bunnyfat
Copy link

ummm it says SyntaxError: Unexpected token '<' (line 1, file "Code.gs") how do i fix it quick

@bunnyfat
Copy link

i need it for school in 20 mins so please

@arcade-smasher
Copy link

cool. I like it! the only problem is if I try to run it using Microsoft (R) HTML Application host it doesn't fade between colors it just goes to the next color without fading any way to fix that?

@arcade-smasher
Copy link

also its when i set the file as .hta not .html

@PAJai0531
Copy link

i love it

@Ardumine
Copy link

I love this!!! I recomend !!!

@ddsifghsudfyvghsdfv
Copy link

how do i import in and use it i did control shift j and pasted and idk hot to make it work???? plz

@ddsifghsudfyvghsdfv
Copy link

hw do i use it

@ddsifghsudfyvghsdfv
Copy link

@ddsifghsudfyvghsdfv
Copy link

ya how do i use it

@haininj
Copy link

haininj commented Dec 2, 2021 via email

@ddsifghsudfyvghsdfv
Copy link

what

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment