JSFiddle - React, Tailwind, and code Playground

by Ulrich Bangert

HTML

<div id="circle">

</div>

CSS

#circle {
  background-color: red;
  border-radius: 50%;
}

JavaScript

var circ = $("#circle"),
    factor = 0.3;
function resize() {
    var sizex = $(window).width() * factor,
        sizey = $(window).height() * factor;
    if (sizex > sizey) size = sizey;
    else size = sizex;
    if (size > 150) size = 150;
    circ.width(size).height(size);
}
$(window).on("resize", resize);
resize();