Cookie playground 🍪

A playground to fiddle around with some Javascript web-based cookies! 🍪

by Codi Bezouka-Smith

HTML

<body>
	
</body>

JavaScript

function getInt(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min) + min);
}
function getColor() {
  let hsl;
  let h = getInt(0, 360);
  let s = getInt(25, 95);
  let l = getInt(85, 95);
  return `hsl(${h},${s}%,${l}%)`;
}

document.cookie = "hsl=" + getColor();