- {finalHour}
+ {hour}
- {finalMinute}
-
-
- {finalSeconds}
+ {minute}
+ {localStorage.getItem('seconds') === 'true' && (
+
+ {seconds}
+
+ )}
);
-}
-
-export { VerticalClock as default, VerticalClock };
+};
diff --git a/src/features/time/hooks/useClockZoom.js b/src/features/time/hooks/useClockZoom.js
new file mode 100644
index 00000000..1f25db83
--- /dev/null
+++ b/src/features/time/hooks/useClockZoom.js
@@ -0,0 +1,19 @@
+import { useEffect, useRef } from 'react';
+import defaults from '../options/default';
+
+export const useClockZoom = () => {
+ const elementRef = useRef(null);
+
+ const updateZoom = () => {
+ if (elementRef.current) {
+ const zoomClock = localStorage.getItem('zoomClock') || defaults.zoomClock;
+ elementRef.current.style.fontSize = `${4 * Number(zoomClock / 100)}em`;
+ }
+ };
+
+ useEffect(() => {
+ updateZoom();
+ }, []);
+
+ return { elementRef, updateZoom };
+};
diff --git a/src/features/time/hooks/useTimeUpdate.js b/src/features/time/hooks/useTimeUpdate.js
new file mode 100644
index 00000000..997e934b
--- /dev/null
+++ b/src/features/time/hooks/useTimeUpdate.js
@@ -0,0 +1,28 @@
+import { useEffect, useRef } from 'react';
+
+export const useTimeUpdate = (updateFn) => {
+ const timerRef = useRef(null);
+
+ useEffect(() => {
+ const startTime = (initialDelay = null) => {
+ const showSeconds = localStorage.getItem('seconds') === 'true';
+ const delay =
+ initialDelay ?? (showSeconds ? 1000 - (Date.now() % 1000) : 60000 - (Date.now() % 60000));
+
+ if (timerRef.current) {
+ clearTimeout(timerRef.current);
+ }
+
+ updateFn();
+ timerRef.current = setTimeout(() => startTime(), delay);
+ };
+
+ startTime(0);
+
+ return () => {
+ if (timerRef.current) {
+ clearTimeout(timerRef.current);
+ }
+ };
+ }, [updateFn]);
+};
diff --git a/src/features/time/options/ClockPreview.jsx b/src/features/time/options/ClockPreview.jsx
new file mode 100644
index 00000000..05c23a0e
--- /dev/null
+++ b/src/features/time/options/ClockPreview.jsx
@@ -0,0 +1,13 @@
+import React from 'react';
+import { motion } from 'framer-motion';
+import Clock from 'features/time/Clock';
+
+const ClockPreview = ({ zoomLevel = 100 }) => {
+ return (
+