JSFiddle - React, Tailwind, and code Playground
HTML
<div id="slider"></div>
<div id="theCircleDiv">
<p class="circlecaption" id="theText">TEST!</p>
</div>
CSS
#theText {
text-align: center;
line-height: 128px;
}
#theCircleDiv {
background: #a0a0a0;
margin: 0px;
width: 128px;
height: 128px;
border-radius: 64px;
}
JavaScript
$("#slider").slider({
max: 255,
value: 128,
slide: resizeEvent,
change: resizeEvent
});
function resize(size) {
var circle = document.getElementById('theCircleDiv'),
text = document.getElementById('theText');
circle.style.width = size + 'px';
circle.style.height = size + 'px';
circle.style.borderRadius = (size / 2) + 'px';
text.style.lineHeight = size + 'px';
}
function resizeEvent() {
resize($("#slider").slider("value"))
}