feat: 10/20 회의 반영 — 이야기 탭을 오늘 피드로 합침(글쓰기 칸·사진 올리기·위치 정보 삭제), 오늘의 각 카드와 히어로·각 공유 템플릿, 나만의 각을 이름+날씨 조건 저장으로, 로그인 없이 좋아요(IP 해시), 피드 순서·불쾌지수 상시·포스트 그림 배경, 새 각 아이콘

This commit is contained in:
minaChoi committed 2026-10-20 17:29:14 +09:00
1 parent 017022a0b0
commit d0213f41a6
81 files changed
+3503 -593

No files matched your search

+88
View File
@@ -0,0 +1,88 @@
import type { Ref } from 'react'
import { createPortal } from 'react-dom'
import type { TopIndex } from '../api/client/types.gen'
import { cx } from '../lib/utils'
import { MEDALS } from './lib'
import { Ic } from './ui'
/** 공유 이미지 전용 틀. 화면 밖에 그려 두고 보내기 때 이것만 찍는다 (화면의 버튼은 이미지에서 빠지므로 글자만으로 만든다) */
function Offscreen({ children }: { children: React.ReactNode }) {
return createPortal(
<div aria-hidden="true" className="pointer-events-none fixed top-0 -left-[10000px] w-[380px]">
{children}
</div>,
document.body,
)
}
export type HeroShare = {
kind: string
sky: string
date: string
place: string
label: string
score?: number | null
bubble?: string | null
summary?: string | null
status: { label: string; value: string; warn: boolean }[]
slots: { label: string; icon: string; temp: string; on: boolean }[]
}
export function HeroShareCard({ d, ref }: { d: HeroShare; ref: Ref<HTMLDivElement> }) {
return (
<Offscreen>
<div ref={ref} className="b-hero relative flex aspect-[4/5] flex-col overflow-hidden px-5 pt-5 pb-4 text-center" data-t={d.kind} data-sky={d.sky}>
<p className="m-0 text-left text-[14px] font-bold opacity-80">
{d.date} · {d.place}
</p>
<div className="b-sun mx-auto mt-5 grid aspect-square w-36 place-items-center rounded-full">
<span>
<small className="block font-jua text-[13px]">{d.label}</small>
<b className="block font-bagel text-[58px] leading-[0.95] font-normal">{d.score ?? '–'}</b>
</span>
</div>
<p className="m-0 mt-4 font-jua text-[26px] leading-tight">{d.bubble}</p>
{d.summary && <p className="m-0 mt-1 text-[15px] font-bold opacity-80">{d.summary}</p>}
<p className="m-0 mt-2 flex flex-wrap justify-center gap-x-2 font-jua text-[14px]">
{d.status.map((x) => (
<span key={x.label} className={cx('whitespace-nowrap', x.warn && 'b-warn')}>
<span className="opacity-75">{x.label}</span> {x.value}
</span>
))}
</p>
<div className="b-strip mt-auto grid grid-cols-4 gap-1 rounded-[18px] p-[3px]">
{d.slots.map((s) => (
<span key={s.label} className={cx('flex flex-col items-center rounded-[14px] py-1.5', s.on && 'b-strip-on')}>
<span className="text-[13px] font-bold opacity-80">{s.label}</span>
<Ic name={s.icon} className="my-0.5 h-[22px] w-[22px] object-contain" />
<b className="font-jua text-[15px] font-normal">{s.temp}</b>
</span>
))}
</div>
</div>
</Offscreen>
)
}
export function GakShareCard({ items, title, ref }: { items: TopIndex[]; title: string; ref: Ref<HTMLDivElement> }) {
return (
<Offscreen>
<div ref={ref} className="b-band-2 flex aspect-[4/5] flex-col bg-white px-5 pt-5 pb-4">
<p className="m-0 font-jua text-[22px]">{title}</p>
<ol className="m-0 mt-3 grid list-none gap-2 p-0">
{items.map((g, i) => (
<li key={g.index_id} className="flex items-center gap-2.5 rounded-[18px] bg-white px-3 py-2.5 shadow-[inset_0_-4px_0_var(--shade)]">
{i < 3 ? <Ic name={MEDALS[i]} className="w-[24px] shrink-0" /> : <span className="w-[24px] shrink-0 text-center font-jua text-(--ink3)">{i + 1}</span>}
<Ic name={g.icon} className="w-[36px] shrink-0" />
<span className="min-w-0 flex-1">
<b className="block font-jua text-[17px] leading-tight font-normal">{g.name}</b>
{g.summary && <small className="block truncate text-xs font-semibold text-(--ink2)">{g.summary}</small>}
</span>
<em className="font-bagel text-[24px] leading-none text-(--orange) not-italic">{g.score}</em>
</li>
))}
</ol>
</div>
</Offscreen>
)
}