feat: 다른 사이트에 붙이는 날씨각 위젯 — 누구나 붙이는 카드(/embed/card, 기본형·상세형, 배경 3종)와 사용 방법 페이지(/widget, 스크립트·iframe 코드)
- 카드: 군산각 카드를 옮겨 그림, 토끼 로딩, 실패하면 '날씨각에서 날씨 보기' 링크, 8초 제한, nginx 대체 화면, '자세히 보기' 버튼만 링크 - 크기: 폭은 자리에 맞춰 자동, 높이는 폭에 따라 비율대로(기본형 245~320px, 상세형 400~520px) - 부하: 지역별 카드 데이터 5분 저장, 저장분이 비면 지역마다 한 요청만 새로 만듦, 노출 수는 Redis 에 쌓았다가 관리자 조회 때 DB(widget_view_daily)로 옮김 - 사용 방법 페이지: 지역(앱 지역은 바꾸지 않음)·모양·배경 고르기, 미리보기, 코드 복사. 들어오는 길은 문의 창 버튼(토스에서는 숨김)과 검색 - GA: 위젯_안내_보기, 위젯_옵션_고름, 위젯_코드_복사 - 문서: docs/위젯_운영.md, 백엔드 테스트 실행법(CLAUDE.md)
This commit is contained in:
1 parent
1a98adc155
commit
dc8201e5f5
38 files changed
+4219
-28
No files matched your search
@@ -0,0 +1,858 @@
|
||||
/* 날씨각 카드 — 다른 사이트가 iframe 으로 붙이는 /embed/card 의 모양 (그리는 것은 card.js).
|
||||
군산각(https://gunsan.webforai.kr/ 의 style.css, 2026-11-25 받은 것)에서 .wx 카드 규칙과 그 규칙이 쓰는 @keyframes,
|
||||
.vh 를 옮겨 왔다. 원본과 다른 곳:
|
||||
1. 원본의 html.js(스크립트가 도는 페이지) → :root. 이 화면은 늘 card.js 가 그린다. 우선순위(클래스 수)는 원본과 같다.
|
||||
2. 카드 높이 401px(상세형 home)·246px(기본형 side) → 100%. 상자가 iframe 을 꽉 채우고, iframe 높이를 그 값으로 준다.
|
||||
기본 높이를 400px(상세형)·245px(기본형)로 맞추려고 아래 여백을 1px 줄였다(:root .wx-home, :root .wx-side).
|
||||
3. 군산각 :root 변수(--ink 등) 중 카드가 쓰는 것과, 군산각 기본 규칙 중 카드 안에서 먹던 것(box-sizing, p·ol 바깥
|
||||
여백, body 의 글자 설정, img·a 기본값)을 아래 첫 두 덩어리에 옮겼다. 기본 규칙은 :where(.wx) 로 카드 안에만,
|
||||
원본처럼 낮은 우선순위로 둔다.
|
||||
4. 뺀 것: 외국어판(.wx-intl, .wx-fold·.wx-fl·.wx-fd), 군산각 옆 패널이 낮은 창에서 접히는 규칙
|
||||
(@media (min-width: 1200px) and (max-height: …)), 시계로 미리 칠하는 html[data-wxt] 갈래.
|
||||
5. 더한 것: html·body 초기화, 상세형(home)의 한마디·요약 한 줄, 상태 줄 두 줄까지 (넘친 글이 반쯤 잘려 보이지 않게),
|
||||
스크립트가 돌지 않을 때의 링크(.wx-ns), 상세형(home) 날짜가 통째로 안 들어가면 숨기기(.is-nodt, card.js 가 붙인다).
|
||||
6. 그리기 전 자리 표시(빈 원과 띠, --wx-skel)를 빼고 토끼 로딩 화면(.wx-load, 날씨각 앱 첫 화면과 같은 토끼와
|
||||
'날씨 불러오는 중…')을 둔다. 못 그리면(is-failed) 가운데 흰 알약 링크 '날씨각에서 날씨 보기 ›'(원본은 '○○ 날씨 보기'와
|
||||
새 창 그림 .icon·.wx-x, 둘 다 뺐다). 8초가 지나도 is-ready·is-failed 가 안 붙으면(card.js 가 안 옴) 스크립트 없이
|
||||
애니메이션 지연만으로 토끼를 감추고 같은 링크를 보인다. 나중에라도 그려지면 그린 카드가 이긴다.
|
||||
7. 기본형(side)도 상세형(home)처럼 모서리를 28px 로 둥글게 했다(원본은 각진 모서리).
|
||||
로딩·실패 화면은 상자(.wx) 안에 있어 같은 모서리로 잘린다.
|
||||
8. 원본은 다 그린 카드 전체가 링크(.wx-go::after 가 카드를 덮음)다. 여기서는 '자세히 보기 ›' 버튼만 링크다 — 붙인 사이트
|
||||
방문자가 카드를 잘못 눌러 페이지를 떠나지 않게. ::after 는 버튼의 눌리는 자리를 위아래로 넓히는 데만 쓴다.
|
||||
배경(상자 클래스 wx-bg-*, card.js 는 몰라도 된다):
|
||||
- sky: 군산각 그대로, 시간대별 하늘.
|
||||
- light: 밝은 바탕 사이트용. 시간대별 하늘을 옅은 파스텔로, 어두운 글자, 얇은 안쪽 테두리, 별 없음, 흰 구름.
|
||||
- dark: 어두운 바탕 사이트용. 시간대별 하늘을 짙게, 흰 글자, 밤에는 별, 푸른 회색 구름.
|
||||
해·달·구름·비·눈과 움직임은 셋이 같다. */
|
||||
|
||||
/* 군산각 :root 값 (--focus 는 원본도 var(--sea), --link 는 var(--sea-hi)) */
|
||||
:root {
|
||||
--ink: #172033;
|
||||
--sea: #2F6FC9;
|
||||
--sea-hi: #255DAF;
|
||||
--sea-deep: #1D4F96;
|
||||
--link: var(--sea-hi);
|
||||
--focus: var(--sea);
|
||||
--ease-out: cubic-bezier(.16, 1, .3, 1);
|
||||
--fb: cubic-bezier(.25, .1, .25, 1);
|
||||
--font: 'Pretendard', 'Pretendard Fallback Noto', 'Pretendard Fallback WQY', 'Pretendard Fallback Inter', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
|
||||
}
|
||||
|
||||
/* 카드 화면: 카드 하나뿐이다. 바탕은 붙인 사이트가 비쳐 보이게 투명, 스크롤바 없음 */
|
||||
html {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
text-size-adjust: 100%;
|
||||
}
|
||||
html, body {
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 군산각 기본 규칙 중 카드 안에서 먹던 것 (*, p·ol, li, img, a, body 의 글자) */
|
||||
:where(.wx, .wx *, .wx *::before, .wx *::after) {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
:where(.wx) :where(p, ol) {
|
||||
margin: 0;
|
||||
}
|
||||
:where(.wx) :where(p, li) {
|
||||
text-wrap: pretty;
|
||||
}
|
||||
:where(.wx) :where(img) {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
:where(.wx) :where(a) {
|
||||
color: var(--link);
|
||||
text-decoration: none;
|
||||
transition: color .2s var(--fb);
|
||||
}
|
||||
:where(.wx) {
|
||||
font: 400 17px/1.47 var(--font);
|
||||
letter-spacing: -.01em;
|
||||
word-break: keep-all;
|
||||
overflow-wrap: break-word;
|
||||
line-break: strict;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
||||
.vh {
|
||||
position: absolute !important;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0 0 0 0);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- 카드 (군산각 style.css 의 .wx 규칙) */
|
||||
.wx {
|
||||
position: relative;
|
||||
color: var(--ink);
|
||||
}
|
||||
.wx-h {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 6px;
|
||||
margin: 0;
|
||||
padding: 12px 14px;
|
||||
}
|
||||
.wx-t {
|
||||
font: 700 13.5px/1.3 var(--font);
|
||||
color: var(--sea-deep);
|
||||
letter-spacing: -.01em;
|
||||
}
|
||||
.wx-dt, .wx-ar {
|
||||
display: none;
|
||||
}
|
||||
.wx-go {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
min-height: 24px;
|
||||
font: 700 12.5px/1.3 var(--font);
|
||||
color: var(--sea-deep);
|
||||
text-decoration: underline;
|
||||
text-decoration-thickness: 1px;
|
||||
text-underline-offset: .18em;
|
||||
}
|
||||
.wx-go:hover {
|
||||
color: var(--ink);
|
||||
}
|
||||
.wx-b:empty {
|
||||
display: none;
|
||||
}
|
||||
.wx-home .wx-h {
|
||||
padding: 16px 18px;
|
||||
}
|
||||
.wx-home .wx-t {
|
||||
font-size: 15px;
|
||||
}
|
||||
@media (max-width: 1023px) {
|
||||
.wx-go {
|
||||
min-height: 44px;
|
||||
}
|
||||
}
|
||||
:where(:root .wx) {
|
||||
--wx-bg: linear-gradient(#9fd3ff, #cfe9ff 55%, #f1f8ff);
|
||||
--wx-fg: #28304a;
|
||||
--wx-strip: rgba(255, 255, 255, .42);
|
||||
--wx-o1: .85;
|
||||
--wx-o2: .75;
|
||||
--wx-o3: .75;
|
||||
--wx-warn: #a8401a;
|
||||
}
|
||||
:root .wx {
|
||||
isolation: isolate;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 12px 16px;
|
||||
border: 0;
|
||||
border-radius: 28px;
|
||||
background: var(--wx-bg);
|
||||
color: var(--wx-fg);
|
||||
}
|
||||
.wx[data-t=morning] {
|
||||
--wx-bg: linear-gradient(#ffd9b8, #ffe9d4 40%, #dff0ff);
|
||||
}
|
||||
.wx:is([data-t=morning], [data-t=day]):is([data-sky=cloudy], [data-sky=rain], [data-sky=snow], [data-sky=sleet]) {
|
||||
--wx-bg: linear-gradient(#a9bbd0, #cbd7e4 55%, #eef2f7);
|
||||
}
|
||||
.wx[data-t=sunset] {
|
||||
--wx-bg: linear-gradient(#4c42b0, #6a48b0 45%, #8e4482);
|
||||
--wx-fg: #fff;
|
||||
--wx-strip: rgba(255, 255, 255, .14);
|
||||
--wx-o2: .85;
|
||||
--wx-o3: 1;
|
||||
--wx-warn: #ffd2b8;
|
||||
}
|
||||
.wx[data-t=night] {
|
||||
--wx-bg: linear-gradient(#141b3d, #27306a 60%, #3d3f86);
|
||||
--wx-fg: #fff;
|
||||
--wx-strip: rgba(255, 255, 255, .14);
|
||||
--wx-o2: .85;
|
||||
--wx-o3: .85;
|
||||
--wx-warn: #ffb38a;
|
||||
}
|
||||
:root .wx-home {
|
||||
height: 100%;
|
||||
padding-bottom: 11px;
|
||||
}
|
||||
:root .wx .wx-h {
|
||||
flex: none;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 0;
|
||||
height: 32px;
|
||||
padding: 0;
|
||||
}
|
||||
:root .wx .wx-t {
|
||||
flex: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: 24px;
|
||||
margin: 0 3px;
|
||||
padding: 0 10px;
|
||||
border-radius: 999px;
|
||||
background: #fff;
|
||||
color: #28304a;
|
||||
box-shadow: 0 0 0 3px var(--wx-strip), 0 4px 12px rgba(40, 48, 74, .1);
|
||||
font: 700 13px/1 WxJua, var(--font);
|
||||
font-synthesis: none;
|
||||
letter-spacing: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
:root .wx .wx-dt {
|
||||
display: block;
|
||||
flex: 0 1 auto;
|
||||
min-width: 0;
|
||||
margin-left: 10px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font: 700 13px/1.5 var(--font);
|
||||
opacity: var(--wx-o1);
|
||||
}
|
||||
:root .wx .wx-go {
|
||||
visibility: hidden;
|
||||
}
|
||||
:root .wx.is-ready .wx-go {
|
||||
visibility: visible;
|
||||
flex: none;
|
||||
display: inline-flex;
|
||||
gap: 3px;
|
||||
height: 30px;
|
||||
min-height: 0;
|
||||
margin-left: auto;
|
||||
padding: 0 12px;
|
||||
border-radius: 999px;
|
||||
background: var(--wx-strip);
|
||||
color: inherit;
|
||||
font: 700 13px/1 var(--font);
|
||||
text-decoration: none;
|
||||
}
|
||||
:root .wx.is-ready .wx-ar {
|
||||
display: inline;
|
||||
margin-left: 2px;
|
||||
font-size: 15px;
|
||||
line-height: 1;
|
||||
}
|
||||
:root .wx.is-ready .wx-go {
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
}
|
||||
:root .wx.is-ready .wx-go::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: -7px -4px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
:root .wx.is-ready .wx-go:hover {
|
||||
background: rgba(255, 255, 255, .62);
|
||||
color: #28304a;
|
||||
}
|
||||
:root .wx.is-ready .wx-go:focus-visible {
|
||||
outline: 3px solid var(--focus);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
/* 못 그렸을 때(is-failed)와 8초가 지나도 그리지 못했을 때(아래 '더한 것: 토끼 로딩 화면') 가운데 뜨는 날씨각 링크 */
|
||||
:root .wx:not(.is-ready) .wx-go {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 2;
|
||||
min-height: 44px;
|
||||
padding: 0 18px;
|
||||
border-radius: 999px;
|
||||
background: #fff;
|
||||
color: #28304a;
|
||||
font: 700 14px/1.3 var(--font);
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
box-shadow: 0 4px 12px rgba(40, 48, 74, .12);
|
||||
}
|
||||
:root .wx.is-failed .wx-go {
|
||||
visibility: visible;
|
||||
}
|
||||
:root .wx:not(.is-ready) .wx-go:hover {
|
||||
color: var(--sea-deep);
|
||||
text-decoration: underline;
|
||||
}
|
||||
:root .wx .wx-b {
|
||||
flex: 1 1 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
min-height: 0;
|
||||
}
|
||||
.wx-stars, .wx-fx {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
pointer-events: none;
|
||||
}
|
||||
.wx-stars {
|
||||
opacity: 0;
|
||||
}
|
||||
.wx[data-t=night] .wx-stars {
|
||||
opacity: 1;
|
||||
}
|
||||
.wx-stars i {
|
||||
position: absolute;
|
||||
width: 3px;
|
||||
height: 3px;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
box-shadow: 0 0 6px #fff;
|
||||
}
|
||||
.wx-shoot {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: var(--len, 90px);
|
||||
height: 1.5px;
|
||||
border-radius: 2px;
|
||||
opacity: 0;
|
||||
background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff);
|
||||
}
|
||||
.wx-drop, .wx-flake {
|
||||
position: absolute;
|
||||
top: var(--top);
|
||||
}
|
||||
.wx-drop {
|
||||
width: 2px;
|
||||
height: 18px;
|
||||
border-radius: 2px;
|
||||
background: linear-gradient(rgba(0, 0, 0, 0), rgba(80, 130, 200, .7));
|
||||
}
|
||||
.wx:is([data-t=sunset], [data-t=night]) .wx-drop {
|
||||
background: linear-gradient(rgba(0, 0, 0, 0), rgba(220, 230, 255, .7));
|
||||
}
|
||||
.wx-flake {
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
box-shadow: 0 0 4px rgba(120, 150, 200, .5);
|
||||
--drift: 18px;
|
||||
}
|
||||
.wx-sky, .wx-say, .wx-strip {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 440px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.wx-sky {
|
||||
flex: none;
|
||||
height: 9.125em;
|
||||
font-size: 16px;
|
||||
}
|
||||
.wx-cl {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
.wx-c1 {
|
||||
top: 2.25em;
|
||||
left: 5%;
|
||||
width: 5.25em;
|
||||
height: 2em;
|
||||
--d: .1s;
|
||||
--f: 6s;
|
||||
}
|
||||
.wx-c2 {
|
||||
top: 6em;
|
||||
left: 63%;
|
||||
width: 6em;
|
||||
height: 2.25em;
|
||||
--d: .25s;
|
||||
--f: 6.4s;
|
||||
}
|
||||
.wx-c3 {
|
||||
top: 1.875em;
|
||||
left: 72%;
|
||||
width: 4em;
|
||||
height: 1.75em;
|
||||
--d: .4s;
|
||||
--f: 5.4s;
|
||||
}
|
||||
.wx-cb, .wx-cb::before, .wx-cb::after {
|
||||
position: absolute;
|
||||
border-radius: 999px;
|
||||
background: #fff;
|
||||
}
|
||||
.wx-cb {
|
||||
inset: 0;
|
||||
box-shadow: inset 0 -.75em 1.125em rgba(160, 190, 230, .45), 0 1em 1.75em rgba(40, 70, 120, .13);
|
||||
}
|
||||
.wx-cb::before, .wx-cb::after {
|
||||
content: "";
|
||||
aspect-ratio: 1;
|
||||
box-shadow: inset 0 -.625em 1em rgba(160, 190, 230, .35);
|
||||
}
|
||||
.wx-cb::before {
|
||||
width: 46%;
|
||||
top: -58%;
|
||||
left: 16%;
|
||||
}
|
||||
.wx-cb::after {
|
||||
width: 36%;
|
||||
top: -36%;
|
||||
left: 50%;
|
||||
}
|
||||
.wx[data-t=night] .wx-cb, .wx[data-t=night] .wx-cb::before, .wx[data-t=night] .wx-cb::after {
|
||||
background: #c9cdf0;
|
||||
}
|
||||
.wx-ob {
|
||||
position: absolute;
|
||||
top: .5em;
|
||||
left: 50%;
|
||||
width: 8em;
|
||||
height: 8em;
|
||||
margin-left: -4em;
|
||||
--d: 0s;
|
||||
--f: 5.6s;
|
||||
}
|
||||
.wx-orb {
|
||||
position: relative;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
color: #5c1f08;
|
||||
background: radial-gradient(circle at 34% 30%, #fff5cf, #ffc86e 30%, #ff8e4e 68%, #ee6436);
|
||||
box-shadow: inset -1.125em -1.5em 2.5em rgba(170, 50, 20, .34), inset 1em 1.125em 1.75em rgba(255, 255, 255, .55), 0 1.875em 3.5em rgba(240, 106, 58, .32);
|
||||
}
|
||||
.wx[data-t=sunset] .wx-orb {
|
||||
color: #4a2442;
|
||||
background: radial-gradient(circle at 34% 30%, #fff4e6, #ffd9b8 32%, #f7a991 68%, #e07a8f);
|
||||
box-shadow: inset -1.125em -1.5em 2.5em rgba(150, 50, 90, .3), inset 1em 1.125em 1.75em rgba(255, 255, 255, .55), 0 0 3.75em rgba(255, 150, 110, .5);
|
||||
}
|
||||
.wx[data-t=night] .wx-orb {
|
||||
color: #2b2a5c;
|
||||
background: radial-gradient(circle at 34% 30%, #fff, #e7e3ff 35%, #b9b0f2 72%, #8f86d9);
|
||||
box-shadow: inset -1.125em -1.5em 2.5em rgba(60, 50, 140, .3), inset 1em 1.125em 1.75em rgba(255, 255, 255, .6), 0 0 3.75em rgba(190, 180, 255, .45);
|
||||
}
|
||||
.wx:is([data-sky=cloudy], [data-sky=rain], [data-sky=snow], [data-sky=sleet]) .wx-orb {
|
||||
filter: saturate(.7) brightness(.96);
|
||||
}
|
||||
.wx .wx-orb.wx-moon {
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
filter: none;
|
||||
}
|
||||
.wx-mo {
|
||||
position: absolute;
|
||||
top: -25%;
|
||||
left: -25%;
|
||||
width: 150%;
|
||||
height: 150%;
|
||||
max-width: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
.wx-sc {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
}
|
||||
.wx-sc small {
|
||||
display: block;
|
||||
font: 700 12px/1.5 WxJua, var(--font);
|
||||
font-synthesis: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
.wx-sc b {
|
||||
display: block;
|
||||
font: 700 3.25em/.95 WxBagel, WxJua, var(--font);
|
||||
font-synthesis: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
.wx-moon.is-lit .wx-sc {
|
||||
text-shadow: 0 0 6px #fff, 0 0 12px #fff;
|
||||
}
|
||||
.wx-moon.is-dim .wx-sc {
|
||||
color: #fff;
|
||||
text-shadow: 0 1px 8px rgba(10, 14, 40, .6);
|
||||
}
|
||||
.wx-say {
|
||||
flex: none;
|
||||
height: 103px;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
.wx-bub {
|
||||
margin: 0;
|
||||
font: 700 24px/30px WxJua, var(--font);
|
||||
font-synthesis: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
.wx-sum {
|
||||
margin: 2px 0 0;
|
||||
font: 700 15px/22.5px var(--font);
|
||||
opacity: var(--wx-o1);
|
||||
}
|
||||
.wx-st {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 0 6px;
|
||||
margin: 6px 0 0;
|
||||
font: 700 14px/21px WxJua, var(--font);
|
||||
font-synthesis: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
.wx-si {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wx-si b {
|
||||
font-weight: inherit;
|
||||
}
|
||||
.wx-sl {
|
||||
opacity: var(--wx-o2);
|
||||
}
|
||||
.wx-dot {
|
||||
opacity: .3;
|
||||
}
|
||||
.wx-si.is-warn {
|
||||
color: var(--wx-warn);
|
||||
}
|
||||
.wx-si.is-warn .wx-sl {
|
||||
opacity: 1;
|
||||
}
|
||||
.wx-strip {
|
||||
flex: none;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 4px;
|
||||
margin-top: 10px;
|
||||
padding: 3px;
|
||||
list-style: none;
|
||||
border-radius: 18px;
|
||||
background: var(--wx-strip);
|
||||
}
|
||||
.wx-strip li {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
padding: 6px 0;
|
||||
border-radius: 14px;
|
||||
}
|
||||
.wx-cn {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
font: 700 13px/19.5px var(--font);
|
||||
opacity: var(--wx-o3);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wx-ic {
|
||||
display: block;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
margin: 2px 0;
|
||||
object-fit: contain;
|
||||
}
|
||||
.wx-tc {
|
||||
font: 700 15px/22.5px WxJua, var(--font);
|
||||
font-synthesis: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
.wx-strip li.is-now {
|
||||
background: #fff;
|
||||
color: #28304a;
|
||||
box-shadow: 0 4px 12px rgba(40, 48, 74, .1);
|
||||
}
|
||||
.wx-strip li.is-now .wx-cn {
|
||||
color: #c2471b;
|
||||
opacity: 1;
|
||||
}
|
||||
:root .wx-side {
|
||||
height: 100%;
|
||||
padding: 10px 12px 9px;
|
||||
border-radius: 28px;
|
||||
}
|
||||
:root .wx-side .wx-h {
|
||||
height: 24px;
|
||||
}
|
||||
:root .wx-side .wx-t {
|
||||
height: 20px;
|
||||
margin: 0 2px;
|
||||
padding: 0 8px;
|
||||
box-shadow: 0 0 0 2px var(--wx-strip);
|
||||
font-size: 11.5px;
|
||||
}
|
||||
:root .wx-side .wx-dt {
|
||||
display: none;
|
||||
}
|
||||
/* 상세형(home) 날짜가 통째로 들어가지 않으면 card.js 가 상자에 is-nodt 를 붙인다: 잘린 채('1…') 두지 않고 자리째 숨긴다 */
|
||||
:root .wx.is-nodt .wx-dt {
|
||||
display: none;
|
||||
}
|
||||
:root .wx-side.is-ready .wx-go {
|
||||
height: 24px;
|
||||
padding: 0 9px;
|
||||
font-size: 11.5px;
|
||||
}
|
||||
:root .wx-side.is-ready .wx-ar {
|
||||
font-size: 13px;
|
||||
}
|
||||
.wx-side .wx-sky {
|
||||
font-size: 11px;
|
||||
}
|
||||
.wx-side .wx-sc small {
|
||||
font-size: 9.5px;
|
||||
line-height: 1.35;
|
||||
}
|
||||
.wx-side .wx-say {
|
||||
height: 26px;
|
||||
}
|
||||
.wx-side .wx-bub {
|
||||
overflow: hidden;
|
||||
font-size: 17px;
|
||||
line-height: 26px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.wx-side .wx-strip {
|
||||
gap: 3px;
|
||||
margin-top: 6px;
|
||||
border-radius: 14px;
|
||||
}
|
||||
.wx-side .wx-strip li {
|
||||
padding: 4px 0;
|
||||
border-radius: 11px;
|
||||
}
|
||||
.wx-side .wx-cn {
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
}
|
||||
.wx-side .wx-ic {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin: 1px 0;
|
||||
}
|
||||
.wx-side .wx-tc {
|
||||
font-size: 13px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- 배경: 밝은 바탕용(light)·어두운 바탕용(dark)
|
||||
같은 갈래의 sky 규칙(.wx[data-t=…], .wx:is(…):is(…))보다 클래스가 많아 순서와 상관없이 이긴다 */
|
||||
:root .wx.wx-bg-light {
|
||||
--wx-bg: linear-gradient(#e3f1ff, #f0f8ff 55%, #fbfdff);
|
||||
--wx-fg: #28304a;
|
||||
--wx-strip: rgba(255, 255, 255, .7);
|
||||
--wx-o1: .85;
|
||||
--wx-o2: .75;
|
||||
--wx-o3: .75;
|
||||
--wx-warn: #a8401a;
|
||||
box-shadow: inset 0 0 0 1px rgba(40, 48, 74, .08);
|
||||
}
|
||||
:root .wx.wx-bg-light[data-t=morning] {
|
||||
--wx-bg: linear-gradient(#ffeedd, #fff6ee 45%, #f3f9ff);
|
||||
}
|
||||
:root .wx.wx-bg-light:is([data-t=morning], [data-t=day]):is([data-sky=cloudy], [data-sky=rain], [data-sky=snow], [data-sky=sleet]) {
|
||||
--wx-bg: linear-gradient(#e6ebf1, #f1f4f8 55%, #fafbfc);
|
||||
}
|
||||
:root .wx.wx-bg-light[data-t=sunset] {
|
||||
--wx-bg: linear-gradient(#ece8ff, #f4ecfb 45%, #fdeef3);
|
||||
}
|
||||
:root .wx.wx-bg-light[data-t=night] {
|
||||
--wx-bg: linear-gradient(#e4e8fa, #ecedfa 60%, #f3f0fb);
|
||||
}
|
||||
:root .wx.wx-bg-light .wx-stars {
|
||||
display: none;
|
||||
}
|
||||
:root .wx.wx-bg-light .wx-cb, :root .wx.wx-bg-light .wx-cb::before, :root .wx.wx-bg-light .wx-cb::after {
|
||||
background: #fff;
|
||||
}
|
||||
:root .wx.wx-bg-light .wx-drop {
|
||||
background: linear-gradient(rgba(0, 0, 0, 0), rgba(80, 130, 200, .7));
|
||||
}
|
||||
:root .wx.wx-bg-light .wx-flake {
|
||||
background: #fff;
|
||||
box-shadow: 0 0 4px rgba(120, 150, 200, .7);
|
||||
}
|
||||
:root .wx.wx-bg-dark {
|
||||
--wx-bg: linear-gradient(#1c3252, #20304c 55%, #1c2540);
|
||||
--wx-fg: #fff;
|
||||
--wx-strip: rgba(255, 255, 255, .12);
|
||||
--wx-o1: .85;
|
||||
--wx-o2: .85;
|
||||
--wx-o3: .85;
|
||||
--wx-warn: #ffb38a;
|
||||
}
|
||||
:root .wx.wx-bg-dark[data-t=morning] {
|
||||
--wx-bg: linear-gradient(#3b2e3c, #34303f 45%, #252c42);
|
||||
}
|
||||
:root .wx.wx-bg-dark:is([data-t=morning], [data-t=day]):is([data-sky=cloudy], [data-sky=rain], [data-sky=snow], [data-sky=sleet]) {
|
||||
--wx-bg: linear-gradient(#2a313d, #262c38 55%, #20242e);
|
||||
}
|
||||
:root .wx.wx-bg-dark[data-t=sunset] {
|
||||
--wx-bg: linear-gradient(#2b2660, #39295d 45%, #482747);
|
||||
}
|
||||
:root .wx.wx-bg-dark[data-t=night] {
|
||||
--wx-bg: linear-gradient(#10152f, #1a2048 60%, #262852);
|
||||
}
|
||||
:root .wx.wx-bg-dark .wx-cb, :root .wx.wx-bg-dark .wx-cb::before, :root .wx.wx-bg-dark .wx-cb::after {
|
||||
background: #aab3d6;
|
||||
}
|
||||
:root .wx.wx-bg-dark .wx-drop {
|
||||
background: linear-gradient(rgba(0, 0, 0, 0), rgba(220, 230, 255, .7));
|
||||
}
|
||||
|
||||
/* 더한 것: 스크립트가 돌지 않을 때 날씨각 링크 (render_card 의 <noscript>, 모양은 is-failed 의 링크와 같다) */
|
||||
.wx-ns {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 6;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 44px;
|
||||
padding: 0 18px;
|
||||
border-radius: 999px;
|
||||
background: #fff;
|
||||
color: #28304a;
|
||||
font: 700 14px/1.3 var(--font);
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
box-shadow: 0 4px 12px rgba(40, 48, 74, .12);
|
||||
}
|
||||
.wx-ns:hover {
|
||||
color: var(--sea-deep);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 더한 것: 토끼 로딩 화면 (render_card 의 .wx-load. 날씨각 앱 첫 화면 #boot 와 같은 토끼·문구, 움직임은 앱의 b-hop).
|
||||
카드 가운데에 두고, 그리면(is-ready)·못 그리면(is-failed) 사라진다. 글자색은 배경을 따른다(dark 는 흰 글자).
|
||||
글꼴은 카드 본문과 같은 시스템 글꼴 굵은 글씨다 (이 화면은 Jua 를 싣지 않고, 둥근 글꼴은 card.js 가 카드 글자에만 받는다) */
|
||||
.wx-load {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
color: var(--wx-fg);
|
||||
font: 700 19px/1.3 var(--font);
|
||||
letter-spacing: 0;
|
||||
text-align: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
.wx-load img {
|
||||
display: block;
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
transform-origin: 50% 100%;
|
||||
}
|
||||
.wx-side .wx-load {
|
||||
gap: 8px;
|
||||
font-size: 15px;
|
||||
}
|
||||
.wx-side .wx-load img {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
}
|
||||
.wx.is-ready .wx-load, .wx.is-failed .wx-load {
|
||||
display: none;
|
||||
}
|
||||
/* card.js 가 오지 않으면(막힘·404) 8초 뒤 스크립트 없이 토끼를 감추고 날씨각 링크를 보인다. 움직임이 아니라 바뀌기만 하므로
|
||||
움직임 줄이기 설정과 상관없이 둔다. is-ready·is-failed 가 붙으면 이 규칙이 안 맞아 그린 카드(또는 실패 링크)가 이긴다 */
|
||||
:root .wx:not(.is-ready):not(.is-failed) .wx-load {
|
||||
animation: wx-gone 0s linear 8s forwards;
|
||||
}
|
||||
:root .wx:not(.is-ready):not(.is-failed) .wx-go {
|
||||
animation: wx-late 0s linear 8s forwards;
|
||||
}
|
||||
@keyframes wx-gone {
|
||||
to { visibility: hidden; }
|
||||
}
|
||||
@keyframes wx-late {
|
||||
to { visibility: visible; }
|
||||
}
|
||||
|
||||
/* 더한 것: 상세형(home)의 글 줄 수 (한마디 한 줄 30px + 요약 한 줄 2+22.5px + 상태 두 줄 6+42px = 102.5px, .wx-say 103px 안) */
|
||||
.wx-home .wx-bub, .wx-home .wx-sum {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
line-clamp: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.wx-home .wx-st {
|
||||
max-height: 42px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 움직임 */
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.wx.is-ready .wx-b {
|
||||
animation: wx-in .45s var(--ease-out) both;
|
||||
}
|
||||
.wx-home :is(.wx-cl, .wx-ob) {
|
||||
animation: wx-drop 1.05s cubic-bezier(.22, .9, .3, 1) var(--d, 0s) backwards;
|
||||
}
|
||||
.wx :is(.wx-cb, .wx-orb) {
|
||||
animation: wx-float var(--f, 4.8s) ease-in-out calc(var(--d, 0s) + 1.05s) infinite;
|
||||
}
|
||||
.wx[data-t=night] .wx-shoot {
|
||||
display: block;
|
||||
animation: wx-shoot var(--dur, 8s) ease-in var(--dl, 0s) infinite;
|
||||
}
|
||||
.wx[data-t=night] .wx-tw {
|
||||
animation: wx-twinkle 5s ease-in-out var(--dl, 0s) infinite;
|
||||
}
|
||||
.wx-drop, .wx-flake {
|
||||
top: -24px;
|
||||
animation: wx-fall var(--dur) linear var(--dl) infinite;
|
||||
}
|
||||
.wx.is-off * {
|
||||
animation-play-state: paused !important;
|
||||
}
|
||||
.wx-load img {
|
||||
animation: wx-hop .9s cubic-bezier(.3, 0, .4, 1) infinite;
|
||||
}
|
||||
}
|
||||
@keyframes wx-hop {
|
||||
0%, to { transform: translateY(0) scale(1.06, .94); }
|
||||
45% { transform: translateY(-22px) scale(.97, 1.03); }
|
||||
}
|
||||
@keyframes wx-drop {
|
||||
0% { opacity: 0; transform: translateY(-60vh) rotate(-10deg); }
|
||||
55% { opacity: 1; }
|
||||
72% { transform: translateY(0) rotate(2deg) scale(1.04, .96); }
|
||||
86% { transform: translateY(-10px); }
|
||||
to { opacity: 1; transform: none; }
|
||||
}
|
||||
@keyframes wx-fall {
|
||||
to { transform: translate(var(--drift, -8px), 440px); }
|
||||
}
|
||||
@keyframes wx-float {
|
||||
0%, to { transform: translateY(0); }
|
||||
50% { transform: translateY(-.5625em) rotate(1.2deg); }
|
||||
}
|
||||
@keyframes wx-in {
|
||||
from { opacity: 0; }
|
||||
}
|
||||
@keyframes wx-shoot {
|
||||
0%, 86% { opacity: 0; transform: rotate(-24deg) translate(0); }
|
||||
89% { opacity: 1; }
|
||||
to { opacity: 0; transform: rotate(-24deg) translate(-240px); }
|
||||
}
|
||||
@keyframes wx-twinkle {
|
||||
0%, to { opacity: .25; }
|
||||
50% { opacity: 1; }
|
||||
}
|
||||
Reference in new issue
Block a user