HTML Section
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="lights"></div>
<script>
for (var i=0; i < 19; i++) {
var bulb = document.createElement("div");
bulb.className = "bulb";
document.getElementById("lights").appendChild(bulb);
}
</script>
<h1>Merry Christmas</h1>
</body>
CSS Section:
@import url('https://fonts.googleapis.com/css?family=Mountains-Of_Christmas');
h1 {
color: gold;
text-align: center;
margin-top: 70px;
font-family: 'Mountains-Of-Christmas', cursive;
font-size: 85px;
}
body {
background-color: #000;
}
.bulb {
width: 50px;
height: 50px;
display: inline-block;
margin: 0px 10px;
border-radius: 100% 4px;
transform: rotate(-45deg);
}
.bulb:nth-child(odd) {
background: #6cb6ff;
opacity: 1;
box-shadow: 1px 1px 15px #6cb6ff, -1px -1px 15px #6cb6ff;
animation: bulb-pulse-1 0.8s linear 0s infinite alternate;
}
.bulb:nth-child(even) {
background: #0c0;
opacity: .3;
box-shadow: none;
animation: bulb-pulse-2 0.8s linear 0s infinite alternate;
}
@keyframes bulb-pulse-1 {
from { box-shadow: 1px 1px 15px #6cb6ff, -1px -1px 15px #6cb6ff; opacity: 1; }
to { box-shadow: none; opacity: .3; }
}
@keyframes bulb-pulse-2 {
from { box-shadow: none; opacity: .3; }
to { box-shadow: 1px 1px 15px #0c0, -1px -1px 15px #0c0; opacity: 1; }
}