JSFiddle - React, Tailwind, and code Playground

HTML

<!--

We're going to build a hotspot positioning library. It has a couple of requirements:
1. Create a div that fully overlays the #player div and that adjusts in browser resize with the viewport (never larger than the viewport).
2. When a user clicks the overlay, the position of the click should be replaced by an icon.
3. As you resize the frame, the icon's relative position and relative size on the video should remain intact and consistent.
3.1 When the icon resizes, it should always be easily clickable/touchable on mobile. This means there is a minimum size below which the hotspot should not scale. There is no maximum size.
4. A user can repeatedly add icons that will continue to maintain their relative position in the div overlay of the video frame with resize.
5. A user can drag the icons around to a new location within the video overlay boundaries.
6. Discuss implications of different environments: position absolute, position fixed, and mobile behavior.
7. Aesthetics: Add in a hotspot border animation that starts as a fully colored border and progressively diminishes as a user hovers over a given icon - https://youtu.be/029fzDD-m-w .
8. Add detailed documentation and extract into a nicely contained library that could be implemented ontop of any div.
9. Bonus: Add a cool library like popper.js to the hotspots.
-->

<script src="//content.jwplatform.com/libraries/DbXZPMBQ.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

<div id="player">
</div>
<div class="player-options">
  <a class="btn md blue" id="play">Play Video</a>
  <a class="btn md red" id="pause">Pause Video</a>
</div>

CSS

/*
 * MIT License

Copyright (c) 2017 Gowtham Ashok

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

@keyframes pulsing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  45% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@keyframes borderanim {
  0% {
    border-top: 5px solid #dddddd;
  }
  33% {
    border-right: 5px solid #dddddd;
  }
  66% {
    border-bottom: 5px solid #dddddd;
  }
  99% {
    border-left: 5px solid #dddddd;
  }
}

.hotspot {
  z-index: 9999;
  background: rgb(223, 0, 36);
  border-radius: 50%;
  border: 5px solid transparent;
  opacity: 0.8;
  animation: pulsing 0.2s;
}

.hotspot:drag {
  animation: pulsing 0.1s;
}

.hotspot:hover {
  animation: borderanim 2s linear infinite;
}

JavaScript

var player = jwplayer("player");

player.setup({
  file: '//content.jwplatform.com/videos/jumBvHdL-cIp6U8lV.mp4',
  image: '//content.jwplatform.com/thumbs/jumBvHdL-720.jpg',
  controls: false,
});

var playBtn = document.getElementById('play');
var pauseBtn = document.getElementById('pause');
var overlayBtn = document.getElementById('overlaydiv');

playBtn.addEventListener('click', function() {
  player.play(true);
});

pauseBtn.addEventListener('click', function() {
  player.pause(true);
});

hotspotOverlay("player");

/* hotspot library */

/* to create the hotspot */
function createHotspot(leftOffset, topOffset, overlay, hotspotSize, hotspotSizeRatio, hotspots, overlayDiv) {

  var hotspot = $("<span></span>");
  hotspot.addClass("hotspot");

  var hotspotSize = overlay.width * hotspotSizeRatio;
  hotspot.leftRatio = (leftOffset - (hotspotSize / 2)) / overlay.width;
  hotspot.topRatio = (topOffset - (hotspotSize / 2)) / overlay.height;

  hotspot.css({
    position: 'absolute',
    left: leftOffset - (hotspotSize / 2),
    top: topOffset - (hotspotSize / 2),
    width: hotspotSize,
    height: hotspotSize
  });

  // make the hotspot draggable
  hotspot.draggable({
    // confine the hotspot to the overlay div
    containment: "parent",
  });

  hotspot.on('dragstop', function(e) {
    var hotspotSize = overlay.width * hotspotSizeRatio;
    var newOffset = $(this).offset();
    hotspot.leftRatio = (newOffset.left) / overlay.width;
    hotspot.topRatio = (newOffset.top) / overlay.height;
  });

  // add the hotspots to the array
  hotspots.push(hotspot);
  overlayDiv.append(hotspots[hotspots.length - 1]);
}

/* to get the overlay dimensions and offset */

function getOverlaySize(divId) {
  var element = [];
  element.width = $(divId).width();
  element.height = $(divId).height();
  element.offset = $(divId).offset();
  console.log($(divId));
  return element;
}

function hotspotOverlay(div, size = 10, minHotspotSize = 20) {

  // creating the overlay div
  var...