JSFiddle - React, Tailwind, and code Playground

by ksumarine

HTML

<svg width="100%" height="100%"></svg>

CSS

body {
  width: 100%;
  height:100%;
}
svg {
  position: fixed;
  width: inherit;
  height: inherit;
  border: 1px solid red;
}

JavaScript

var scale = 0;
document.addEventListener('wheel', e => {
	e.preventDefault();
  scale += e.deltaY * -0.01;
  scale = Math.min(Math.max(.125, scale), 4);
	console.log(scale);
});