feat: 히어로 칸을 지금·습도·불쾌지수·상황 1칸으로 — 습도·불쾌지수 늘 표시
This commit is contained in:
1 parent
97ebfe2d36
commit
3a73a44cb0
7 files changed
+31
-23
No files matched your search
@@ -561,8 +561,16 @@ export type Hero = {
|
||||
* Feels C
|
||||
*/
|
||||
feels_c?: number | null;
|
||||
/**
|
||||
* Humidity
|
||||
*
|
||||
* 지금 습도 %. 히어로에 늘 보인다
|
||||
*/
|
||||
humidity?: number | null;
|
||||
/**
|
||||
* Discomfort
|
||||
*
|
||||
* 지금 불쾌지수. 히어로에 늘 보인다
|
||||
*/
|
||||
discomfort?: number | null;
|
||||
/**
|
||||
@@ -601,7 +609,7 @@ export type Hero = {
|
||||
/**
|
||||
* Stats
|
||||
*
|
||||
* 히어로 두 칸. 지금 챙길 것(비·미세먼지·자외선·일교차·체감·불쾌지수) 먼저
|
||||
* 히어로 상황 칸 1개. 지금 챙길 것(비·미세먼지·자외선·일교차·체감) 먼저
|
||||
*/
|
||||
stats?: Array<HeroStat>;
|
||||
};
|
||||
|
||||
@@ -31,7 +31,8 @@ const PREVIEW: Record<TimeKind, { label: string; clock: string; hour: number }>
|
||||
}
|
||||
|
||||
// 히어로 칸을 받아 오는 동안 자리만 잡아 둔다
|
||||
const STAT_HOLD = ['a', 'b']
|
||||
const STAT_HOLD = ['a']
|
||||
const MUGGY = 75 // 불쾌지수 이 이상이면 경고 색
|
||||
|
||||
const STARS = Array.from({ length: 26 }, (_, i) => ({ left: `${(i * 37) % 100}%`, top: `${(i * 53) % 60}%`, opacity: 0.4 + ((i * 7) % 6) / 10 }))
|
||||
// 별똥별 셋: 위치·길이·주기를 엇갈려 하나씩 떨어지게
|
||||
@@ -131,9 +132,13 @@ function Hero({ hero, today, feedLoad, todayLoad }: HeroProps) {
|
||||
</div>
|
||||
<span className="b-cloud b-fall top-[140px] left-[58%] h-9 w-[96px]" style={fall('.25s', '6.4s')} aria-hidden="true" />
|
||||
</div>
|
||||
{/* 기온 + 서버가 고른 챙길 것(비·미세먼지·자외선·일교차 등)을 한 줄 세 칸으로. 휴대폰에서 두 줄로 넘치지 않게 칸 안에서 위아래로 */}
|
||||
{/* 기온·습도·불쾌지수 + 서버가 고른 챙길 것(비·미세먼지·자외선·일교차 등) 한 칸을 한 줄 네 칸으로. 휴대폰에서 두 줄로 넘치지 않게 칸 안에서 위아래로 */}
|
||||
<div className="relative z-[3] mt-1 grid auto-cols-fr grid-flow-col gap-1.5">
|
||||
<Stat label={mode === 'now' ? '지금' : PREVIEW[mode].label}>{heroVal(tempLoad, tempChip, 'w-12')}</Stat>
|
||||
<Stat label="습도">{heroVal(feedLoad, hero?.humidity != null ? `${hero.humidity}%` : null, 'w-10')}</Stat>
|
||||
<Stat label="불쾌지수" tone={hero?.discomfort != null && hero.discomfort >= MUGGY ? 'warn' : 'normal'}>
|
||||
{heroVal(feedLoad, hero?.discomfort != null ? `${hero.discomfort} ${hero.discomfort_label ?? ''}`.trim() : null, 'w-10')}
|
||||
</Stat>
|
||||
{hero?.stats?.length
|
||||
? hero.stats.map((s) => (
|
||||
<Stat key={s.label} label={s.label} tone={s.tone}>
|
||||
|
||||
Reference in new issue
Block a user