feat: 노을 탭 3일 하늘 타일 — 히어로 문장·타일 색·피드 카드를 점수 등급 기준으로(잿빛이면 거의 안 보인다고), 타일 누르면 그날로, 다른 날 안내도 등급 기준
This commit is contained in:
1 parent
118a7b29ff
commit
52b79c6de9
9 files changed
+152
-90
No files matched your search
@@ -30,7 +30,7 @@ from services.calc.index_calc import rank_score
|
||||
from services.calc.moon import MoonNight, nearest, night, view_line
|
||||
from services.calc.sky_score import GRADE_LABEL, sky_title
|
||||
from services.calc.sun import sun_times
|
||||
from services.hero_stats import UV_HIGH, HeroInput, hero_stats, uv_label
|
||||
from services.hero_stats import UV_HIGH, HeroInput, hero_stats, uv_label, uv_level
|
||||
from services.index_service import IndexBoard, IndexItem, IndexService
|
||||
from services.now_service import NowService, NowWeather
|
||||
from services.season_service import SeasonService
|
||||
@@ -627,7 +627,7 @@ class FeedService:
|
||||
return None
|
||||
label = uv_label(top)
|
||||
at = peak.forecast_at.astimezone(KST)
|
||||
rows = [Row(label=f"{r.forecast_at.astimezone(KST).hour}시", value=uv_label(float(r.uv_index))) for r in c.uv]
|
||||
rows = [Row(label=f"{r.forecast_at.astimezone(KST).hour}시", value=uv_label(float(r.uv_index)), level=uv_level(float(r.uv_index))) for r in c.uv]
|
||||
when = "점심때" if at.hour == 12 else f"{hour_label(at.hour)} 무렵"
|
||||
todo = "선크림·모자·선글라스 챙기고 그늘로 다녀요" if top >= UV_HIGH else "선크림·모자 챙겨요"
|
||||
line = f"오늘 자외선 지수 {label}\n{when} 나가면 {todo}"
|
||||
@@ -664,13 +664,13 @@ class FeedService:
|
||||
sit = SkySituation(target.situation) if target.situation else None
|
||||
line = plan.situation_label or "" # 보이는 날만 그날 하늘 한 줄
|
||||
better = plan.outlook
|
||||
if day_verdict(target) == "rest":
|
||||
if day_verdict(target) == "rest" or SkyGrade(target.grade) is SkyGrade.GRAY: # 거의 안 보이는 날은 한 줄 카드
|
||||
return PostData(**base, size="line", title=plan.title, icon=icon, caption=" ".join(filter(None, [line and f"{line}.", better])),
|
||||
slides=[], share_messages=[plan.title])
|
||||
cuts = [Cut(**b) for b in target.best_times if b["kind"] != "peak"]
|
||||
slides = [SunsetSlide(kind="sunset", eyebrow=f"{when} {word} · {c.region.name}", line=line, score=target.score,
|
||||
grade_label=GRADE_LABEL[SkyGrade(target.grade)], cuts=cuts, situation=sit,
|
||||
headline=sky_title(sit, plan.kind, None, plan.best_at) or plan.title, peak_at=plan.best_at)]
|
||||
headline=sky_title(SkyGrade(target.grade), plan.kind, None, plan.best_at), peak_at=plan.best_at)]
|
||||
if c.sky.spots and not rise:
|
||||
slides.append(RowsSlide(kind="rows", eyebrow="가까운 노을 명소", line=f"해 지는 {compass(c.sky.sunset_azimuth)}쪽", icon="sunset",
|
||||
rows=[Row(label=f"{n + 1} {x.spot.name}", value=f"{compass(x.direction)} {x.distance_km}km", place=x.spot.name) for n, x in enumerate(c.sky.spots)]))
|
||||
|
||||
Reference in new issue
Block a user