JSFiddle - React, Tailwind, and code Playground

by dandiebolt

HTML

<div id="all">
  <div class="java">Java</div>
  <div class="script">Script</div>
</div>
<div id="div1">
<a href='#'>abelian</a>
<a href='#'>accessible</a>
<a href='#'>additive</a>
<a href='#'>adjunction</a>
<a href='#'>algebra for a monad</a>
<a href='#'>amnestic</a>
<a href='#'>balanced</a>
<a href='#'>Beck's theorem</a>
<a href='#'>bicategory</a>
<a href='#'>bifunctor</a>
<a href='#'>bimorphism</a>
<a href='#'>Bousfield localization</a>
<a href='#'>calculus of functors</a>
<a href='#'>cartesian closed</a>
<a href='#'>cartesian functor</a>
<a href='#'>cartesian morphism</a>
<a href='#'>Cartesian square</a>
<a href='#'>categorification</a>
<a href='#'>category</a>
<a href='#'>category of categories</a>
<a href='#'>classifying space</a>
<a href='#'>coend</a>
<a href='#'>coequalizer</a>
<a href='#'>coimage</a>
<a href='#'>comma</a>
<a href='#'>comonad</a>
<a href='#'>compact</a>
<a href='#'>complete</a>
<a href='#'>composition</a>
<a href='#'>concrete</a>
<a href='#'>cone</a>
<a href='#'>connected</a>
<a href='#'>conservative functor</a>
<a href='#'>constant</a>
<a href='#'>contravariant functor</a>
<a href='#'>coproduct</a>
<a href='#'>Day convolution</a>
<a href='#'>density theorem</a>
<a href='#'>diagonal functor</a>
<a href='#'>diagram</a>
<a href='#'>differential graded category</a>
<a href='#'>discrete</a>
<a href='#'>distributor</a>
<a href='#'>Dwyer–Kan equivalence</a>
<a href='#'>Eilenberg–Moore category</a>
<a href='#'>end</a>
<a href='#'>endofunctor</a>
<a href='#'>enriched category</a>
<a href='#'>empty</a>
<a href='#'>epimorphism</a>
<a href='#'>equalizer</a>
<a href='#'>equivalence</a>
<a href='#'>equivalent</a>
<a href='#'>essentially surjective</a>
<a href='#'>evaluation</a>
<a href='#'>faithful</a>
<a href='#'>fundamental category</a>
<a href='#'>fundamental groupoid</a>
<a href='#'>fibered category</a>
<a href='#'>fiber product</a>
<a href='#'>filtered</a>
<a href='#'>finitary monad</a>
<a href='#'>finite</a>
<a href='#'>forgetful functor</a>
<a...

CSS

body {
  background: #000
}

#all {
  margin: 160px auto;
  width: 100px;
  height: 100px;
  -webkit-animation: grow 4s;
/*   animation-timing-function: ease-in; */
    -webkit-animation-delay:0.5s;
  animation-fill-mode: forwards;
  /*Safari and Chrome*/
}

.script {
  font-family: Microsoft YaHei;
  color: #fff;
  font-size: 40px;
  display: block;
  position: relative;
  /*   text-align: left; */
}

.java {
  font-family: Microsoft YaHei;
  color: #fff;
  font-size: 40px;
  display: block;
  position: relative;
}

.java:before {
  content: "";
  display: block;
  position: absolute;
  left: 85px;
  width: 20px;
  height: 100%;
  background-color: red;
  -webkit-animation-delay: 2s ;
  -webkit-animation: grow 4s;
/*   animation-timing-function: ease-in; */
   -webkit-animation-delay:0.5s;
  animation-fill-mode: forwards;
  /*Safari and Chrome*/
}

@-webkit-keyframes grow
/*Safari and Chrome*/

{
  from {
    width: 0px;
  }
  to {
    width: 480px;
  }
}

#div1 {
  position: relative;
  width: 1400px;
  height: 1200px;
  margin: -300px auto 0;
}

#div1 a {
  position: absolute;
  top: 0px;
  left: 0px;
  font-family: Microsoft YaHei;
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  padding: 3px 6px;
}


/* #div1 a:hover {border: 1px solid #eee; background: #000; } */

#div1 .blue {
  color: blue;
}

#div1 .red {
  color: red;
}

#div1 .yellow {
  color: yellow;
}

p {
  font: 16px Microsoft YaHei;
  text-align: center;
  color: #ba0c0c;
}

p a {
  font-size: 20px;
  color: #ba0c0c;
}

p span {
  font-size: 14px;
  color: #ba0c0c;
}


/* p a:hover { color: red; } */

JavaScript

document.getElementById('div1').style.visibility = "hidden";

var change = function changeVisibility() {
  document.getElementById('all').style.visibility = "hidden";
  document.getElementById('div1').style.visibility = "visible";
}
setTimeout(change, 4000);

var radius = 200;
var dtr = Math.PI / 180;
var d = 300;

var mcList = [];
var active = false;
var lasta = 1;
var lastb = 1;
var distr = true;
var tspeed = 10;
var size = 250;

var mouseX = 0;
var mouseY = 0;

var howElliptical = 1;

var aA = null;
var oDiv = null;

window.onload = function() {
  var i = 0;
  var oTag = null;

  oDiv = document.getElementById('div1');

  aA = oDiv.getElementsByTagName('a');
  // aA=document.getElementById('div2');
  // aA=oDiv.getElementsByTagName('span');

  for (i = 0; i < aA.length; i++) {
    oTag = {};

    oTag.offsetWidth = aA[i].offsetWidth;
    oTag.offsetHeight = aA[i].offsetHeight;

    mcList.push(oTag);
  }

  sineCosine(0, 0, 0);

  positionAll();

  oDiv.onmouseover = function() {
    active = true;
  };

  oDiv.onmouseout = function() {
    active = false;
  };

  oDiv.onmousemove = function(ev) {
    var oEvent = window.event || ev;

    mouseX = oEvent.clientX - (oDiv.offsetLeft + oDiv.offsetWidth / 2);
    mouseY = oEvent.clientY - (oDiv.offsetTop + oDiv.offsetHeight / 2);

    mouseX /= 5;
    mouseY /= 5;
  };

  setInterval(update, 30);
};

function update() {
  var a;
  var b;

  if (active) {
    a = (-Math.min(Math.max(-mouseY, -size), size) / radius) * tspeed;
    b = (Math.min(Math.max(-mouseX, -size), size) / radius) * tspeed;
  } else {
    a = lasta * 0.98;
    b = lastb * 0.98;
  }

  lasta = a;
  lastb = b;

  if (Math.abs(a) <= 0.01 && Math.abs(b) <= 0.01) {
    return;
  }

  var c = 0;
  sineCosine(a, b, c);
  for (var j = 0; j < mcList.length; j++) {
    var rx1 = mcList[j].cx;
    var ry1 = mcList[j].cy * ca + mcList[j].cz * (-sa);
    var rz1 = mcList[j].cy * sa + mcList[j].cz * ca;

    var rx2 = rx1 * cb + rz1 * sb;
    var ry2 = ry1;
 ...