D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
sandravizz
Full window
Github gist
2.7 css | animation
Built with
blockbuilder.org
<!DOCTYPE html> <meta charset="utf-8"> <html> <head> <!-- Google fonts reference--> <link href="https://fonts.googleapis.com/css2?family=Montserrat+Alternates:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;1,100;1,300&display=swap" rel="stylesheet"> <style> /*Defining text stylings*/ #h1 { font-size:30px; margin:30px 0px 0px 20px; color:#f5fa91; font-family: 'Montserrat Alternates', sans-serif; font-weight:300; } #link { font-family:'Montserrat Alternates', sans-serif; font-weight:200; font-size:10px; margin:5px 0px 100px 22px; color:white; } a:link, a:visited, a:active { text-decoration: none; color:white; border-bottom:1.5px dotted white; } body { background-color:#011227; } /*Defining chart stylings*/ #lights { width:500px; } .bulb { width: 100px; height: 10px; float: left; margin: 10px 10px; transform: rotate(-45deg); } .bulb:nth-child(odd) { background:#8ff798; animation: blub1 2s; } .bulb:nth-child(even) { background:#85f6fa; } @keyframes blub1 { from {} to {opacity:0;} } </style> </head> <body> <!-- Creating the headlines --> <p id="h1">CSS | ANIMATION</p> <div id="link">by <a href="https://slides.com/sandravizmad">SANDRA</a></div> <!-- Creating some elements --> <div id ="lights" style="text-align:center;"></div> <div class="bulb"></div> <div class="bulb"></div> <script> //Defining the loop for ( var i = 0 ; i < 45 ; i++ ) { var bulb = document.createElement("div"); bulb.className = "bulb"; document.getElementById("lights") .appendChild(bulb);} </script> </body> </html>