A Pen by Andrew saeed

Thumbnail
This awesome code was written by 2ndow, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright 2ndow ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>A Pen by  Andrew saeed</title>
  
  
  
  
    <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>

</head>

<body>

  <span>A</span>
<span>N</span>
<span>D</span>
<span>R</span>
<span>E</span>
<span>W</span>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/2ndow/a-pen-by-andrew-saeed-BroJma */
setInterval(window.onload = function () {
    "use strict";
    var span = document.getElementsByTagName("span"),
        i;
    for (i = 0; i <= span.length; i += 1) {
        var color = ["#080", "#00f", "#f00", "#090"],
            colors = Math.ceil(Math.random() * color.length),
            leftx = Math.round(Math.random() * window.innerHeight),
            topx = Math.round(Math.random() * window.innerWidth);
        span[i].style.color = color[colors];
        span[i].style.position = "absolute";
        span[i].style.left = topx + 100;
        span[i].style.top = leftx + 100;
        span[i].style.transition = "all 0.5s linear 0s";
        span[i].style.fontSize = "6em";
    }
}, 1000);

Comments