clock exercise 6.2
This commit is contained in:
44
w6_2_clock/clock.js
Normal file
44
w6_2_clock/clock.js
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Clock Module
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef Clock
|
||||
* @type {object}
|
||||
* @property {number} x - The x-coordinate of the clock center.
|
||||
* @property {number} y - The y-coordinate of the clock center.
|
||||
* @property {number} radius - The radius of the clock.
|
||||
* @property {string} color - The color of the clock.
|
||||
* @property {number} oneSecondMs - The interval in milliseconds for one second.
|
||||
* @property {number} hours - The current hour.
|
||||
* @property {number} minutes - The current minute.
|
||||
* @property {number} seconds - The current second.
|
||||
*/
|
||||
|
||||
const createClock = (color, oneSecondMs) => (x, y, radius) => {
|
||||
// return a clock
|
||||
};
|
||||
|
||||
// export const createSportsClock = createClock('#FFF000', 500);
|
||||
// export const createStandardClock = createClock('#FFFFFF', 1000);
|
||||
|
||||
export const drawClock = (clock) => {
|
||||
// draw the clock face
|
||||
};
|
||||
|
||||
export function startClock(clock) {
|
||||
// start animating the clock
|
||||
}
|
||||
|
||||
export function stopClock(intervalId) {
|
||||
// stop the clock
|
||||
}
|
||||
|
||||
// Private Helpers
|
||||
const tick = (clock) => {
|
||||
// return a new clock that advances the time of 1 second
|
||||
};
|
||||
|
||||
const drawClockHands = (x, y, alpha, length) => {
|
||||
// draw the clock hands
|
||||
};
|
||||
Reference in New Issue
Block a user