JSFiddle - React, Tailwind, and code Playground
HTML
<div class="point"></div>
CSS
.point{
position :absolute;
width:20px;
height:20px;
left:200px;
background:red;
top:200px
}
JavaScript
function getNewX(xVlaue, oldWidth, newWidth){
return xVlaue * newWidth / oldWidth;
}
var width = 0;
var height = 0;
$(document).ready(function(){
width = $(window).width();
height = $(window).height();
$(window).resize(function(){
newx = getNewX(200, width, $(window).width());
$(".point").css("left", newx);
newx = getNewX(200, height, $(window).height());
$(".point").css("top", newx);
});
});