Skip to content

Instantly share code, notes, and snippets.

@erikpantzar
Created January 13, 2017 12:44
Show Gist options
  • Save erikpantzar/a5fab9617ecdc0169b1a9924f961995e to your computer and use it in GitHub Desktop.
Save erikpantzar/a5fab9617ecdc0169b1a9924f961995e to your computer and use it in GitHub Desktop.
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