Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/Graduations.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { For } from 'solid-js';

import { ClockLine as Graduation } from '@/ClockLine';
import { rotate, seconds } from '@/common';

// For not used because Graduations are static - minor optimization
export const Graduations = () =>
[...Array(seconds).keys()]
.map<[boolean, number]>((index) => [index % 5 === 0, index])
.map(([isHour, index]) => (
export const Graduations = () => (
<For each={Array.from({ length: seconds }, (_, index) => index % 5 === 0)}>
{(isHour, index) => (
<Graduation
class={
isHour
Expand All @@ -14,6 +14,8 @@ export const Graduations = () =>
}
graduation
length={isHour ? 6 : 2.5}
transform={rotate(index / seconds, 0)}
transform={rotate(index() / seconds, 0)}
/>
));
)}
</For>
);