Giter Club home page Giter Club logo

colorful-clock's Introduction

Colorful Clock

Colorful Clock

Demo

Demo:https://as60160.github.io/Colorful-Clock/

簡介

從 「180 websites in 180 days」 看到的,這是裡面的 Day 11 作品。

這個網頁每過一秒會更新時間,同時漸進式改變背景的顏色,並且將背景顏色的 16 進位代碼 (Hex 色碼) 呈現在畫面上。

想法

  1. 使用 JavaScript 的 setInterval() 讓時間跟顏色每一秒改變一次。
  2. 原始作品是用 Hex 色碼表示顏色,我改用 RGB 色碼表示。
  3. 原始作品的時間跟顏色之間有關聯,所以重新載入網頁後,顏色不會隨機改變,而是按照原有的設定進行。我的作法是讓網頁每次載入時,都隨機產生顏色。

使用工具或技術

全部用 JavaScript 進行操作,其中幾個重要的方法如下:

  • 時間函數:
    • new Date()
    • getHours()
    • getMinutes()
    • getSeconds()
  • 排程設定:
    • setInterval()

colorful-clock's People

Contributors

as60160 avatar

Watchers

James Cloos avatar  avatar

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.