0
Skip to Content
Resectus Medical
About
Technology
Company
News
Contact
Resectus Medical
About
Technology
Company
News
Contact
About
Technology
Company
News
Contact
<script>
(function(){
  var tries=0;

  function boot(){
    glowInit();

    var vids=document.querySelectorAll(".rm-360 video");
    for(var i=0;i<vids.length;i++){
      patchOne(vids[i]);
    }

    if(tries++<40){
      setTimeout(boot,600);
    }
  }


  /* 360 VIDEO SMOOTHING */

  function patchOne(v){
    var stage=v.closest(".rm-360");

    if(!stage||stage.getAttribute("data-rm-abs")!=="1"){
      return;
    }

    if(v.getAttribute("data-rm-smooth")==="1"){
      return;
    }

    v.setAttribute("data-rm-smooth","1");

    var dsc=Object.getOwnPropertyDescriptor(
      HTMLMediaElement.prototype,
      "currentTime"
    );

    var pending=null,
        busy=false,
        guard=null;

    function apply(t){
      busy=true;

      if(guard){
        clearTimeout(guard);
      }

      guard=setTimeout(function(){
        busy=false;
        flush();
      },250);

      try{
        dsc.set.call(v,t);
      }catch(e){
        busy=false;
      }
    }

    function flush(){
      if(pending!==null&&!busy){
        var t=pending;
        pending=null;
        apply(t);
      }
    }

    v.addEventListener("seeked",function(){
      busy=false;
      flush();
    });

    try{
      Object.defineProperty(v,"currentTime",{
        configurable:true,

        get:function(){
          return dsc.get.call(v);
        },

        set:function(t){
          if(busy){
            pending=t;
          }else{
            apply(t);
          }
        }
      });
    }catch(e){}
  }


  /* GLOW INITIALIZATION */

  function glowInit(){

    /* EXISTING WORKING SECTION IDS */

    var SUF=[
      "518f4924",
      "11057b17",
      "33ea6c34",
      "6c6648df",
      "518f4929",
      "518f491d",
      "89ac18",
      "ca4f5a9"
    ];

    var secs=document.querySelectorAll(".page-section");

    for(var i=0;i<secs.length;i++){
      initSec(secs[i],SUF);
    }


    /* RECENT NEWS — DIRECT INITIALIZATION */

    var news=document.querySelector("#news.page-section");

    if(news){
      initGlowDirect(news);
    }
  }


  /* EXISTING SECTION-ID GLOW */

  function initSec(sec,SUF){

    var id=sec.getAttribute("data-section-id")||"";
    var hit=false;

    for(var j=0;j<SUF.length;j++){

      var s=SUF[j];

      if(
        id.length>=s.length &&
        id.indexOf(s,id.length-s.length)!==-1
      ){
        hit=true;
        break;
      }
    }

    if(
      !hit ||
      sec.getAttribute("data-rm-glow")==="1"
    ){
      return;
    }

    initGlowDirect(sec);
  }


  /* SHARED DIRECT GLOW ENGINE */

  function initGlowDirect(sec){

    if(
      !sec ||
      sec.getAttribute("data-rm-glow")==="1"
    ){
      return;
    }

    sec.setAttribute("data-rm-glow","1");

    if(!sec.classList.contains("rm-lit")){
      sec.classList.add("rm-lit");
    }


    /* ADD GLOW ELEMENT */

    var has=false;
    var kids=sec.children;

    for(var k=0;k<kids.length;k++){

      if(
        kids[k].classList &&
        kids[k].classList.contains("rm-lit__glow")
      ){
        has=true;
        break;
      }
    }

    if(!has){
      var g=document.createElement("span");
      g.className="rm-lit__glow";
      sec.appendChild(g);
    }


    /* GLOW ON / OFF */

    sec.addEventListener("pointerenter",function(){
      sec.classList.add("rm-lit-on");
    });

    sec.addEventListener("pointerleave",function(){
      sec.classList.remove("rm-lit-on");
    });


    /* FOLLOW CURSOR */

    sec.addEventListener("pointermove",function(e){

      var r=sec.getBoundingClientRect();

      if(!r.width||!r.height){
        return;
      }

      sec.style.setProperty(
        "--mx",
        ((e.clientX-r.left)/r.width*100).toFixed(2)+"%"
      );

      sec.style.setProperty(
        "--my",
        ((e.clientY-r.top)/r.height*100).toFixed(2)+"%"
      );
    });
  }


  /* START */

  if(document.readyState!=="loading"){

    setTimeout(boot,900);

  }else{

    document.addEventListener(
      "DOMContentLoaded",
      function(){
        setTimeout(boot,900);
      }
    );
  }

})();
</script>
Resectus Medical

Made with Squarespace

Location

Baltimore, MD

Contact

alexander.tinana@resectus.com