feat: 피드를 시간대별 카드로 다시 짜고 하늘 배경·내 캐릭터 추가, 다른 시안 정리
- 피드: 그날 카드 12장을 03:00에 한 번에 만들고, 시간대(아침·낮·저녁·밤, 저녁은 일몰 2시간 전부터)마다 순서를 바꾸고 조건이 맞는 카드만 켠다. 새 카드 우산·특보, 내일 미리보기, 한 문장·시(예시 seed). 흐린 날 노을은 한 줄 카드.
- 캐시를 feed:{구}:{시간대}로 나누고 시간대 경계·일몰·예보 갱신 때 만료해 새 카드가 늦게 보이던 문제를 고친다.
- 히어로는 오늘 1위 각만 보여 준다.
- 각 점수·노을 점수를 7일 지나면 지운다.
- 화면 전체 하늘 배경(시간대별 색, 느린 일렁임, 밤 별)과 화면 끝까지 이어지는 위·아래 바.
- 상단바 로그인 버튼, 내 정보 창(캐릭터 6종·배경색 6종·오늘 기분 8종·닉네임·로그아웃), PATCH /v1/auth/me, 댓글·상단바에 캐릭터·배경색·기분 표시. users.character·color·mood 칸 추가.
- 카드 슬라이드와 가로 줄을 Embla 카로셀로 바꿔 PC에서도 마우스로 끌어 넘기고 화살표로 넘긴다.
- 좋아요·저장을 받아 둔 피드 데이터에도 반영해 다른 탭에 다녀와도 유지되게 고치고, 좋아요 때 하트가 터지는 애니메이션을 넣는다.
- 보내기에서 게시물을 인스타 스토리 크기(1080×1920) 이미지로 공유하거나 내려받는다 (modern-screenshot).
- 창이 열려 있는 동안 뒤 페이지 스크롤을 잠근다.
- 시안 B 확정: 시안 A 아이콘(public/a)과 쓰지 않는 전역 스타일·글꼴 삭제.
- 문서: 데이터 흐름 지도(backend/docs/data-flow-map.html), 확정 시안(docs/시안B_확정.html), 피드 기획 v2, 호출량·DB 크기 추정, data-pipeline 갱신. 보고 폴더와 예전 시안 html 삭제.
This commit is contained in:
1 parent
f8b47f064a
commit
a9ddbaab3c
93 files changed
+2322
-2751
No files matched your search
+60
-5
@@ -1,7 +1,8 @@
|
||||
import type { CSSProperties, ReactNode } from 'react'
|
||||
import { Link } from 'react-router'
|
||||
import { cx } from '../lib/utils'
|
||||
import { iconSrc } from './lib'
|
||||
import { useCarousel, type Carousel } from './carousel'
|
||||
import { AVATAR_COLORS, iconSrc, moodEmoji } from './lib'
|
||||
|
||||
type IcProps = { name: string; className?: string; alt?: string; style?: CSSProperties }
|
||||
|
||||
@@ -9,6 +10,23 @@ export function Ic({ name, className, alt = '', style }: IcProps) {
|
||||
return <img src={iconSrc(name)} alt={alt} className={cx('block', className)} style={style} decoding="async" />
|
||||
}
|
||||
|
||||
type AvatarProps = { character: string; color?: string | null; mood?: string | null; size?: number; className?: string }
|
||||
|
||||
/** 프로필 동그라미: 고른 배경색 위에 캐릭터, 오른쪽 위에 오늘 기분 */
|
||||
export function Avatar({ character, color, mood, size = 34, className }: AvatarProps) {
|
||||
const emoji = moodEmoji(mood)
|
||||
return (
|
||||
<span className={cx('relative inline-grid shrink-0 place-items-center rounded-full', className)} style={{ width: size, height: size, background: AVATAR_COLORS[color ?? ''] ?? AVATAR_COLORS.orange }}>
|
||||
<Ic name={character} style={{ width: size * 0.7 }} />
|
||||
{emoji && (
|
||||
<span className="absolute -top-1 -right-1 grid place-items-center rounded-full bg-white leading-none shadow-[0_1px_3px_rgb(40_48_74/0.25)]" style={{ width: size * 0.48, height: size * 0.48, fontSize: size * 0.3 }} aria-hidden="true">
|
||||
{emoji}
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
type SecProps = { title: string; sub?: ReactNode; more?: { to: string; label?: string }; className?: string }
|
||||
|
||||
export function Sec({ title, sub, more, className }: SecProps) {
|
||||
@@ -27,10 +45,35 @@ export function Sec({ title, sub, more, className }: SecProps) {
|
||||
)
|
||||
}
|
||||
|
||||
export function Rail({ children, className, label }: { children: ReactNode; className?: string; label?: string }) {
|
||||
/** PC(마우스)에서만 보이는 좌우 화살표 */
|
||||
export function Arrows({ api, prev, next, className }: { api: Carousel; prev: boolean; next: boolean; className?: string }) {
|
||||
const btn = 'absolute top-1/2 z-[3] hidden size-8 -translate-y-1/2 cursor-pointer place-items-center rounded-full bg-white/90 text-lg font-extrabold text-[#28304a] shadow-[0_4px_10px_rgb(40_48_74/0.18)] pointer-fine:grid'
|
||||
return (
|
||||
<div className={cx('b-noscroll flex snap-x snap-proximity gap-2.5 overflow-x-auto px-4 pt-3 pb-1 *:shrink-0 *:snap-start', className)} role={label ? 'group' : undefined} aria-label={label}>
|
||||
{children}
|
||||
<>
|
||||
{prev && (
|
||||
<button type="button" data-noshot onClick={() => api?.scrollPrev()} aria-label="이전" className={cx(btn, 'left-1.5', className)}>
|
||||
‹
|
||||
</button>
|
||||
)}
|
||||
{next && (
|
||||
<button type="button" data-noshot onClick={() => api?.scrollNext()} aria-label="다음" className={cx(btn, 'right-1.5', className)}>
|
||||
›
|
||||
</button>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
const STRIP = { align: 'start', dragFree: true, containScroll: 'trimSnaps' } as const
|
||||
|
||||
export function Rail({ children, className, label }: { children: ReactNode; className?: string; label?: string }) {
|
||||
const { ref, api, prev, next } = useCarousel(STRIP)
|
||||
return (
|
||||
<div className="relative" role={label ? 'group' : undefined} aria-label={label}>
|
||||
<div ref={ref} className="overflow-hidden">
|
||||
<div className={cx('flex gap-2.5 px-4 pt-3 pb-1 *:shrink-0', className)}>{children}</div>
|
||||
</div>
|
||||
<Arrows api={api} prev={prev} next={next} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -39,7 +82,7 @@ type ChipsProps<K extends string> = { items: readonly (readonly [K, string])[];
|
||||
|
||||
export function Chips<K extends string>({ items, value, onChange, label }: ChipsProps<K>) {
|
||||
return (
|
||||
<div className="b-noscroll flex gap-2 overflow-x-auto px-4 pt-3 pb-0.5" role="group" aria-label={label}>
|
||||
<ChipStrip label={label}>
|
||||
{items.map(([k, l]) => (
|
||||
<button
|
||||
key={k}
|
||||
@@ -51,6 +94,18 @@ export function Chips<K extends string>({ items, value, onChange, label }: Chips
|
||||
{l}
|
||||
</button>
|
||||
))}
|
||||
</ChipStrip>
|
||||
)
|
||||
}
|
||||
|
||||
function ChipStrip({ children, label }: { children: ReactNode; label: string }) {
|
||||
const { ref, api, prev, next } = useCarousel(STRIP)
|
||||
return (
|
||||
<div className="relative" role="group" aria-label={label}>
|
||||
<div ref={ref} className="overflow-hidden">
|
||||
<div className="flex gap-2 px-4 pt-3 pb-0.5">{children}</div>
|
||||
</div>
|
||||
<Arrows api={api} prev={prev} next={next} className="mt-[5px] size-7 text-base" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user