feat: 각 탭·스토리·각 상세에 지금 구간 점수와 아침·낮·저녁·밤 칸, 히어로 '지금 날씨 점수'
This commit is contained in:
1 parent
d6525f592c
commit
5a5f585bda
10 files changed
+152
-26
No files matched your search
@@ -150,7 +150,7 @@ export const getSkyRankingOptions = (options?: Options<GetSkyRankingData>) => qu
|
||||
export const listIndicesQueryKey = (options: Options<ListIndicesData>) => createQueryKey('listIndices', options);
|
||||
|
||||
/**
|
||||
* 지수 목록 (점수순, 1~3위, 오늘 날씨 점수)
|
||||
* 지수 목록 (지금 구간 점수순, 1~3위, 지금 날씨 점수)
|
||||
*/
|
||||
export const listIndicesOptions = (options: Options<ListIndicesData>) => queryOptions<ListIndicesResponse, ListIndicesError, ListIndicesResponse, ReturnType<typeof listIndicesQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export { addComment, deleteComment, getArticle, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, healthzHealthzGet, likeComment, likePost, listArticles, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, logout, me, nearestRegion, type Options, refresh, savePost, signup, unlikeComment, unlikePost, unsavePost, updateMe } from './sdk.gen';
|
||||
export { type AddCommentData, type AddCommentError, type AddCommentErrors, type AddCommentResponse, type AddCommentResponses, type AirData, AirGrade, ArticleCategory, type ArticleSummary, AuthProvider, type BandArticle, type BandEvent, type Bands, type BestTime, type ClientOptions, type CommentData, type CommuteData, Confidence, type Cut, type DayData, type DeleteCommentData, type DeleteCommentError, type DeleteCommentErrors, type DeleteCommentResponse, type DeleteCommentResponses, type ErrorInfo, type EventData, type Factor, type GakSlide, type GetArticleData, type GetArticleError, type GetArticleErrors, type GetArticleResponse, type GetArticleResponses, type GetFeedData, type GetFeedError, type GetFeedErrors, type GetFeedResponse, type GetFeedResponses, type GetImageData, type GetImageError, type GetImageErrors, type GetImageResponses, type GetIndexData, type GetIndexError, type GetIndexErrors, type GetIndexResponse, type GetIndexResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetSeasonWeekData, type GetSeasonWeekResponse, type GetSeasonWeekResponses, type GetSkyData, type GetSkyError, type GetSkyErrors, type GetSkyRankingData, type GetSkyRankingResponse, type GetSkyRankingResponses, type GetSkyResponse, type GetSkyResponses, type GetWatchSummaryData, type GetWatchSummaryError, type GetWatchSummaryErrors, type GetWatchSummaryResponse, type GetWatchSummaryResponses, type GetWeatherNowData, type GetWeatherNowError, type GetWeatherNowErrors, type GetWeatherNowResponse, type GetWeatherNowResponses, type GetWeatherTodayData, type GetWeatherTodayError, type GetWeatherTodayErrors, type GetWeatherTodayResponse, type GetWeatherTodayResponses, type GetWeekData, type GetWeekError, type GetWeekErrors, type GetWeekRankingData, type GetWeekRankingResponse, type GetWeekRankingResponses, type GetWeekResponse, type GetWeekResponses, type HealthzHealthzGetData, type HealthzHealthzGetResponse, type HealthzHealthzGetResponses, type Hero, type HeroStat, type HourCell, type HoursSlide, type HttpValidationError, IndexCategory, type IndexSummary, type LikeCommentData, type LikeCommentError, type LikeCommentErrors, type LikeCommentResponse, type LikeCommentResponses, type LikePostData, type LikePostError, type LikePostErrors, type LikePostResponse, type LikePostResponses, type ListArticlesData, type ListArticlesError, type ListArticlesErrors, type ListArticlesResponse, type ListArticlesResponses, type ListCommentsData, type ListCommentsError, type ListCommentsErrors, type ListCommentsResponse, type ListCommentsResponses, type ListEventsData, type ListEventsError, type ListEventsErrors, type ListEventsResponse, type ListEventsResponses, type ListIndicesData, type ListIndicesError, type ListIndicesErrors, type ListIndicesResponse, type ListIndicesResponses, type ListPlacesData, type ListPlacesError, type ListPlacesErrors, type ListPlacesResponse, type ListPlacesResponses, type ListRegionsData, type ListRegionsError, type ListRegionsErrors, type ListRegionsResponse, type ListRegionsResponses, type ListSavedData, type ListSavedError, type ListSavedErrors, type ListSavedResponse, type ListSavedResponses, type LoginData, type LoginError, type LoginErrors, type LoginResponse, type LoginResponses, type LogoutData, type LogoutError, type LogoutErrors, type LogoutResponse, type LogoutResponses, type Me, type MeData, type MeError, type MeErrors, type MeResponse, type MeResponses, type NearestRegionData, type NearestRegionError, type NearestRegionErrors, type NearestRegionResponse, type NearestRegionResponses, type PlaceData, type PlanSlide, type PlanSpot, type PlanStep, type PostData, PostType, type Rain2h, type RainHourData, RainType, type RankData, type RefreshData, type RefreshError, type RefreshErrors, type RefreshResponse, type RefreshResponses, type RegionData, type ReqComment, type ReqLogin, type ReqRefresh, type ReqSignup, type ReqUpdateMe, type ResArticle, type ResArticleList, type ResAuth, type ResComment, type ResCommentLike, type ResCommentList, type ResEventList, type ResFeed, type ResHealth, type ResIndexDetail, type ResIndexList, type ResLogout, type ResMe, type ResPlaceList, type ResPost, type ResPostLike, type ResPostSave, type ResRegion, type ResRegionList, type ResSavedList, type ResSeasonWeek, type ResSky, type ResSkyRanking, type ResWatchSummary, type ResWeatherNow, type ResWeatherToday, type ResWebPacketProtocol, type ResWeek, type ResWeekRanking, type Row, type RowsSlide, type SavedPost, type SavePostData, type SavePostError, type SavePostErrors, type SavePostResponse, type SavePostResponses, type ScoreBand, type SignupData, type SignupError, type SignupErrors, type SignupResponse, type SignupResponses, Sky, SkyGrade, type SkyPlanData, type SkyScoreData, SkySituation, SkyType, SlotTone, type SpotData, type SunsetSlide, type TermData, type Tomorrow, type TopIndex, type TrendPoint, type UnlikeCommentData, type UnlikeCommentError, type UnlikeCommentErLine truncated
|
||||
export { type AddCommentData, type AddCommentError, type AddCommentErrors, type AddCommentResponse, type AddCommentResponses, type AirData, AirGrade, ArticleCategory, type ArticleSummary, AuthProvider, type BandArticle, type BandEvent, type Bands, type BestTime, type ClientOptions, type CommentData, type CommuteData, Confidence, type Cut, type DayData, type DeleteCommentData, type DeleteCommentError, type DeleteCommentErrors, type DeleteCommentResponse, type DeleteCommentResponses, type ErrorInfo, type EventData, type Factor, type GakSlide, type GetArticleData, type GetArticleError, type GetArticleErrors, type GetArticleResponse, type GetArticleResponses, type GetFeedData, type GetFeedError, type GetFeedErrors, type GetFeedResponse, type GetFeedResponses, type GetImageData, type GetImageError, type GetImageErrors, type GetImageResponses, type GetIndexData, type GetIndexError, type GetIndexErrors, type GetIndexResponse, type GetIndexResponses, type GetPostData, type GetPostError, type GetPostErrors, type GetPostResponse, type GetPostResponses, type GetSeasonWeekData, type GetSeasonWeekResponse, type GetSeasonWeekResponses, type GetSkyData, type GetSkyError, type GetSkyErrors, type GetSkyRankingData, type GetSkyRankingResponse, type GetSkyRankingResponses, type GetSkyResponse, type GetSkyResponses, type GetWatchSummaryData, type GetWatchSummaryError, type GetWatchSummaryErrors, type GetWatchSummaryResponse, type GetWatchSummaryResponses, type GetWeatherNowData, type GetWeatherNowError, type GetWeatherNowErrors, type GetWeatherNowResponse, type GetWeatherNowResponses, type GetWeatherTodayData, type GetWeatherTodayError, type GetWeatherTodayErrors, type GetWeatherTodayResponse, type GetWeatherTodayResponses, type GetWeekData, type GetWeekError, type GetWeekErrors, type GetWeekRankingData, type GetWeekRankingResponse, type GetWeekRankingResponses, type GetWeekResponse, type GetWeekResponses, type HealthzHealthzGetData, type HealthzHealthzGetResponse, type HealthzHealthzGetResponses, type Hero, type HeroStat, type HourCell, type HoursSlide, type HttpValidationError, IndexCategory, type IndexSummary, type LikeCommentData, type LikeCommentError, type LikeCommentErrors, type LikeCommentResponse, type LikeCommentResponses, type LikePostData, type LikePostError, type LikePostErrors, type LikePostResponse, type LikePostResponses, type ListArticlesData, type ListArticlesError, type ListArticlesErrors, type ListArticlesResponse, type ListArticlesResponses, type ListCommentsData, type ListCommentsError, type ListCommentsErrors, type ListCommentsResponse, type ListCommentsResponses, type ListEventsData, type ListEventsError, type ListEventsErrors, type ListEventsResponse, type ListEventsResponses, type ListIndicesData, type ListIndicesError, type ListIndicesErrors, type ListIndicesResponse, type ListIndicesResponses, type ListPlacesData, type ListPlacesError, type ListPlacesErrors, type ListPlacesResponse, type ListPlacesResponses, type ListRegionsData, type ListRegionsError, type ListRegionsErrors, type ListRegionsResponse, type ListRegionsResponses, type ListSavedData, type ListSavedError, type ListSavedErrors, type ListSavedResponse, type ListSavedResponses, type LoginData, type LoginError, type LoginErrors, type LoginResponse, type LoginResponses, type LogoutData, type LogoutError, type LogoutErrors, type LogoutResponse, type LogoutResponses, type Me, type MeData, type MeError, type MeErrors, type MeResponse, type MeResponses, type NearestRegionData, type NearestRegionError, type NearestRegionErrors, type NearestRegionResponse, type NearestRegionResponses, type PlaceData, type PlanSlide, type PlanSpot, type PlanStep, type PostData, PostType, type Rain2h, type RainHourData, RainType, type RankData, type RefreshData, type RefreshError, type RefreshErrors, type RefreshResponse, type RefreshResponses, type RegionData, type ReqComment, type ReqLogin, type ReqRefresh, type ReqSignup, type ReqUpdateMe, type ResArticle, type ResArticleList, type ResAuth, type ResComment, type ResCommentLike, type ResCommentList, type ResEventList, type ResFeed, type ResHealth, type ResIndexDetail, type ResIndexList, type ResLogout, type ResMe, type ResPlaceList, type ResPost, type ResPostLike, type ResPostSave, type ResRegion, type ResRegionList, type ResSavedList, type ResSeasonWeek, type ResSky, type ResSkyRanking, type ResWatchSummary, type ResWeatherNow, type ResWeatherToday, type ResWebPacketProtocol, type ResWeek, type ResWeekRanking, type Row, type RowsSlide, type SavedPost, type SavePostData, type SavePostError, type SavePostErrors, type SavePostResponse, type SavePostResponses, type ScoreBand, type SignupData, type SignupError, type SignupErrors, type SignupResponse, type SignupResponses, Sky, SkyGrade, type SkyPlanData, type SkyScoreData, SkySituation, SkyType, type SlotPoint, SlotTone, type SpotData, type SunsetSlide, type TermData, type Tomorrow, type TopIndex, type TrendPoint, type UnlikeCommentData, type UnlikeCommentError, typeLine truncated
|
||||
@@ -49,7 +49,7 @@ export const getSky = <ThrowOnError extends boolean = true>(options: Options<Get
|
||||
export const getSkyRanking = <ThrowOnError extends boolean = true>(options?: Options<GetSkyRankingData, ThrowOnError>): RequestResult<GetSkyRankingResponses, unknown, ThrowOnError> => (options?.client ?? client).get<GetSkyRankingResponses, unknown, ThrowOnError>({ url: '/v1/sky/ranking', ...options });
|
||||
|
||||
/**
|
||||
* 지수 목록 (점수순, 1~3위, 오늘 날씨 점수)
|
||||
* 지수 목록 (지금 구간 점수순, 1~3위, 지금 날씨 점수)
|
||||
*/
|
||||
export const listIndices = <ThrowOnError extends boolean = true>(options: Options<ListIndicesData, ThrowOnError>): RequestResult<ListIndicesResponses, ListIndicesErrors, ThrowOnError> => (options.client ?? client).get<ListIndicesResponses, ListIndicesErrors, ThrowOnError>({ url: '/v1/index/list', ...options });
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://openapi.gen.json` | (string & {});
|
||||
baseUrl: `${string}://${string}` | (string & {});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -743,6 +743,24 @@ export type IndexSummary = {
|
||||
* Trend
|
||||
*/
|
||||
trend?: Array<TrendPoint>;
|
||||
/**
|
||||
* Active
|
||||
*
|
||||
* 지금 구간이 이 각의 시간대와 겹침. false 면 순위 밖, score 는 하루 점수
|
||||
*/
|
||||
active?: boolean;
|
||||
/**
|
||||
* Slot
|
||||
*
|
||||
* score 가 어느 구간 점수인지 (지금 구간)
|
||||
*/
|
||||
slot?: string | null;
|
||||
/**
|
||||
* Slots
|
||||
*
|
||||
* 오늘 구간별 점수. 각 시간대와 안 겹치는 구간은 없음
|
||||
*/
|
||||
slots?: Array<SlotPoint>;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1440,6 +1458,8 @@ export type ResIndexList = {
|
||||
day?: string | null;
|
||||
/**
|
||||
* Weather Score
|
||||
*
|
||||
* 지금 날씨 점수 (지금 구간 기준)
|
||||
*/
|
||||
weather_score?: number | null;
|
||||
/**
|
||||
@@ -2154,6 +2174,28 @@ export const SkyType = { /**
|
||||
*/
|
||||
export type SkyType = typeof SkyType[keyof typeof SkyType];
|
||||
|
||||
/**
|
||||
* SlotPoint
|
||||
*/
|
||||
export type SlotPoint = {
|
||||
/**
|
||||
* Slot
|
||||
*
|
||||
* morning / day / evening / night
|
||||
*/
|
||||
slot: string;
|
||||
/**
|
||||
* Label
|
||||
*
|
||||
* 아침 / 낮 / 저녁 / 밤
|
||||
*/
|
||||
label: string;
|
||||
/**
|
||||
* Score
|
||||
*/
|
||||
score: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* SlotTone
|
||||
*/
|
||||
@@ -2311,6 +2353,12 @@ export type TopIndex = {
|
||||
* Summary
|
||||
*/
|
||||
summary?: string | null;
|
||||
/**
|
||||
* Active
|
||||
*
|
||||
* 지금 구간이 이 각의 시간대와 겹침. false 면 순위 밖, score 는 하루 점수
|
||||
*/
|
||||
active?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -124,12 +124,16 @@ export function GakPage() {
|
||||
<div className={cx('grid grid-cols-3 gap-2 p-3 transition-opacity', q.isPlaceholderData && 'opacity-60')}>
|
||||
{items.map((g) => {
|
||||
return (
|
||||
<button key={g.index_id} type="button" onClick={() => open({ type: 'gak', indexId: g.index_id })} aria-label={`${g.rank}위 ${g.name} ${g.score}점`} className="relative flex cursor-pointer flex-col items-center rounded-[22px] bg-white px-1.5 pt-3 pb-2.5 shadow-[inset_0_-5px_0_var(--shade)]">
|
||||
<span className="absolute top-[7px] left-[9px] font-jua text-[13px] text-(--ink3)">{g.rank}</span>
|
||||
<button key={g.index_id} type="button" onClick={() => open({ type: 'gak', indexId: g.index_id })} aria-label={g.active ? `${g.rank}위 ${g.name} ${g.score}점` : `${g.name}, 지금 시간대 아님`} className={cx('relative flex cursor-pointer flex-col items-center rounded-[22px] bg-white px-1.5 pt-3 pb-2.5 shadow-[inset_0_-5px_0_var(--shade)]', !g.active && 'opacity-55')}>
|
||||
{g.active && <span className="absolute top-[7px] left-[9px] font-jua text-[13px] text-(--ink3)">{g.rank}</span>}
|
||||
{g.is_core && <span className="absolute top-2 right-2 text-[10.5px] font-extrabold text-[#1f9d62]">가을</span>}
|
||||
<Ic name={g.icon} className="w-[50px]" />
|
||||
<b className="mt-1 font-jua text-[15px] font-normal">{g.name}</b>
|
||||
<em className={cx('font-bagel text-[22px] leading-[1.1] not-italic', g.score < 50 ? 'text-(--ink3)' : 'text-(--orange)')}>{g.score}</em>
|
||||
{g.active ? (
|
||||
<em className={cx('font-bagel text-[22px] leading-[1.1] not-italic', g.score < 50 ? 'text-(--ink3)' : 'text-(--orange)')}>{g.score}</em>
|
||||
) : (
|
||||
<small className="py-1 text-[12px] leading-[1.1] font-extrabold text-(--ink3)">지금 아님</small>
|
||||
)}
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
|
||||
@@ -157,6 +157,8 @@ function Swap({ labels, at }: { labels: readonly ReactNode[]; at: number }) {
|
||||
/* ---------- 시트 스켈레톤: 완료 화면과 같은 틀·같은 줄 높이 ---------- */
|
||||
const N3 = [0, 1, 2]
|
||||
const N4 = [0, 1, 2, 3]
|
||||
const SLOT_KEYS = ['morning', 'day', 'evening', 'night'] as const
|
||||
const SLOT_NAMES = { morning: '아침', day: '낮', evening: '저녁', night: '밤' } as const
|
||||
const N6 = [0, 1, 2, 3, 4, 5]
|
||||
const N14 = Array.from({ length: 14 }, (_, i) => i)
|
||||
|
||||
@@ -348,8 +350,9 @@ function GakSheet({ indexId, onTitle }: { indexId: number; onTitle: (t: string)
|
||||
<h4 className="m-0 font-jua text-[22px] font-normal">{g.name}</h4>
|
||||
{d.description && <p className="mt-0.5 text-[13.5px] font-semibold text-(--ink2)">{d.description}</p>}
|
||||
</div>
|
||||
<b className="ml-auto font-bagel text-[42px] font-normal text-(--orange)">{g.score}</b>
|
||||
<b className={cx('ml-auto font-bagel text-[42px] font-normal', g.active ? 'text-(--orange)' : 'text-(--ink3)')}>{g.score}</b>
|
||||
</div>
|
||||
{!g.active && <p className="mt-2 text-[13px] font-bold text-(--ink2)">지금 시간대엔 해당 없어요. 점수는 오늘 가장 좋은 시간대 기준이에요.</p>}
|
||||
{now && (
|
||||
<p className="mt-3 rounded-2xl bg-[#fff4ec] px-3.5 py-2.5 text-[14.5px] font-bold">
|
||||
<b className="mr-1.5 font-jua font-normal text-(--orange)">{now.low}~{now.high}점</b>
|
||||
@@ -357,6 +360,23 @@ function GakSheet({ indexId, onTitle }: { indexId: number; onTitle: (t: string)
|
||||
</p>
|
||||
)}
|
||||
{factors.length > 2 && <Radar name={g.name} factors={factors} />}
|
||||
{g.slots && g.slots.length > 0 && (
|
||||
<div className="mt-2.5 grid grid-cols-4 gap-1.5" aria-label="오늘 시간대별 점수">
|
||||
{SLOT_KEYS.map((k) => {
|
||||
const s = g.slots?.find((x) => x.slot === k)
|
||||
const cur = g.active && g.slot === k
|
||||
return (
|
||||
<div key={k} className={cx('rounded-2xl px-1 py-2 text-center', cur ? 'bg-[#fff4ec]' : 'bg-[#f3f6fb]')}>
|
||||
<small className="block text-xs font-extrabold text-(--ink2)">
|
||||
{SLOT_NAMES[k]}
|
||||
{cur && ' · 지금'}
|
||||
</small>
|
||||
<b className={cx('block font-bagel text-xl font-normal', s ? 'text-(--orange)' : 'text-(--ink3)')}>{s ? s.score : '–'}</b>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
{g.trend && g.trend.length > 0 && (
|
||||
<div className="mt-2.5 grid grid-cols-4 gap-1.5">
|
||||
{g.trend.map((t) => (
|
||||
|
||||
@@ -125,7 +125,7 @@ function Hero({ hero, today, feedLoad, todayLoad }: HeroProps) {
|
||||
</svg>
|
||||
)}
|
||||
<span className={cx('relative', moon && '[text-shadow:0_0_6px_#fff,0_0_12px_#fff]')}>
|
||||
<small className="block font-jua text-[13px]">{failed(feedLoad) ? '점수를 못 불러왔어요' : '오늘 날씨 점수'}</small>
|
||||
<small className="block font-jua text-[13px]">{failed(feedLoad) ? '점수를 못 불러왔어요' : '지금 날씨 점수'}</small>
|
||||
<b className="block font-bagel text-[74px] leading-[0.95] font-normal">{heroVal(feedLoad, hero?.weather_score, 'w-[120px]')}</b>
|
||||
</span>
|
||||
</div>
|
||||
@@ -185,15 +185,19 @@ function Stories({ items }: { items: TopIndex[] }) {
|
||||
return (
|
||||
<Rail label="오늘의 각 순위">
|
||||
{items.map((g, i) => (
|
||||
<button key={g.index_id} type="button" onClick={() => open({ type: 'gak', indexId: g.index_id })} aria-label={`${g.rank}위 ${g.name} ${g.score}점`} className="flex w-[72px] cursor-pointer flex-col items-center gap-1">
|
||||
<span className={cx('relative size-[68px] rounded-full p-[3px]', g.score < 50 ? 'bg-[#d6deea]' : 'b-ring')}>
|
||||
<button key={g.index_id} type="button" onClick={() => open({ type: 'gak', indexId: g.index_id })} aria-label={g.active ? `${g.rank}위 ${g.name} ${g.score}점` : `${g.name}, 지금 시간대 아님`} className={cx('flex w-[72px] cursor-pointer flex-col items-center gap-1', !g.active && 'opacity-55')}>
|
||||
<span className={cx('relative size-[68px] rounded-full p-[3px]', !g.active || g.score < 50 ? 'bg-[#d6deea]' : 'b-ring')}>
|
||||
<i className="grid size-full place-items-center rounded-full border-[3px] border-(--page) bg-(--page)">
|
||||
<Ic name={g.icon} className="w-[42px]" />
|
||||
</i>
|
||||
{i < 3 && <Ic name={MEDALS[i]} className="absolute -right-1 -bottom-1 w-[25px]" />}
|
||||
{i < 3 && g.active && <Ic name={MEDALS[i]} className="absolute -right-1 -bottom-1 w-[25px]" />}
|
||||
</span>
|
||||
<b className="font-jua text-[13px] font-normal whitespace-nowrap">{g.name}</b>
|
||||
<em className="font-bagel text-[12.5px] leading-none text-(--orange) not-italic">{g.score}</em>
|
||||
{g.active ? (
|
||||
<em className="font-bagel text-[12.5px] leading-none text-(--orange) not-italic">{g.score}</em>
|
||||
) : (
|
||||
<small className="text-[11px] leading-none font-extrabold text-(--ink3)">지금 아님</small>
|
||||
)}
|
||||
</button>
|
||||
))}
|
||||
</Rail>
|
||||
|
||||
Reference in new issue
Block a user