general/clocks/src/clock.js
/**
     * Paint the alarm "phantom" hour hand.
     * Scaled to a 200px diameter clock rotated to origin of 12o'clock.
     */
Paint the alarm "phantom" hour hand.
Scaled to a 200px diameter clock rotated to origin of 12o'clock.
Paint the alarm " phantom " hour hand . Scaled to a 200px diameter clock rotated to origin of 12o ' clock .
function drawAlarmHourHand() {
        var alarmHours = alarm.getHours(),
            alarmAhr = alarmHours>=12 ? alarmHours-12 : alarmHours;
        ctx.save();
        var begin = -22;
        var end = 55;
        ctx.lineWidth = 7;
        ctx.strokeStyle = "rgba(0,0,0,0.1)";
        ctx.lineCap = "round";
        ctx.rotate(alarmAhr*(Math.PI/6) + (Math.PI/360)*alarm.getMinutes() + (Math.PI/21600)*alarm.getSeconds());
        ctx.beginPath();
        ctx.moveTo(begin, 0);
        ctx.lineTo(end, 0);
        ctx.stroke();
        ctx.restore();
    }
function drawAlarmHourHand ( ) { var alarmHours = alarm . getHours ( ) , alarmAhr = alarmHours >= 12 ? alarmHours - 12 : alarmHours ; ctx . save ( ) ; var begin = - 22 ; var end = 55 ; ctx . lineWidth = 7 ; ctx . strokeStyle = "rgba(0,0,0,0.1)" ; ctx . lineCap = "round" ; ctx . rotate ( alarmAhr * ( Math . PI / 6 ) + ( Math . PI / 360 ) * alarm . getMinutes ( ) + ( Math . PI / 21600 ) * alarm . getSeconds ( ) ) ; ctx . beginPath ( ) ; ctx . moveTo ( begin , 0 ) ; ctx . lineTo ( end , 0 ) ; ctx . stroke ( ) ; ctx . restore ( ) ; }
Paint the alarm "phantom" hour hand.
Paint the alarm " phantom " hour hand .
// Don't touch any previous settings on the stack
 // Drawing constraints for the hour hand
 // Extend the hour hand beyond the center
 // Style the hour Hand
 // Rotate based on the current fractions of time
 // Restore previous settings on the canvas stack
