Merge branch 'feat/youtube-shorts' — 각 포스트 오늘·내일·주말 점수, 밤 화면 포스트 색, 동네 글 묶음 1개부터 (1557ba4)
겹친 곳: 히어로 아이콘 간격은 main 방식(버튼 좌우 5px) 하나로, 달 포스트는 밤하늘·행사는 사진 있을 때만 밤하늘, 토스에선 첫 이야기 카드 숨김 유지
This commit is contained in:
commit
3a249c509d
11 files changed
+106
-95
No files matched your search
+26
-16
@@ -53,7 +53,8 @@ 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 || post.post_type === PostType.MOON) return 'night'
|
||||
if (post.post_type === PostType.MOON) return 'night'
|
||||
if (post.post_type === PostType.EVENT) return slide.image ? 'night' : 'peach'
|
||||
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'
|
||||
@@ -63,18 +64,16 @@ function slideBg(post: PostData, slide: Slide): SlideBg {
|
||||
const DARK = new Set<SlideBg>(['dusk', 'night'])
|
||||
|
||||
// 그림 배경이 있는 각(code)과 장 수. 여러 장이면 글마다 돌려 쓴다
|
||||
const BG_IMAGES: Record<string, number> = { bike: 4, picnic: 1, hiking: 1, camping: 1, stars: 1, walk: 1, hangang: 1 }
|
||||
const EVENT_BG_N = 4
|
||||
const BG_IMAGES: Record<string, number> = { bike: 4, picnic: 1, hiking: 1, hangang: 1 }
|
||||
|
||||
function bgImage(name: string, n: number, seed: number): CSSProperties {
|
||||
const file = n > 1 ? `${name}-${'abcd'[seed % n]}` : name
|
||||
return { backgroundImage: `url(/post-bg/${file}.webp)`, backgroundSize: 'cover', backgroundPosition: 'center' }
|
||||
}
|
||||
|
||||
/** 그림 배경: 각은 각마다, 사진 없는 행사는 행사용. 없으면 색 배경만 */
|
||||
/** 그림 배경: 각은 각마다. 없으면 색 배경만 */
|
||||
function slideImage(post: PostData, slide: Slide): CSSProperties | undefined {
|
||||
if (slide.kind === 'gak') return BG_IMAGES[slide.code] ? bgImage(slide.code, BG_IMAGES[slide.code], post.post_id) : undefined
|
||||
if (post.post_type === PostType.EVENT && slide.kind === 'rows' && !slide.image) return bgImage('event', EVENT_BG_N, post.post_id)
|
||||
return undefined
|
||||
}
|
||||
|
||||
@@ -164,17 +163,28 @@ function SlideView({ slide, bg, img }: { slide: Slide; bg: SlideBg; img?: CSSPro
|
||||
<div className={cx(slideBase, `b-bg-${bg}`)} style={img}>
|
||||
<Eyebrow>오늘의 각 · {slide.rank}위</Eyebrow>
|
||||
<Big>{slide.line}</Big>
|
||||
<Pic name={slide.code} />
|
||||
<Pic name={slide.code} className="[@media(max-height:700px)]:top-[26%] [@media(max-height:700px)]:w-[34%]" />
|
||||
{slide.say && <p className="relative z-[1] m-0 mt-2.5 w-[56%] rounded-[16px] rounded-tl-[4px] bg-white/80 px-3 py-2 text-[14px] leading-snug font-bold">{slide.say}</p>}
|
||||
{/* 점수 근거: 비중 큰 조건과 지금 값. 오른쪽 아이콘과 겹치지 않게 왼쪽 반만 */}
|
||||
{!!slide.rows?.length && (
|
||||
<div className="relative z-[1] mt-2 w-[56%] rounded-[16px] bg-white/70 px-3 text-[14px] [&_b]:text-[15px] [&>div>div]:py-1.5 [&>div]:mt-0">
|
||||
<Rows rows={slide.rows} />
|
||||
{/* 오른쪽 아래 빈 곳에 오늘·내일·주말 점수 (각 상세 날짜 칸과 같은 값) */}
|
||||
<div className="relative z-[1] mt-auto flex items-end justify-between gap-3">
|
||||
<div>
|
||||
<b className="block font-bagel text-[82px] leading-[0.9] font-normal text-(--orange) [@media(max-height:700px)]:text-[64px]">{slide.score}</b>
|
||||
<p className="m-0 font-jua text-[29px] leading-tight">{slide.name}</p>
|
||||
</div>
|
||||
)}
|
||||
<b className="mt-auto font-bagel text-[82px] leading-[0.9] font-normal text-(--orange)">{slide.score}</b>
|
||||
<p className="m-0 font-jua text-[29px] leading-tight">{slide.name}</p>
|
||||
<Eyebrow className="mt-1">{slide.summary}</Eyebrow>
|
||||
{!!slide.trend?.length && (
|
||||
<div className="grid w-[46%] grid-cols-2 gap-1.5">
|
||||
{slide.trend.map((t) => (
|
||||
<div key={t.day} className="rounded-xl bg-white/80 px-1 py-1.5 text-center">
|
||||
<small className="block text-[11px] font-extrabold whitespace-nowrap text-(--ink2)">
|
||||
{t.label}
|
||||
{t.estimated && ' 예상'}
|
||||
</small>
|
||||
<b className="block font-bagel text-lg leading-tight font-normal text-(--orange)">{t.score}</b>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<button type="button" onClick={() => open({ type: 'gak', indexId: slide.index_id })} className="mt-3 cursor-pointer self-start rounded-full bg-(--orange) px-4 py-[9px] font-jua text-[15px] text-white shadow-[inset_0_-5px_0_var(--orange-deep)]">
|
||||
계산 근거 보기
|
||||
</button>
|
||||
@@ -438,7 +448,7 @@ function FullCard({ post }: PostProps) {
|
||||
<small className="text-xs font-semibold text-(--ink2)">{account}</small>
|
||||
</span>
|
||||
</div>
|
||||
<div className="relative aspect-[4/5] overflow-hidden" onClick={onTap}>
|
||||
<div className="b-day relative aspect-[4/5] overflow-hidden" onClick={onTap}>
|
||||
{n > 1 && (
|
||||
<span data-noshot className="absolute top-3 right-3 z-[2] rounded-full bg-[rgb(30_36_56/0.55)] px-[9px] py-[3px] text-xs font-extrabold text-white" aria-hidden="true">
|
||||
{index + 1}/{n}
|
||||
@@ -548,7 +558,7 @@ export function PostFrame({ title, account, avatar, caption, more, shot, pinned,
|
||||
<small className="text-xs font-semibold text-(--ink2)">{account}</small>
|
||||
</span>
|
||||
</div>
|
||||
<div ref={bodyRef}>{children}</div>
|
||||
<div ref={bodyRef} className="b-day">{children}</div>
|
||||
<div className="flex items-center gap-3.5 px-3 pt-2.5 pb-1 [&_svg]:size-[26px] [&_svg]:stroke-[1.9]">
|
||||
{postId != null && (
|
||||
<>
|
||||
|
||||
Reference in new issue
Block a user