feat: 달 포스트·히어로 달을 오늘 밤 실제 모양으로 — 표면 무늬·빛 번짐, 보름엔 가장 밝게, 저녁엔 노을빛, 달 포스트는 밤하늘·별 배경
This commit is contained in:
1 parent
fcc4163e15
commit
d32e24a5ab
8 files changed
+143
-24
No files matched your search
+25
-3
@@ -13,6 +13,7 @@ import { usePinnedLike, type PinnedKey } from './pinnedLike'
|
||||
import { useSheet } from './sheetContext'
|
||||
import { CommentIcon, HeartIcon, SendIcon } from './svg'
|
||||
import { useCarousel } from './carousel'
|
||||
import { MoonArt } from './moon'
|
||||
import { Arrows, Credit, Ic, Rows, Skel, TAP44, Thumb } from './ui'
|
||||
|
||||
const ACCOUNTS: Record<PostType, readonly [string, string]> = {
|
||||
@@ -52,7 +53,7 @@ function slideBg(post: PostData, slide: Slide): SlideBg {
|
||||
if (slide.kind === 'plan') return slide.eyebrow.startsWith('일') ? 'peach' : 'butter'
|
||||
if (slide.kind === 'gak') return GAK_BG[post.post_id % GAK_BG.length]
|
||||
if (slide.kind === 'image') return 'sky'
|
||||
if (post.post_type === PostType.EVENT) return 'night'
|
||||
if (post.post_type === PostType.EVENT || post.post_type === PostType.MOON) return 'night'
|
||||
if (post.post_type === PostType.TIP) return 'sky'
|
||||
if (post.post_type === PostType.AIR) return slide.icon === 'vent' ? 'mint' : 'lilac'
|
||||
if (post.post_type === PostType.DAY_TRIP) return slide.image ? 'night' : 'mint'
|
||||
@@ -104,6 +105,27 @@ function Pic({ name, className }: { name: string; className?: string }) {
|
||||
|
||||
const slideBase = 'relative flex h-full w-full shrink-0 flex-col px-5 py-[22px]'
|
||||
|
||||
// 달 포스트 밤하늘 별: [left %, top %, 크기 px]
|
||||
const STARS: [number, number, number][] = [
|
||||
[8, 34, 2], [18, 52, 1.5], [30, 40, 2.5], [44, 30, 1.5], [52, 58, 2], [62, 22, 1.5], [90, 18, 2], [94, 44, 1.5], [12, 70, 1.5], [38, 66, 2], [76, 74, 1.5], [86, 64, 2], [24, 12, 1.5], [70, 10, 2.5],
|
||||
]
|
||||
|
||||
/** 달 포스트 그림: 아이콘 대신 오늘 밤 실제 모양의 달과 별 */
|
||||
function MoonPic({ pct, waxing }: { pct: number; waxing: boolean }) {
|
||||
return (
|
||||
<>
|
||||
<span className="pointer-events-none absolute inset-0 -z-10" aria-hidden="true">
|
||||
{STARS.map(([x, y, s]) => (
|
||||
<i key={`${x},${y}`} className="absolute rounded-full bg-white opacity-80 shadow-[0_0_6px_rgb(255_255_255/0.8)]" style={{ left: `${x}%`, top: `${y}%`, width: s, height: s }} />
|
||||
))}
|
||||
</span>
|
||||
<span className="b-fall pointer-events-none absolute top-[22%] right-0 w-[60%]" style={fall('.1s', '5s')}>
|
||||
<MoonArt pct={pct} waxing={waxing} className="b-bob w-full" />
|
||||
</span>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function SlideView({ slide, bg, img }: { slide: Slide; bg: SlideBg; img?: CSSProperties }) {
|
||||
const { open } = useSheet()
|
||||
if (slide.kind === 'hours') {
|
||||
@@ -258,12 +280,12 @@ function SlideView({ slide, bg, img }: { slide: Slide; bg: SlideBg; img?: CSSPro
|
||||
</div>
|
||||
)
|
||||
return (
|
||||
<div className={cx(slideBase, `b-bg-${bg}`)} style={img}>
|
||||
<div className={cx(slideBase, `b-bg-${bg}`, slide.moon_pct != null && 'isolate')} style={img}>
|
||||
<Eyebrow className={DARK.has(bg) ? 'opacity-85' : undefined}>{slide.eyebrow}</Eyebrow>
|
||||
<Big className="relative z-[1]">
|
||||
<Lines text={slide.line} />
|
||||
</Big>
|
||||
<Pic name={slide.icon} className="w-[36%]" />
|
||||
{slide.moon_pct != null ? <MoonPic pct={slide.moon_pct} waxing={!!slide.moon_waxing} /> : <Pic name={slide.icon} className="w-[36%]" />}
|
||||
<Rows rows={slide.rows ?? []} dark={DARK.has(bg)} />
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user