JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">
</style>
<title>Webbutbildningen - info</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="box2">
<svg id="svg" xmlns="http://www.w3.org/2000/svg" height="1600" version="1.1"></svg>
</div>
</body>
</html>
CSS
rect.flake {
fill: rgb(255,205,0);
}
JavaScript
var NR_OF_FLAKES = 100,
svg = document.querySelector('svg'),
xmlns = "http://www.w3.org/2000/svg";
for(var i = 0; i < NR_OF_FLAKES; i++) {
var xPos = Math.random()*window.innerWidth,
yPos = Math.random()*window.innerHeight,
flake = document.createElementNS(xmlns, "rect");
flake.setAttribute("width", 5);
flake.setAttribute("height", 5);
flake.setAttribute("x", xPos);
flake.setAttribute("y", yPos);
flake.setAttribute("class", "flake");
svg.appendChild(flake);
}