Merge branch 'feat/youtube-shorts' — 각 포스트 오늘·내일·주말 점수, 밤 화면 포스트 색, 동네 글 묶음 1개부터 (1557ba4)

겹친 곳: 히어로 아이콘 간격은 main 방식(버튼 좌우 5px) 하나로, 달 포스트는 밤하늘·행사는 사진 있을 때만 밤하늘, 토스에선 첫 이야기 카드 숨김 유지
This commit is contained in:
minaChoi committed 2026-10-27 16:26:31 +09:00
commit 3a249c509d
11 files changed
+106 -95

No files matched your search

+26 -16
View File
@@ -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 && (
<>
+1 -2
View File
@@ -159,8 +159,7 @@ const WEATHER_ICON: Record<Weather, string> = {
sleet: 'snow',
}
// 구름 수: 구름 많음 둘, 흐림·비·눈 셋
// 히어로 오른쪽 위 좋아요·댓글·보내기: 셋 다 같은 32px 칸에 아이콘 가운데, 수는 아이콘 옆
// 아이콘마다 좌우 여백을 같게: 숫자가 붙어도 아이콘 사이 간격이 그대로
// 히어로 오른쪽 위 좋아요·댓글·보내기: 아이콘마다 좌우 여백을 같게, 숫자가 붙어도 아이콘 사이 간격이 그대로
const HERO_ACT = 'relative flex h-8 cursor-pointer items-center justify-center gap-1 px-[5px] text-[13px] leading-none font-extrabold tabular-nums'
const CLOUDS = [
{ cls: 'top-9 left-[5%] h-8 w-[84px]', d: '.1s', f: '6s' },
+35 -21
View File
@@ -620,72 +620,86 @@ html.b-sheet-open .b-app :is(.b-fall, .b-bob, .b-blob, .b-skystars i, .b-shoot,
.b-app[data-t='night'] .b-tabbar {
--ink: #fff;
}
.b-app[data-t='night'] .bg-white {
.b-app[data-t='night'] .bg-white:not(.b-day, .b-day *) {
background-color: var(--card);
}
.b-app[data-t='night'] [class*='bg-white/'] {
.b-app[data-t='night'] [class*='bg-white/']:not(.b-day, .b-day *) {
background-color: rgb(34 42 92 / 0.85);
}
.b-app[data-t='night'] :is([class*='bg-[#f'], [class*='bg-[#e'], [class*='bg-[#d'], [class*='bg-[#c'], [class*='bg-[linear-gradient']):not(.b-keep-bg) {
.b-app[data-t='night'] :is([class*='bg-[#f'], [class*='bg-[#e'], [class*='bg-[#d'], [class*='bg-[#c'], [class*='bg-[linear-gradient']):not(.b-keep-bg, .b-day, .b-day *) {
background: var(--chip);
}
.b-app[data-t='night'] [class*='border-[#dfe5ee]'] {
.b-app[data-t='night'] [class*='border-[#dfe5ee]']:not(.b-day, .b-day *) {
border-color: rgb(255 255 255 / 0.12);
}
.b-app[data-t='night'] [class*='rgb(217_229_244'] {
.b-app[data-t='night'] [class*='rgb(217_229_244']:not(.b-day, .b-day *) {
box-shadow: inset 0 -5px 0 var(--shade);
}
.b-app[data-t='night'] .bg-\(--ink\) {
.b-app[data-t='night'] .bg-\(--ink\):not(.b-day, .b-day *) {
background-color: #4b56b5;
color: #fff;
}
.b-app[data-t='night'] .bg-\(--ink\) .text-\[\#ffb3c4\] {
.b-app[data-t='night'] .bg-\(--ink\) .text-\[\#ffb3c4\]:not(.b-day, .b-day *) {
color: #ffd0dc;
}
/* b-keep-bg(밤에도 밝은 바탕 그대로) 안은 글자도 그대로 */
.b-app[data-t='night'] .text-\[\#28304a\]:not(.b-keep-bg, .b-keep-bg *) {
.b-app[data-t='night'] .text-\[\#28304a\]:not(.b-keep-bg, .b-keep-bg *, .b-day, .b-day *) {
color: var(--ink);
}
.b-app[data-t='night'] :is(.text-\[\#1f9d62\], .text-\[\#1f7a4f\]) {
.b-app[data-t='night'] :is(.text-\[\#1f9d62\], .text-\[\#1f7a4f\]):not(.b-day, .b-day *) {
color: #4fd39a;
}
.b-app[data-t='night'] .text-\[\#d6457a\] {
.b-app[data-t='night'] .text-\[\#d6457a\]:not(.b-day, .b-day *) {
color: #ff8db5;
}
.b-app[data-t='night'] .text-\[\#c2471b\] {
.b-app[data-t='night'] .text-\[\#c2471b\]:not(.b-day, .b-day *) {
color: #ffab85;
}
.b-app[data-t='night'] .bg-\[\#dff5ea\] {
.b-app[data-t='night'] .bg-\[\#dff5ea\]:not(.b-day, .b-day *) {
background: rgb(79 211 154 / 0.16);
}
.b-app[data-t='night'] .bg-\[\#ffe8dc\] {
.b-app[data-t='night'] .bg-\[\#ffe8dc\]:not(.b-day, .b-day *) {
background: rgb(255 138 87 / 0.16);
}
.b-app[data-t='night'] .b-bg-sky {
.b-app[data-t='night'] .b-bg-sky:not(.b-day, .b-day *) {
background: linear-gradient(180deg, #2a4384, #1f2c62);
}
.b-app[data-t='night'] .b-bg-butter {
.b-app[data-t='night'] .b-bg-butter:not(.b-day, .b-day *) {
background: linear-gradient(180deg, #4d4128, #2c2a3e);
}
.b-app[data-t='night'] .b-bg-peach {
.b-app[data-t='night'] .b-bg-peach:not(.b-day, .b-day *) {
background: linear-gradient(180deg, #553632, #2e2840);
}
.b-app[data-t='night'] .b-bg-mint {
.b-app[data-t='night'] .b-bg-mint:not(.b-day, .b-day *) {
background: linear-gradient(180deg, #1f4a45, #1d2d4a);
}
.b-app[data-t='night'] .b-bg-lilac {
.b-app[data-t='night'] .b-bg-lilac:not(.b-day, .b-day *) {
background: linear-gradient(180deg, #3d3480, #262a5e);
}
.b-app[data-t='night'] .b-band-1 {
.b-app[data-t='night'] .b-band-1:not(.b-day, .b-day *) {
background: linear-gradient(180deg, rgb(255 160 110 / 0.12), rgb(255 255 255 / 0));
}
.b-app[data-t='night'] .b-band-2 {
.b-app[data-t='night'] .b-band-2:not(.b-day, .b-day *) {
background: linear-gradient(180deg, rgb(255 214 110 / 0.12), rgb(255 255 255 / 0));
}
.b-app[data-t='night'] .b-band-3 {
.b-app[data-t='night'] .b-band-3:not(.b-day, .b-day *) {
background: linear-gradient(180deg, rgb(110 230 180 / 0.12), rgb(255 255 255 / 0));
}
/* 밤에도 포스트 카드 본문은 낮 색 그대로 (어두운 카드가 줄줄이 이어지지 않게). 위 밤 덮어쓰기는 이 안을 뺀다 */
.b-app[data-t='night'] .b-day {
--ink: #28304a;
--ink2: #5a6380;
--ink3: #8a92aa;
--line: #e6ecf4;
--shade: #d9e5f4;
--orange: #ff7a45;
--heart: #ff3b5c;
--skel: color-mix(in oklab, currentColor 13%, transparent);
color: var(--ink);
color-scheme: light;
}
.b-app[data-t='night'] img[data-dark] {
filter: drop-shadow(0 0 1px rgb(255 255 255 / 0.9)) drop-shadow(0 0 6px rgb(255 255 255 / 0.3));
}
+1 -1
View File
@@ -5,7 +5,7 @@ const line = { fill: 'none', stroke: 'currentColor', strokeLinecap: 'round', str
// 좋아요·댓글·보내기 세 아이콘이 나란히 놓일 때 크기가 같아 보이게: 하트는 원래 그림이 작아 10% 키우고(보이는 칸을 좁힘), 보내기는 커서 5% 줄인다
export function HeartIcon({ className }: P) {
return (
<svg viewBox="1.1 2.75 21.8 21.8" className={className} aria-hidden="true">
<svg viewBox="1.1 1.95 21.8 21.8" className={className} aria-hidden="true">
<path d="M12 20.5s-8-4.9-8-11A4.6 4.6 0 0 1 12 6.8a4.6 4.6 0 0 1 8 2.7c0 6.1-8 11-8 11z" />
</svg>
)
+2 -4
View File
@@ -32,8 +32,6 @@ const WRITE_ERRORS: Record<string, string> = {
INVALID_INPUT: '100자 안으로 써 주세요.',
}
// 글이 이보다 적으면 '동네 사람들' 묶음 대신 첫 글 쓰기 카드
const GROUP_MIN = 3
const COMPOSE_ID = 'talk-compose'
const REASONS = [
@@ -385,10 +383,10 @@ export function FirstTalkCard() {
)
}
/** '동네 사람들' 자리: 글이 GROUP_MIN 개 이상이면 묶음, 아니면 첫 글 쓰기 */
/** '동네 사람들' 자리: 글이 하나라도 있으면 묶음, 없으면 첫 글 쓰기 */
export function NearTalks({ talks, loaded }: { talks: TalkData[]; loaded: boolean }) {
if (!loaded) return null
if (talks.length >= GROUP_MIN) return <TalkGroup title="동네 사람들" talks={talks} />
if (talks.length) return <TalkGroup title="동네 사람들" talks={talks} />
return IS_TOSS ? null : <FirstTalkCard />
}