Created
January 13, 2017 12:44
-
-
Save erikpantzar/a5fab9617ecdc0169b1a9924f961995e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function time() { | |
const OFFSET = 90; | |
const now = new Date(); | |
const hourT = now.getHours(); | |
const minT = now.getMinutes(); | |
const secT = now.getSeconds(); | |
const hd = 360/12; | |
const mhd = hd/60; | |
const shd = hd/3600; | |
const fluidDeg = hd*hourT+mhd*minT+shd*secT + OFFSET; | |
hour.style.transform = `rotate(${fluidDeg}deg)`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment