GithubHelp home page GithubHelp logo

Integrate current time about matrix HOT 2 CLOSED

rezmason avatar rezmason commented on May 14, 2024
Integrate current time

from matrix.

Comments (2)

flinknet avatar flinknet commented on May 14, 2024 1

Thank you for your answer.

but is there a reason folks who want what you want couldn't do what you've done, and make a little website that puts the code rain in an iframe?

I guess you are right. If i can do it, than anybody can handle that.

from matrix.

Rezmason avatar Rezmason commented on May 14, 2024

Sorry for the late reply. Thanks for your kind words!

The blend mode you chose in your proof of concept produces a pretty cool "frosted glass" look, doesn't it?

image

I suppose I could add a showTime option or something, but is there a reason folks who want what you want couldn't do what you've done, and make a little website that puts the code rain in an iframe?

I'm not opposed to adding things like this, but most feature requests I act on are so tightly integrated into the renderer that modifying the project really is the only viable option.

It hadn't even occurred to me to take the approach you have, using an iframe as a visual element in a larger composition. Check this out!

<html>
<head>
  <style>
    body {
      background-color: black;
    }

    @font-face {
        font-family: Matrix-Code;
    }

    iframe {
      border: none;

      width:100%;
      height:100%;
      position: absolute;
      top: 0;
      left: 0;
    }

    #over {
      background: black;
      color: hsl(115, 10%, 55%);
      mix-blend-mode: hard-light;

      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;

      display: grid;
      justify-content: center;
      align-items: center;

      font-size:40vh; 
      font-family: Matrix-Code;
      font-weight: 900;
      letter-spacing: -.2em;
    }
  </style>
</head>
<body>
  <iframe src="https://rezmason.github.io/matrix/?width=400"></iframe>
  <div id="over" onload="currentTime()"></div>
</body>
<script>
  function currentTime() {
    let date = new Date(); 
    let hh = date.getHours();
    let mm = date.getMinutes();

     hh = (hh < 10) ? "0" + hh : hh;
     mm = (mm < 10) ? "0" + mm : mm;

     let time = hh + ":" + mm;

    document.getElementById("over").innerText = time;
    document.getElementById("over2").innerText = time;
    let t = setTimeout(function(){ currentTime() }, 1000); 
  }

  currentTime();
</script>
</html>

image

Works like a dream! Except the Matrix font has no "6" character. (They added it in Resurrections, I'm working on an update.)

from matrix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.