Open ellsdly opened 5 years ago
AFRAME.registerPrimitive('a-clock', { defaultComponents: { clock: {} } }); AFRAME.registerComponent('clock', { init: function() { console.log('Hello, World!'); this.el.innerHTML = `
`;
let temp = 0.5 / 60;
function startTime() {
var today = new Date();
var h = today.getHours();
if (h > 12) {
h = h - 12;
}
var m = today.getMinutes();
var s = today.getSeconds();
document.getElementById('seconds').object3D.rotation.z = -THREE.Math.degToRad(6) * s;
document.getElementById('minutes').object3D.rotation.z = -THREE.Math.degToRad(6) * m;
document.getElementById('hours').object3D.rotation.z = -THREE.Math.degToRad(30) * h;
var t = setTimeout(startTime, 1000);
}
startTime();
} });
pmst peaks see tootama aga peab vaatama ja muutma jnejne
Tavaline koolikell, näitab praegust aega vms.