시계 위젯 구현

This commit is contained in:
dohyeons
2025-10-14 10:12:40 +09:00
parent 4813da827e
commit ce65e6106d
7 changed files with 448 additions and 115 deletions

View File

@@ -42,7 +42,12 @@ export function ClockWidget({ element }: ClockWidgetProps) {
if (config.style === "analog") {
return (
<div className="h-full w-full">
<AnalogClock time={currentTime} theme={config.theme} />
<AnalogClock
time={currentTime}
theme={config.theme}
timezone={config.timezone}
customColor={config.customColor}
/>
</div>
);
}
@@ -57,28 +62,36 @@ export function ClockWidget({ element }: ClockWidgetProps) {
showSeconds={config.showSeconds}
format24h={config.format24h}
theme={config.theme}
customColor={config.customColor}
/>
</div>
);
}
// 'both' - 아날로그 + 디지털
// 'both' - 아날로그 + 디지털 (작은 크기에 최적화)
return (
<div className="flex h-full w-full flex-col">
{/* 아날로그 시계 (상단 60%) */}
<div className="flex-[3]">
<AnalogClock time={currentTime} theme={config.theme} />
<div className="flex h-full w-full flex-col overflow-hidden">
{/* 아날로그 시계 (상단 55%) */}
<div className="flex-[55] overflow-hidden">
<AnalogClock
time={currentTime}
theme={config.theme}
timezone={config.timezone}
customColor={config.customColor}
/>
</div>
{/* 디지털 시계 (하단 40%) */}
<div className="flex-[2]">
{/* 디지털 시계 (하단 45%) - 컴팩트 버전 */}
<div className="flex-[45] overflow-hidden">
<DigitalClock
time={currentTime}
timezone={config.timezone}
showDate={config.showDate}
showDate={false}
showSeconds={config.showSeconds}
format24h={config.format24h}
theme={config.theme}
customColor={config.customColor}
compact={true}
/>
</div>
</div>