Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58d6249102 | ||
|
|
414c827e38 |
No files matched your search
+5
-12
@@ -33,7 +33,7 @@ NAVER_CLIENT_ID=
|
|||||||
NAVER_CLIENT_SECRET=
|
NAVER_CLIENT_SECRET=
|
||||||
# 미발급. 없으면 네이버 지역검색을 쓴다
|
# 미발급. 없으면 네이버 지역검색을 쓴다
|
||||||
KAKAO_REST_API_KEY=
|
KAKAO_REST_API_KEY=
|
||||||
OPENAI_API_KEY=
|
GEMINI_API_KEY=
|
||||||
# 디코딩된 키(인코딩 키는 이중 인코딩된다)
|
# 디코딩된 키(인코딩 키는 이중 인코딩된다)
|
||||||
TOUR_API_KEY=
|
TOUR_API_KEY=
|
||||||
# 발행할 때 이 숙소의 노래를 한 곡 만든다(가사 Gemini → 작곡 Suno).
|
# 발행할 때 이 숙소의 노래를 한 곡 만든다(가사 Gemini → 작곡 Suno).
|
||||||
@@ -65,6 +65,9 @@ SOCIAL_APPROVAL_HOURS=24
|
|||||||
SOCIAL_APP_ORIGIN=
|
SOCIAL_APP_ORIGIN=
|
||||||
THREADS_APP_ID=
|
THREADS_APP_ID=
|
||||||
THREADS_APP_SECRET=
|
THREADS_APP_SECRET=
|
||||||
|
# ★ Meta 가 발급하는 값이 아니라 **우리가 정해서 앱 콘솔에 등록**하는 우리 콜백 주소다.
|
||||||
|
# https 여야 하고(로컬 http 는 등록되지 않는다), nginx 가 /v1/ 을 API 로 보내므로
|
||||||
|
# 발행 호스트와 같은 오리진을 쓴다: https://<SITE_PUBLIC_HOST>/v1/social/oauth/callback
|
||||||
THREADS_REDIRECT_URI=
|
THREADS_REDIRECT_URI=
|
||||||
# 알림톡(대행사). 비면 발송을 건너뛰고 빌더 화면 승인만 쓴다 — 기능은 그대로 돈다.
|
# 알림톡(대행사). 비면 발송을 건너뛰고 빌더 화면 승인만 쓴다 — 기능은 그대로 돈다.
|
||||||
# ★ 템플릿 코드는 심사 대상이라 env 로 둔다. 반려로 코드가 바뀌면 배포 없이 고쳐야 한다.
|
# ★ 템플릿 코드는 심사 대상이라 env 로 둔다. 반려로 코드가 바뀌면 배포 없이 고쳐야 한다.
|
||||||
@@ -113,14 +116,6 @@ GSC_CREDENTIALS_FILE=
|
|||||||
GSC_CREDENTIALS_HOST_FILE=
|
GSC_CREDENTIALS_HOST_FILE=
|
||||||
GSC_ALERT_DAYS=7
|
GSC_ALERT_DAYS=7
|
||||||
GSC_ALERT_WEBHOOK_URL=
|
GSC_ALERT_WEBHOOK_URL=
|
||||||
|
|
||||||
# 장애 알림(잡 dead-letter·발행 업무 실패·부분 실패·잡 큐 정체) — Teams Workflows 수신 webhook.
|
|
||||||
# GSC_ALERT_WEBHOOK_URL 과 다른 값이다(그건 색인 감시 전용) — docs/ALERTS.md.
|
|
||||||
# 비우면 알림은 DB(alert_outbox)에 쌓이기만 하고 안 나간다. 서버 동작에는 영향 없다.
|
|
||||||
TEAMS_WEBHOOK_URL=
|
|
||||||
# 재시도마다 중복 스팸을 막는 창(분). 기본 60분 — 같은 사유가 이 시간 안에 또 터지면 다시 안 보낸다.
|
|
||||||
ALERT_DEDUPE_WINDOW_MIN=60
|
|
||||||
|
|
||||||
# 비우면 로컬 발행만 한다
|
# 비우면 로컬 발행만 한다
|
||||||
AZURE_STORAGE_CONNECTION_STRING=
|
AZURE_STORAGE_CONNECTION_STRING=
|
||||||
AZURE_STORAGE_CONTAINER=
|
AZURE_STORAGE_CONTAINER=
|
||||||
@@ -137,9 +132,7 @@ AZURE_STORAGE_PREFIX=
|
|||||||
# 자동 로그인 — 위저드 앞에 로그인 화면을 세우지 않으려고 세션을 미리 잡는다.
|
# 자동 로그인 — 위저드 앞에 로그인 화면을 세우지 않으려고 세션을 미리 잡는다.
|
||||||
# ⚠️ 이 값은 **프론트 번들에 구워진다.** 페이지를 연 사람은 누구나 JS 에서 읽는다 —
|
# ⚠️ 이 값은 **프론트 번들에 구워진다.** 페이지를 연 사람은 누구나 JS 에서 읽는다 —
|
||||||
# 내부 테스트 호스트에서만 채우고, 사장님에게 여는 순간 비운다(lib/autoSession.ts).
|
# 내부 테스트 호스트에서만 채우고, 사장님에게 여는 순간 비운다(lib/autoSession.ts).
|
||||||
# ★ solution-frontend(--profile dev, vite dev)에서만 읽힌다 — 운영 진입점(solution-site,
|
# ★ 바꾸면 재빌드해야 한다: ./deploy.sh solution-site
|
||||||
# nginx/Dockerfile)은 이 값을 build arg 로 아예 받지 않는다. 여기 채워도 운영 번들에는
|
|
||||||
# 절대 안 들어간다. 바꾸면 재기동만 하면 된다(운영 이미지 재빌드가 필요 없다).
|
|
||||||
AUTO_LOGIN_ID=
|
AUTO_LOGIN_ID=
|
||||||
AUTO_LOGIN_PW=
|
AUTO_LOGIN_PW=
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
| 최근에 뭘 왜 바꿨나 | [docs/DEVLOG.md](docs/DEVLOG.md) |
|
| 최근에 뭘 왜 바꿨나 | [docs/DEVLOG.md](docs/DEVLOG.md) |
|
||||||
| 서버에 올릴 때 | [docs/DEPLOY.md](docs/DEPLOY.md) |
|
| 서버에 올릴 때 | [docs/DEPLOY.md](docs/DEPLOY.md) |
|
||||||
| **어느 서버**에 올리나 (킹서버) | [docs/SERVERS.md](docs/SERVERS.md) |
|
| **어느 서버**에 올리나 (킹서버) | [docs/SERVERS.md](docs/SERVERS.md) |
|
||||||
| 장애가 나면 누가·어떻게 아나 | [docs/ALERTS.md](docs/ALERTS.md) |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -116,13 +115,6 @@
|
|||||||
(`VITE_GOOGLE_CLIENT_ID`, compose 가 루트 값을 흘려보낸다). 백엔드는 이 값으로 구글 토큰의
|
(`VITE_GOOGLE_CLIENT_ID`, compose 가 루트 값을 흘려보낸다). 백엔드는 이 값으로 구글 토큰의
|
||||||
수신자(`aud`)를 대조한다 — **이 검사가 유일하게 "남의 앱에 발급된 진짜 구글 토큰"을 막는다.**
|
수신자(`aud`)를 대조한다 — **이 검사가 유일하게 "남의 앱에 발급된 진짜 구글 토큰"을 막는다.**
|
||||||
어긋나면 버튼은 뜨는데 로그인만 계속 거부된다. 비우면 구글 로그인만 꺼진다(서버는 뜬다).
|
어긋나면 버튼은 뜨는데 로그인만 계속 거부된다. 비우면 구글 로그인만 꺼진다(서버는 뜬다).
|
||||||
- **★ `VITE_AUTO_LOGIN_ID`·`PW` 는 운영 진입점(`solution-site`, nginx/Dockerfile)에 절대
|
|
||||||
넘기지 않는다.** 예전엔 `docker-compose.yml` 의 `solution-site` build args 에 이 값이
|
|
||||||
실제로 흘러가고 있었다 — `.env` 에 채운 채로 배포하면 자동 로그인 계정이 사장님이 여는
|
|
||||||
운영 번들에 그대로 구워졌다(누구나 JS 에서 읽을 수 있다). 지금은 그 build arg 자체가
|
|
||||||
없다. `lib/autoSession.ts` 의 `import.meta.env.DEV` 가드가 둘째 안전판이다 — 실수로
|
|
||||||
값이 다시 넘어와도 운영 빌드(`vite build`)에서는 죽은 코드로 접혀 번들에서 빠진다.
|
|
||||||
자동 로그인이 필요하면 `solution-frontend`(`--profile dev`, `vite dev`)만 쓴다.
|
|
||||||
- **`AZURE_STORAGE_PREFIX` 와 루트 절대경로는 충돌한다.** HTML 이 `/assets/…` 를 가리키는데
|
- **`AZURE_STORAGE_PREFIX` 와 루트 절대경로는 충돌한다.** HTML 이 `/assets/…` 를 가리키는데
|
||||||
블롭은 `ai-for-web/assets/…` 에 놓인다. 접두사를 쓰려면 오리진 경로를 `/ai-for-web` 로 잡는
|
블롭은 `ai-for-web/assets/…` 에 놓인다. 접두사를 쓰려면 오리진 경로를 `/ai-for-web` 로 잡는
|
||||||
CDN 을 앞에 세워야 한다. 아니면 비워라.
|
CDN 을 앞에 세워야 한다. 아니면 비워라.
|
||||||
|
|||||||
+3
-2
@@ -248,10 +248,11 @@ services:
|
|||||||
VITE_API_BASE_URL: ${PUBLIC_API_BASE_URL:-http://localhost}
|
VITE_API_BASE_URL: ${PUBLIC_API_BASE_URL:-http://localhost}
|
||||||
VITE_PUBLISH_HOST: ${SITE_PUBLIC_HOST:-localhost}
|
VITE_PUBLISH_HOST: ${SITE_PUBLIC_HOST:-localhost}
|
||||||
VITE_SITE_PREVIEW_URL: ${PUBLIC_WEB_BASE_URL:-http://localhost}
|
VITE_SITE_PREVIEW_URL: ${PUBLIC_WEB_BASE_URL:-http://localhost}
|
||||||
|
# ⚠️ 비어 있으면 자동 로그인은 아예 꺼진다(기본값 없음). 채우면 번들에 구워진다.
|
||||||
|
VITE_AUTO_LOGIN_ID: ${AUTO_LOGIN_ID:-}
|
||||||
|
VITE_AUTO_LOGIN_PW: ${AUTO_LOGIN_PW:-}
|
||||||
# 비어 있으면 구글 로그인 버튼이 안 뜬다. 백엔드 GOOGLE_CLIENT_ID 와 같은 값이다.
|
# 비어 있으면 구글 로그인 버튼이 안 뜬다. 백엔드 GOOGLE_CLIENT_ID 와 같은 값이다.
|
||||||
VITE_GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
|
VITE_GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
|
||||||
# ★ VITE_AUTO_LOGIN_ID·PW 는 여기 없다 — nginx/Dockerfile 이 그 ARG 를 아예 안 받는다.
|
|
||||||
# 자동 로그인이 필요하면 solution-frontend(--profile dev)를 쓴다.
|
|
||||||
image: o2o-web4ai-solution-site
|
image: o2o-web4ai-solution-site
|
||||||
container_name: o2o-web4ai-solution-site
|
container_name: o2o-web4ai-solution-site
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
# 장애 알림 (2026-09-15)
|
|
||||||
|
|
||||||
구현: `services/alert_service.py`(적재·재시도·중복 억제) · `services/teams_webhook.py`(전송) ·
|
|
||||||
`worker/runner.py` · `services/build_service.py` · `services/rollback_service.py`(발생 지점) ·
|
|
||||||
`scheduler/jobs.py`(발송·큐 정체 스윕). 전용 컨테이너 없음 — 기존 API·워커 프로세스가 한다.
|
|
||||||
|
|
||||||
## 무엇을 알리나
|
|
||||||
|
|
||||||
| kind | 언제 | dedupe_key |
|
|
||||||
|---|---|---|
|
|
||||||
| `job_dead` | 잡이 재시도를 소진해 DEAD | `job_dead:{JobType}:{place_id 또는 job_id}` |
|
|
||||||
| `build_failed` | BUILD·ROLLBACK 이 **게이트 반려가 아닌** 렌더·인프라 실패로 끝남 | `build_failed:{place_id}` |
|
|
||||||
| `partial_failure` | 노래 등 곁가지 생성 실패(발행 자체는 계속) | `song_failed:{place_id}` |
|
|
||||||
| `queue_stuck` | dead-letter 누적·좀비 실행·PENDING 30분 이상 정체 | `queue_health` |
|
|
||||||
| `recovery` | 위 dedupe_key 가 다음 정상 상태에서 풀릴 때 한 번 | 없음(매번 새 행) |
|
|
||||||
|
|
||||||
★ **게이트 반려는 알리지 않는다.** 사장님이 fact 를 안 채웠거나 고유 콘텐츠가 없어서 막힌 건
|
|
||||||
운영자가 손댈 일이 아니다 — `build_service._fail(reason, gate=None)` 일 때만 `build_failed`.
|
|
||||||
|
|
||||||
## 중복 억제·재시도
|
|
||||||
|
|
||||||
`send_alert(kind, title, detail, dedupe_key)` — 같은 dedupe_key 로 "안 풀린"(resolved_at
|
|
||||||
NULL) 알림이 이미 있으면 새로 만들지 않는다. `resolve_alert(dedupe_key, ...)` 가 그 알림을
|
|
||||||
풀고 복구 알림을 한 번 보낸다. 실제 전송은 `scheduler.jobs.sweep_alert_outbox`(1분마다) —
|
|
||||||
실패하면 `crud/job_crud.compute_backoff` 와 같은 백오프로 최대 5회 재시도 후 `FAILED`(소진)로
|
|
||||||
멈춘다. `TEAMS_WEBHOOK_URL` 이 비어 있으면 적재만 되고 전송은 안 나간다(서버 동작엔 영향 없음).
|
|
||||||
|
|
||||||
`detail` 은 저장 **전에** `alert_service._scrub` 이 쿼리스트링 키·Bearer 토큰·`password=` 류·
|
|
||||||
이메일을 마스킹한다 — 외부 API 예외 메시지가 URL 에 키를 실어 보내는 경우가 있다.
|
|
||||||
|
|
||||||
## 설정
|
|
||||||
|
|
||||||
```
|
|
||||||
TEAMS_WEBHOOK_URL= # Teams Workflows 수신 webhook. 비우면 알림이 DB(alert_outbox)에
|
|
||||||
# 쌓이기만 하고 안 나간다 — 서버는 그대로 뜬다.
|
|
||||||
ALERT_DEDUPE_WINDOW_MIN=60
|
|
||||||
```
|
|
||||||
|
|
||||||
`GSC_ALERT_WEBHOOK_URL`(search_console_alerts.py)과는 **다른 값**이다 — 색인 감시 전용과
|
|
||||||
이 잡 큐·발행 알림은 목적이 달라 의도적으로 분리했다(services/teams_webhook.py 머리주석).
|
|
||||||
|
|
||||||
## 서버·DB 전체 장애 — 이 알림 체계로는 못 잡는다
|
|
||||||
|
|
||||||
`alert_service`·`scheduler`가 도는 프로세스 자체가 죽으면(서버 다운·DB 완전 단절) 이 체계는
|
|
||||||
자기 장애를 자기가 못 알린다. **외부 감시가 필요하다** — uptime 모니터 등에서 주기적으로
|
|
||||||
`GET /readyz` 를 찌른다(`router/router.py`). `/healthz` 와 다르다: `/healthz` 는 프로세스
|
|
||||||
생존만(항상 200), `/readyz` 는 **DB 에 실제로 `SELECT 1` 을 던져** 200/503 을 가른다.
|
|
||||||
|
|
||||||
절차:
|
|
||||||
1. 외부 모니터가 `https://<host>/readyz` 를 1~5분 간격으로 확인한다.
|
|
||||||
2. 2xx 가 아니거나 타임아웃이면 **그 모니터 자신의 채널**로 알린다 — 이 레포의
|
|
||||||
`TEAMS_WEBHOOK_URL` 로 보내면 안 된다(webhook 이 죽은 서버 안에 있을 수 있다).
|
|
||||||
3. 이 모니터의 실제 설정(어느 서비스·어느 채널)은 이 세션에서 만들지 않았다 — 운영 계정·
|
|
||||||
외부 서비스 연결은 사용자 승인 후 진행한다.
|
|
||||||
|
|
||||||
## 아직 안 한 것 — 운영 미적용
|
|
||||||
|
|
||||||
- 실제 Teams Workflows webhook 생성·채널 지정 — mock 테스트만 했다(tests/test_alert_service.py).
|
|
||||||
- 외부 uptime 모니터 실제 연결(2절 3번).
|
|
||||||
- 마이그레이션(`0016_alert_outbox.sql`) 서버 적용.
|
|
||||||
- `alert_outbox` 오래된 SENT/FAILED 행 보관 정책(지금은 무기한 보관 — 운영 부하를 보고 정한다).
|
|
||||||
@@ -371,8 +371,6 @@ JWT 를 쓰지 않는 이유는 JWT 가 서명만 검증하고 **소비를 못
|
|||||||
남은 정책: 만료 24시간의 최종 근거, 야간 발송(현재 화면 채널만 사용), 다계정 선택,
|
남은 정책: 만료 24시간의 최종 근거, 야간 발송(현재 화면 채널만 사용), 다계정 선택,
|
||||||
장기 미사용 계정의 사전 토큰 갱신. 계정은 현재 user/provider당 하나다.
|
장기 미사용 계정의 사전 토큰 갱신. 계정은 현재 user/provider당 하나다.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 8. FAQ 는 20개를 채운다 — 모자란 만큼 공통 질문 + 문의 안내 (2026-09-14)
|
## 8. FAQ 는 20개를 채운다 — 모자란 만큼 공통 질문 + 문의 안내 (2026-09-14)
|
||||||
|
|
||||||
**왜** — 확인된 fact 로만 쓰면 FAQ 가 4~8개에서 끝난다. 실측(2026-09-14, 로컬): 스테이머뭄 fact 8건,
|
**왜** — 확인된 fact 로만 쓰면 FAQ 가 4~8개에서 끝난다. 실측(2026-09-14, 로컬): 스테이머뭄 fact 8건,
|
||||||
|
|||||||
+60
-145
@@ -1,88 +1,5 @@
|
|||||||
# 개발 일지
|
# 개발 일지
|
||||||
|
|
||||||
## 2026-09-16 — Teams 웹훅 수신자 고장 — 플로우 재생성으로 해결
|
|
||||||
|
|
||||||
원인: 플로우의 `body/recipient` 가 `"48:notes"`(Teams 예약값, 실제 채팅 아님)로 박혀 있어
|
|
||||||
`PostCardToConversation` 호출마다 BadRequest. 플로우 재생성(웹훅 템플릿) + 채널로 지정해서
|
|
||||||
해결, 실제 채널 게시 확인함. `TEAMS_WEBHOOK_URL` 갱신함(`.env`, 커밋 안 됨).
|
|
||||||
|
|
||||||
## 2026-09-16 — 크롤링 실패를 jobs.result 에 구조화해서 싣는다
|
|
||||||
|
|
||||||
`common/collect_diagnostics.py`(신규) + `collect_service.py` 채널별 실패 10곳 연결.
|
|
||||||
전엔 로그 한 줄로만 남아 원인 확인하려면 워커 로그를 grep 해야 했다 — 이제 잡 결과에도 남는다.
|
|
||||||
|
|
||||||
**검증** — `python3 ast` 파싱, 수동 실행 확인.
|
|
||||||
|
|
||||||
## 2026-09-16 — Gemini 호출 실패가 온보딩 생성 잡을 죽이지 않게
|
|
||||||
|
|
||||||
**한 일**
|
|
||||||
- `services/copy_service.py` — 소개문·FAQ 생성(`generate` 단계)에서 `GeminiError` 가 나면
|
|
||||||
잡을 실패시키지 않고 `generate` 를 건너뛴 것으로 기록한 뒤 fact 만으로 저장까지 계속한다.
|
|
||||||
프론트 사유 라벨: `generationLabels.ts` `SKIP_REASONS.generation_failed`.
|
|
||||||
- `common/database/db_session_manager.py` — 유니크 제약 충돌(`IntegrityError`) 로그를
|
|
||||||
ERROR → WARN. 재수집 시 이미 등록된 링크를 다시 넣으려는 정상 경로라
|
|
||||||
`services/collect_service.py` `_add_link` 가 이미 "이미 있으면 그만" 으로 처리한다.
|
|
||||||
|
|
||||||
**왜**
|
|
||||||
API 키가 아예 없을 때는 이미 `generate` 를 건너뛰고 fact 만으로 계속하면서, 키는 있는데
|
|
||||||
**호출이 실패할 때만** 잡 전체를 DEAD 로 보내는 건 일관성이 없었다. 발행도 고유 콘텐츠
|
|
||||||
0건으로 막지 않고(`publish_gate.check_unique_content` — "얇은 콘텐츠로 발행을 막지 않기로
|
|
||||||
했다"), 다른 곁들이 콘텐츠(자작곡 등, `build_service.py`)도 실패하면 로그만 남기고 계속
|
|
||||||
진행한다 — 이 갈래만 예외였다.
|
|
||||||
|
|
||||||
실측(2026-09-15 밤, 킹서버): 사진분석(VISION) 배치가 Gemini 분당 쿼터를 다 써서, 같은 키를
|
|
||||||
쓰는 온보딩 COPY 잡의 생성 호출도 429 를 맞고 재시도(총 20초 안팎)를 소진해 DEAD 로 갔다.
|
|
||||||
화면엔 "콘텐츠 생성을 완료하지 못했습니다" 로 떴다 — fact 만으로도 편집·발행이 되는데
|
|
||||||
잡을 죽일 이유가 없었다.
|
|
||||||
|
|
||||||
유니크 제약 쪽은 별개로, 이 로그가 ERROR 레벨이라 킹서버 워커 로그를 보면 크롤링이 계속
|
|
||||||
오류나는 것처럼 보였다(실제로는 매 재수집마다 정상적으로 나는 로그).
|
|
||||||
|
|
||||||
**남은 것** — Gemini 429 자체의 재시도 대기시간은 아직 안 늘렸다(호출 내 최대 8초 백오프 ·
|
|
||||||
잡 재시도 5초/10초). 분당 쿼터가 다 찬 상황을 실제로 견디려면 더 길게 기다려야 하는데,
|
|
||||||
그만큼 워커 슬롯을 오래 묶어 두는 트레이드오프가 있어 다음 작업으로 미룬다.
|
|
||||||
|
|
||||||
## 2026-09-15 — 장애 알림(잡 dead-letter·발행 실패·큐 정체) + /readyz
|
|
||||||
|
|
||||||
- alert_outbox(마이그레이션 0016) + services/alert_service.py — 영구 저장 + 재시도(최대 5회,
|
|
||||||
job_crud 와 같은 백오프) + dedupe_key 로 중복 스팸 억제 + 복구 알림. 전용 컨테이너 없이
|
|
||||||
기존 스케줄러(API 컨테이너, 1분·5분 스윕)와 워커 코드 안 후크로 돈다.
|
|
||||||
- 알리는 지점: 잡이 DEAD 로 떨어질 때(worker/runner.py), BUILD·ROLLBACK 이 **게이트 반려가
|
|
||||||
아닌** 렌더·인프라 실패로 끝날 때, 노래 등 부분 실패, 잡 큐 정체(dead-letter 누적·좀비
|
|
||||||
실행·PENDING 정체). 게이트 반려(사장님 쪽 문제)는 알리지 않는다.
|
|
||||||
- services/teams_webhook.py — Teams Workflows 수신 webhook 어댑터(일반화, search_console_alerts.py
|
|
||||||
와는 별도). TEAMS_WEBHOOK_URL 미설정이면 적재만 되고 전송은 안 나간다.
|
|
||||||
- detail 은 저장 전에 마스킹된다(쿼리스트링 키·Bearer 토큰·password=·이메일).
|
|
||||||
- `/readyz` 추가 — `/healthz`(프로세스 생존)와 달리 DB 에 실제로 SELECT 1 을 던져 본다.
|
|
||||||
서버·DB 가 통째로 죽으면 이 알림 체계도 자기 장애를 못 알리므로, 외부 uptime 모니터가
|
|
||||||
이 경로를 봐야 한다(docs/ALERTS.md — 실제 외부 연결은 이 세션에서 하지 않았다).
|
|
||||||
- ★ 버그 하나 잡음: alert_crud.due_pending 이 파이썬에서 계산한 시각과 DB 의 next_attempt_at
|
|
||||||
을 비교했는데, 앱·DB 서버 시계가 몇 십 ms 만 어긋나도(실측: 로컬에서 재현) send_alert
|
|
||||||
직후 process_outbox 를 부르는 자리에서 방금 넣은 알림이 안 잡혔다. `func.now()`(DB 쪽
|
|
||||||
시계)로 비교하도록 고쳤다.
|
|
||||||
- 검증: tests/test_alert_service.py(신규 17건) · test_job_queue.py(dead-letter 알림 1건 추가,
|
|
||||||
16건) · test_build_publish.py(게이트 반려/업무 실패 구분 확인 추가, 15건) · test_healthz.py
|
|
||||||
(readyz 1건 추가, 2건) 전부 통과.
|
|
||||||
- 운영 미적용: 실제 Teams webhook 생성·채널 지정, 외부 uptime 모니터 연결, 마이그레이션
|
|
||||||
0016 서버 적용 — 전부 사용자 승인 후 별도 진행.
|
|
||||||
|
|
||||||
## 2026-09-15 — 운영 번들의 자동 로그인 자격증명 제거 · refresh 토큰 무효화
|
|
||||||
|
|
||||||
- `docker-compose.yml` `solution-site`(운영 진입점) 빌드에서 `VITE_AUTO_LOGIN_ID`·`PW`
|
|
||||||
build arg 를 없앴다 — 채워진 채로 배포하면 사장님이 여는 번들에 그대로 구워져 누구나
|
|
||||||
JS 에서 읽을 수 있었다. `nginx/Dockerfile` 도 그 ARG 자체를 안 받는다.
|
|
||||||
- `lib/autoSession.ts` 에 `import.meta.env.DEV` 가드를 더했다(둘째 안전판) — 운영 빌드는
|
|
||||||
이 분기가 죽은 코드로 접혀 번들에서 통째로 빠진다. 실측: 자격증명 값을 채운 채로
|
|
||||||
운영 빌드를 돌려도 `build/client` 어디에도 그 문자열이 없는 것을 확인했다.
|
|
||||||
- `users.token_version`(마이그레이션 0015) 추가 — `refresh_token()` 이 지금까지 서명·만료만
|
|
||||||
보고 DB 를 한 번도 안 읽었다. 비밀번호를 바꿔도 이미 나간 refresh 토큰(7일)은 만료 전까지
|
|
||||||
계속 새 access 토큰을 찍어냈다. 이제 재발급마다 DB 의 token_version 을 대조하고,
|
|
||||||
비밀번호 변경이 그 값을 올린다(그 전 refresh 토큰은 다음 재발급부터 거절).
|
|
||||||
- 검증: `tests/test_auth.py` 16건 통과(신규 3건 — 정상 재발급·비번 변경 후 거절·계정 차단 후
|
|
||||||
거절). `tests/test_schema_ddl.py` 통과(ORM ↔ init.sql 일치).
|
|
||||||
- 운영 미적용: 실제 서버 `.env` 의 `AUTO_LOGIN_ID`·`PW` 값 확인·제거와 마이그레이션 적용은
|
|
||||||
이 세션에서 하지 않았다 — 서버 접속·DB 변경은 사용자 승인 후 별도로 진행한다.
|
|
||||||
|
|
||||||
## 2026-09-15 — 워커 렌더·발행 버전·예약 안내·미리보기 대기
|
## 2026-09-15 — 워커 렌더·발행 버전·예약 안내·미리보기 대기
|
||||||
|
|
||||||
- 상시 프리렌더를 제거하고 워커가 컴파일된 Node 렌더러를 실행한다.
|
- 상시 프리렌더를 제거하고 워커가 컴파일된 Node 렌더러를 실행한다.
|
||||||
@@ -98,68 +15,6 @@ API 키가 아예 없을 때는 이미 `generate` 를 건너뛰고 fact 만으
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 2026-09-14 — SNS 게재: 사장님이 누르면 글을 쓰고, 승인받아, 사장님 계정으로 올린다
|
|
||||||
|
|
||||||
**추가 검증 (Threads 전환 완료본)** — 격리 DB `web4ai_social_isolated_test_db`, `SCHEDULER_ENABLED=0`에서
|
|
||||||
변경본 648 passed / 2 failed, 변경 전 HEAD 사본 635 passed / 동일한 2 failed를 확인했다.
|
|
||||||
실패는 기존 `test_rate_limit_closes_the_tap`·썸네일 호스트 기대값 검사이며 SNS 신규 13건은 모두 통과했다.
|
|
||||||
공용 테스트 DB에서는 다른 실행의 삭제/정리와 충돌했으므로 그 결과는 회귀 판정에서 제외했다.
|
|
||||||
`npm run lint`·전체 프론트 빌드 통과, site vitest 62 passed.
|
|
||||||
임시 payload를 실제 프리렌더해 데스크톱·모바일 하단 카드를 확인했고, SNS 글만 있는 payload는
|
|
||||||
고유 콘텐츠 0건으로 발행 거부됨을 확인했다. 실제 Threads 게시·알림톡 발송·운영 배포는 실행하지 않았다.
|
|
||||||
운영 활성화 전제와 남은 정책은 [SOCIAL.md](SOCIAL.md)에 정리했다.
|
|
||||||
|
|
||||||
|
|
||||||
**무슨 일** — 발행한 사이트로 사람을 데려올 경로가 제품 안에 없었다. IndexNow 통보와 사이트맵뿐이고,
|
|
||||||
그건 검색엔진이 언제 읽을지 우리가 모른다. 이제 사장님이 [SNS에 알리기] 를 누르면 확인된 fact 로
|
|
||||||
짧은 글을 쓰고, 승인을 받아 **사장님 개인 계정**(스레드)으로 올린다. 올린 글은 발행본 맨 아래에도 실린다.
|
|
||||||
|
|
||||||
**★ 이 변경의 크기** — 섹션 하나 추가가 아니다. 이 레포가 처음으로 ①외부에 **쓰기**를 하고
|
|
||||||
②**남의 계정 자격증명을 보관**하고 ③**되돌릴 수 없는 행위**를 한다. 아래 결정이 전부 여기서 나왔다.
|
|
||||||
|
|
||||||
**승인을 다시 둔다 — 7절의 예외** ([DECISIONS 7-1절](DECISIONS.md))
|
|
||||||
7절("LLM 이 쓴 문장은 승인 없이 나간다")의 "왜 안전한가" 두 줄이 여기서는 둘 다 성립하지 않는다.
|
|
||||||
기준은 문장의 참/거짓이 아니라 **명의**(사장님 계정의 발언) · **되돌릴 수 있나**(없다) ·
|
|
||||||
**무엇이 주로 틀리나**(문장이 아니라 링크 — `_publish_target` 이 계산하므로 앞 게이트가 못 본다)다.
|
|
||||||
7절의 함정은 구조로 막았다: 시작이 사장님 클릭이라 "안 눌러서 영영 안 나감" 이 생기지 않고,
|
|
||||||
승인 경로가 둘(알림톡·빌더)이며, 미승인은 만료되어 **화면에 보이게** 남는다.
|
|
||||||
|
|
||||||
**★ 게시는 주소가 확정된 사이트에만.** `sites.domain` 이 비면 발행 슬러그가 **상호명에서 파생**되고
|
|
||||||
(`_publish_target`), 상호를 고치면 주소가 통째로 바뀐다 — `SITE_SLUG_LOCKED` 는 `domain` 변경만
|
|
||||||
막으므로 여기엔 안 걸린다. 이미 올라간 글의 링크는 404 가 되고 **그 글은 수정할 수 없다.**
|
|
||||||
→ `PUBLISHED` + `current_version_id` + `domain` 셋이 다 있을 때만 허용한다.
|
|
||||||
|
|
||||||
**★ 승인은 GET 이 아니라 POST.** 메신저 링크 미리보기·백신·프리페치가 사람이 누르기 전에 URL 을
|
|
||||||
연다. GET 승인이면 사장님이 안 눌렀는데 올라가고 로그에는 "승인됨" 으로 남는다.
|
|
||||||
일회성은 토큰이 아니라 `status='PENDING_APPROVAL'` 조건이 붙은 단일 UPDATE 가 보장한다.
|
|
||||||
|
|
||||||
**게시는 기본으로 꺼져 있다**(`SOCIAL_POSTING_ENABLED=0`). 초안·승인까지는 계약 없이 돌지만
|
|
||||||
게시는 되돌릴 수 없어서, 플랫폼 계약과 **1-4(해지 시 사이트 처리)** 결론을 확인한 뒤 사람이 연다.
|
|
||||||
★ 1-4 가 이 기능의 **전제조건**이 됐다 — 외부에 영구 링크를 뿌리는 순간 "유예 기간 미정" 이
|
|
||||||
"죽은 링크 정책 미정" 이 된다.
|
|
||||||
|
|
||||||
**사진은 올리지 않는다.** 1-2(이미지 재게시)의 격리는 "나중에 필터로 뺄 수 있다" 는 전제 위에 있는데
|
|
||||||
SNS 는 그 전제가 깨진다(플랫폼 서버에 사본이 생긴다). 게다가 지금 OWNER 사진은 존재할 수 없다(5-3).
|
|
||||||
→ 필터가 아니라 **미디어 첨부 코드를 아예 만들지 않았다.**
|
|
||||||
|
|
||||||
**플랫폼은 스레드다.** X 는 URL 이 든 글을 쓰는 데 **요청당 $0.20** 이 안내돼 있어(공식 가격표),
|
|
||||||
"계정 단위 고정비" 라는 처음 가정이 틀렸다 — 사이트마다 나가는 변동비다. 스레드는 직접 API 에
|
|
||||||
건당 과금 안내가 없다. 어댑터 경계는 그대로 두되 X 어댑터는 넣지 않았다([API_USAGE 5절](API_USAGE.md)).
|
|
||||||
|
|
||||||
**밟은 함정 둘**
|
|
||||||
- **ORM 기본값에 쉼표가 딸려 들어갔다.** `server_default=text("'[]',")` → `DEFAULT '[]', NOT NULL`
|
|
||||||
로 나가 **CREATE TABLE 이 통째로 실패**했다. 운영 DB 는 init.sql 로 만들어져 안 드러나고
|
|
||||||
**ORM 이 스키마를 만드는 테스트 DB 에서만** 터진다 — 9월 10일의 `now()` 기본값 사고와 같은 자리다.
|
|
||||||
- **승인 스윕 주기가 1분이었다.** 쓰기 커넥션을 계속 집어 들어, 같은 컨테이너에서 도는 테스트가
|
|
||||||
커넥션을 못 받아 `TimeoutError` 로 무더기 실패했다(실측). 이 스윕이 하는 일은 "만료 표시" 와
|
|
||||||
"중단된 초안 정리" 뿐이라 분 단위 정밀도가 필요 없다 → **5분**.
|
|
||||||
|
|
||||||
**검증** — 백엔드 SNS 테스트 9건 통과(초안 dedup·owner 스코프 · 주소 고정 요구 · GET 프리페치가
|
|
||||||
상태를 안 바꾸는지 · 승인 CAS 일회성 · 만료·중단 스윕). `tsc -b`·`eslint` 통과(shared·site·frontend),
|
|
||||||
vitest 58 passed(신규 3). 스케줄러를 끈 상태에서 snapshot·vision·social 26건 동시 통과.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 2026-09-15 — Google 사이트맵 자동 제출·색인 관측
|
## 2026-09-15 — Google 사이트맵 자동 제출·색인 관측
|
||||||
|
|
||||||
- 기존 스케줄러에서 발행 완료 DB 감지 → 사이트맵 제출 → 색인 조회 → 지연/실패 알림.
|
- 기존 스케줄러에서 발행 완료 DB 감지 → 사이트맵 제출 → 색인 조회 → 지연/실패 알림.
|
||||||
@@ -270,6 +125,66 @@ site·frontend·admin `tsc --noEmit` 통과 · site vitest 63 passed.
|
|||||||
**남은 것** — SiteOntology 매칭은 지역으로 거르지 않는다. 지금은 낱말 대조가 다른 지역 단어를 막지만,
|
**남은 것** — SiteOntology 매칭은 지역으로 거르지 않는다. 지금은 낱말 대조가 다른 지역 단어를 막지만,
|
||||||
운영에 전국 데이터가 들어가면 SiteOntology 에 지역 필터를 넣는 것이 맞다.
|
운영에 전국 데이터가 들어가면 SiteOntology 에 지역 필터를 넣는 것이 맞다.
|
||||||
|
|
||||||
|
## 2026-09-14 — SNS 게재: 사장님이 누르면 글을 쓰고, 승인받아, 사장님 계정으로 올린다
|
||||||
|
|
||||||
|
**추가 검증 (Threads 전환 완료본)** — 격리 DB `web4ai_social_isolated_test_db`, `SCHEDULER_ENABLED=0`에서
|
||||||
|
변경본 648 passed / 2 failed, 변경 전 HEAD 사본 635 passed / 동일한 2 failed를 확인했다.
|
||||||
|
실패는 기존 `test_rate_limit_closes_the_tap`·썸네일 호스트 기대값 검사이며 SNS 신규 13건은 모두 통과했다.
|
||||||
|
공용 테스트 DB에서는 다른 실행의 삭제/정리와 충돌했으므로 그 결과는 회귀 판정에서 제외했다.
|
||||||
|
`npm run lint`·전체 프론트 빌드 통과, site vitest 62 passed.
|
||||||
|
임시 payload를 실제 프리렌더해 데스크톱·모바일 하단 카드를 확인했고, SNS 글만 있는 payload는
|
||||||
|
고유 콘텐츠 0건으로 발행 거부됨을 확인했다. 실제 Threads 게시·알림톡 발송·운영 배포는 실행하지 않았다.
|
||||||
|
운영 활성화 전제와 남은 정책은 [SOCIAL.md](SOCIAL.md)에 정리했다.
|
||||||
|
|
||||||
|
|
||||||
|
**무슨 일** — 발행한 사이트로 사람을 데려올 경로가 제품 안에 없었다. IndexNow 통보와 사이트맵뿐이고,
|
||||||
|
그건 검색엔진이 언제 읽을지 우리가 모른다. 이제 사장님이 [SNS에 알리기] 를 누르면 확인된 fact 로
|
||||||
|
짧은 글을 쓰고, 승인을 받아 **사장님 개인 계정**(스레드)으로 올린다. 올린 글은 발행본 맨 아래에도 실린다.
|
||||||
|
|
||||||
|
**★ 이 변경의 크기** — 섹션 하나 추가가 아니다. 이 레포가 처음으로 ①외부에 **쓰기**를 하고
|
||||||
|
②**남의 계정 자격증명을 보관**하고 ③**되돌릴 수 없는 행위**를 한다. 아래 결정이 전부 여기서 나왔다.
|
||||||
|
|
||||||
|
**승인을 다시 둔다 — 7절의 예외** ([DECISIONS 7-1절](DECISIONS.md))
|
||||||
|
7절("LLM 이 쓴 문장은 승인 없이 나간다")의 "왜 안전한가" 두 줄이 여기서는 둘 다 성립하지 않는다.
|
||||||
|
기준은 문장의 참/거짓이 아니라 **명의**(사장님 계정의 발언) · **되돌릴 수 있나**(없다) ·
|
||||||
|
**무엇이 주로 틀리나**(문장이 아니라 링크 — `_publish_target` 이 계산하므로 앞 게이트가 못 본다)다.
|
||||||
|
7절의 함정은 구조로 막았다: 시작이 사장님 클릭이라 "안 눌러서 영영 안 나감" 이 생기지 않고,
|
||||||
|
승인 경로가 둘(알림톡·빌더)이며, 미승인은 만료되어 **화면에 보이게** 남는다.
|
||||||
|
|
||||||
|
**★ 게시는 주소가 확정된 사이트에만.** `sites.domain` 이 비면 발행 슬러그가 **상호명에서 파생**되고
|
||||||
|
(`_publish_target`), 상호를 고치면 주소가 통째로 바뀐다 — `SITE_SLUG_LOCKED` 는 `domain` 변경만
|
||||||
|
막으므로 여기엔 안 걸린다. 이미 올라간 글의 링크는 404 가 되고 **그 글은 수정할 수 없다.**
|
||||||
|
→ `PUBLISHED` + `current_version_id` + `domain` 셋이 다 있을 때만 허용한다.
|
||||||
|
|
||||||
|
**★ 승인은 GET 이 아니라 POST.** 메신저 링크 미리보기·백신·프리페치가 사람이 누르기 전에 URL 을
|
||||||
|
연다. GET 승인이면 사장님이 안 눌렀는데 올라가고 로그에는 "승인됨" 으로 남는다.
|
||||||
|
일회성은 토큰이 아니라 `status='PENDING_APPROVAL'` 조건이 붙은 단일 UPDATE 가 보장한다.
|
||||||
|
|
||||||
|
**게시는 기본으로 꺼져 있다**(`SOCIAL_POSTING_ENABLED=0`). 초안·승인까지는 계약 없이 돌지만
|
||||||
|
게시는 되돌릴 수 없어서, 플랫폼 계약과 **1-4(해지 시 사이트 처리)** 결론을 확인한 뒤 사람이 연다.
|
||||||
|
★ 1-4 가 이 기능의 **전제조건**이 됐다 — 외부에 영구 링크를 뿌리는 순간 "유예 기간 미정" 이
|
||||||
|
"죽은 링크 정책 미정" 이 된다.
|
||||||
|
|
||||||
|
**사진은 올리지 않는다.** 1-2(이미지 재게시)의 격리는 "나중에 필터로 뺄 수 있다" 는 전제 위에 있는데
|
||||||
|
SNS 는 그 전제가 깨진다(플랫폼 서버에 사본이 생긴다). 게다가 지금 OWNER 사진은 존재할 수 없다(5-3).
|
||||||
|
→ 필터가 아니라 **미디어 첨부 코드를 아예 만들지 않았다.**
|
||||||
|
|
||||||
|
**플랫폼은 스레드다.** X 는 URL 이 든 글을 쓰는 데 **요청당 $0.20** 이 안내돼 있어(공식 가격표),
|
||||||
|
"계정 단위 고정비" 라는 처음 가정이 틀렸다 — 사이트마다 나가는 변동비다. 스레드는 직접 API 에
|
||||||
|
건당 과금 안내가 없다. 어댑터 경계는 그대로 두되 X 어댑터는 넣지 않았다([API_USAGE 5절](API_USAGE.md)).
|
||||||
|
|
||||||
|
**밟은 함정 둘**
|
||||||
|
- **ORM 기본값에 쉼표가 딸려 들어갔다.** `server_default=text("'[]',")` → `DEFAULT '[]', NOT NULL`
|
||||||
|
로 나가 **CREATE TABLE 이 통째로 실패**했다. 운영 DB 는 init.sql 로 만들어져 안 드러나고
|
||||||
|
**ORM 이 스키마를 만드는 테스트 DB 에서만** 터진다 — 9월 10일의 `now()` 기본값 사고와 같은 자리다.
|
||||||
|
- **승인 스윕 주기가 1분이었다.** 쓰기 커넥션을 계속 집어 들어, 같은 컨테이너에서 도는 테스트가
|
||||||
|
커넥션을 못 받아 `TimeoutError` 로 무더기 실패했다(실측). 이 스윕이 하는 일은 "만료 표시" 와
|
||||||
|
"중단된 초안 정리" 뿐이라 분 단위 정밀도가 필요 없다 → **5분**.
|
||||||
|
|
||||||
|
**검증** — 백엔드 SNS 테스트 9건 통과(초안 dedup·owner 스코프 · 주소 고정 요구 · GET 프리페치가
|
||||||
|
상태를 안 바꾸는지 · 승인 CAS 일회성 · 만료·중단 스윕). `tsc -b`·`eslint` 통과(shared·site·frontend),
|
||||||
|
vitest 58 passed(신규 3). 스케줄러를 끈 상태에서 snapshot·vision·social 26건 동시 통과.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 2026-09-11 — 발행하면 이 숙소의 노래가 한 곡 생긴다 (가사 Gemini → 작곡 Suno)
|
## 2026-09-11 — 발행하면 이 숙소의 노래가 한 곡 생긴다 (가사 Gemini → 작곡 Suno)
|
||||||
|
|||||||
@@ -81,6 +81,22 @@ docker compose logs -f solution-backend | grep "\[social\]"
|
|||||||
★ 쿠키는 `Secure` 다. https 가 아닌 호스트(예: 사내 IP 로 직접 접속)에서는 브라우저가 쿠키를
|
★ 쿠키는 `Secure` 다. https 가 아닌 호스트(예: 사내 IP 로 직접 접속)에서는 브라우저가 쿠키를
|
||||||
저장하지 않아 **항상 `INVALID_OAUTH_STATE`** 가 된다. 원인이 화면에 안 보이는 종류라 여기 적어 둔다.
|
저장하지 않아 **항상 `INVALID_OAUTH_STATE`** 가 된다. 원인이 화면에 안 보이는 종류라 여기 적어 둔다.
|
||||||
|
|
||||||
|
### 4. 연결과 게시는 전제가 다르다
|
||||||
|
|
||||||
|
| | 필요한 것 |
|
||||||
|
|---|---|
|
||||||
|
| **연결(OAuth)** | `SOCIAL_TOKEN_SECRET` + `THREADS_APP_ID` · `APP_SECRET` · `REDIRECT_URI` |
|
||||||
|
| **게시** | `SOCIAL_TOKEN_SECRET`(토큰 복호화) + 저장된 계정 토큰 + `SOCIAL_POSTING_ENABLED=1` |
|
||||||
|
|
||||||
|
★ 게시는 **이미 받아 둔 사장님 토큰 하나면 된다**(`threads.publish(text, token)`). 앱 자격증명과
|
||||||
|
리디렉션 URI 는 계정을 **새로 연결할 때만** 쓴다. 둘을 한 깃발로 묶으면 "리디렉션 URI 가 아직
|
||||||
|
없다" 는 이유로 게시까지 막힌다 — 실제로 그랬다(2026-09-15: 토큰은 있고 URI 만 없는데
|
||||||
|
게시가 열리지 않았다). 그래서 `accounts.token_ready()` 와 `accounts.configured()` 를 갈랐다.
|
||||||
|
|
||||||
|
★ 리디렉션 URI 는 **Meta 가 발급하는 값이 아니다.** 우리가 정해서 앱 콘솔에 등록하는 우리
|
||||||
|
주소다: `https://<SITE_PUBLIC_HOST>/v1/social/oauth/callback`
|
||||||
|
(nginx 가 `/v1/` 을 API 로 보내므로 발행 호스트와 같은 오리진이면 된다).
|
||||||
|
|
||||||
## 보완한 안전장치
|
## 보완한 안전장치
|
||||||
|
|
||||||
**POSTING 10분 경과는 UNKNOWN**이다. APPROVED로 되돌리면 응답 유실/프로세스 종료 때 중복 게시한다.
|
**POSTING 10분 경과는 UNKNOWN**이다. APPROVED로 되돌리면 응답 유실/프로세스 종료 때 중복 게시한다.
|
||||||
|
|||||||
+4
-61
@@ -3,70 +3,13 @@
|
|||||||
`Open-Meteo → /v1/local/weather → useLiveWeather → WeatherSection`
|
`Open-Meteo → /v1/local/weather → useLiveWeather → WeatherSection`
|
||||||
|
|
||||||
관측값은 기존 API를 사용하며 브라우저에서 10분마다 갱신한다. 조회 실패 시 마지막 관측값과
|
관측값은 기존 API를 사용하며 브라우저에서 10분마다 갱신한다. 조회 실패 시 마지막 관측값과
|
||||||
관측 시각을 유지한다. 날씨 문구는 API 요청마다 생성하지 않는다. **API 키 없음** — Open-Meteo
|
관측 시각을 유지한다. 날씨 문구는 API 요청마다 생성하지 않는다.
|
||||||
는 키 발급 없이 쓰는 무료 공개 엔드포인트다(`services/external/open_meteo.py`).
|
|
||||||
|
|
||||||
## Open-Meteo 응답 → 내부 스냅샷
|
|
||||||
|
|
||||||
`GET https://api.open-meteo.com/v1/forecast?latitude=&longitude=¤t=temperature_2m,weather_code,wind_speed_10m&timezone=auto`
|
|
||||||
|
|
||||||
원본 `current` 블록(`temperature_2m`·`weather_code`·`wind_speed_10m`·`time`)을 어댑터가
|
|
||||||
`{temperature, weather_code, wind_speed, observed_at, timezone, latitude, longitude}`로
|
|
||||||
정규화한다(`open_meteo.py:fetch_current_weather`). `weather_code`는 WMO 표준 정수 코드 그대로
|
|
||||||
저장·전달되고, 하늘 상태 문구로 바꾸는 건 아래 두 곳뿐이다 — **반드시 같은 구간이어야 한다**
|
|
||||||
(하이드레이션 전엔 백엔드 값, 후엔 브라우저 값을 쓰는데 표가 다르면 같은 날씨인데 문구가 바뀐다):
|
|
||||||
|
|
||||||
- 서버: `site_payload._weather_condition()` — 프리렌더 스냅샷에 쓰인다.
|
|
||||||
- 브라우저: `use-live-weather.ts:condition()` — 10분마다 재조회할 때 쓰인다.
|
|
||||||
|
|
||||||
| 코드 | 날씨 상태(한국어) | 날씨 상태(영어) | 내부 분류 |
|
|
||||||
|---|---|---|---|
|
|
||||||
| 0 | 맑음 | Clear sky | 맑음 |
|
|
||||||
| 1 | 대체로 맑음 | Mainly clear | 구름많음 |
|
|
||||||
| 2 | 구름 조금 | Partly cloudy | 구름많음 |
|
|
||||||
| 3 | 흐림 | Overcast | 구름많음 |
|
|
||||||
| 45 | 안개 | Fog | 안개 |
|
|
||||||
| 48 | 착빙성 안개 (서리 안개) | Depositing rime fog | 안개 |
|
|
||||||
| 51 | 가벼운 이슬비 | Drizzle: Light intensity | 이슬비 |
|
|
||||||
| 53 | 보통 이슬비 | Drizzle: Moderate intensity | 이슬비 |
|
|
||||||
| 55 | 강한 이슬비 | Drizzle: Dense intensity | 이슬비 |
|
|
||||||
| 56 | 가벼운 착빙성 이슬비 | Freezing Drizzle: Light intensity | 어는비 |
|
|
||||||
| 57 | 강한 착빙성 이슬비 | Freezing Drizzle: Dense intensity | 어는비 |
|
|
||||||
| 61 | 약한 비 | Rain: Slight intensity | 비 |
|
|
||||||
| 63 | 보통 비 | Rain: Moderate intensity | 비 |
|
|
||||||
| 65 | 강한 비 | Rain: Heavy intensity | 강한비 |
|
|
||||||
| 66 | 약한 착빙성 비 (얼어붙는 비) | Freezing Rain: Light intensity | 어는비 |
|
|
||||||
| 67 | 강한 착빙성 비 | Freezing Rain: Heavy intensity | 어는비 |
|
|
||||||
| 71 | 약한 눈 | Snow fall: Slight intensity | 눈 |
|
|
||||||
| 73 | 보통 눈 | Snow fall: Moderate intensity | 눈 |
|
|
||||||
| 75 | 강한 눈 | Snow fall: Heavy intensity | 눈 |
|
|
||||||
| 77 | 싸라기눈 (진눈깨비) | Snow grains | 눈 |
|
|
||||||
| 80 | 약한 소나기 | Rain showers: Slight | 소나기 |
|
|
||||||
| 81 | 보통 소나기 | Rain showers: Moderate | 소나기 |
|
|
||||||
| 82 | 강한 소나기 | Rain showers: Violent | 소나기 |
|
|
||||||
| 85 | 약한 소나기성 눈 | Snow showers: Slight | 소나기 |
|
|
||||||
| 86 | 강한 소나기성 눈 | Snow showers: Heavy | 소나기 |
|
|
||||||
| 95 | 뇌우 (천둥번개) | Thunderstorm: Slight or moderate | 뇌우 |
|
|
||||||
| 96 | 우박을 동반한 약한 뇌우 | Thunderstorm with slight hail | 뇌우 |
|
|
||||||
| 99 | 우박을 동반한 강한 뇌우 | Thunderstorm with heavy hail | 뇌우 |
|
|
||||||
|
|
||||||
이 27개가 Open-Meteo `weather_code`의 전체 정의 값이다 — 표에 없는 값(파싱 실패 포함)만
|
|
||||||
안전하게 `흐림`으로 떨어진다(실제로는 도달하지 않는 방어 분기).
|
|
||||||
|
|
||||||
`weatherMood()`(`derive.ts`)는 위 11종을 화면 배경 그림용으로 다시 4종(맑음/흐림/비/눈)으로
|
|
||||||
뭉친다 — 정규식 기반이라 새 분류를 추가해도 대개 자동으로 걸린다(예: "이슬비"·"강한비"·"어는비"는
|
|
||||||
모두 `/비|우/` 패턴에 "비"가 들어 있어 `비`로 걸린다). `WeatherSection`의 `skyKey`는 노트가
|
|
||||||
실제로 있는 세부 조건(구름많음/안개/소나기/뇌우/이슬비/강한비/어는비)이면 그 조건 그대로 쓰고,
|
|
||||||
그 외(맑음/흐림/비/눈)엔 `mood`로 내려간다 — 어차피 세부 조건과 mood 값이 같기 때문이다.
|
|
||||||
|
|
||||||
`weather_notes.json → weather_notes.py → site_payload._weather → noteSets/tempNoteSets`
|
`weather_notes.json → weather_notes.py → site_payload._weather → noteSets/tempNoteSets`
|
||||||
|
|
||||||
하늘 11종(맑음·구름많음·안개·비·이슬비·강한비·어는비·눈·소나기·뇌우·흐림)·기온 5구간에 각
|
하늘 5종·기온 5구간에 각 5문구를 싣는다. 첫 렌더는 첫 문장으로 고정해 하이드레이션을 맞추고,
|
||||||
5문구를 싣는다. 첫 렌더는 첫 문장으로 고정해 하이드레이션을 맞추고, 브라우저에서는 무작위 시작
|
브라우저에서는 무작위 시작 후 20초마다 한 바퀴 안에서 중복 없이 순환한다.
|
||||||
후 20초마다 한 바퀴 안에서 중복 없이 순환한다. 기온 구간은 기존 `weatherBand`의 30·25·20·10도다.
|
기온 구간은 기존 `weatherBand`의 30·25·20·10도다. 구름많음은 그림상 흐림과 같지만 문구는 별도다.
|
||||||
구름많음·안개·소나기·뇌우·이슬비·강한비·어는비는 그림(mood)상 흐림 또는 비와 같이 묶이지만
|
|
||||||
문구는 조건별로 따로 쓴다. **비 중에서도 어는비(착빙성)만 안전 안내가 다르다** — 도로·보행
|
|
||||||
결빙 위험을 짚는 문구가 필요해서 이슬비·강한비와 갈랐다(2026-09-17).
|
|
||||||
|
|
||||||
목업 README 2.3의 순환 계약을 제품으로 옮겼다. 군산 전용 시설·장소를 다른 사업장에 복사하지
|
목업 README 2.3의 순환 계약을 제품으로 옮겼다. 군산 전용 시설·장소를 다른 사업장에 복사하지
|
||||||
않도록 기본 문구는 장소·시설·영업시간을 주장하지 않는 공통 안내로 구성한다. **LLM 생성이 아니다.**
|
않도록 기본 문구는 장소·시설·영업시간을 주장하지 않는 공통 안내로 구성한다. **LLM 생성이 아니다.**
|
||||||
|
|||||||
+6
-5
@@ -27,18 +27,19 @@ COPY admin ./admin
|
|||||||
ARG VITE_API_BASE_URL
|
ARG VITE_API_BASE_URL
|
||||||
ARG VITE_PUBLISH_HOST
|
ARG VITE_PUBLISH_HOST
|
||||||
ARG VITE_SITE_PREVIEW_URL
|
ARG VITE_SITE_PREVIEW_URL
|
||||||
|
# ⚠️ 자동 로그인 계정. **번들에 그대로 구워져** 페이지를 연 사람이 JS 에서 읽을 수 있다 —
|
||||||
|
# 내부 테스트 호스트에서만 채우고, 사장님에게 여는 순간 비운다(lib/autoSession).
|
||||||
|
ARG VITE_AUTO_LOGIN_ID
|
||||||
|
ARG VITE_AUTO_LOGIN_PW
|
||||||
# 구글 OAuth 클라이언트 ID. 비밀이 아니라 번들에 들어가도 된다 — 다만 백엔드 GOOGLE_CLIENT_ID 와
|
# 구글 OAuth 클라이언트 ID. 비밀이 아니라 번들에 들어가도 된다 — 다만 백엔드 GOOGLE_CLIENT_ID 와
|
||||||
# 같은 값이어야 한다(백엔드가 이 값으로 토큰의 aud 를 대조한다).
|
# 같은 값이어야 한다(백엔드가 이 값으로 토큰의 aud 를 대조한다).
|
||||||
ARG VITE_GOOGLE_CLIENT_ID
|
ARG VITE_GOOGLE_CLIENT_ID
|
||||||
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL \
|
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL \
|
||||||
VITE_PUBLISH_HOST=$VITE_PUBLISH_HOST \
|
VITE_PUBLISH_HOST=$VITE_PUBLISH_HOST \
|
||||||
VITE_SITE_PREVIEW_URL=$VITE_SITE_PREVIEW_URL \
|
VITE_SITE_PREVIEW_URL=$VITE_SITE_PREVIEW_URL \
|
||||||
|
VITE_AUTO_LOGIN_ID=$VITE_AUTO_LOGIN_ID \
|
||||||
|
VITE_AUTO_LOGIN_PW=$VITE_AUTO_LOGIN_PW \
|
||||||
VITE_GOOGLE_CLIENT_ID=$VITE_GOOGLE_CLIENT_ID
|
VITE_GOOGLE_CLIENT_ID=$VITE_GOOGLE_CLIENT_ID
|
||||||
# ★ VITE_AUTO_LOGIN_ID·PW 를 여기서 **절대 받지 않는다.** 이 이미지가 사장님에게 열리는
|
|
||||||
# 운영 진입점(solution-site)이다 — 자동 로그인 계정이 번들에 구워지면 페이지를 연 누구나
|
|
||||||
# JS 에서 그대로 읽는다. 내부 테스트용 자동 로그인은 solution-frontend(--profile dev,
|
|
||||||
# vite dev)에만 있다 — 그쪽은 이 Dockerfile 을 타지 않는다(lib/autoSession.ts 의 DEV 가드도
|
|
||||||
# 같은 이유로 있다 — 이 ARG 가 실수로 되돌아와도 프로덕션 빌드에서는 죽은 코드가 된다).
|
|
||||||
RUN npm run build -w @o2o/frontend
|
RUN npm run build -w @o2o/frontend
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ CREATE TABLE IF NOT EXISTS public.users (
|
|||||||
role SMALLINT NOT NULL DEFAULT 1, -- UserRole: 1=user 2=owner 3=developer
|
role SMALLINT NOT NULL DEFAULT 1, -- UserRole: 1=user 2=owner 3=developer
|
||||||
provider SMALLINT NOT NULL DEFAULT 1, -- AuthProvider: 1=local(id/pw) 2=google
|
provider SMALLINT NOT NULL DEFAULT 1, -- AuthProvider: 1=local(id/pw) 2=google
|
||||||
provider_uid VARCHAR(255) NULL, -- 구글 sub — 이메일이 바뀌어도 같은 사람인지 판단하는 유일 키
|
provider_uid VARCHAR(255) NULL, -- 구글 sub — 이메일이 바뀌어도 같은 사람인지 판단하는 유일 키
|
||||||
token_version SMALLINT NOT NULL DEFAULT 1, -- ★ refresh 토큰 무효화 키. JWT(access·refresh)의 sub 에 실려 나간다 — 이 값을 올리면(bump_token_version) 그 전에 발급된 refresh 토큰은 다음 재발급에서 전부 거절된다
|
|
||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||||
deleted BOOLEAN NOT NULL DEFAULT FALSE
|
deleted BOOLEAN NOT NULL DEFAULT FALSE
|
||||||
@@ -338,24 +337,6 @@ CREATE TABLE IF NOT EXISTS public.site_search_status (
|
|||||||
deleted BOOLEAN NOT NULL DEFAULT false
|
deleted BOOLEAN NOT NULL DEFAULT false
|
||||||
);
|
);
|
||||||
|
|
||||||
-- 장애 알림 발송함 — services/alert_service.py. 워커·스케줄러가 죽어도 알림 자체는
|
|
||||||
-- DB 에 남아야 한다(메모리 큐로만 두면 장애를 알릴 메시지까지 같이 잃는다).
|
|
||||||
CREATE TABLE IF NOT EXISTS public.alert_outbox (
|
|
||||||
alert_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
||||||
kind VARCHAR(50) NOT NULL, -- job_dead · build_failed · partial_failure · queue_stuck · recovery …
|
|
||||||
dedupe_key VARCHAR(200) NULL, -- 같은 사유의 재시도 스팸을 막는 키(alert_service.send_alert)
|
|
||||||
title VARCHAR(200) NOT NULL,
|
|
||||||
detail TEXT NULL, -- 이미 비밀·개인정보를 걷어낸 텍스트만(_scrub)
|
|
||||||
status SMALLINT NOT NULL DEFAULT 1, -- AlertStatus: 1=pending 2=sent 3=failed(재시도 소진)
|
|
||||||
attempts SMALLINT NOT NULL DEFAULT 0,
|
|
||||||
next_attempt_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
||||||
sent_at TIMESTAMPTZ NULL,
|
|
||||||
resolved_at TIMESTAMPTZ NULL, -- 채워지면 그 dedupe_key 는 "복구됨" — 다음 문제 발생 때 새로 알린다
|
|
||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
||||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
||||||
deleted BOOLEAN NOT NULL DEFAULT FALSE
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public.sites (
|
CREATE TABLE IF NOT EXISTS public.sites (
|
||||||
site_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
site_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||||
place_id uuid NOT NULL, -- 사업장과 1:1
|
place_id uuid NOT NULL, -- 사업장과 1:1
|
||||||
@@ -513,13 +494,6 @@ CREATE INDEX IF NOT EXISTS ix_jobs_lease ON public.jobs (status, lease_until);
|
|||||||
CREATE UNIQUE INDEX IF NOT EXISTS uq_jobs_dedupe_active ON public.jobs (dedupe_key)
|
CREATE UNIQUE INDEX IF NOT EXISTS uq_jobs_dedupe_active ON public.jobs (dedupe_key)
|
||||||
WHERE status IN (1, 2) AND dedupe_key IS NOT NULL;
|
WHERE status IN (1, 2) AND dedupe_key IS NOT NULL;
|
||||||
|
|
||||||
-- alert_outbox
|
|
||||||
-- 재시도 경로: PENDING(1) 이면서 next_attempt_at 이 지난 것.
|
|
||||||
CREATE INDEX IF NOT EXISTS ix_alert_outbox_pending ON public.alert_outbox (status, next_attempt_at);
|
|
||||||
-- 최근 같은 사유 조회(dedupe·복구 판정): send_alert·resolve_alert 가 dedupe_key 로 최신 행을 찾는다.
|
|
||||||
CREATE INDEX IF NOT EXISTS ix_alert_outbox_dedupe ON public.alert_outbox (dedupe_key, created_at DESC)
|
|
||||||
WHERE dedupe_key IS NOT NULL;
|
|
||||||
|
|
||||||
-- ============================================================
|
-- ============================================================
|
||||||
-- 마이그레이션 기준선(baseline)
|
-- 마이그레이션 기준선(baseline)
|
||||||
-- ============================================================
|
-- ============================================================
|
||||||
|
|||||||
+6
-1
@@ -1,4 +1,9 @@
|
|||||||
-- SNS: credentials and approval records never enter public payloads.
|
-- 0015 · SNS 계정 연결
|
||||||
|
--
|
||||||
|
-- ★ 번호가 0012·0013 이었는데 main 에 같은 번호가 이미 있어서(0012_place_faqs_template_source,
|
||||||
|
-- 0013_job_progress) 병합하며 뒤로 밀었다. migrate.py 는 파일명 정렬로 돌고 적용 이력도
|
||||||
|
-- 파일명(stem)으로 남기므로, 이미 옛 이름으로 적용된 DB 는 이 파일을 한 번 더 돌린다 —
|
||||||
|
-- 안에 있는 문장이 전부 IF NOT EXISTS 라 두 번 돌아도 결과가 같다(그래서 밀 수 있었다).
|
||||||
CREATE TABLE IF NOT EXISTS public.owner_social_accounts (
|
CREATE TABLE IF NOT EXISTS public.owner_social_accounts (
|
||||||
account_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
account_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||||
user_id uuid NOT NULL,
|
user_id uuid NOT NULL,
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
-- 0015 · users.token_version — refresh 토큰 무효화 키
|
|
||||||
--
|
|
||||||
-- ★ 왜 필요한가 (보안 점검, 2026-09-15)
|
|
||||||
-- auth_service.refresh_token() 은 지금까지 refresh 토큰을 서명만 검증하고 그 안의 sub
|
|
||||||
-- (user_id·id·role)를 그대로 새 access 토큰에 옮겨 찍었다 — DB 를 한 번도 보지 않았다.
|
|
||||||
-- 비밀번호를 바꾸거나(다른 기기의 세션을 끊고 싶을 때) 계정을 차단해도, 이미 발급된
|
|
||||||
-- refresh 토큰(7일)을 쥔 클라이언트는 만료 전까지 계속 새 access 토큰을 받을 수 있었다.
|
|
||||||
-- token_version 을 JWT 의 sub 에 같이 싣고 refresh 할 때 DB 의 지금 값과 대조하면,
|
|
||||||
-- bump_token_version() 을 부른 시점 이후의 refresh 시도는 전부 거절된다.
|
|
||||||
--
|
|
||||||
-- ★ 옛 토큰(token_version 없이 발급된 것)도 읽힌다 — UserInfo 가 기본값 1 을 먼저 깔고
|
|
||||||
-- 그 위에 없는 키는 안 덮으므로(common/models/gmodel.py UserInfo.__init__), 새 컬럼의
|
|
||||||
-- DEFAULT 1 과 맞아떨어진다. 배포 순간 전원 강제 로그아웃이 되지 않는다.
|
|
||||||
|
|
||||||
ALTER TABLE public.users ADD COLUMN IF NOT EXISTS token_version SMALLINT NOT NULL DEFAULT 1;
|
|
||||||
|
|
||||||
COMMENT ON COLUMN public.users.token_version IS
|
|
||||||
'refresh 토큰 무효화 키. JWT(access·refresh)의 sub 에 실려 나간다 — 이 값을 올리면(bump_token_version) 그 전에 발급된 refresh 토큰은 다음 재발급에서 전부 거절된다.';
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
-- 0016 · alert_outbox — 장애 알림 발송함(services/alert_service.py)
|
|
||||||
--
|
|
||||||
-- ★ 왜 필요한가 — 최종 생성 실패(JobStatus.DEAD) · BUILD 잡 업무 실패(게이트 반려가 아닌
|
|
||||||
-- 렌더·인프라 실패) · 노래 등 부분 실패 · 잡 큐 정체를 Teams Workflows webhook 으로
|
|
||||||
-- 알린다. 워커·스케줄러가 죽어도 알림 자체는 DB 에 남아야 하므로(메모리 큐면 장애를
|
|
||||||
-- 알릴 메시지까지 같이 잃는다) 영구 저장 + 재시도 + 중복 억제를 이 표 하나로 한다.
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public.alert_outbox (
|
|
||||||
alert_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
||||||
kind VARCHAR(50) NOT NULL,
|
|
||||||
dedupe_key VARCHAR(200) NULL,
|
|
||||||
title VARCHAR(200) NOT NULL,
|
|
||||||
detail TEXT NULL,
|
|
||||||
status SMALLINT NOT NULL DEFAULT 1,
|
|
||||||
attempts SMALLINT NOT NULL DEFAULT 0,
|
|
||||||
next_attempt_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
||||||
sent_at TIMESTAMPTZ NULL,
|
|
||||||
resolved_at TIMESTAMPTZ NULL,
|
|
||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
||||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
|
||||||
deleted BOOLEAN NOT NULL DEFAULT FALSE
|
|
||||||
);
|
|
||||||
|
|
||||||
COMMENT ON COLUMN public.alert_outbox.kind IS
|
|
||||||
'job_dead · build_failed · partial_failure · queue_stuck · recovery …';
|
|
||||||
COMMENT ON COLUMN public.alert_outbox.status IS
|
|
||||||
'AlertStatus: 1=pending 2=sent 3=failed(재시도 소진)';
|
|
||||||
COMMENT ON COLUMN public.alert_outbox.detail IS
|
|
||||||
'이미 비밀·개인정보를 걷어낸 텍스트만 들어온다 — alert_service._scrub 가 저장 전에 거른다.';
|
|
||||||
COMMENT ON COLUMN public.alert_outbox.resolved_at IS
|
|
||||||
'채워지면 그 dedupe_key 는 복구됨으로 본다 — 다음 문제 발생 때 새 알림을 보낸다.';
|
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS ix_alert_outbox_pending ON public.alert_outbox (status, next_attempt_at);
|
|
||||||
CREATE INDEX IF NOT EXISTS ix_alert_outbox_dedupe ON public.alert_outbox (dedupe_key, created_at DESC)
|
|
||||||
WHERE dedupe_key IS NOT NULL;
|
|
||||||
+6
-1
@@ -1,4 +1,9 @@
|
|||||||
-- SNS: credentials and approval records never enter public payloads.
|
-- 0016 · SNS 게재 글
|
||||||
|
--
|
||||||
|
-- ★ 번호가 0012·0013 이었는데 main 에 같은 번호가 이미 있어서(0012_place_faqs_template_source,
|
||||||
|
-- 0013_job_progress) 병합하며 뒤로 밀었다. migrate.py 는 파일명 정렬로 돌고 적용 이력도
|
||||||
|
-- 파일명(stem)으로 남기므로, 이미 옛 이름으로 적용된 DB 는 이 파일을 한 번 더 돌린다 —
|
||||||
|
-- 안에 있는 문장이 전부 IF NOT EXISTS 라 두 번 돌아도 결과가 같다(그래서 밀 수 있었다).
|
||||||
CREATE TABLE IF NOT EXISTS public.place_social_posts (
|
CREATE TABLE IF NOT EXISTS public.place_social_posts (
|
||||||
post_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
post_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||||
place_id uuid NOT NULL,
|
place_id uuid NOT NULL,
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
"""수집(크롤링) 중 실패를 jobs.result 에 구조화해서 싣는다 — 워커 로그 grep 없이 확인용.
|
|
||||||
|
|
||||||
★ contextvars 로 든다 — 실패 지점이 흩어진 여러 함수에 리스트를 관통시키지 않는다.
|
|
||||||
자세한 배경은 DEVLOG.md 참고.
|
|
||||||
"""
|
|
||||||
from contextlib import contextmanager
|
|
||||||
from contextvars import ContextVar
|
|
||||||
from dataclasses import asdict, dataclass
|
|
||||||
|
|
||||||
from common.logger import LOG
|
|
||||||
|
|
||||||
_current: ContextVar[list["CollectIssue"] | None] = ContextVar("_collect_issues", default=None)
|
|
||||||
|
|
||||||
# jobs.result 는 DB 에 그대로 쌓인다 — 예외 메시지가 길어지는(HTML 응답 전체를 문 등) 경우가
|
|
||||||
# 있어 상한을 둔다. 잘린 메시지도 원인 파악엔 충분하고, 전체는 여전히 로그에 남는다.
|
|
||||||
_MAX_MESSAGE = 500
|
|
||||||
_MAX_TARGET = 200
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class CollectIssue:
|
|
||||||
stage: str # 어느 단계에서(예: "naver_place" · "tour_api" · "yanolja" · "static_html")
|
|
||||||
target: str # 무엇을 하다가(URL·검색어 등)
|
|
||||||
error_type: str # 예외 클래스명
|
|
||||||
message: str # 예외 메시지
|
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
|
||||||
def collecting():
|
|
||||||
"""run_collect() 진입부에서 한 번 연다. 중첩 호출은 바깥 것을 그대로 쓴다."""
|
|
||||||
token = _current.set([])
|
|
||||||
try:
|
|
||||||
yield
|
|
||||||
finally:
|
|
||||||
_current.reset(token)
|
|
||||||
|
|
||||||
|
|
||||||
def note_issue(stage: str, target: str, ex: Exception) -> CollectIssue:
|
|
||||||
"""실패 한 건을 기록하고 기존과 같은 형식으로 로그도 남긴다.
|
|
||||||
|
|
||||||
collecting() 없이 불러도 죽지 않는다 — 그때는 기록만 안 되고 로그는 그대로 남는다
|
|
||||||
(단발 호출·테스트 호환)."""
|
|
||||||
issue = CollectIssue(
|
|
||||||
stage=stage,
|
|
||||||
target=target[:_MAX_TARGET],
|
|
||||||
error_type=type(ex).__name__,
|
|
||||||
message=str(ex)[:_MAX_MESSAGE],
|
|
||||||
)
|
|
||||||
issues = _current.get()
|
|
||||||
if issues is not None:
|
|
||||||
issues.append(issue)
|
|
||||||
LOG.w(f"[collect] {stage} 실패(계속) {issue.target}: {issue.error_type}: {issue.message}")
|
|
||||||
return issue
|
|
||||||
|
|
||||||
|
|
||||||
def snapshot() -> list[dict]:
|
|
||||||
"""지금까지 쌓인 실패 목록. run_collect() 가 끝에서 jobs.result 에 싣는다."""
|
|
||||||
issues = _current.get()
|
|
||||||
return [asdict(i) for i in issues] if issues else []
|
|
||||||
@@ -113,10 +113,7 @@ class DBSessionManager(Singleton):
|
|||||||
return ErrorType.SUCCESS
|
return ErrorType.SUCCESS
|
||||||
except IntegrityError as ex:
|
except IntegrityError as ex:
|
||||||
await db.rollback()
|
await db.rollback()
|
||||||
# ★ 유니크 제약 충돌은 호출부가 "이미 있음"으로 처리하는 정상 경로다
|
LOG.e_no_callstack(f"duplicated. {ex}")
|
||||||
# (services/collect_service.py `_add_link`). ERROR 로 찍지 않는다 — 진짜 못
|
|
||||||
# 보던 무결성 오류는 아래 일반 Exception 갈래로 간다.
|
|
||||||
LOG.w(f"duplicated. {ex}")
|
|
||||||
return ErrorType.DB_ALREADY_SAME_KEY
|
return ErrorType.DB_ALREADY_SAME_KEY
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
await db.rollback()
|
await db.rollback()
|
||||||
|
|||||||
@@ -80,12 +80,6 @@ class users(MainTableMixin, MAIN_BASE):
|
|||||||
# 컬럼이 NOT NULL 이면 그 경로가 통째로 깨진다(init.sql 의 DEFAULT 1 과 같은 값).
|
# 컬럼이 NOT NULL 이면 그 경로가 통째로 깨진다(init.sql 의 DEFAULT 1 과 같은 값).
|
||||||
provider = Column(SmallInteger, nullable=False, server_default=text("1"), default=AuthProvider.LOCAL.value)
|
provider = Column(SmallInteger, nullable=False, server_default=text("1"), default=AuthProvider.LOCAL.value)
|
||||||
provider_uid = Column(String(255), nullable=True) # 구글 sub — 이메일이 바뀌어도 같은 사람인지 판단하는 유일한 키
|
provider_uid = Column(String(255), nullable=True) # 구글 sub — 이메일이 바뀌어도 같은 사람인지 판단하는 유일한 키
|
||||||
# ★ refresh 토큰 무효화 키. JWT(access·refresh 둘 다)의 sub 에 이 값을 같이 싣는다
|
|
||||||
# (common/models/gmodel.py UserInfo). refresh_token() 이 DB 의 지금 값과 대조해서,
|
|
||||||
# 달라졌으면(비밀번호 변경 등으로 bump_token_version 이 불렸으면) 재발급을 거절한다.
|
|
||||||
# ★ access 토큰 자체는 검사하지 않는다 — 그건 30분짜리라 노출 창이 이미 좁다. 문제는
|
|
||||||
# refresh 토큰(7일)이 DB 를 한 번도 안 보고 계속 access 토큰을 찍어 내던 것이었다.
|
|
||||||
token_version = Column(SmallInteger, nullable=False, server_default=text("1"), default=1)
|
|
||||||
|
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
@@ -479,29 +473,6 @@ class site_search_status(MainTableMixin, MAIN_BASE):
|
|||||||
alerted_at = Column(DateTime(timezone=True), nullable=True)
|
alerted_at = Column(DateTime(timezone=True), nullable=True)
|
||||||
|
|
||||||
|
|
||||||
class alert_outbox(MainTableMixin, MAIN_BASE):
|
|
||||||
"""장애 알림 발송함 — services/alert_service.py 가 쓰고 읽는다.
|
|
||||||
|
|
||||||
★ 왜 영구 저장하나: 워커 프로세스가 죽으면 메모리에만 쌓아 둔 알림은 그대로 사라진다.
|
|
||||||
장애가 나서 죽었는데 그 장애를 알릴 메시지까지 같이 잃으면 본말전도다.
|
|
||||||
★ dedupe_key + 최근 전송 시각으로 재시도마다 중복 스팸을 막는다(alert_service.send_alert) —
|
|
||||||
같은 사유가 몇 분 간격으로 계속 터져도 사람에게는 한 통만 간다.
|
|
||||||
★ resolved_at 은 "복구 알림"의 근거다 — 이 키로 마지막에 안 풀린 알림이 있으면
|
|
||||||
다음 정상 상태에서 복구 메시지를 한 번 보내고 이 값을 채운다."""
|
|
||||||
|
|
||||||
__tablename__ = "alert_outbox"
|
|
||||||
alert_id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
|
||||||
kind = Column(String(50), nullable=False) # job_dead · build_failed · partial_failure · queue_stuck · recovery …
|
|
||||||
dedupe_key = Column(String(200), nullable=True)
|
|
||||||
title = Column(String(200), nullable=False)
|
|
||||||
detail = Column(Text, nullable=True) # 이미 비밀·개인정보를 걷어낸 텍스트만 들어온다(alert_service._scrub)
|
|
||||||
status = Column(SmallInteger, nullable=False, server_default=text("1"), default=1) # AlertStatus: 1=pending 2=sent 3=failed(소진)
|
|
||||||
attempts = Column(SmallInteger, nullable=False, server_default=text("0"), default=0)
|
|
||||||
next_attempt_at = Column(DateTime(timezone=True), nullable=False, server_default=_utc_now_sql())
|
|
||||||
sent_at = Column(DateTime(timezone=True), nullable=True)
|
|
||||||
resolved_at = Column(DateTime(timezone=True), nullable=True)
|
|
||||||
|
|
||||||
|
|
||||||
class site_sections(MainTableMixin, MAIN_BASE):
|
class site_sections(MainTableMixin, MAIN_BASE):
|
||||||
"""섹션 하나의 콘텐츠. **JSON import/export 의 단위**다.
|
"""섹션 하나의 콘텐츠. **JSON import/export 의 단위**다.
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ class ErrorType(Enum):
|
|||||||
ACCOUNT_PROVIDER_CONFLICT = auto() # 이미 다른 로그인 수단으로 가입된 이메일 — 자동 연결하지 않는다(DECISIONS 1절)
|
ACCOUNT_PROVIDER_CONFLICT = auto() # 이미 다른 로그인 수단으로 가입된 이메일 — 자동 연결하지 않는다(DECISIONS 1절)
|
||||||
OAUTH_NOT_CONFIGURED = auto() # GOOGLE_CLIENT_ID 미설정 — 구글 로그인만 꺼진다
|
OAUTH_NOT_CONFIGURED = auto() # GOOGLE_CLIENT_ID 미설정 — 구글 로그인만 꺼진다
|
||||||
OAUTH_INVALID_TOKEN = auto() # 구글 ID 토큰 서명·수신자·만료 검증 실패
|
OAUTH_INVALID_TOKEN = auto() # 구글 ID 토큰 서명·수신자·만료 검증 실패
|
||||||
ACCOUNT_SESSION_REVOKED = auto() # ★ refresh 토큰의 token_version 이 지금 DB 값과 다르다 — 그 뒤로 무효화됐다(비밀번호 변경 등)
|
|
||||||
|
|
||||||
# 사업장(places) 관련 에러
|
# 사업장(places) 관련 에러
|
||||||
PLACE_NOT_FOUND = 1200
|
PLACE_NOT_FOUND = 1200
|
||||||
@@ -435,10 +434,14 @@ class JobType(CodeEnum):
|
|||||||
BUILD = 4 # 사이트 정적 빌드 — ★ 개별 재빌드 단위
|
BUILD = 4 # 사이트 정적 빌드 — ★ 개별 재빌드 단위
|
||||||
LOCAL_SYNC = 5 # 지역 정보 갱신 — 행정구역 코드 단위(같은 지역 사이트 50개여도 1회)
|
LOCAL_SYNC = 5 # 지역 정보 갱신 — 행정구역 코드 단위(같은 지역 사이트 50개여도 1회)
|
||||||
AI_CHECK = 6 # AI 검색 노출 점검
|
AI_CHECK = 6 # AI 검색 노출 점검
|
||||||
SOCIAL_DRAFT = 8
|
|
||||||
SOCIAL_POST = 9
|
|
||||||
SONG = 7 # 이 숙소의 노래 한 곡 (가사 Gemini → 작곡 Suno). 발행이 이 잡을 건다
|
SONG = 7 # 이 숙소의 노래 한 곡 (가사 Gemini → 작곡 Suno). 발행이 이 잡을 건다
|
||||||
ROLLBACK = 8 # 예전 버전 스냅샷으로 다시 굽고 공개 주소를 그 버전으로 되돌림
|
ROLLBACK = 8 # 예전 버전 스냅샷으로 다시 굽고 공개 주소를 그 버전으로 되돌림
|
||||||
|
# ★ 번호를 재사용하지 않는다. 같은 값을 두 번 쓰면 파이썬 enum 이 **조용히 별칭**으로 묶어
|
||||||
|
# (`JobType.ROLLBACK is JobType.SOCIAL_DRAFT` → True) 한쪽 잡이 남의 핸들러로 간다.
|
||||||
|
# 실제로 그랬다(2026-09-16, 병합): SNS 가 8·9 를, 롤백이 8 을 각자 가져와 겹쳤다.
|
||||||
|
# 에러도 안 나고 `HANDLERS` 조회만 조용히 뒤바뀐다 — 다음 번호는 늘 마지막 +1 이다.
|
||||||
|
SOCIAL_DRAFT = 9 # SNS 소개글 초안 작성 (Gemini) — 사장님이 누를 때만
|
||||||
|
SOCIAL_POST = 10 # 승인된 글을 사장님 계정으로 게시 (Threads)
|
||||||
|
|
||||||
|
|
||||||
class JobStatus(CodeEnum):
|
class JobStatus(CodeEnum):
|
||||||
@@ -473,11 +476,3 @@ class SocialPostStatus(str, Enum):
|
|||||||
EXPIRED = "EXPIRED"
|
EXPIRED = "EXPIRED"
|
||||||
FAILED = "FAILED"
|
FAILED = "FAILED"
|
||||||
UNKNOWN = "UNKNOWN" # 응답 유실·워커 중단: 자동 재시도는 중복 게시가 된다.
|
UNKNOWN = "UNKNOWN" # 응답 유실·워커 중단: 자동 재시도는 중복 게시가 된다.
|
||||||
|
|
||||||
|
|
||||||
class AlertStatus(CodeEnum):
|
|
||||||
"""alert_outbox.status 코드값. services/alert_service.py 가 이 상태로 재시도를 판단한다."""
|
|
||||||
|
|
||||||
PENDING = 1 # 아직 안 보냄(다음 process_outbox 스윕에서 시도)
|
|
||||||
SENT = 2 # 전송 성공
|
|
||||||
FAILED = 3 # 재시도 상한 소진 — 더 시도하지 않는다(사람이 outbox 를 봐야 한다)
|
|
||||||
@@ -70,15 +70,11 @@ class UserInfo(StructModel):
|
|||||||
user_id: str # users.user_id (uuid) — 데이터 스코프 키. 사업장은 owner_user_id 로 이 값에 매인다
|
user_id: str # users.user_id (uuid) — 데이터 스코프 키. 사업장은 owner_user_id 로 이 값에 매인다
|
||||||
id: str # users.id (로그인 아이디) — get_me 재조회 키
|
id: str # users.id (로그인 아이디) — get_me 재조회 키
|
||||||
role: int # users.role (UserRole) — 권한 게이트(최고관리자 등) 판단 키
|
role: int # users.role (UserRole) — 권한 게이트(최고관리자 등) 판단 키
|
||||||
token_version: int # users.token_version — refresh 토큰 무효화 키(auth_service.refresh_token 이 대조)
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs) -> None:
|
def __init__(self, *args, **kwargs) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
# 구버전 토큰(role·token_version 미포함) 도 디코딩되도록 기본값을 먼저 깔고 kwargs 로
|
# 구버전 토큰(role 미포함) 도 디코딩되도록 기본값을 먼저 깔고 kwargs 로 덮어쓴다.
|
||||||
# 덮어쓴다. token_version 기본값은 DB 컬럼 기본값(1)과 같아야 한다 — 배포 순간 옛
|
|
||||||
# 토큰이 전부 "버전이 다르다"로 거절되는 것을 막는다.
|
|
||||||
self.role = UserRole.USER.value
|
self.role = UserRole.USER.value
|
||||||
self.token_version = 1
|
|
||||||
for dictionary in args:
|
for dictionary in args:
|
||||||
for key in dictionary:
|
for key in dictionary:
|
||||||
setattr(self, key, dictionary[key])
|
setattr(self, key, dictionary[key])
|
||||||
|
|||||||
@@ -128,10 +128,6 @@ class ExternalApiConfig(BaseSettings):
|
|||||||
# 3.7 기본: 라벨이 틀리면 사람 확인 큐 비용이 모델 값 차이(1건 $0.045 vs $0.018)보다 크다.
|
# 3.7 기본: 라벨이 틀리면 사람 확인 큐 비용이 모델 값 차이(1건 $0.045 vs $0.018)보다 크다.
|
||||||
gemini_vision_model: str = Field("gemini-3.7-flash", validation_alias="GEMINI_VISION_MODEL")
|
gemini_vision_model: str = Field("gemini-3.7-flash", validation_alias="GEMINI_VISION_MODEL")
|
||||||
gemini_text_model: str = Field("gemini-3.7-flash", validation_alias="GEMINI_TEXT_MODEL")
|
gemini_text_model: str = Field("gemini-3.7-flash", validation_alias="GEMINI_TEXT_MODEL")
|
||||||
llm_provider: str = Field("openai", validation_alias="LLM_PROVIDER")
|
|
||||||
openai_api_key: str = Field("", validation_alias="OPENAI_API_KEY")
|
|
||||||
openai_text_model: str = Field("gpt-5.6-luna", validation_alias="OPENAI_TEXT_MODEL")
|
|
||||||
openai_vision_model: str = Field("gpt-5.6-luna", validation_alias="OPENAI_VISION_MODEL")
|
|
||||||
# 이 값 미만이면 자동 반영하지 않고 사람 확인 큐(PENDING_REVIEW)에 남긴다.
|
# 이 값 미만이면 자동 반영하지 않고 사람 확인 큐(PENDING_REVIEW)에 남긴다.
|
||||||
vision_confidence_threshold: float = Field(0.7, validation_alias="VISION_CONFIDENCE_THRESHOLD")
|
vision_confidence_threshold: float = Field(0.7, validation_alias="VISION_CONFIDENCE_THRESHOLD")
|
||||||
tour_api_key: str = Field("", validation_alias="TOUR_API_KEY")
|
tour_api_key: str = Field("", validation_alias="TOUR_API_KEY")
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
"""alert_outbox 원장 접근. services/alert_service.py 가 부른다."""
|
|
||||||
from sqlalchemy import func, select, update
|
|
||||||
|
|
||||||
from common.database.model.models import alert_outbox
|
|
||||||
from common.enums import AlertStatus
|
|
||||||
from common.utils.gtime import GTime
|
|
||||||
|
|
||||||
|
|
||||||
async def latest_unresolved(session, dedupe_key: str):
|
|
||||||
"""이 dedupe_key 로 아직 안 풀린(resolved_at IS NULL) 가장 최근 알림. 없으면 None.
|
|
||||||
|
|
||||||
★ send_alert 의 중복 억제와 resolve_alert 의 "지금 알람 상태인가" 판정이 **같은 질의**를
|
|
||||||
쓴다 — 따로 구현하면 두 판단이 어긋날 수 있다."""
|
|
||||||
result = await session.execute(
|
|
||||||
select(alert_outbox)
|
|
||||||
.where(alert_outbox.dedupe_key == dedupe_key, alert_outbox.deleted.is_(False),
|
|
||||||
alert_outbox.resolved_at.is_(None))
|
|
||||||
.order_by(alert_outbox.created_at.desc())
|
|
||||||
.limit(1)
|
|
||||||
)
|
|
||||||
return result.scalars().first()
|
|
||||||
|
|
||||||
|
|
||||||
async def insert(session, values: dict) -> alert_outbox:
|
|
||||||
row = alert_outbox(**values)
|
|
||||||
session.add(row)
|
|
||||||
await session.flush()
|
|
||||||
return row
|
|
||||||
|
|
||||||
|
|
||||||
async def due_pending(session, limit: int = 20):
|
|
||||||
"""★ `next_attempt_at <= func.now()` — **DB 서버의** 지금 시각과 비교한다. 파이썬에서 계산한
|
|
||||||
GTime.UTC() 와 비교하면 앱 서버와 DB 서버의 시계가 몇 십 ms 만 어긋나도(흔하다 — 별도
|
|
||||||
컨테이너) send_alert 직후 process_outbox 를 부르는 자리에서 방금 넣은 행이 안 잡힐 수
|
|
||||||
있다(실측: 로컬에서 그렇게 재현됐다). 비교를 DB 쪽 시계 하나로 통일하면 이 경합이 없다."""
|
|
||||||
result = await session.execute(
|
|
||||||
select(alert_outbox)
|
|
||||||
.where(alert_outbox.status == AlertStatus.PENDING.value, alert_outbox.deleted.is_(False),
|
|
||||||
alert_outbox.next_attempt_at <= func.now())
|
|
||||||
.order_by(alert_outbox.next_attempt_at)
|
|
||||||
.limit(limit)
|
|
||||||
)
|
|
||||||
return result.scalars().all()
|
|
||||||
|
|
||||||
|
|
||||||
async def mark_sent(session, alert_id) -> None:
|
|
||||||
now = GTime.UTC()
|
|
||||||
await session.execute(
|
|
||||||
update(alert_outbox).where(alert_outbox.alert_id == alert_id)
|
|
||||||
.values(status=AlertStatus.SENT.value, sent_at=now, updated_at=now)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def mark_retry(session, alert_id, attempts: int, next_attempt_at) -> None:
|
|
||||||
await session.execute(
|
|
||||||
update(alert_outbox).where(alert_outbox.alert_id == alert_id)
|
|
||||||
.values(attempts=attempts, next_attempt_at=next_attempt_at, updated_at=GTime.UTC())
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def mark_exhausted(session, alert_id, attempts: int) -> None:
|
|
||||||
"""재시도 상한 소진 — 더 시도하지 않는다(사람이 outbox 를 봐야 한다)."""
|
|
||||||
await session.execute(
|
|
||||||
update(alert_outbox).where(alert_outbox.alert_id == alert_id)
|
|
||||||
.values(status=AlertStatus.FAILED.value, attempts=attempts, updated_at=GTime.UTC())
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def mark_resolved(session, alert_id) -> None:
|
|
||||||
now = GTime.UTC()
|
|
||||||
await session.execute(
|
|
||||||
update(alert_outbox).where(alert_outbox.alert_id == alert_id)
|
|
||||||
.values(resolved_at=now, updated_at=now)
|
|
||||||
)
|
|
||||||
@@ -173,12 +173,9 @@ class JobQueue:
|
|||||||
|
|
||||||
return await self._tx(run)
|
return await self._tx(run)
|
||||||
|
|
||||||
async def reap(self) -> list[dict]:
|
async def reap(self) -> list[str]:
|
||||||
"""만료된 lease(워커 사망 등)의 RUNNING 잡을 회수. 시도 남으면 즉시 재큐, 소진되면 DEAD.
|
"""만료된 lease(워커 사망 등)의 RUNNING 잡을 회수. 시도 남으면 즉시 재큐, 소진되면 DEAD.
|
||||||
|
회수된 job_id 목록 반환."""
|
||||||
회수된 잡마다 {job_id, job_type, status, last_error} 를 돌려준다 — worker/runner.py 의
|
|
||||||
run_reaper 가 이 중 DEAD(4) 로 떨어진 것만 골라 알린다(alert_service). job_id 목록만
|
|
||||||
돌려주던 예전 모양보다 한 겹 더 있는 이유가 그것뿐이다."""
|
|
||||||
sql = text("""
|
sql = text("""
|
||||||
UPDATE jobs SET
|
UPDATE jobs SET
|
||||||
status = CASE WHEN attempts >= max_attempts THEN 4 ELSE 1 END,
|
status = CASE WHEN attempts >= max_attempts THEN 4 ELSE 1 END,
|
||||||
@@ -188,15 +185,12 @@ class JobQueue:
|
|||||||
worker_id = NULL,
|
worker_id = NULL,
|
||||||
updated_at = now()
|
updated_at = now()
|
||||||
WHERE status = 2 AND lease_until IS NOT NULL AND lease_until < now()
|
WHERE status = 2 AND lease_until IS NOT NULL AND lease_until < now()
|
||||||
RETURNING job_id, job_type, status, last_error
|
RETURNING job_id
|
||||||
""")
|
""")
|
||||||
|
|
||||||
async def run(s):
|
async def run(s):
|
||||||
rows = (await s.execute(sql)).all()
|
rows = (await s.execute(sql)).all()
|
||||||
return [
|
return [str(r[0]) for r in rows]
|
||||||
{"job_id": str(r[0]), "job_type": r[1], "status": r[2], "last_error": r[3]}
|
|
||||||
for r in rows
|
|
||||||
]
|
|
||||||
|
|
||||||
return await self._tx(run)
|
return await self._tx(run)
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
from sqlalchemy import text
|
from sqlalchemy import text
|
||||||
|
from common.enums import JobType
|
||||||
from common.database.db_session_manager import DB_SESSION_MNG
|
from common.database.db_session_manager import DB_SESSION_MNG
|
||||||
from common.database.model.models import place_social_posts as Post
|
from common.database.model.models import place_social_posts as Post
|
||||||
|
|
||||||
@@ -41,7 +42,7 @@ async def decide(s, post_id, sha, approve, via):
|
|||||||
)
|
)
|
||||||
).first()
|
).first()
|
||||||
if row and approve and row.account_id:
|
if row and approve and row.account_id:
|
||||||
await enqueue(s, post_id, 9)
|
await enqueue(s, post_id, JobType.SOCIAL_POST.value)
|
||||||
return bool(row)
|
return bool(row)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import time
|
import time
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
|
|
||||||
from fastapi import FastAPI, Request, Response
|
from fastapi import FastAPI, Request
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
from fastapi.middleware.gzip import GZipMiddleware
|
from fastapi.middleware.gzip import GZipMiddleware
|
||||||
from sqlalchemy import text
|
|
||||||
|
|
||||||
from common.database.db_session_manager import DB_SESSION_MNG
|
from common.database.db_session_manager import DB_SESSION_MNG
|
||||||
from common.enums import DBType, DBWRType
|
|
||||||
from common.logger import LOG
|
from common.logger import LOG
|
||||||
from common.utils.gtime import GTime
|
from common.utils.gtime import GTime
|
||||||
from config.server_configs import web_server_config
|
from config.server_configs import web_server_config
|
||||||
@@ -89,29 +87,6 @@ async def healthz():
|
|||||||
return API_SERVER_START_TIME
|
return API_SERVER_START_TIME
|
||||||
|
|
||||||
|
|
||||||
@app.get(path="/readyz", responses={404: {"description": "Not found"}, 503: {"description": "Not ready"}})
|
|
||||||
async def readyz(response: Response):
|
|
||||||
"""★ healthz 와 다른 걸 본다 — healthz 는 "프로세스가 살아 있나"(항상 200),
|
|
||||||
이건 "요청을 실제로 처리할 수 있나"(DB 에 붙는지 실제로 한 번 물어본다).
|
|
||||||
|
|
||||||
★ 왜 필요한가: 이 서버·DB 가 통째로 죽으면 우리 알림(alert_service, Teams webhook)도
|
|
||||||
같이 죽는다 — 자기 장애를 자기가 알릴 수 없다. 외부 감시(uptime 모니터 등)가 이 경로를
|
|
||||||
주기적으로 찔러야 전체 다운을 잡는다. DEPLOY.md·SERVERS.md 에 붙일 절차: 이 경로가
|
|
||||||
2xx 가 아니면(또는 응답이 없으면) 그 감시 서비스 **자신의** 채널로 알린다 — Teams
|
|
||||||
webhook 이 죽은 원인 그 자체일 수 있으므로 같은 경로로 알리면 안 된다."""
|
|
||||||
try:
|
|
||||||
async def _ping(s):
|
|
||||||
await s.execute(text("SELECT 1"))
|
|
||||||
return True
|
|
||||||
|
|
||||||
await DB_SESSION_MNG.execute_lambda(DBType.MAIN.value, DBWRType.DB_READ.value, _ping)
|
|
||||||
return {"ok": True, "db": "up"}
|
|
||||||
except Exception as ex: # noqa: BLE001 — 준비 안 됐다는 것 자체가 이 엔드포인트의 응답이다
|
|
||||||
LOG.w(f"[readyz] DB 연결 확인 실패: {type(ex).__name__}: {ex}")
|
|
||||||
response.status_code = 503
|
|
||||||
return {"ok": False, "db": "down"}
|
|
||||||
|
|
||||||
|
|
||||||
# 각 도메인 라우터를 등록한다. 새 기능 추가 시 router.v1.<domain>.<file> 를 import 후 include.
|
# 각 도메인 라우터를 등록한다. 새 기능 추가 시 router.v1.<domain>.<file> 를 import 후 include.
|
||||||
app.include_router(router.v1.auth.account.router)
|
app.include_router(router.v1.auth.account.router)
|
||||||
app.include_router(router.v1.place.place.router)
|
app.include_router(router.v1.place.place.router)
|
||||||
|
|||||||
@@ -3,16 +3,10 @@
|
|||||||
다중 워커(운영)에서 잡이 워커마다 중복 실행되면 안 되므로 SCHEDULER_ENABLED=1 인 프로세스에서만 등록한다.
|
다중 워커(운영)에서 잡이 워커마다 중복 실행되면 안 되므로 SCHEDULER_ENABLED=1 인 프로세스에서만 등록한다.
|
||||||
|
|
||||||
등록된 잡 —
|
등록된 잡 —
|
||||||
· SNS 승인 만료·중단 복구 : 5분 간격 (scheduler/jobs.sweep_social_posts)
|
· Search Console 색인 점검 : 10분 간격 (GSC_ENABLED=1 일 때만)
|
||||||
|
· SNS 승인 만료·중단 복구 : 5분 간격 (scheduler/jobs.sweep_social_posts)
|
||||||
|
|
||||||
붙을 잡 —
|
붙을 잡 —
|
||||||
등록된 잡:
|
|
||||||
· Search Console (GSC_ENABLED=1, 10분마다)
|
|
||||||
· 알림 발송 스윕 (1분마다) — alert_outbox 의 PENDING 을 실제로 보낸다
|
|
||||||
· 잡 큐 정체 점검 (5분마다) — dead-letter 누적·좀비 실행·오래 밀린 PENDING 을 본다
|
|
||||||
둘 다 무조건 등록한다 — TEAMS_WEBHOOK_URL 이 비어 있으면 알림은 쌓이기만 하고 안 나간다
|
|
||||||
(services/teams_webhook.is_configured), 서버 동작에는 영향이 없다.
|
|
||||||
붙을 잡 —
|
|
||||||
· 지역정보 갱신 : 축제 주 1회 / 관광정보 월 1회 / 날씨 시간 단위 — 행정구역 코드 단위 캐시 갱신
|
· 지역정보 갱신 : 축제 주 1회 / 관광정보 월 1회 / 날씨 시간 단위 — 행정구역 코드 단위 캐시 갱신
|
||||||
· 수집 재시도 : 실패한 수집 작업 재시도 (외부 API 실패 시 직전 값 유지 + 내부 알림)
|
· 수집 재시도 : 실패한 수집 작업 재시도 (외부 API 실패 시 직전 값 유지 + 내부 알림)
|
||||||
· 사이트 재빌드 : 검증 상태가 바뀐 place 만 개별 재빌드 (전체 재빌드 금지)
|
· 사이트 재빌드 : 검증 상태가 바뀐 place 만 개별 재빌드 (전체 재빌드 금지)
|
||||||
@@ -43,24 +37,20 @@ def start_scheduler():
|
|||||||
|
|
||||||
# 한국시간 기준. 잡은 scheduler/jobs.py 에 정의하고 여기서 add_job 으로 등록한다.
|
# 한국시간 기준. 잡은 scheduler/jobs.py 에 정의하고 여기서 add_job 으로 등록한다.
|
||||||
_scheduler = AsyncIOScheduler(timezone="Asia/Seoul")
|
_scheduler = AsyncIOScheduler(timezone="Asia/Seoul")
|
||||||
# ★ 1분이 아니라 5분이다. 이 스윕이 하는 일은 "만료 표시" 와 "중단된 초안 정리" 뿐이라
|
|
||||||
# 분 단위 정밀도가 필요 없고, 주기가 짧으면 쓰기 커넥션을 계속 집어 든다 —
|
|
||||||
# 실측(2026-09-14): 1분 주기로 두자 같은 컨테이너에서 도는 테스트가 커넥션을 못 받아
|
|
||||||
# TimeoutError 로 무더기 실패했다. 운영에서도 같은 풀을 발행·수집과 나눠 쓴다.
|
|
||||||
from scheduler.jobs import sweep_social_posts
|
|
||||||
_scheduler.add_job(sweep_social_posts, 'interval', minutes=5, max_instances=1, coalesce=True)
|
|
||||||
if os.environ.get("GSC_ENABLED") == "1":
|
if os.environ.get("GSC_ENABLED") == "1":
|
||||||
from services.search_console_service import run_scheduled_check
|
from services.search_console_service import run_scheduled_check
|
||||||
_scheduler.add_job(run_scheduled_check, "interval", minutes=10,
|
_scheduler.add_job(run_scheduled_check, "interval", minutes=10,
|
||||||
id="search-console", max_instances=1, coalesce=True)
|
id="search-console", max_instances=1, coalesce=True)
|
||||||
|
|
||||||
from scheduler.jobs import sweep_alert_outbox, sweep_queue_health
|
# ★ 1분이 아니라 5분이다. 이 스윕이 하는 일은 "만료 표시" 와 "중단된 초안 정리" 뿐이라
|
||||||
_scheduler.add_job(sweep_alert_outbox, "interval", minutes=1,
|
# 분 단위 정밀도가 필요 없고, 주기가 짧으면 쓰기 커넥션을 계속 집어 든다 —
|
||||||
id="alert-outbox", max_instances=1, coalesce=True)
|
# 실측(2026-09-14): 1분 주기로 두자 같은 컨테이너에서 도는 테스트가 커넥션을 못 받아
|
||||||
_scheduler.add_job(sweep_queue_health, "interval", minutes=5,
|
# TimeoutError 로 무더기 실패했다. 운영에서도 같은 풀을 발행·수집과 나눠 쓴다.
|
||||||
id="queue-health", max_instances=1, coalesce=True)
|
from scheduler.jobs import sweep_social_posts
|
||||||
|
_scheduler.add_job(sweep_social_posts, "interval", minutes=5,
|
||||||
|
id="social-sweep", max_instances=1, coalesce=True)
|
||||||
|
|
||||||
_scheduler.start()
|
_scheduler.start()
|
||||||
LOG.i("[scheduler] started (KST: SNS 승인 만료·중단 복구)")
|
|
||||||
LOG.i(f"[scheduler] started (KST: {len(_scheduler.get_jobs())}개 잡)")
|
LOG.i(f"[scheduler] started (KST: {len(_scheduler.get_jobs())}개 잡)")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,59 +1,6 @@
|
|||||||
"""스케줄 잡 로직(what). '언제 도느냐'(scheduler/__init__.py)와 분리된, 잡이 실제로 하는 일.
|
|
||||||
|
|
||||||
잡은 '대상을 고르는 것'까지만 하고, 실제 처리는 도메인 service 가 책임진다.
|
|
||||||
(지역정보 갱신 · 수집 재시도 · 개별 사이트 재빌드가 여기로 들어온다.)
|
|
||||||
"""
|
|
||||||
from common.logger import LOG
|
|
||||||
|
|
||||||
"""예약 실행 진입점. 복구 전이는 DB 조건부 UPDATE로 여러 프로세스에서도 안전하다."""
|
"""예약 실행 진입점. 복구 전이는 DB 조건부 UPDATE로 여러 프로세스에서도 안전하다."""
|
||||||
from crud.social_crud import sweep
|
from crud.social_crud import sweep
|
||||||
|
|
||||||
|
|
||||||
async def sweep_social_posts():
|
async def sweep_social_posts():
|
||||||
await sweep()
|
await sweep()
|
||||||
|
|
||||||
async def sweep_alert_outbox():
|
|
||||||
"""대기 중인 알림을 실제로 보낸다(services/alert_service.process_outbox)."""
|
|
||||||
from services import alert_service
|
|
||||||
|
|
||||||
try:
|
|
||||||
await alert_service.process_outbox()
|
|
||||||
except Exception as ex: # noqa: BLE001 — 스윕 실패가 스케줄러를 죽이면 안 된다(다음 주기 재시도)
|
|
||||||
LOG.w(f"[scheduler] 알림 발송 스윕 실패: {type(ex).__name__}: {ex}")
|
|
||||||
|
|
||||||
|
|
||||||
async def sweep_queue_health():
|
|
||||||
"""잡 큐가 막혔는지 주기적으로 본다 — dead-letter 누적·좀비 실행·오래 밀린 PENDING.
|
|
||||||
|
|
||||||
★ 왜 필요한가: 개별 잡의 DEAD 전이는 worker/runner.py 가 그 자리에서 바로 알린다. 이건
|
|
||||||
그것과 다른 신호다 — 잡 하나하나는 재시도 중(아직 DEAD 아님)인데 **큐 전체가 정체**된
|
|
||||||
경우(워커 프로세스가 죽었거나 DB 순단이 길어지는 경우)는 개별 잡 알림만으로는 안 보인다.
|
|
||||||
★ 복구되면 한 번만 알린다 — send_alert/resolve_alert 의 dedupe_key 가 그 판단을 한다."""
|
|
||||||
from crud.job_crud import JobQueue
|
|
||||||
from services import alert_service
|
|
||||||
|
|
||||||
try:
|
|
||||||
snap = await JobQueue().ops()
|
|
||||||
except Exception as ex: # noqa: BLE001
|
|
||||||
LOG.w(f"[scheduler] 큐 상태 조회 실패: {type(ex).__name__}: {ex}")
|
|
||||||
return
|
|
||||||
|
|
||||||
# 기준값: dead-letter 가 최근 1시간에 쌓였거나, 좀비 실행이 있거나, 가장 오래된 PENDING 이
|
|
||||||
# 30분 넘게 안 집혔다(정상 워커라면 대기 잡을 몇 초 안에 claim 한다).
|
|
||||||
problems = []
|
|
||||||
if snap.get("dead_1h", 0) > 0:
|
|
||||||
problems.append(f"최근 1시간 dead-letter {snap['dead_1h']}건")
|
|
||||||
if snap.get("stuck_running", 0) > 0:
|
|
||||||
problems.append(f"좀비 실행 {snap['stuck_running']}건(lease 만료 또는 10분 초과)")
|
|
||||||
if snap.get("oldest_pending_sec", 0) > 1800:
|
|
||||||
problems.append(f"가장 오래된 대기 잡이 {snap['oldest_pending_sec'] // 60}분째 안 집힘")
|
|
||||||
|
|
||||||
dedupe_key = "queue_health"
|
|
||||||
if problems:
|
|
||||||
await alert_service.send_alert(
|
|
||||||
kind="queue_stuck",
|
|
||||||
title="잡 큐 정체",
|
|
||||||
detail=" · ".join(problems) + f"\n{snap}",
|
|
||||||
dedupe_key=dedupe_key,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
await alert_service.resolve_alert(dedupe_key, "잡 큐 정상으로 돌아옴")
|
|
||||||
@@ -1,24 +1,7 @@
|
|||||||
"""군산 공통 맛집 한일옥 등록. 기본은 조회, --apply로 현재 설정 DB에 반영한다.
|
"""군산 공통 맛집 한일옥 등록. 기본은 조회, --apply로 현재 설정 DB에 반영한다.
|
||||||
|
|
||||||
네이버 ID는 body에 보관하여 자동 수집(NAVER_CRAWL)의 (source, external_id) 갱신과는 분리한다
|
external_id가 없는 지역 공통 항목은 snapshot이 모든 군산 업장에 포함한다.
|
||||||
— source 가 OFFICIAL_WEB 으로 다르므로 자동 크롤링이 이 행을 건드리지 않는다.
|
네이버 ID는 body에 보관하여 자동 수집의 (source, external_id) 갱신과 분리한다.
|
||||||
|
|
||||||
★ 거리(2026-09-17 추가): 처음엔 external_id 없이 "지역 공통"(모든 군산 업장에 거리 없이 노출)
|
|
||||||
으로만 등록했다. 하지만 한일옥은 실존 업소라 업장마다 실제 거리가 다르고, 지역 공통 캐시
|
|
||||||
경로(services/snapshot.py::_local_contents, external_id IS NULL)는 거리를 업장마다 못 담는
|
|
||||||
설계라 거리가 안 나갔다(2026-09-17 확인). 그래서 external_id 를 네이버 place id 로 채워
|
|
||||||
그 경로에서 빠지게 하고, TourAPI·NAVER_CRAWL 맛집과 같은 개인화 경로(place_area_refs +
|
|
||||||
site_sections, services/local_restaurant_enrichment.py 와 동일한 패턴)로 업장별 거리를 얹는다.
|
|
||||||
★ 대가: 더는 "새 군산 업장에 자동으로 붙는" 지역 공통이 아니다 — 새 업장이 생기면
|
|
||||||
이 스크립트를 다시 돌려야 그 업장에도 한일옥이 연결된다.
|
|
||||||
|
|
||||||
사용법 (solution/backend 에서, 가상환경 안에서) — 호스트(Windows) 실행은 PGSSLMODE=disable 필수
|
|
||||||
(한글 홈 경로 탓에 asyncpg 인증서 로딩이 깨진다, dev-env-quirks 메모):
|
|
||||||
PowerShell: $env:PGSSLMODE = "disable"; python scripts/pin_gunsan_hanilok.py [--apply]
|
|
||||||
|
|
||||||
배포서버 실행방법
|
|
||||||
docker compose exec solution-backend python scripts/pin_gunsan_hanilok.py # 드라이런 먼저
|
|
||||||
docker compose exec solution-backend python scripts/pin_gunsan_hanilok.py --apply # 반영
|
|
||||||
"""
|
"""
|
||||||
import argparse
|
import argparse
|
||||||
import asyncio
|
import asyncio
|
||||||
@@ -37,47 +20,18 @@ from sqlalchemy.engine import URL
|
|||||||
from sqlalchemy.ext.asyncio import create_async_engine
|
from sqlalchemy.ext.asyncio import create_async_engine
|
||||||
|
|
||||||
from common.database.db_session_manager import DB_SESSION_MNG
|
from common.database.db_session_manager import DB_SESSION_MNG
|
||||||
from common.database.model.models import area_contents, place_area_refs, places
|
from common.database.model.models import area_contents, places
|
||||||
from common.enums import LocalContentStatus, LocalContentType, LocalSource
|
from common.enums import LocalContentStatus, LocalContentType, LocalSource
|
||||||
from common.utils.geo import haversine_m
|
|
||||||
from config.server_configs import main_db_config as cfg
|
from config.server_configs import main_db_config as cfg
|
||||||
from services.collector.naver_place_adapter import NaverPlaceAdapter
|
|
||||||
from services.external import naver_place_lookup
|
|
||||||
from services.local_content_service import LocalContentService
|
|
||||||
from services.site_payload import _local
|
from services.site_payload import _local
|
||||||
from services.snapshot import _local_contents, _site_places
|
from services.snapshot import _local_contents
|
||||||
|
|
||||||
REGION = '52군산시'
|
REGION = '52군산시'
|
||||||
NAVER_ID = '11861452'
|
NAVER_ID = '11861452'
|
||||||
CONTENT_ID = uuid.uuid5(uuid.NAMESPACE_URL, 'web4ai:52군산시:restaurant:11861452')
|
CONTENT_ID = uuid.uuid5(uuid.NAMESPACE_URL, 'web4ai:52군산시:restaurant:11861452')
|
||||||
|
|
||||||
|
|
||||||
def _as_float(value) -> float | None:
|
|
||||||
try:
|
|
||||||
return float(value) if value is not None else None
|
|
||||||
except (TypeError, ValueError):
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
async def _fetch_coordinates() -> tuple[float, float] | None:
|
|
||||||
"""한일옥 좌표. TourAPI 에 없는 수기 등록이라 네이버 상세 페이지에서 가져온다
|
|
||||||
(services/local_restaurant_enrichment.py 가 자동 크롤링 맛집에 쓰는 것과 같은 어댑터)."""
|
|
||||||
summary = await NaverPlaceAdapter().fetch_summary(naver_place_lookup.place_url(NAVER_ID))
|
|
||||||
if not summary:
|
|
||||||
return None
|
|
||||||
lat, lng = _as_float(summary.get('latitude')), _as_float(summary.get('longitude'))
|
|
||||||
if lat is None or lng is None:
|
|
||||||
return None
|
|
||||||
return lat, lng
|
|
||||||
|
|
||||||
|
|
||||||
async def main(apply: bool):
|
async def main(apply: bool):
|
||||||
lat_lng = await _fetch_coordinates()
|
|
||||||
if lat_lng is None:
|
|
||||||
print(json.dumps({'error': '네이버에서 한일옥 좌표를 가져오지 못했습니다.'}, ensure_ascii=False))
|
|
||||||
return
|
|
||||||
lat, lng = lat_lng
|
|
||||||
|
|
||||||
engine = create_async_engine(URL.create(
|
engine = create_async_engine(URL.create(
|
||||||
'postgresql+asyncpg', username=cfg.write_id, password=cfg.write_pw,
|
'postgresql+asyncpg', username=cfg.write_id, password=cfg.write_pw,
|
||||||
host=cfg.write_host, port=cfg.write_port, database=cfg.name,
|
host=cfg.write_host, port=cfg.write_port, database=cfg.name,
|
||||||
@@ -87,8 +41,8 @@ async def main(apply: bool):
|
|||||||
rows = (await conn.execute(select(
|
rows = (await conn.execute(select(
|
||||||
area_contents.local_content_id, area_contents.title, area_contents.body,
|
area_contents.local_content_id, area_contents.title, area_contents.body,
|
||||||
).where(
|
).where(
|
||||||
area_contents.region_code == REGION, area_contents.kind == 'restaurant',
|
area_contents.region_code == REGION,
|
||||||
area_contents.source == LocalSource.OFFICIAL_WEB.value,
|
area_contents.kind == 'restaurant', area_contents.external_id.is_(None),
|
||||||
area_contents.deleted.is_(False),
|
area_contents.deleted.is_(False),
|
||||||
))).mappings().all()
|
))).mappings().all()
|
||||||
if rows and any(r['body'].get('naverPlaceId') != NAVER_ID for r in rows):
|
if rows and any(r['body'].get('naverPlaceId') != NAVER_ID for r in rows):
|
||||||
@@ -99,13 +53,12 @@ async def main(apply: bool):
|
|||||||
local_content_id=content_id, region_code=REGION,
|
local_content_id=content_id, region_code=REGION,
|
||||||
content_type=LocalContentType.RESTAURANT.value, kind='restaurant',
|
content_type=LocalContentType.RESTAURANT.value, kind='restaurant',
|
||||||
# 사용자 확인을 거친 수기 웹 등록. 크롤링한 값으로 표시하지 않는다.
|
# 사용자 확인을 거친 수기 웹 등록. 크롤링한 값으로 표시하지 않는다.
|
||||||
source=LocalSource.OFFICIAL_WEB.value, external_id=NAVER_ID, title='한일옥',
|
source=LocalSource.OFFICIAL_WEB.value, external_id=None, title='한일옥',
|
||||||
body={**(rows[0]['body'] if rows else {}),
|
body={**(rows[0]['body'] if rows else {}),
|
||||||
'name': '한일옥', 'searchQuery': '군산 한일옥',
|
'name': '한일옥', 'searchQuery': '군산 한일옥',
|
||||||
'naverPlaceId': NAVER_ID,
|
'naverPlaceId': NAVER_ID,
|
||||||
'sourceUrl': f'https://m.place.naver.com/restaurant/{NAVER_ID}/home',
|
'sourceUrl': f'https://m.place.naver.com/restaurant/{NAVER_ID}/home',
|
||||||
'registration': 'owner_confirmed_region_default'},
|
'registration': 'owner_confirmed_region_default'},
|
||||||
latitude=lat, longitude=lng,
|
|
||||||
status=LocalContentStatus.PUBLISHED.value, published_at=now,
|
status=LocalContentStatus.PUBLISHED.value, published_at=now,
|
||||||
collected_at=now, display_start_at=None, display_end_at=None,
|
collected_at=now, display_start_at=None, display_end_at=None,
|
||||||
expires_at=None, deleted=False, updated_at=now,
|
expires_at=None, deleted=False, updated_at=now,
|
||||||
@@ -115,72 +68,21 @@ async def main(apply: bool):
|
|||||||
index_elements=[area_contents.local_content_id],
|
index_elements=[area_contents.local_content_id],
|
||||||
set_={k: v for k, v in values.items() if k != 'local_content_id'},
|
set_={k: v for k, v in values.items() if k != 'local_content_id'},
|
||||||
))
|
))
|
||||||
|
targets = (await conn.execute(select(places.place_id, places.name).where(
|
||||||
targets = (await conn.execute(select(
|
|
||||||
places.place_id, places.name, places.latitude, places.longitude,
|
|
||||||
).where(
|
|
||||||
places.deleted.is_(False), places.region_code == REGION,
|
places.deleted.is_(False), places.region_code == REGION,
|
||||||
))).mappings().all()
|
))).mappings().all()
|
||||||
|
print(json.dumps({'applied': apply, 'database': cfg.name, 'region': REGION,
|
||||||
distances: dict[str, int | None] = {}
|
'contentId': str(content_id), 'naverPlaceId': NAVER_ID,
|
||||||
for row in targets:
|
'existingPlaces': [dict(r) for r in targets]},
|
||||||
plat, plng = _as_float(row['latitude']), _as_float(row['longitude'])
|
default=str, ensure_ascii=False))
|
||||||
distances[str(row['place_id'])] = (
|
|
||||||
round(haversine_m(plat, plng, lat, lng)) if plat is not None and plng is not None else None
|
|
||||||
)
|
|
||||||
|
|
||||||
if apply:
|
|
||||||
for row in targets:
|
|
||||||
stmt = insert(place_area_refs).values(
|
|
||||||
place_id=row['place_id'], local_content_id=content_id,
|
|
||||||
distance_m=distances[str(row['place_id'])], deleted=False,
|
|
||||||
).on_conflict_do_update(
|
|
||||||
index_elements=[place_area_refs.place_id, place_area_refs.local_content_id],
|
|
||||||
set_={'distance_m': distances[str(row['place_id'])], 'deleted': False, 'updated_at': now},
|
|
||||||
)
|
|
||||||
await conn.execute(stmt)
|
|
||||||
|
|
||||||
print(json.dumps({
|
|
||||||
'applied': apply, 'database': cfg.name, 'region': REGION,
|
|
||||||
'contentId': str(content_id), 'naverPlaceId': NAVER_ID,
|
|
||||||
'coordinates': {'latitude': lat, 'longitude': lng},
|
|
||||||
'existingPlaces': [
|
|
||||||
{**{k: v for k, v in r.items() if k not in ('latitude', 'longitude')},
|
|
||||||
'distanceMeters': distances[str(r['place_id'])]}
|
|
||||||
for r in targets
|
|
||||||
],
|
|
||||||
}, default=str, ensure_ascii=False))
|
|
||||||
|
|
||||||
if apply:
|
if apply:
|
||||||
# ★ 업장마다 다른 거리라 사이트 개인화 맵(site_sections)에도 얹어야 캔버스·발행본이 읽는다
|
# place_id 없는 새 군산 업장도 지역 공통 경로만으로 받는지 확인한다.
|
||||||
# (services/local_content_service.py::_write_site_places 규약과 동일).
|
snapshot = await _local_contents(SimpleNamespace(region_code=REGION))
|
||||||
service = LocalContentService()
|
local, _ = _local(snapshot, None, None)
|
||||||
for row in targets:
|
matches = [r for r in local['restaurants'] if r['name'] == '한일옥']
|
||||||
place_id = row['place_id']
|
assert len(matches) == 1, '지역 공통 payload에 한일옥이 정확히 한 번 있어야 합니다.'
|
||||||
places_map = dict(await _site_places(place_id))
|
print(json.dumps({'verifiedRegionalPayload': matches}, ensure_ascii=False))
|
||||||
prev = places_map.get(str(content_id)) or {}
|
|
||||||
places_map[str(content_id)] = {
|
|
||||||
'kind': 'restaurant',
|
|
||||||
'distanceMeters': distances[str(place_id)],
|
|
||||||
'hidden': bool(prev.get('hidden', False)),
|
|
||||||
}
|
|
||||||
await service._write_site_places(place_id, places_map)
|
|
||||||
|
|
||||||
# 업장마다 거리를 포함해 정확히 한 번 실렸는지 확인한다.
|
|
||||||
mismatches = []
|
|
||||||
for row in targets:
|
|
||||||
place = SimpleNamespace(
|
|
||||||
place_id=row['place_id'], region_code=REGION,
|
|
||||||
latitude=row['latitude'], longitude=row['longitude'],
|
|
||||||
)
|
|
||||||
snapshot = await _local_contents(place)
|
|
||||||
local, _ = _local(snapshot, _as_float(row['latitude']), _as_float(row['longitude']))
|
|
||||||
matches = [r for r in local['restaurants'] if r['name'] == '한일옥']
|
|
||||||
expected = distances[str(row['place_id'])]
|
|
||||||
ok = len(matches) == 1 and (expected is None or matches[0].get('distanceMeters') == expected)
|
|
||||||
if not ok:
|
|
||||||
mismatches.append({'place': row['name'], 'matches': matches, 'expectedDistanceMeters': expected})
|
|
||||||
print(json.dumps({'verified': not mismatches, 'mismatches': mismatches}, ensure_ascii=False))
|
|
||||||
finally:
|
finally:
|
||||||
await engine.dispose()
|
await engine.dispose()
|
||||||
await DB_SESSION_MNG.dispose_all()
|
await DB_SESSION_MNG.dispose_all()
|
||||||
|
|||||||
@@ -1,162 +0,0 @@
|
|||||||
"""장애 알림 — 영구 저장 + 재시도 + 중복 억제.
|
|
||||||
|
|
||||||
★ 왜 이 모양인가
|
|
||||||
잡 큐 소진(JobStatus.DEAD) · BUILD 잡의 업무 실패(게이트 반려가 아닌 렌더·인프라 실패) ·
|
|
||||||
노래 같은 곁가지의 부분 실패 · 잡 큐 정체를 Teams 로 알린다. 알림을 만드는 자리(worker/runner.py ·
|
|
||||||
build_service.py · scheduler)는 이 모듈의 send_alert() 하나만 부르면 된다 — 언제 실제로
|
|
||||||
보낼지, 같은 사유를 몇 번이나 다시 보낼지는 전부 여기서 정한다.
|
|
||||||
|
|
||||||
★ 재시도마다 중복 스팸을 내지 않는다 (dedupe)
|
|
||||||
같은 dedupe_key 로 "아직 안 풀린" 알림이 있으면 새로 만들지 않는다 — 잡이 몇 번을 실패하며
|
|
||||||
재큐되든 사람에게는 처음 한 통만 간다. 문제가 사라지면(resolve_alert) 그 dedupe_key 는
|
|
||||||
다시 "풀린" 상태가 되고, 다음에 같은 사유가 또 터지면 새로 알린다.
|
|
||||||
|
|
||||||
★ 영구 저장 + 재시도 (outbox)
|
|
||||||
webhook 전송이 그 자리에서 실패해도(네트워크 순단 등) 알림 자체를 잃지 않는다 — DB 에
|
|
||||||
PENDING 으로 남기고 process_outbox() 가 백오프를 두고 다시 시도한다. 워커·API 프로세스가
|
|
||||||
재시작돼도 이 표만 보면 뭐가 안 나갔는지 안다.
|
|
||||||
|
|
||||||
★ 비밀·개인정보를 남기지 않는다 (scrub)
|
|
||||||
detail 은 저장 **전에** 한 번 걸러진다 — 외부 API 예외 메시지가 쿼리스트링에 키를 실어
|
|
||||||
보내는 경우가 있다(TourAPI·Suno 등). 전화번호·API 키·bearer 토큰·이메일을 마스킹한다.
|
|
||||||
|
|
||||||
★ webhook 미설정이면 조용히 아무 일도 안 한다(teams_webhook.is_configured). 서버는 그대로 뜬다.
|
|
||||||
"""
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
from datetime import timedelta
|
|
||||||
|
|
||||||
from common.database.db_session_manager import DB_SESSION_MNG
|
|
||||||
from common.enums import DBType
|
|
||||||
from common.logger import LOG
|
|
||||||
from common.utils.gtime import GTime
|
|
||||||
from crud import alert_crud
|
|
||||||
from crud.job_crud import compute_backoff
|
|
||||||
from services import teams_webhook
|
|
||||||
|
|
||||||
# 중복 억제 창(분). 이 시간 안에 같은 dedupe_key 로 또 send_alert 가 불리면 새로 만들지 않는다.
|
|
||||||
DEDUPE_WINDOW_MIN_ENV = "ALERT_DEDUPE_WINDOW_MIN"
|
|
||||||
DEFAULT_DEDUPE_WINDOW_MIN = 60
|
|
||||||
# 재시도 상한. 소진되면 AlertStatus.FAILED — 더 자동으로는 안 보낸다.
|
|
||||||
MAX_ATTEMPTS = 5
|
|
||||||
|
|
||||||
_DETAIL_MAX_LEN = 2000
|
|
||||||
|
|
||||||
# ── 비밀·개인정보 마스킹 ──────────────────────────────────────────────────
|
|
||||||
_RE_QUERY_SECRET = re.compile(
|
|
||||||
r"(?i)([?&](?:key|token|api[_-]?key|secret|access[_-]?token|auth)=)[^\s&]+"
|
|
||||||
)
|
|
||||||
_RE_BEARER = re.compile(r"(?i)\bBearer\s+[A-Za-z0-9\-_.]{8,}")
|
|
||||||
_RE_KV_SECRET = re.compile(r"(?i)\b(password|passwd|pwd|secret|api[_-]?key)\s*[:=]\s*\S+")
|
|
||||||
_RE_EMAIL = re.compile(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}")
|
|
||||||
|
|
||||||
|
|
||||||
def _scrub(text: str) -> str:
|
|
||||||
"""저장 전에 반드시 한 번 거친다. 순서가 중요하다 — 쿼리스트링을 먼저 지워야
|
|
||||||
그 값이 이메일 형태여도 뒤의 이메일 마스킹이 이중으로 손대지 않는다."""
|
|
||||||
if not text:
|
|
||||||
return ""
|
|
||||||
out = _RE_QUERY_SECRET.sub(r"\1***", text)
|
|
||||||
out = _RE_BEARER.sub("Bearer ***", out)
|
|
||||||
out = _RE_KV_SECRET.sub(lambda m: f"{m.group(1)}=***", out)
|
|
||||||
out = _RE_EMAIL.sub(lambda m: m.group(0)[:2] + "***@***", out)
|
|
||||||
return out[:_DETAIL_MAX_LEN]
|
|
||||||
|
|
||||||
|
|
||||||
def _dedupe_window_min() -> int:
|
|
||||||
try:
|
|
||||||
return int(os.environ.get(DEDUPE_WINDOW_MIN_ENV) or DEFAULT_DEDUPE_WINDOW_MIN)
|
|
||||||
except ValueError:
|
|
||||||
return DEFAULT_DEDUPE_WINDOW_MIN
|
|
||||||
|
|
||||||
|
|
||||||
async def send_alert(kind: str, title: str, detail: str = "", dedupe_key: str | None = None) -> None:
|
|
||||||
"""알림을 큐에 넣는다(즉시 보내지 않는다 — process_outbox 가 보낸다).
|
|
||||||
|
|
||||||
★ 즉시 안 보내는 이유: 이 함수는 워커의 실패 처리 경로(예외 발생 지점)에서 불린다.
|
|
||||||
여기서 동기적으로 webhook 을 때리면 그 지연·재시도가 잡 처리 자체를 늦춘다. 큐에
|
|
||||||
적재만 하고 별도 스윕(scheduler)이 실제 전송을 맡는다 — 알림 발송 실패가 발행
|
|
||||||
파이프라인에 영향을 주지 않는다(파일 머리주석의 관심사 분리)."""
|
|
||||||
try:
|
|
||||||
async def _op(session):
|
|
||||||
if dedupe_key:
|
|
||||||
existing = await alert_crud.latest_unresolved(session, dedupe_key)
|
|
||||||
if existing is not None:
|
|
||||||
return # 이미 이 사유로 풀리지 않은 알림이 있다 — 또 만들지 않는다.
|
|
||||||
await alert_crud.insert(session, {
|
|
||||||
"kind": kind[:50],
|
|
||||||
"dedupe_key": dedupe_key[:200] if dedupe_key else None,
|
|
||||||
"title": title[:200],
|
|
||||||
"detail": _scrub(detail),
|
|
||||||
})
|
|
||||||
|
|
||||||
await DB_SESSION_MNG.execute_lambda_write(DBType.MAIN.value, _op)
|
|
||||||
except Exception as ex: # noqa: BLE001 — 알림 적재 실패가 원래 하던 일(잡 처리)을 죽이면 안 된다
|
|
||||||
LOG.w(f"[alert] 적재 실패(무시하고 계속): {type(ex).__name__}: {ex}")
|
|
||||||
|
|
||||||
|
|
||||||
async def resolve_alert(dedupe_key: str, title: str, detail: str = "") -> None:
|
|
||||||
"""이 dedupe_key 로 안 풀린 알림이 있으면 "복구됨" 을 한 번 알리고 풀린 것으로 남긴다.
|
|
||||||
|
|
||||||
★ 안 풀린 알림이 없으면(애초에 문제가 없었다) 아무것도 하지 않는다 — 정상 상태마다
|
|
||||||
"복구됨" 을 보내면 그게 새로운 스팸이 된다."""
|
|
||||||
try:
|
|
||||||
async def _op(session):
|
|
||||||
existing = await alert_crud.latest_unresolved(session, dedupe_key)
|
|
||||||
if existing is None:
|
|
||||||
return
|
|
||||||
await alert_crud.mark_resolved(session, existing.alert_id)
|
|
||||||
await alert_crud.insert(session, {
|
|
||||||
"kind": "recovery",
|
|
||||||
"dedupe_key": None, # 복구 알림 자신은 dedupe 대상이 아니다 — 매번 보낸다.
|
|
||||||
"title": title[:200],
|
|
||||||
"detail": _scrub(detail),
|
|
||||||
})
|
|
||||||
|
|
||||||
await DB_SESSION_MNG.execute_lambda_write(DBType.MAIN.value, _op)
|
|
||||||
except Exception as ex: # noqa: BLE001
|
|
||||||
LOG.w(f"[alert] 복구 알림 적재 실패(무시하고 계속): {type(ex).__name__}: {ex}")
|
|
||||||
|
|
||||||
|
|
||||||
async def process_outbox(limit: int = 20) -> dict:
|
|
||||||
"""PENDING 알림을 실제로 보낸다. 스케줄러가 주기적으로 부른다(scheduler/jobs.py).
|
|
||||||
|
|
||||||
★ 잡 큐의 백오프·소진 규칙(crud/job_crud.compute_backoff)을 그대로 재사용한다 —
|
|
||||||
"몇 번 실패하면 얼마나 쉬고 언제 포기하나" 를 두 번 설계하지 않는다."""
|
|
||||||
sent = failed = 0
|
|
||||||
try:
|
|
||||||
async def _load(session):
|
|
||||||
return await alert_crud.due_pending(session, limit)
|
|
||||||
|
|
||||||
due = await DB_SESSION_MNG.execute_lambda_write(DBType.MAIN.value, _load)
|
|
||||||
except Exception as ex: # noqa: BLE001
|
|
||||||
LOG.w(f"[alert] outbox 조회 실패: {type(ex).__name__}: {ex}")
|
|
||||||
return {"sent": 0, "failed": 0}
|
|
||||||
|
|
||||||
for row in due:
|
|
||||||
ok = await teams_webhook.send(row.title, row.detail or "")
|
|
||||||
|
|
||||||
async def _update(session, row=row, ok=ok):
|
|
||||||
if ok:
|
|
||||||
await alert_crud.mark_sent(session, row.alert_id)
|
|
||||||
else:
|
|
||||||
attempts = row.attempts + 1
|
|
||||||
if attempts >= MAX_ATTEMPTS:
|
|
||||||
await alert_crud.mark_exhausted(session, row.alert_id, attempts)
|
|
||||||
else:
|
|
||||||
next_at = GTime.UTC() + timedelta(seconds=compute_backoff(attempts))
|
|
||||||
await alert_crud.mark_retry(session, row.alert_id, attempts, next_at)
|
|
||||||
|
|
||||||
try:
|
|
||||||
await DB_SESSION_MNG.execute_lambda_write(DBType.MAIN.value, _update)
|
|
||||||
except Exception as ex: # noqa: BLE001
|
|
||||||
LOG.w(f"[alert] outbox 갱신 실패 {row.alert_id}: {type(ex).__name__}: {ex}")
|
|
||||||
continue
|
|
||||||
if ok:
|
|
||||||
sent += 1
|
|
||||||
else:
|
|
||||||
failed += 1
|
|
||||||
|
|
||||||
if sent or failed:
|
|
||||||
LOG.i(f"[alert] outbox 스윕 — 전송 {sent}건 · 재시도/소진 {failed}건")
|
|
||||||
return {"sent": sent, "failed": failed}
|
|
||||||
@@ -76,7 +76,6 @@ class AuthService:
|
|||||||
user_id=str(user.user_id),
|
user_id=str(user.user_id),
|
||||||
id=user.id,
|
id=user.id,
|
||||||
role=user.role,
|
role=user.role,
|
||||||
token_version=user.token_version,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _finish_login(self, user: users) -> Res_Login:
|
async def _finish_login(self, user: users) -> Res_Login:
|
||||||
@@ -317,10 +316,6 @@ class AuthService:
|
|||||||
res.result.SetResult(ErrorType.ACCOUNT_PROVIDER_CONFLICT)
|
res.result.SetResult(ErrorType.ACCOUNT_PROVIDER_CONFLICT)
|
||||||
return res
|
return res
|
||||||
data["password"] = await GetHashedPW(data["password"])
|
data["password"] = await GetHashedPW(data["password"])
|
||||||
# ★ 비밀번호를 바꾸면 그 전에 나간 refresh 토큰을 전부 무효화한다 — 안 그러면
|
|
||||||
# 누군가 비번을 훔쳐 넣어 둔 refresh 토큰이 이 사람이 비번을 바꾼 뒤로도
|
|
||||||
# 계속 살아 있다(auth_service.refresh_token 이 이 값을 대조한다).
|
|
||||||
data["token_version"] = (me.token_version or 1) + 1
|
|
||||||
else:
|
else:
|
||||||
data.pop("password", None)
|
data.pop("password", None)
|
||||||
# 빈 문자열은 NULL 로 저장(미입력 = 값 비움).
|
# 빈 문자열은 NULL 로 저장(미입력 = 값 비움).
|
||||||
@@ -341,35 +336,8 @@ class AuthService:
|
|||||||
return await self.get_me(user_info)
|
return await self.get_me(user_info)
|
||||||
|
|
||||||
async def refresh_token(self, refresh_token: str) -> Res_RefreshToken:
|
async def refresh_token(self, refresh_token: str) -> Res_RefreshToken:
|
||||||
"""refresh 토큰 → 새 access 토큰.
|
|
||||||
|
|
||||||
★ 서명·만료만 보고 DB 를 한 번도 안 읽던 자리다 — 비밀번호를 바꾸거나 계정을
|
|
||||||
막아도, 이미 나간 refresh 토큰(7일)은 만료 전까지 계속 새 access 토큰을 찍어냈다.
|
|
||||||
여기서 최신 DB 상태를 한 번 대조한다: 이 토큰의 token_version 이 지금 값과
|
|
||||||
다르면(bump_token_version 이 불렸다는 뜻) 재발급을 거절한다."""
|
|
||||||
res = Res_RefreshToken()
|
res = Res_RefreshToken()
|
||||||
# refresh 토큰 검증은 라우터 Depends(IsValidRefreshToken) 에서 1차 수행됨(서명·만료).
|
# refresh 토큰 검증은 라우터 Depends(IsValidRefreshToken) 에서 1차 수행됨.
|
||||||
user_info = DecodeRefreshToken(refresh_token)
|
user_info = DecodeRefreshToken(refresh_token)
|
||||||
|
res.access_token = CreateAccessToken(user_info)
|
||||||
err_type, user = await DB_SESSION_MNG.execute_lambda(
|
|
||||||
users.DBType(),
|
|
||||||
DBWRType.DB_READ.value,
|
|
||||||
lambda s: self.user_crud.get_user_by_login_id(s, user_info.id),
|
|
||||||
)
|
|
||||||
if err_type != ErrorType.SUCCESS or user is None:
|
|
||||||
res.result.SetResult(ErrorType.ACCOUNT_NOT_FOUND)
|
|
||||||
return res
|
|
||||||
user: users
|
|
||||||
|
|
||||||
if user.status != UserStatus.ACTIVE.value:
|
|
||||||
res.result.SetResult(ErrorType.ACCOUNT_BLOCKED_USER)
|
|
||||||
return res
|
|
||||||
# ★ 구버전 토큰(token_version 없이 발급됨)은 UserInfo 기본값 1 로 읽힌다 — DB 컬럼
|
|
||||||
# 기본값도 1 이라 배포 직후에는 전부 통과한다. bump 가 불린 뒤에만 갈린다.
|
|
||||||
if user_info.token_version != user.token_version:
|
|
||||||
res.result.SetResult(ErrorType.ACCOUNT_SESSION_REVOKED)
|
|
||||||
return res
|
|
||||||
|
|
||||||
# ★ 최신 DB 값으로 다시 만든다 — role 이 바뀌었으면 그것도 여기서 따라온다.
|
|
||||||
res.access_token = CreateAccessToken(self._user_info(user))
|
|
||||||
return res
|
return res
|
||||||
@@ -30,7 +30,6 @@ from common.utils.gtime import GTime
|
|||||||
from crud.site_crud import SiteCRUD
|
from crud.site_crud import SiteCRUD
|
||||||
from crud.place_crud import PlaceCRUD
|
from crud.place_crud import PlaceCRUD
|
||||||
from services import (
|
from services import (
|
||||||
alert_service,
|
|
||||||
azure_static,
|
azure_static,
|
||||||
indexnow,
|
indexnow,
|
||||||
publish_gate,
|
publish_gate,
|
||||||
@@ -156,15 +155,6 @@ async def run_build(job: dict) -> dict:
|
|||||||
except Exception as ex: # noqa: BLE001 — 노래 실패가 발행을 죽이면 안 된다
|
except Exception as ex: # noqa: BLE001 — 노래 실패가 발행을 죽이면 안 된다
|
||||||
song_result = {"error": f"{type(ex).__name__}: {ex}"}
|
song_result = {"error": f"{type(ex).__name__}: {ex}"}
|
||||||
LOG.w(f"[build] place={place_id} 노래 실패(노래 없이 발행): {type(ex).__name__}: {ex}")
|
LOG.w(f"[build] place={place_id} 노래 실패(노래 없이 발행): {type(ex).__name__}: {ex}")
|
||||||
# ★ 발행 자체는 계속되므로(사이트는 노래 없이 나간다) 이건 REJECTED 도 FAILED 도
|
|
||||||
# 아니다 — 별도 종류(partial_failure)로 알린다. 발행이 실패한 게 아니라는 걸
|
|
||||||
# 운영자가 첫 줄만 보고 알아야 한다.
|
|
||||||
await alert_service.send_alert(
|
|
||||||
kind="partial_failure",
|
|
||||||
title=f"노래 생성 실패(발행은 계속) — {place_id}",
|
|
||||||
detail=f"place_id={place_id}\n{song_result['error']}",
|
|
||||||
dedupe_key=f"song_failed:{place_id}",
|
|
||||||
)
|
|
||||||
|
|
||||||
# ★ 일정(LLM)은 **여기서 직접** 부른다. 이건 잡이라 기다리는 사람이 없다 —
|
# ★ 일정(LLM)은 **여기서 직접** 부른다. 이건 잡이라 기다리는 사람이 없다 —
|
||||||
# 캔버스 경로가 잡으로 넘기는 것과 사정이 다르다(local_content_service._ensure_region_stories).
|
# 캔버스 경로가 잡으로 넘기는 것과 사정이 다르다(local_content_service._ensure_region_stories).
|
||||||
@@ -236,15 +226,6 @@ async def run_build(job: dict) -> dict:
|
|||||||
result["build_status"] = "FAILED"
|
result["build_status"] = "FAILED"
|
||||||
result["error"] = reason
|
result["error"] = reason
|
||||||
LOG.w(f"[build] place={place_id} v{version_no} 실패: {reason}")
|
LOG.w(f"[build] place={place_id} v{version_no} 실패: {reason}")
|
||||||
# ★ 게이트 반려(gate is not None)는 알리지 않는다 — 사장님이 값을 안 채웠다고
|
|
||||||
# 운영자를 부르면 안 된다. 여기서 알리는 건 렌더·인프라가 죽은 "업무 실패"뿐이다.
|
|
||||||
if gate is None:
|
|
||||||
await alert_service.send_alert(
|
|
||||||
kind="build_failed",
|
|
||||||
title=f"발행 실패 — {place_name or place_id}",
|
|
||||||
detail=f"place_id={place_id} v{version_no}\n{reason}",
|
|
||||||
dedupe_key=f"build_failed:{place_id}",
|
|
||||||
)
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# ---- 1차 게이트: 렌더 없이 판정 가능한 것 ----
|
# ---- 1차 게이트: 렌더 없이 판정 가능한 것 ----
|
||||||
@@ -367,10 +348,6 @@ async def run_build(job: dict) -> dict:
|
|||||||
)
|
)
|
||||||
result["build_status"] = "BUILT"
|
result["build_status"] = "BUILT"
|
||||||
result["routes"] = report.get("routes")
|
result["routes"] = report.get("routes")
|
||||||
# ★ 빌드가 렌더·인프라 실패 없이 끝났다 — 직전에 build_failed 알림이 안 풀린 채 있었으면
|
|
||||||
# 지금 풀렸다는 뜻이다(정상 발행이 재개됐다). 알림이 없었으면 resolve_alert 가 조용히
|
|
||||||
# 아무것도 안 한다(파일 머리주석).
|
|
||||||
await alert_service.resolve_alert(f"build_failed:{place_id}", f"발행 재개 — {place_name or place_id}")
|
|
||||||
|
|
||||||
if want_publish:
|
if want_publish:
|
||||||
# 썸네일은 발행 상태 전이와 같은 UPDATE 에 싣는다 — 못 만들었으면 키를 넣지 않아
|
# 썸네일은 발행 상태 전이와 같은 UPDATE 에 싣는다 — 못 만들었으면 키를 넣지 않아
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
import re
|
import re
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from common import collect_diagnostics
|
|
||||||
from common.database.db_session_manager import DB_SESSION_MNG
|
from common.database.db_session_manager import DB_SESSION_MNG
|
||||||
from common.database.model.models import place_facts as facts_model
|
from common.database.model.models import place_facts as facts_model
|
||||||
from common.database.model.models import place_photos, place_channels, places, place_units
|
from common.database.model.models import place_photos, place_channels, places, place_units
|
||||||
@@ -125,7 +124,7 @@ async def discover_official_site(place, place_id: str) -> str:
|
|||||||
try:
|
try:
|
||||||
candidates = await client.search_local(query)
|
candidates = await client.search_local(query)
|
||||||
except Exception as ex: # noqa: BLE001 — 발견 실패가 수집을 죽이면 안 된다
|
except Exception as ex: # noqa: BLE001 — 발견 실패가 수집을 죽이면 안 된다
|
||||||
collect_diagnostics.note_issue("naver_local_search", query, ex)
|
LOG.w(f"[collect] 지역검색 실패(계속) {query!r}: {type(ex).__name__}: {ex}")
|
||||||
return "not_found"
|
return "not_found"
|
||||||
|
|
||||||
match = naver_client.pick_match(place.name, candidates, address)
|
match = naver_client.pick_match(place.name, candidates, address)
|
||||||
@@ -169,7 +168,7 @@ async def discover_tour_api(place, place_id: str) -> str:
|
|||||||
longitude=place.longitude,
|
longitude=place.longitude,
|
||||||
)
|
)
|
||||||
except Exception as ex: # noqa: BLE001 — 발견 실패가 수집을 죽이면 안 된다
|
except Exception as ex: # noqa: BLE001 — 발견 실패가 수집을 죽이면 안 된다
|
||||||
collect_diagnostics.note_issue("tour_api", place.name, ex)
|
LOG.w(f"[collect] TourAPI 조회 실패(계속): {type(ex).__name__}: {ex}")
|
||||||
return "error"
|
return "error"
|
||||||
|
|
||||||
if not found:
|
if not found:
|
||||||
@@ -216,7 +215,7 @@ async def discover_yanolja(place, place_id: str) -> str:
|
|||||||
try:
|
try:
|
||||||
found = await yanolja_adapter.search_by_address(address)
|
found = await yanolja_adapter.search_by_address(address)
|
||||||
except Exception as ex: # noqa: BLE001 — 발견 실패가 수집을 죽이면 안 된다
|
except Exception as ex: # noqa: BLE001 — 발견 실패가 수집을 죽이면 안 된다
|
||||||
collect_diagnostics.note_issue("yanolja_search", place.name, ex)
|
LOG.w(f"[collect] 야놀자 검색 실패(계속): {type(ex).__name__}: {ex}")
|
||||||
return "error"
|
return "error"
|
||||||
|
|
||||||
if not found:
|
if not found:
|
||||||
@@ -255,7 +254,7 @@ async def discover_links(place, place_id: str, *, include_perplexity: bool = Fal
|
|||||||
if stat["naver_place"] == "resolved":
|
if stat["naver_place"] == "resolved":
|
||||||
stat["discovered"] += 1
|
stat["discovered"] += 1
|
||||||
except Exception as ex: # noqa: BLE001 — 발견 실패가 수집을 죽이면 안 된다
|
except Exception as ex: # noqa: BLE001 — 발견 실패가 수집을 죽이면 안 된다
|
||||||
collect_diagnostics.note_issue("naver_place", place.name, ex)
|
LOG.w(f"[collect] 네이버 플레이스 조회 실패(계속): {type(ex).__name__}: {ex}")
|
||||||
stat["naver_place"] = "error"
|
stat["naver_place"] = "error"
|
||||||
|
|
||||||
# TourAPI 도 같은 성격의 '직접 해석' 이다 — 검색모델을 거치지 않고, 키가 있으면 항상 시도한다.
|
# TourAPI 도 같은 성격의 '직접 해석' 이다 — 검색모델을 거치지 않고, 키가 있으면 항상 시도한다.
|
||||||
@@ -265,7 +264,7 @@ async def discover_links(place, place_id: str, *, include_perplexity: bool = Fal
|
|||||||
if stat["tour_api"] == "resolved":
|
if stat["tour_api"] == "resolved":
|
||||||
stat["discovered"] += 1
|
stat["discovered"] += 1
|
||||||
except Exception as ex: # noqa: BLE001
|
except Exception as ex: # noqa: BLE001
|
||||||
collect_diagnostics.note_issue("tour_api", place.name, ex)
|
LOG.w(f"[collect] TourAPI 조회 실패(계속): {type(ex).__name__}: {ex}")
|
||||||
stat["tour_api"] = "error"
|
stat["tour_api"] = "error"
|
||||||
|
|
||||||
# 자체 홈페이지 — 네이버 지역검색이 이미 준 값이라 추가 요금이 없다(위 함수 머리주석).
|
# 자체 홈페이지 — 네이버 지역검색이 이미 준 값이라 추가 요금이 없다(위 함수 머리주석).
|
||||||
@@ -275,7 +274,7 @@ async def discover_links(place, place_id: str, *, include_perplexity: bool = Fal
|
|||||||
if stat["official_site"] == "resolved":
|
if stat["official_site"] == "resolved":
|
||||||
stat["discovered"] += 1
|
stat["discovered"] += 1
|
||||||
except Exception as ex: # noqa: BLE001
|
except Exception as ex: # noqa: BLE001
|
||||||
collect_diagnostics.note_issue("official_site", place.name, ex)
|
LOG.w(f"[collect] 자체 홈페이지 조회 실패(계속): {type(ex).__name__}: {ex}")
|
||||||
stat["official_site"] = "error"
|
stat["official_site"] = "error"
|
||||||
|
|
||||||
# 야놀자(NOL) — 숙박 업종에서만 의미가 있고, 상호 대조 실패 시 등록하지 않는다(위 함수 참고).
|
# 야놀자(NOL) — 숙박 업종에서만 의미가 있고, 상호 대조 실패 시 등록하지 않는다(위 함수 참고).
|
||||||
@@ -285,7 +284,7 @@ async def discover_links(place, place_id: str, *, include_perplexity: bool = Fal
|
|||||||
if stat["yanolja"] == "resolved":
|
if stat["yanolja"] == "resolved":
|
||||||
stat["discovered"] += 1
|
stat["discovered"] += 1
|
||||||
except Exception as ex: # noqa: BLE001
|
except Exception as ex: # noqa: BLE001
|
||||||
collect_diagnostics.note_issue("yanolja", place.name, ex)
|
LOG.w(f"[collect] 야놀자 조회 실패(계속): {type(ex).__name__}: {ex}")
|
||||||
stat["yanolja"] = "error"
|
stat["yanolja"] = "error"
|
||||||
|
|
||||||
# 오직 요청 옵션으로만 연다. 서버 env 로 일괄 활성화하면 일반 크롤링·재수집에서도
|
# 오직 요청 옵션으로만 연다. 서버 env 로 일괄 활성화하면 일반 크롤링·재수집에서도
|
||||||
@@ -310,7 +309,7 @@ async def discover_links(place, place_id: str, *, include_perplexity: bool = Fal
|
|||||||
return stat
|
return stat
|
||||||
except perplexity.PerplexityError as ex:
|
except perplexity.PerplexityError as ex:
|
||||||
# ★ 실패해도 파이프라인을 죽이지 않는다 — 이미 등록된 링크로 크롤링은 계속한다.
|
# ★ 실패해도 파이프라인을 죽이지 않는다 — 이미 등록된 링크로 크롤링은 계속한다.
|
||||||
collect_diagnostics.note_issue("perplexity_discover", place.name, ex)
|
LOG.w(f"[collect] URL 발견 실패(계속): {type(ex).__name__}: {ex}")
|
||||||
stat["error"] = str(ex)[:200]
|
stat["error"] = str(ex)[:200]
|
||||||
return stat
|
return stat
|
||||||
|
|
||||||
@@ -422,10 +421,10 @@ async def fetch_one(link):
|
|||||||
try:
|
try:
|
||||||
source = await adapter.fetch(link.url)
|
source = await adapter.fetch(link.url)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
collect_diagnostics.note_issue("fetch", link.url, ex)
|
LOG.w(f"[collect] 수집 실패(계속) {link.url}: {type(ex).__name__}: {ex}")
|
||||||
return None, "failed"
|
return None, "failed"
|
||||||
if not source.ok:
|
if not source.ok:
|
||||||
collect_diagnostics.note_issue("fetch", link.url, RuntimeError(source.error))
|
LOG.w(f"[collect] 수집 실패(계속) {link.url}: {source.error}")
|
||||||
return None, "failed"
|
return None, "failed"
|
||||||
return source, "fetched"
|
return source, "fetched"
|
||||||
|
|
||||||
@@ -551,15 +550,6 @@ async def store_media(place_id: str, sources: list, unit_map: dict) -> dict:
|
|||||||
# ---- 오케스트레이션 --------------------------------------------------------
|
# ---- 오케스트레이션 --------------------------------------------------------
|
||||||
async def run_collect(job: dict) -> dict:
|
async def run_collect(job: dict) -> dict:
|
||||||
"""COLLECT 잡 핸들러. 반환값이 jobs.result 에 저장돼 폴링·감사에 쓰인다."""
|
"""COLLECT 잡 핸들러. 반환값이 jobs.result 에 저장돼 폴링·감사에 쓰인다."""
|
||||||
with collect_diagnostics.collecting():
|
|
||||||
result = await _run_collect(job)
|
|
||||||
issues = collect_diagnostics.snapshot()
|
|
||||||
if issues:
|
|
||||||
result["issues"] = issues
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
async def _run_collect(job: dict) -> dict:
|
|
||||||
payload = job["payload"]
|
payload = job["payload"]
|
||||||
place_id = payload["place_id"]
|
place_id = payload["place_id"]
|
||||||
owner_user_id = payload["owner_user_id"]
|
owner_user_id = payload["owner_user_id"]
|
||||||
@@ -692,7 +682,7 @@ async def _run_collect(job: dict) -> dict:
|
|||||||
from services import place_research
|
from services import place_research
|
||||||
result["research"] = await place_research.research_place(place, place_id)
|
result["research"] = await place_research.research_place(place, place_id)
|
||||||
except Exception as ex: # noqa: BLE001
|
except Exception as ex: # noqa: BLE001
|
||||||
collect_diagnostics.note_issue("place_research", place.name, ex)
|
LOG.w(f"[collect] 업소 조사 실패(계속): {type(ex).__name__}: {ex}")
|
||||||
result["research"] = {"error": f"{type(ex).__name__}: {ex}"}
|
result["research"] = {"error": f"{type(ex).__name__}: {ex}"}
|
||||||
|
|
||||||
await _finish(place_id, owner_user_id, PlaceStatus.REVIEW)
|
await _finish(place_id, owner_user_id, PlaceStatus.REVIEW)
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
"""COPY 흐름. 단계 구현: copy_steps / 프롬프트: prompts/copy / 호출·검증: external/gemini_text."""
|
"""COPY 흐름. 단계 구현: copy_steps / 프롬프트: prompts/copy / 호출·검증: external/gemini_text."""
|
||||||
from common.logger import LOG
|
|
||||||
from services.copy_steps import CopyAborted, prepare_copy, generate_copy, save_copy, fill_faqs
|
from services.copy_steps import CopyAborted, prepare_copy, generate_copy, save_copy, fill_faqs
|
||||||
from services.external import gemini_text
|
from services.external import gemini_text
|
||||||
from services.job_progress import JobProgress
|
from services.job_progress import JobProgress
|
||||||
@@ -21,16 +20,8 @@ async def run_copy(job: dict) -> dict:
|
|||||||
if inputs.catalog is None and not inputs.ungrounded:
|
if inputs.catalog is None and not inputs.ungrounded:
|
||||||
raise CopyAborted(note)
|
raise CopyAborted(note)
|
||||||
else:
|
else:
|
||||||
try:
|
async with progress.step("generate"):
|
||||||
async with progress.step("generate"):
|
copy = await generate_copy(inputs)
|
||||||
copy = await generate_copy(inputs)
|
|
||||||
except gemini_text.GeminiError as ex:
|
|
||||||
# ★ 호출 실패는 미설정과 같은 취급이다 — fact 만으로도 편집·발행이 되고
|
|
||||||
# (publish_gate.check_unique_content), 발행은 고유 콘텐츠 0건으로 막지 않는다.
|
|
||||||
# 자세한 배경은 DEVLOG.md 참고.
|
|
||||||
note = f"생성 호출 실패: {ex}"
|
|
||||||
LOG.w(f"[copy] 생성 실패, fact 만으로 계속: {ex}")
|
|
||||||
await progress.skip("generate", "generation_failed")
|
|
||||||
|
|
||||||
async with progress.step("save"):
|
async with progress.step("save"):
|
||||||
result = await save_copy(inputs, copy)
|
result = await save_copy(inputs, copy)
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ from crud.place_crud import PlaceCRUD
|
|||||||
from router.v1.fact.protocol import Req_UpsertFact
|
from router.v1.fact.protocol import Req_UpsertFact
|
||||||
from services import faq_fill, place_research
|
from services import faq_fill, place_research
|
||||||
from services.external import gemini_text
|
from services.external import gemini_text
|
||||||
from services.llm import provider
|
|
||||||
from services.fact_service import FactService
|
from services.fact_service import FactService
|
||||||
from common.job_errors import PermanentJobError
|
from common.job_errors import PermanentJobError
|
||||||
|
|
||||||
@@ -182,11 +181,6 @@ async def prepare_copy(place_id: str, owner_user_id: str) -> CopyInputs:
|
|||||||
|
|
||||||
|
|
||||||
async def generate_copy(inputs: CopyInputs) -> gemini_text.GeneratedCopy:
|
async def generate_copy(inputs: CopyInputs) -> gemini_text.GeneratedCopy:
|
||||||
active_provider = provider.active()
|
|
||||||
model = (
|
|
||||||
external_api_config.openai_text_model if active_provider.__name__.endswith("openai")
|
|
||||||
else external_api_config.gemini_text_model
|
|
||||||
)
|
|
||||||
try:
|
try:
|
||||||
return await gemini_text.generate_copy(
|
return await gemini_text.generate_copy(
|
||||||
inputs.place.name,
|
inputs.place.name,
|
||||||
@@ -196,7 +190,7 @@ async def generate_copy(inputs: CopyInputs) -> gemini_text.GeneratedCopy:
|
|||||||
records=inputs.records or None,
|
records=inputs.records or None,
|
||||||
suggested_questions=faq_fill.suggested_questions(inputs.catalog, inputs.known_fact_keys) if inputs.catalog else None,
|
suggested_questions=faq_fill.suggested_questions(inputs.catalog, inputs.known_fact_keys) if inputs.catalog else None,
|
||||||
max_faqs=faq_fill.FAQ_TARGET,
|
max_faqs=faq_fill.FAQ_TARGET,
|
||||||
model=model,
|
model=external_api_config.gemini_text_model,
|
||||||
)
|
)
|
||||||
except gemini_text.GeminiNotConfigured as ex:
|
except gemini_text.GeminiNotConfigured as ex:
|
||||||
raise CopyAborted(str(ex)) from ex
|
raise CopyAborted(str(ex)) from ex
|
||||||
@@ -249,7 +243,7 @@ async def save_copy(inputs: CopyInputs, copy: gemini_text.GeneratedCopy | None)
|
|||||||
actor, place_id,
|
actor, place_id,
|
||||||
Req_UpsertFact(
|
Req_UpsertFact(
|
||||||
key=key, value=text_value.strip(),
|
key=key, value=text_value.strip(),
|
||||||
source_type=SourceType.LLM, source_url=f"llm:{copy.source or external_api_config.gemini_text_model}",
|
source_type=SourceType.LLM, source_url=f"gemini:{external_api_config.gemini_text_model}",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
if res.result.success:
|
if res.result.success:
|
||||||
|
|||||||
+38
-32
@@ -3,13 +3,15 @@
|
|||||||
이 파일이 하는 일은 **엮는 것뿐**이다. 고칠 것이 생기면 해당 겹으로 바로 간다:
|
이 파일이 하는 일은 **엮는 것뿐**이다. 고칠 것이 생기면 해당 겹으로 바로 간다:
|
||||||
|
|
||||||
무엇을 묻는가 services/prompts/vision.py 프롬프트·응답 스키마
|
무엇을 묻는가 services/prompts/vision.py 프롬프트·응답 스키마
|
||||||
어떻게 부르는가 services/llm/provider.py 공급자 선택(gemini/openai) · HTTP·재시도·토큰·비용
|
어떻게 부르는가 services/llm/gemini.py HTTP·재시도·토큰·비용
|
||||||
무엇을 돌려주는가 여기 배치 나누기 → 호출 → ref 매칭 → 조립
|
무엇을 돌려주는가 여기 배치 나누기 → 호출 → ref 매칭 → 조립
|
||||||
|
|
||||||
결과는 순서가 아니라 `ref` 로 매칭하고, 신뢰도가 낮으면 사람 확인 대상으로 남긴다.
|
결과는 순서가 아니라 `ref` 로 매칭하고, 신뢰도가 낮으면 사람 확인 대상으로 남긴다.
|
||||||
(문장 생성과 달리 여기엔 grounding 겹이 없다 — 사진 설명은 대조할 fact 가 없고,
|
(문장 생성과 달리 여기엔 grounding 겹이 없다 — 사진 설명은 대조할 fact 가 없고,
|
||||||
대신 신뢰도 임계값과 사람 확인 큐가 그 몫을 한다.)
|
대신 신뢰도 임계값과 사람 확인 큐가 그 몫을 한다.)
|
||||||
"""
|
"""
|
||||||
|
import base64
|
||||||
|
import json
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
@@ -17,19 +19,20 @@ import httpx
|
|||||||
|
|
||||||
from common.enums import PlaceCategory
|
from common.enums import PlaceCategory
|
||||||
from common.logger import LOG
|
from common.logger import LOG
|
||||||
from services.llm import provider
|
from services.llm.gemini import (
|
||||||
from services.llm.errors import LlmError as GeminiError
|
DEFAULT_MODEL,
|
||||||
from services.llm.errors import LlmInvalidOutput as GeminiInvalidOutput # noqa: F401 (하위 호환 재노출)
|
GeminiError,
|
||||||
from services.llm.errors import LlmNotConfigured as GeminiNotConfigured
|
GeminiInvalidOutput,
|
||||||
from services.llm.types import ImagePart, Usage
|
GeminiNotConfigured,
|
||||||
|
Usage,
|
||||||
|
call,
|
||||||
|
extract_text,
|
||||||
|
is_configured,
|
||||||
|
price,
|
||||||
|
read_usage,
|
||||||
|
)
|
||||||
from services.prompts.vision import RESPONSE_SCHEMA, build_prompt
|
from services.prompts.vision import RESPONSE_SCHEMA, build_prompt
|
||||||
|
|
||||||
|
|
||||||
def is_configured() -> bool:
|
|
||||||
"""호출측(vision_service.py 등)은 이 겹만 안다 — 어느 공급자가 활성인지는 몰라도 된다."""
|
|
||||||
return provider.active().is_configured()
|
|
||||||
|
|
||||||
|
|
||||||
# URL 확장자 대신 파일 시그니처로 MIME을 판별한다.
|
# URL 확장자 대신 파일 시그니처로 MIME을 판별한다.
|
||||||
_MAGIC = (
|
_MAGIC = (
|
||||||
(b"\x89PNG\r\n\x1a\n", "image/png"),
|
(b"\x89PNG\r\n\x1a\n", "image/png"),
|
||||||
@@ -110,7 +113,7 @@ async def _run_batch(
|
|||||||
★ 배치가 통째로 실패해도 예외를 밖으로 던지지 않는다 — 호출측이 나머지 배치를 계속 돌려야 한다."""
|
★ 배치가 통째로 실패해도 예외를 밖으로 던지지 않는다 — 호출측이 나머지 배치를 계속 돌려야 한다."""
|
||||||
out: dict[str, VisionResult] = {}
|
out: dict[str, VisionResult] = {}
|
||||||
ref_map: dict[str, ImageInput] = {}
|
ref_map: dict[str, ImageInput] = {}
|
||||||
images_payload: list[ImagePart] = []
|
parts: list[dict] = [{"text": ""}] # 자리를 잡아두고 프롬프트는 아래에서 채운다
|
||||||
|
|
||||||
for i, image in enumerate(batch):
|
for i, image in enumerate(batch):
|
||||||
ref = f"img-{i}"
|
ref = f"img-{i}"
|
||||||
@@ -124,27 +127,33 @@ async def _run_batch(
|
|||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
ref_map[ref] = image
|
ref_map[ref] = image
|
||||||
label = f"[{ref}]" + (f" (힌트: {image.unit_name_hint})" if image.unit_name_hint else "")
|
parts.append({"text": f"[{ref}]" + (f" (힌트: {image.unit_name_hint})" if image.unit_name_hint else "")})
|
||||||
images_payload.append(ImagePart(mime_type=image.mime_type or _sniff_mime(data), data=data, label=label))
|
parts.append({
|
||||||
|
"inline_data": {"mime_type": image.mime_type or _sniff_mime(data), "data": base64.b64encode(data).decode()}
|
||||||
|
})
|
||||||
|
|
||||||
if not ref_map:
|
if not ref_map:
|
||||||
return out
|
return out
|
||||||
|
|
||||||
prompt = build_prompt(category, unit_names, sorted(ref_map))
|
parts[0] = {"text": build_prompt(category, unit_names, sorted(ref_map))}
|
||||||
llm_provider = provider.active()
|
body = {
|
||||||
|
"contents": [{"role": "user", "parts": parts}],
|
||||||
|
"generationConfig": {
|
||||||
|
"responseMimeType": "application/json",
|
||||||
|
"responseSchema": RESPONSE_SCHEMA,
|
||||||
|
"temperature": 0,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
usage.batches += 1
|
usage.batches += 1
|
||||||
try:
|
try:
|
||||||
llm_result = await llm_provider.generate(
|
payload = await call(client, model, body, max_retries)
|
||||||
client, model, prompt=prompt, images=images_payload,
|
parsed = json.loads(extract_text(payload))
|
||||||
response_schema=RESPONSE_SCHEMA, temperature=0, max_retries=max_retries,
|
|
||||||
)
|
|
||||||
parsed = llm_result.json
|
|
||||||
except GeminiNotConfigured:
|
except GeminiNotConfigured:
|
||||||
raise # 키 문제는 전체를 중단시킨다 — 나머지 배치도 어차피 실패한다
|
raise # 키 문제는 전체를 중단시킨다 — 나머지 배치도 어차피 실패한다
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
usage.failed_batches += 1
|
usage.failed_batches += 1
|
||||||
LOG.w(f"[vision] 배치 실패(계속) {len(ref_map)}장: {type(ex).__name__}: {ex}")
|
LOG.w(f"[gemini] 배치 실패(계속) {len(ref_map)}장: {type(ex).__name__}: {ex}")
|
||||||
for image in ref_map.values():
|
for image in ref_map.values():
|
||||||
out[image.origin_url] = VisionResult(
|
out[image.origin_url] = VisionResult(
|
||||||
origin_url=image.origin_url, ok=False, needs_review=True,
|
origin_url=image.origin_url, ok=False, needs_review=True,
|
||||||
@@ -152,7 +161,7 @@ async def _run_batch(
|
|||||||
)
|
)
|
||||||
return out
|
return out
|
||||||
|
|
||||||
batch_usage = llm_result.usage
|
batch_usage = read_usage(payload)
|
||||||
usage.input_tokens += batch_usage.input_tokens
|
usage.input_tokens += batch_usage.input_tokens
|
||||||
usage.output_tokens += batch_usage.output_tokens
|
usage.output_tokens += batch_usage.output_tokens
|
||||||
|
|
||||||
@@ -196,7 +205,7 @@ async def analyze_images(
|
|||||||
*,
|
*,
|
||||||
category: Optional[PlaceCategory] = None,
|
category: Optional[PlaceCategory] = None,
|
||||||
unit_names: Optional[list[str]] = None,
|
unit_names: Optional[list[str]] = None,
|
||||||
model: Optional[str] = None,
|
model: str = DEFAULT_MODEL,
|
||||||
batch_size: int = 10,
|
batch_size: int = 10,
|
||||||
confidence_threshold: float = 0.7,
|
confidence_threshold: float = 0.7,
|
||||||
max_retries: int = 2,
|
max_retries: int = 2,
|
||||||
@@ -208,10 +217,8 @@ async def analyze_images(
|
|||||||
호출측이 길이나 순서로 매칭하다 어긋나면 엉뚱한 사진에 alt 가 붙는다.
|
호출측이 길이나 순서로 매칭하다 어긋나면 엉뚱한 사진에 alt 가 붙는다.
|
||||||
★ needs_review=True 인 항목은 자동 반영하지 말고 사람 확인 큐(MediaStatus.PENDING_REVIEW)로 보낸다.
|
★ needs_review=True 인 항목은 자동 반영하지 말고 사람 확인 큐(MediaStatus.PENDING_REVIEW)로 보낸다.
|
||||||
"""
|
"""
|
||||||
llm_provider = provider.active()
|
if not is_configured():
|
||||||
if not llm_provider.is_configured():
|
raise GeminiNotConfigured("GEMINI_API_KEY 가 설정되지 않았다")
|
||||||
raise GeminiNotConfigured("API 키가 설정되지 않았다")
|
|
||||||
model = model or llm_provider.DEFAULT_MODEL
|
|
||||||
if not images:
|
if not images:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@@ -242,9 +249,8 @@ async def analyze_images(
|
|||||||
ok = sum(1 for r in results if r.ok)
|
ok = sum(1 for r in results if r.ok)
|
||||||
review = sum(1 for r in results if r.needs_review)
|
review = sum(1 for r in results if r.needs_review)
|
||||||
LOG.i(
|
LOG.i(
|
||||||
f"[vision] 사진분석 {len(results)}장 (성공 {ok} · 확인필요 {review}) · "
|
f"[gemini] 사진분석 {len(results)}장 (성공 {ok} · 확인필요 {review}) · "
|
||||||
f"배치 {usage.batches}(실패 {usage.failed_batches}) · model={model} · "
|
f"배치 {usage.batches}(실패 {usage.failed_batches}) · model={model} · "
|
||||||
f"tokens in={usage.input_tokens} out={usage.output_tokens} · "
|
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${price(model, Usage(usage.input_tokens, usage.output_tokens))}"
|
||||||
f"약 ${llm_provider.price(model, Usage(usage.input_tokens, usage.output_tokens))}"
|
|
||||||
)
|
)
|
||||||
return results
|
return results
|
||||||
+35
-20
@@ -3,7 +3,7 @@
|
|||||||
이 파일이 하는 일은 **엮는 것뿐**이다. 고칠 것이 생기면 해당 겹으로 바로 간다:
|
이 파일이 하는 일은 **엮는 것뿐**이다. 고칠 것이 생기면 해당 겹으로 바로 간다:
|
||||||
|
|
||||||
무엇을 묻는가 services/prompts/extract.py 프롬프트·응답 스키마
|
무엇을 묻는가 services/prompts/extract.py 프롬프트·응답 스키마
|
||||||
어떻게 부르는가 services/llm/provider.py 공급자 선택(gemini/openai) · HTTP·재시도·토큰·비용
|
어떻게 부르는가 services/llm/gemini.py HTTP·재시도·토큰·비용
|
||||||
답을 믿을 것인가 services/grounding/extract.py evidence 원문 대조
|
답을 믿을 것인가 services/grounding/extract.py evidence 원문 대조
|
||||||
무엇을 돌려주는가 여기 호출 → 검증 → CollectedFact 조립
|
무엇을 돌려주는가 여기 호출 → 검증 → CollectedFact 조립
|
||||||
|
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
통과한 fact 도 UNVERIFIED 로 들어간다. 사장님이 확인해야 사이트에 나간다 —
|
통과한 fact 도 UNVERIFIED 로 들어간다. 사장님이 확인해야 사이트에 나간다 —
|
||||||
그 게이트는 fact 계층이 담당한다. 여기서는 '원문에 있었다' 까지만 보장한다.
|
그 게이트는 fact 계층이 담당한다. 여기서는 '원문에 있었다' 까지만 보장한다.
|
||||||
"""
|
"""
|
||||||
|
import json
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
@@ -25,9 +26,16 @@ from common.enums import PlaceCategory
|
|||||||
from common.logger import LOG
|
from common.logger import LOG
|
||||||
from services.collector.base import CollectedFact
|
from services.collector.base import CollectedFact
|
||||||
from services.grounding.extract import verify
|
from services.grounding.extract import verify
|
||||||
from services.llm import provider
|
from services.llm.gemini import (
|
||||||
from services.llm.errors import LlmInvalidOutput as GeminiInvalidOutput
|
DEFAULT_MODEL,
|
||||||
from services.llm.errors import LlmNotConfigured as GeminiNotConfigured
|
GeminiInvalidOutput,
|
||||||
|
GeminiNotConfigured,
|
||||||
|
call,
|
||||||
|
extract_text,
|
||||||
|
is_configured,
|
||||||
|
price,
|
||||||
|
read_usage,
|
||||||
|
)
|
||||||
from services.prompts.extract import RESPONSE_SCHEMA, build_prompt
|
from services.prompts.extract import RESPONSE_SCHEMA, build_prompt
|
||||||
|
|
||||||
# 이보다 짧은 원문은 호출하지 않는다. 메뉴판 한 줄도 안 되는 분량에서 나올 fact 는 없고,
|
# 이보다 짧은 원문은 호출하지 않는다. 메뉴판 한 줄도 안 되는 분량에서 나올 fact 는 없고,
|
||||||
@@ -57,7 +65,7 @@ async def extract_facts(
|
|||||||
source_text: str,
|
source_text: str,
|
||||||
*,
|
*,
|
||||||
source_url: str,
|
source_url: str,
|
||||||
model: Optional[str] = None,
|
model: str = DEFAULT_MODEL,
|
||||||
max_retries: int = 2,
|
max_retries: int = 2,
|
||||||
client: Optional[httpx.AsyncClient] = None,
|
client: Optional[httpx.AsyncClient] = None,
|
||||||
) -> ExtractResult:
|
) -> ExtractResult:
|
||||||
@@ -67,31 +75,38 @@ async def extract_facts(
|
|||||||
여기서 구조적으로 찍어 둔다(사장님 붙여넣기면 'owner:paste' 같은 식별자라도 넣는다).
|
여기서 구조적으로 찍어 둔다(사장님 붙여넣기면 'owner:paste' 같은 식별자라도 넣는다).
|
||||||
★ 원문이 짧으면 **API 를 호출하지 않는다** — 근거가 없는데 부르면 그게 곧 환각 유발이다.
|
★ 원문이 짧으면 **API 를 호출하지 않는다** — 근거가 없는데 부르면 그게 곧 환각 유발이다.
|
||||||
"""
|
"""
|
||||||
llm = provider.active()
|
if not is_configured():
|
||||||
if not llm.is_configured():
|
raise GeminiNotConfigured("GEMINI_API_KEY 가 설정되지 않았다")
|
||||||
raise GeminiNotConfigured("API 키가 설정되지 않았다")
|
|
||||||
if not (source_url or "").strip():
|
if not (source_url or "").strip():
|
||||||
raise ValueError("source_url 이 비었다 — 출처 없는 추출은 하지 않는다")
|
raise ValueError("source_url 이 비었다 — 출처 없는 추출은 하지 않는다")
|
||||||
model = model or llm.DEFAULT_MODEL
|
|
||||||
|
|
||||||
text = (source_text or "").strip()
|
text = (source_text or "").strip()
|
||||||
if len(text) < MIN_SOURCE_CHARS:
|
if len(text) < MIN_SOURCE_CHARS:
|
||||||
LOG.i(f"[extract] '{place_name}' 원문 {len(text)}자 — 짧아서 호출하지 않는다")
|
LOG.i(f"[gemini-extract] '{place_name}' 원문 {len(text)}자 — 짧아서 호출하지 않는다")
|
||||||
return ExtractResult(rejected=[("(전체)", f"원문이 {len(text)}자로 너무 짧다 — 호출하지 않았다")])
|
return ExtractResult(rejected=[("(전체)", f"원문이 {len(text)}자로 너무 짧다 — 호출하지 않았다")])
|
||||||
|
|
||||||
|
body = {
|
||||||
|
"contents": [{"role": "user", "parts": [{"text": build_prompt(place_name, category, text)}]}],
|
||||||
|
"generationConfig": {
|
||||||
|
"responseMimeType": "application/json",
|
||||||
|
"responseSchema": RESPONSE_SCHEMA,
|
||||||
|
# ★ 0.0 — 옮겨 적는 작업이다. 창의성이 개입할 자리가 없다.
|
||||||
|
"temperature": 0.0,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
owns_client = client is None
|
owns_client = client is None
|
||||||
client = client or httpx.AsyncClient(timeout=httpx.Timeout(120.0, connect=10.0))
|
client = client or httpx.AsyncClient(timeout=httpx.Timeout(120.0, connect=10.0))
|
||||||
try:
|
try:
|
||||||
llm_result = await llm.generate(
|
payload = await call(client, model, body, max_retries)
|
||||||
client, model, prompt=build_prompt(place_name, category, text),
|
parsed = json.loads(extract_text(payload))
|
||||||
# ★ 0.0 — 옮겨 적는 작업이다. 창의성이 개입할 자리가 없다.
|
except json.JSONDecodeError as ex:
|
||||||
response_schema=RESPONSE_SCHEMA, temperature=0.0, max_retries=max_retries,
|
raise GeminiInvalidOutput(f"구조화 출력 파싱 실패: {ex}") from ex
|
||||||
)
|
|
||||||
finally:
|
finally:
|
||||||
if owns_client:
|
if owns_client:
|
||||||
await client.aclose()
|
await client.aclose()
|
||||||
|
|
||||||
rows = llm_result.json.get("facts") if llm_result.json else None
|
rows = parsed.get("facts")
|
||||||
if not isinstance(rows, list):
|
if not isinstance(rows, list):
|
||||||
raise GeminiInvalidOutput(f"facts 가 배열이 아니다: {type(rows).__name__}")
|
raise GeminiInvalidOutput(f"facts 가 배열이 아니다: {type(rows).__name__}")
|
||||||
|
|
||||||
@@ -109,14 +124,14 @@ async def extract_facts(
|
|||||||
for row in passed
|
for row in passed
|
||||||
]
|
]
|
||||||
|
|
||||||
usage = llm_result.usage
|
usage = read_usage(payload)
|
||||||
LOG.i(
|
LOG.i(
|
||||||
f"[extract] '{place_name}' 추출 {len(rows)}건 → 통과 {len(facts)}건 · "
|
f"[gemini-extract] '{place_name}' 추출 {len(rows)}건 → 통과 {len(facts)}건 · "
|
||||||
f"반려 {len(rejected)}건 · model={model} · "
|
f"반려 {len(rejected)}건 · model={model} · "
|
||||||
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${llm.price(model, usage)}"
|
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${price(model, usage)}"
|
||||||
)
|
)
|
||||||
if rejected:
|
if rejected:
|
||||||
for label, why in rejected[:10]:
|
for label, why in rejected[:10]:
|
||||||
LOG.w(f"[extract] 반려 {label} — {why}")
|
LOG.w(f"[gemini-extract] 반려 {label} — {why}")
|
||||||
|
|
||||||
return ExtractResult(facts=facts, rejected=rejected)
|
return ExtractResult(facts=facts, rejected=rejected)
|
||||||
+70
-52
@@ -3,7 +3,7 @@
|
|||||||
이 파일이 하는 일은 **엮는 것뿐**이다. 고칠 것이 생기면 해당 겹으로 바로 간다:
|
이 파일이 하는 일은 **엮는 것뿐**이다. 고칠 것이 생기면 해당 겹으로 바로 간다:
|
||||||
|
|
||||||
무엇을 묻는가 services/prompts/copy.py 프롬프트·응답 스키마
|
무엇을 묻는가 services/prompts/copy.py 프롬프트·응답 스키마
|
||||||
어떻게 부르는가 services/llm/provider.py 공급자 선택(gemini/openai) · HTTP·재시도·토큰·비용
|
어떻게 부르는가 services/llm/gemini.py HTTP·재시도·토큰·비용
|
||||||
답을 믿을 것인가 services/grounding/copy.py ground_check · faq_polarity_ok
|
답을 믿을 것인가 services/grounding/copy.py ground_check · faq_polarity_ok
|
||||||
무엇을 돌려주는가 여기 근거 모으기 → 호출 → 검증 → 조립
|
무엇을 돌려주는가 여기 근거 모으기 → 호출 → 검증 → 조립
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
어디를 봐야 할지가 파일 안에서 갈리지 않았다.
|
어디를 봐야 할지가 파일 안에서 갈리지 않았다.
|
||||||
"""
|
"""
|
||||||
import hashlib
|
import hashlib
|
||||||
|
import json
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
@@ -19,18 +20,21 @@ import httpx
|
|||||||
from common.enums import PlaceCategory
|
from common.enums import PlaceCategory
|
||||||
from common.logger import LOG
|
from common.logger import LOG
|
||||||
from services.grounding.copy import FactInput, faq_polarity_ok, ground_check
|
from services.grounding.copy import FactInput, faq_polarity_ok, ground_check
|
||||||
from services.llm import provider
|
from services.llm.gemini import (
|
||||||
from services.llm.errors import LlmError
|
DEFAULT_MODEL as DEFAULT_TEXT_MODEL,
|
||||||
from services.llm.errors import LlmInvalidOutput as GeminiInvalidOutput
|
GeminiError,
|
||||||
from services.llm.errors import LlmNotConfigured as GeminiNotConfigured
|
GeminiInvalidOutput,
|
||||||
|
GeminiNotConfigured,
|
||||||
|
Usage,
|
||||||
|
call,
|
||||||
|
extract_text,
|
||||||
|
is_configured,
|
||||||
|
price,
|
||||||
|
read_usage,
|
||||||
|
)
|
||||||
from services.prompts.copy import RESPONSE_SCHEMA, build_prompt
|
from services.prompts.copy import RESPONSE_SCHEMA, build_prompt
|
||||||
|
|
||||||
|
|
||||||
def is_configured() -> bool:
|
|
||||||
"""호출측(copy_service.py, place_service.py 등)은 이 겹만 안다 — 어느 공급자가 활성인지는 몰라도 된다."""
|
|
||||||
return provider.active().is_configured()
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class GeneratedFaq:
|
class GeneratedFaq:
|
||||||
question: str
|
question: str
|
||||||
@@ -50,7 +54,6 @@ class GeneratedCopy:
|
|||||||
meta_description: Optional[str] = None
|
meta_description: Optional[str] = None
|
||||||
faqs: list[GeneratedFaq] = field(default_factory=list)
|
faqs: list[GeneratedFaq] = field(default_factory=list)
|
||||||
rejected: list[tuple[str, str]] = field(default_factory=list)
|
rejected: list[tuple[str, str]] = field(default_factory=list)
|
||||||
source: str = "" # ★ "openai:gpt-5.6-luna" 형식 — copy_steps.py 가 fact 출처 표기에 쓴다
|
|
||||||
|
|
||||||
|
|
||||||
def _unit_facts(unit_summaries: Optional[list[dict]]) -> list[FactInput]:
|
def _unit_facts(unit_summaries: Optional[list[dict]]) -> list[FactInput]:
|
||||||
@@ -97,7 +100,7 @@ async def generate_copy(
|
|||||||
records: Optional[list[str]] = None,
|
records: Optional[list[str]] = None,
|
||||||
suggested_questions: Optional[list[str]] = None,
|
suggested_questions: Optional[list[str]] = None,
|
||||||
max_faqs: int = 8,
|
max_faqs: int = 8,
|
||||||
model: Optional[str] = None,
|
model: str = DEFAULT_TEXT_MODEL,
|
||||||
max_retries: int = 2,
|
max_retries: int = 2,
|
||||||
client: Optional[httpx.AsyncClient] = None,
|
client: Optional[httpx.AsyncClient] = None,
|
||||||
) -> GeneratedCopy:
|
) -> GeneratedCopy:
|
||||||
@@ -108,15 +111,13 @@ async def generate_copy(
|
|||||||
★ 생성 결과는 전부 ground_check 를 통과한 것만 담긴다. 통과 못 한 항목은 rejected 로 간다.
|
★ 생성 결과는 전부 ground_check 를 통과한 것만 담긴다. 통과 못 한 항목은 rejected 로 간다.
|
||||||
★ 생성 대상 필드는 업종 스키마의 allow_llm=True 인 것뿐이다(호출측이 필터링해서 넘긴다).
|
★ 생성 대상 필드는 업종 스키마의 allow_llm=True 인 것뿐이다(호출측이 필터링해서 넘긴다).
|
||||||
"""
|
"""
|
||||||
llm = provider.active()
|
if not is_configured():
|
||||||
if not llm.is_configured():
|
raise GeminiNotConfigured("GEMINI_API_KEY 가 설정되지 않았다")
|
||||||
raise GeminiNotConfigured(f"{llm.__name__.rsplit('.', 1)[-1].upper()}_API_KEY 가 설정되지 않았다")
|
|
||||||
model = model or llm.DEFAULT_MODEL
|
|
||||||
# ★ 사업장 fact 가 없어도 객실·메뉴 근거가 있으면 쓴다. 요금표만 있는 모텔이 그 경우다 —
|
# ★ 사업장 fact 가 없어도 객실·메뉴 근거가 있으면 쓴다. 요금표만 있는 모텔이 그 경우다 —
|
||||||
# "대실 20,000원" 은 근거 있는 사실이고, 손님이 가장 먼저 묻는 것이기도 하다.
|
# "대실 20,000원" 은 근거 있는 사실이고, 손님이 가장 먼저 묻는 것이기도 하다.
|
||||||
unit_grounding = _unit_facts(unit_summaries)
|
unit_grounding = _unit_facts(unit_summaries)
|
||||||
if not facts and not unit_grounding:
|
if not facts and not unit_grounding:
|
||||||
LOG.i(f"[llm-text] '{place_name}' 근거 fact 0건 — 생성하지 않는다(호출 없음)")
|
LOG.i(f"[gemini-text] '{place_name}' 근거 fact 0건 — 생성하지 않는다(호출 없음)")
|
||||||
return GeneratedCopy(rejected=[("(전체)", "근거 fact 가 없다 — 생성하지 않았다")])
|
return GeneratedCopy(rejected=[("(전체)", "근거 fact 가 없다 — 생성하지 않았다")])
|
||||||
|
|
||||||
# 검증에 쓸 근거 = 넘겨받은 fact + 객실 요약 + 상호명(상호에 숫자가 있어도 근거로 본다)
|
# 검증에 쓸 근거 = 넘겨받은 fact + 객실 요약 + 상호명(상호에 숫자가 있어도 근거로 본다)
|
||||||
@@ -124,22 +125,31 @@ async def generate_copy(
|
|||||||
grounding.append(FactInput(key="place_name", label="상호명", value=place_name))
|
grounding.append(FactInput(key="place_name", label="상호명", value=place_name))
|
||||||
allowed_keys = {f.key for f in facts} | {f.key for f in grounding}
|
allowed_keys = {f.key for f in facts} | {f.key for f in grounding}
|
||||||
|
|
||||||
prompt = build_prompt(place_name, category, facts, max_faqs, unit_grounding, records, suggested_questions)
|
body = {
|
||||||
|
"contents": [{"role": "user", "parts": [{
|
||||||
|
"text": build_prompt(place_name, category, facts, max_faqs, unit_grounding, records, suggested_questions)
|
||||||
|
}]}],
|
||||||
|
"generationConfig": {
|
||||||
|
"responseMimeType": "application/json",
|
||||||
|
"responseSchema": RESPONSE_SCHEMA,
|
||||||
|
"temperature": 0.2,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
owns_client = client is None
|
owns_client = client is None
|
||||||
client = client or httpx.AsyncClient(timeout=httpx.Timeout(120.0, connect=10.0))
|
client = client or httpx.AsyncClient(timeout=httpx.Timeout(120.0, connect=10.0))
|
||||||
try:
|
try:
|
||||||
llm_result = await llm.generate(
|
payload = await call(client, model, body, max_retries)
|
||||||
client, model, prompt=prompt, response_schema=RESPONSE_SCHEMA, temperature=0.2, max_retries=max_retries,
|
parsed = json.loads(extract_text(payload))
|
||||||
)
|
except json.JSONDecodeError as ex:
|
||||||
|
raise GeminiInvalidOutput(f"구조화 출력 파싱 실패: {ex}") from ex
|
||||||
finally:
|
finally:
|
||||||
if owns_client:
|
if owns_client:
|
||||||
await client.aclose()
|
await client.aclose()
|
||||||
|
|
||||||
parsed = llm_result.json
|
usage = read_usage(payload)
|
||||||
usage = llm_result.usage
|
|
||||||
|
|
||||||
result = GeneratedCopy(source=f"{llm.__name__.rsplit('.', 1)[-1]}:{model}")
|
result = GeneratedCopy()
|
||||||
|
|
||||||
# ── 소개문 ──
|
# ── 소개문 ──
|
||||||
intro = (parsed.get("intro") or "").strip()
|
intro = (parsed.get("intro") or "").strip()
|
||||||
@@ -180,10 +190,10 @@ async def generate_copy(
|
|||||||
result.faqs.append(GeneratedFaq(question=question, answer=answer, fact_keys=keys))
|
result.faqs.append(GeneratedFaq(question=question, answer=answer, fact_keys=keys))
|
||||||
|
|
||||||
LOG.i(
|
LOG.i(
|
||||||
f"[llm-text] '{place_name}' 생성 — 소개문 {'O' if result.intro else 'X'} · "
|
f"[gemini-text] '{place_name}' 생성 — 소개문 {'O' if result.intro else 'X'} · "
|
||||||
f"메타 {'O' if result.meta_description else 'X'} · FAQ {len(result.faqs)}건 · "
|
f"메타 {'O' if result.meta_description else 'X'} · FAQ {len(result.faqs)}건 · "
|
||||||
f"반려 {len(result.rejected)}건 · model={model} · "
|
f"반려 {len(result.rejected)}건 · model={model} · "
|
||||||
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${llm.price(model, usage)}"
|
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${price(model, usage)}"
|
||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@@ -205,7 +215,7 @@ _SUMMARY_PROMPT = (
|
|||||||
async def summarize_text(
|
async def summarize_text(
|
||||||
text: str,
|
text: str,
|
||||||
*,
|
*,
|
||||||
model: Optional[str] = None,
|
model: str = DEFAULT_TEXT_MODEL,
|
||||||
max_retries: int = 2,
|
max_retries: int = 2,
|
||||||
client: Optional[httpx.AsyncClient] = None,
|
client: Optional[httpx.AsyncClient] = None,
|
||||||
) -> Optional[str]:
|
) -> Optional[str]:
|
||||||
@@ -217,10 +227,8 @@ async def summarize_text(
|
|||||||
stripped = text.strip()
|
stripped = text.strip()
|
||||||
if not stripped:
|
if not stripped:
|
||||||
return None
|
return None
|
||||||
llm = provider.active()
|
if not is_configured():
|
||||||
if not llm.is_configured():
|
|
||||||
return None
|
return None
|
||||||
model = model or llm.DEFAULT_MODEL
|
|
||||||
|
|
||||||
# 길이 기준을 바꾼 뒤 이전 길이의 요약을 재사용하지 않도록 프롬프트도 키에 넣는다.
|
# 길이 기준을 바꾼 뒤 이전 길이의 요약을 재사용하지 않도록 프롬프트도 키에 넣는다.
|
||||||
cache_key = hashlib.sha256((_SUMMARY_PROMPT + stripped).encode("utf-8")).hexdigest()
|
cache_key = hashlib.sha256((_SUMMARY_PROMPT + stripped).encode("utf-8")).hexdigest()
|
||||||
@@ -228,13 +236,20 @@ async def summarize_text(
|
|||||||
if cached is not None:
|
if cached is not None:
|
||||||
return cached
|
return cached
|
||||||
|
|
||||||
|
body = {
|
||||||
|
"contents": [{"role": "user", "parts": [{
|
||||||
|
"text": _SUMMARY_PROMPT + stripped,
|
||||||
|
}]}],
|
||||||
|
"generationConfig": {"temperature": 0.2},
|
||||||
|
}
|
||||||
|
|
||||||
owns_client = client is None
|
owns_client = client is None
|
||||||
client = client or httpx.AsyncClient(timeout=httpx.Timeout(60.0, connect=10.0))
|
client = client or httpx.AsyncClient(timeout=httpx.Timeout(60.0, connect=10.0))
|
||||||
try:
|
try:
|
||||||
result = await llm.generate(client, model, prompt=_SUMMARY_PROMPT + stripped, temperature=0.2, max_retries=max_retries)
|
payload = await call(client, model, body, max_retries)
|
||||||
summary = result.text.strip()
|
summary = extract_text(payload).strip()
|
||||||
except LlmError as ex:
|
except GeminiError as ex:
|
||||||
LOG.w(f"[llm-text] 요약 실패: {ex}")
|
LOG.w(f"[gemini-text] 요약 실패: {ex}")
|
||||||
return None
|
return None
|
||||||
finally:
|
finally:
|
||||||
if owns_client:
|
if owns_client:
|
||||||
@@ -242,11 +257,6 @@ async def summarize_text(
|
|||||||
|
|
||||||
if not summary:
|
if not summary:
|
||||||
return None
|
return None
|
||||||
usage = result.usage
|
|
||||||
LOG.i(
|
|
||||||
f"[llm-text] 요약 {len(stripped)}자 → {len(summary)}자 · model={model} · "
|
|
||||||
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${llm.price(model, usage)}"
|
|
||||||
)
|
|
||||||
if len(_SUMMARY_CACHE) >= _SUMMARY_CACHE_MAX:
|
if len(_SUMMARY_CACHE) >= _SUMMARY_CACHE_MAX:
|
||||||
_SUMMARY_CACHE.clear() # 간단한 캐시 상한 — 관리 도구 트래픽 규모에는 LRU 가 과하다.
|
_SUMMARY_CACHE.clear() # 간단한 캐시 상한 — 관리 도구 트래픽 규모에는 LRU 가 과하다.
|
||||||
_SUMMARY_CACHE[cache_key] = summary
|
_SUMMARY_CACHE[cache_key] = summary
|
||||||
@@ -269,7 +279,7 @@ async def generate_song(
|
|||||||
region: str,
|
region: str,
|
||||||
grounding: list[str],
|
grounding: list[str],
|
||||||
intro: str = "",
|
intro: str = "",
|
||||||
model: Optional[str] = None,
|
model: str = DEFAULT_TEXT_MODEL,
|
||||||
max_retries: int = 2,
|
max_retries: int = 2,
|
||||||
client: Optional[httpx.AsyncClient] = None,
|
client: Optional[httpx.AsyncClient] = None,
|
||||||
) -> GeneratedSong:
|
) -> GeneratedSong:
|
||||||
@@ -281,39 +291,47 @@ async def generate_song(
|
|||||||
★ 재료가 하나도 없으면 부르지 않는다 — 소개문과 같은 규칙이다. 상호와 지역만으로 쓴 노래는
|
★ 재료가 하나도 없으면 부르지 않는다 — 소개문과 같은 규칙이다. 상호와 지역만으로 쓴 노래는
|
||||||
어느 숙소에 붙여도 말이 되는 노래이고, 그건 이 기능이 하려던 일이 아니다.
|
어느 숙소에 붙여도 말이 되는 노래이고, 그건 이 기능이 하려던 일이 아니다.
|
||||||
"""
|
"""
|
||||||
llm = provider.active()
|
if not is_configured():
|
||||||
if not llm.is_configured():
|
raise GeminiNotConfigured("GEMINI_API_KEY 가 설정되지 않았다")
|
||||||
raise GeminiNotConfigured("API 키가 설정되지 않았다")
|
|
||||||
if not grounding and not (intro or "").strip():
|
if not grounding and not (intro or "").strip():
|
||||||
raise GeminiInvalidOutput("가사를 쓸 재료가 없다 — 확인된 fact 도 소개문도 없다")
|
raise GeminiInvalidOutput("가사를 쓸 재료가 없다 — 확인된 fact 도 소개문도 없다")
|
||||||
model = model or llm.DEFAULT_MODEL
|
|
||||||
|
|
||||||
from common.category_schema import get_schema
|
from common.category_schema import get_schema
|
||||||
from services.prompts.song import RESPONSE_SCHEMA as SONG_SCHEMA, build_prompt as build_song_prompt
|
from services.prompts.song import RESPONSE_SCHEMA as SONG_SCHEMA, build_prompt as build_song_prompt
|
||||||
|
|
||||||
prompt = build_song_prompt(place_name, get_schema(category).label, region, grounding, intro)
|
body = {
|
||||||
|
"contents": [{"role": "user", "parts": [{
|
||||||
|
"text": build_song_prompt(place_name, get_schema(category).label, region, grounding, intro)
|
||||||
|
}]}],
|
||||||
|
"generationConfig": {
|
||||||
|
"responseMimeType": "application/json",
|
||||||
|
"responseSchema": SONG_SCHEMA,
|
||||||
|
# 소개문(0.2)보다 높다 — 노래는 정확해야 하는 글이 아니라 흥얼거릴 글이다.
|
||||||
|
"temperature": 0.9,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
owns_client = client is None
|
owns_client = client is None
|
||||||
client = client or httpx.AsyncClient(timeout=httpx.Timeout(120.0, connect=10.0))
|
client = client or httpx.AsyncClient(timeout=httpx.Timeout(120.0, connect=10.0))
|
||||||
try:
|
try:
|
||||||
llm_result = await llm.generate(
|
payload = await call(client, model, body, max_retries)
|
||||||
client, model, prompt=prompt, response_schema=SONG_SCHEMA, temperature=0.9, max_retries=max_retries,
|
parsed = json.loads(extract_text(payload))
|
||||||
)
|
except json.JSONDecodeError as ex:
|
||||||
|
raise GeminiInvalidOutput(f"가사 파싱 실패: {ex}") from ex
|
||||||
finally:
|
finally:
|
||||||
if owns_client:
|
if owns_client:
|
||||||
await client.aclose()
|
await client.aclose()
|
||||||
|
|
||||||
parsed = llm_result.json or {}
|
|
||||||
title = (parsed.get("title") or "").strip()
|
title = (parsed.get("title") or "").strip()
|
||||||
lyrics = (parsed.get("lyrics") or "").strip()
|
lyrics = (parsed.get("lyrics") or "").strip()
|
||||||
style = (parsed.get("style") or "").strip()
|
style = (parsed.get("style") or "").strip()
|
||||||
if not lyrics:
|
if not lyrics:
|
||||||
raise GeminiInvalidOutput("가사가 비어 있다")
|
raise GeminiInvalidOutput("가사가 비어 있다")
|
||||||
|
|
||||||
usage = llm_result.usage
|
usage = read_usage(payload)
|
||||||
LOG.i(
|
LOG.i(
|
||||||
f"[llm-text] '{place_name}' 가사 — '{title}' ({style}) · {len(lyrics)}자 · "
|
f"[gemini-text] '{place_name}' 가사 — '{title}' ({style}) · {len(lyrics)}자 · "
|
||||||
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${llm.price(model, usage)}"
|
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${price(model, usage)}"
|
||||||
)
|
)
|
||||||
# 제목이 비면 상호를 쓴다 — 빈 제목은 플레이어에서 빈 줄로 보인다.
|
# 제목이 비면 상호를 쓴다 — 빈 제목은 플레이어에서 빈 줄로 보인다.
|
||||||
return GeneratedSong(title=title or place_name, lyrics=lyrics, style=style or "acoustic ballad")
|
return GeneratedSong(title=title or place_name, lyrics=lyrics, style=style or "acoustic ballad")
|
||||||
|
|||||||
+2
-4
@@ -30,7 +30,6 @@ from services.llm.perplexity import (
|
|||||||
PerplexityNotConfigured,
|
PerplexityNotConfigured,
|
||||||
call,
|
call,
|
||||||
is_configured,
|
is_configured,
|
||||||
read_usage,
|
|
||||||
)
|
)
|
||||||
from services.prompts.channel_discovery import RESPONSE_SCHEMA, SYSTEM_PROMPT, build_prompt
|
from services.prompts.channel_discovery import RESPONSE_SCHEMA, SYSTEM_PROMPT, build_prompt
|
||||||
|
|
||||||
@@ -127,13 +126,12 @@ async def discover_channels(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 내부 검색 횟수는 품질·지연 관측값이다. Sonar 과금은 토큰 + 요청 컨텍스트 요금이다.
|
# 내부 검색 횟수는 품질·지연 관측값이다. Sonar 과금은 토큰 + 요청 컨텍스트 요금이다.
|
||||||
usage = read_usage(payload)
|
usage = payload.get("usage") or {}
|
||||||
reasons = result.reason_counts()
|
reasons = result.reason_counts()
|
||||||
reason_text = " ".join(f"{k}{v}" for k, v in sorted(reasons.items())) or "없음"
|
reason_text = " ".join(f"{k}{v}" for k, v in sorted(reasons.items())) or "없음"
|
||||||
LOG.i(
|
LOG.i(
|
||||||
f"[perplexity] '{name}' 검색={searches}회 발견={len(found)} 통과={len(links)} "
|
f"[perplexity] '{name}' 검색={searches}회 발견={len(found)} 통과={len(links)} "
|
||||||
f"탈락={len(filtered_out)}({reason_text}) "
|
f"탈락={len(filtered_out)}({reason_text}) tokens={usage.get('total_tokens', '?')}"
|
||||||
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${usage.cost}"
|
|
||||||
)
|
)
|
||||||
if searches > SEARCH_COUNT_WARN_THRESHOLD:
|
if searches > SEARCH_COUNT_WARN_THRESHOLD:
|
||||||
LOG.w(
|
LOG.w(
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from common.logger import LOG
|
from common.logger import LOG
|
||||||
from services.llm.perplexity import DEFAULT_MAX_TOKENS, DEFAULT_MODEL, PerplexityError, call, read_usage
|
from services.llm.perplexity import DEFAULT_MAX_TOKENS, DEFAULT_MODEL, PerplexityError, call
|
||||||
from services.prompts.restaurant_search import RESPONSE_SCHEMA, SYSTEM_PROMPT, build_prompt
|
from services.prompts.restaurant_search import RESPONSE_SCHEMA, SYSTEM_PROMPT, build_prompt
|
||||||
|
|
||||||
MAX_RESULTS = 10
|
MAX_RESULTS = 10
|
||||||
@@ -54,10 +54,4 @@ async def search_region_restaurants(
|
|||||||
except PerplexityError as ex:
|
except PerplexityError as ex:
|
||||||
LOG.w(f"[restaurant_discovery] '{region_label}' 검색 실패: {ex}")
|
LOG.w(f"[restaurant_discovery] '{region_label}' 검색 실패: {ex}")
|
||||||
return []
|
return []
|
||||||
names = _parse_names(payload)
|
return _parse_names(payload)
|
||||||
usage = read_usage(payload)
|
|
||||||
LOG.i(
|
|
||||||
f"[restaurant_discovery] '{region_label}' {len(names)}곳 · "
|
|
||||||
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${usage.cost}"
|
|
||||||
)
|
|
||||||
return names
|
|
||||||
+29
-10
@@ -21,10 +21,8 @@ collector/tour_api_adapter.py 가 '사업장 1곳'의 fact 를 캐는 쪽이라
|
|||||||
진행 예정 축제(군산시간여행축제 등)는 끝내 안 잡혔다. searchFestival2 는 법정동(시도)
|
진행 예정 축제(군산시간여행축제 등)는 끝내 안 잡혔다. searchFestival2 는 법정동(시도)
|
||||||
단위로 묻지만 정확하고 기간까지 함께 준다 — 그래서 시도 전체를 받아 우리가 거리로 거른다.
|
단위로 묻지만 정확하고 기간까지 함께 준다 — 그래서 시도 전체를 받아 우리가 거리로 거른다.
|
||||||
eventStartDate 는 파라미터로 준 날짜 **이후 시작하는** 행사만 거른다(이전에 시작해 아직
|
eventStartDate 는 파라미터로 준 날짜 **이후 시작하는** 행사만 거른다(이전에 시작해 아직
|
||||||
진행 중인 행사는 잡히지 않는다 — 실측). 그래서 항상 **그 해 1월 1일**로 고정해 부른다.
|
진행 중인 행사는 잡히지 않는다 — 실측). 그래서 항상 **그 해 1월 1일**로 고정해 부르고,
|
||||||
종료된 행사도 그대로 싣는다(2026-09-17 결정) — 시작일을 2020년으로 당겨 실측해도 API 자체가
|
이미 끝난 행사(eventenddate < 오늘)만 우리가 한 번 더 거른다.
|
||||||
옛 행사를 추가로 주지 않아(최근~예정 위주) 여기서 더 거를 실익이 없고, 이미 끝난 축제를
|
|
||||||
보여줄지는 노출 단계(local_content_service)의 몫으로 넘긴다.
|
|
||||||
|
|
||||||
★ 이미지 저작권 — 수집 단계에서 끝낸다 (collector/tour_api_adapter.py 와 같은 규칙)
|
★ 이미지 저작권 — 수집 단계에서 끝낸다 (collector/tour_api_adapter.py 와 같은 규칙)
|
||||||
firstimage 는 공공누리 Type1(출처표시)·Type3(출처표시+변경금지)만 남긴다.
|
firstimage 는 공공누리 Type1(출처표시)·Type3(출처표시+변경금지)만 남긴다.
|
||||||
@@ -237,7 +235,7 @@ def _normalize_festival(item: dict, distance_m: int) -> Optional[dict]:
|
|||||||
|
|
||||||
★ `_normalize` 와 같은 규약이다 — 렌더러 이름으로 바꿔 내보내고, 저장 자리는 부르는 쪽이 정한다.
|
★ `_normalize` 와 같은 규약이다 — 렌더러 이름으로 바꿔 내보내고, 저장 자리는 부르는 쪽이 정한다.
|
||||||
★ 기간(eventstartdate/enddate)은 **원값 그대로** 남긴다. 화면 문자열("2026.10.01 ~ …")로 미리
|
★ 기간(eventstartdate/enddate)은 **원값 그대로** 남긴다. 화면 문자열("2026.10.01 ~ …")로 미리
|
||||||
구워 두면 정렬·계절 산출(site_payload._festival)이 읽을 값이 없어진다.
|
구워 두면 노출 기간 필터(`_festival_not_ended`·display_end_at)가 읽을 값이 없어진다.
|
||||||
날짜는 사실이고 문장은 표기다 — 사실만 저장한다.
|
날짜는 사실이고 문장은 표기다 — 사실만 저장한다.
|
||||||
"""
|
"""
|
||||||
content_id = str(item.get("contentid") or "").strip()
|
content_id = str(item.get("contentid") or "").strip()
|
||||||
@@ -268,19 +266,26 @@ def _normalize_festival(item: dict, distance_m: int) -> Optional[dict]:
|
|||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
def _festival_not_ended(body: dict, today: date) -> bool:
|
||||||
|
"""종료일이 지났으면 끝난 축제 — 신지 않는다. 기간을 아예 모르면 못 믿으니 역시 뺀다.
|
||||||
|
종료일 없이 시작일만 있으면(무기한 진행) 유지한다 — 끝났다는 증거가 없다."""
|
||||||
|
end, start = body.get("eventenddate"), body.get("eventstartdate")
|
||||||
|
ymd = today.strftime("%Y%m%d")
|
||||||
|
if end:
|
||||||
|
return len(end) == 8 and end.isdigit() and end >= ymd
|
||||||
|
return bool(start)
|
||||||
|
|
||||||
|
|
||||||
async def fetch_festivals_in_sido(client: httpx.AsyncClient, latitude: float, longitude: float,
|
async def fetch_festivals_in_sido(client: httpx.AsyncClient, latitude: float, longitude: float,
|
||||||
*, sido_code: str, today: date) -> list[dict]:
|
*, sido_code: str, today: date) -> list[dict]:
|
||||||
"""업장이 속한 시도의 축제 **전부**(정규화, 거리순, 종료 여부와 무관하게 전부). 반경으로 자르지 않는다.
|
"""업장이 속한 시도의 축제 **전부**(정규화, 거리순, 이미 끝난 것 제외). 반경으로 자르지 않는다.
|
||||||
|
|
||||||
★ 반경을 안 두는 이유(2026-09-08 결정): 축제는 차로 가는 행사라 20km 로 자르면 시도 안의
|
★ 반경을 안 두는 이유(2026-09-08 결정): 축제는 차로 가는 행사라 20km 로 자르면 시도 안의
|
||||||
큰 축제가 빠진다. 시도 전체를 그대로 싣고, 거리는 정렬·표시용으로만 잰다.
|
큰 축제가 빠진다. 시도 전체를 그대로 싣고, 거리는 정렬·표시용으로만 잰다.
|
||||||
(종류별 노출 상한은 스냅샷이 20건으로 자른다 — 사진 있는 것 우선 → 가까운 순.)
|
(종류별 노출 상한은 스냅샷이 20건으로 자른다 — 사진 있는 것 우선 → 가까운 순.)
|
||||||
★ locationBasedList2 의 위치 색인은 못 믿어서 searchFestival2 를 쓴다(위 모듈 docstring).
|
★ locationBasedList2 의 위치 색인은 못 믿어서 searchFestival2 를 쓴다(위 모듈 docstring).
|
||||||
eventStartDate 는 그 해 1월 1일로 **고정** — "오늘" 을 넣으면 그 이전에 시작해 아직 진행 중인
|
eventStartDate 는 그 해 1월 1일로 **고정** — "오늘" 을 넣으면 그 이전에 시작해 아직 진행 중인
|
||||||
축제가 파라미터 자체에서 빠진다(실측). 연초부터 전부 받는다.
|
축제가 파라미터 자체에서 빠진다(실측). 연초부터 전부 받고, 끝난 것만 여기서 거른다.
|
||||||
★ 종료된 축제도 거르지 않고 그대로 싣는다(2026-09-17 결정) — 시작일을 2020년으로 당겨 실측해도
|
|
||||||
API 가 옛 행사를 추가로 주지 않아 더 거를 실익이 없었고, 실제로 보여줄지는 노출 단계
|
|
||||||
(local_content_service.py — area_contents.display_end_at)가 정한다.
|
|
||||||
★ 좌표 없는 항목은 뺀다 — distance_m 이 NOT NULL 이고, 거리 없는 카드는 도보 필터에 못 얹는다.
|
★ 좌표 없는 항목은 뺀다 — distance_m 이 NOT NULL 이고, 거리 없는 카드는 도보 필터에 못 얹는다.
|
||||||
"""
|
"""
|
||||||
start_date = date(today.year, 1, 1).strftime("%Y%m%d")
|
start_date = date(today.year, 1, 1).strftime("%Y%m%d")
|
||||||
@@ -300,6 +305,8 @@ async def fetch_festivals_in_sido(client: httpx.AsyncClient, latitude: float, lo
|
|||||||
body = _normalize_festival(item, round(distance))
|
body = _normalize_festival(item, round(distance))
|
||||||
if not body or body["contentid"] in seen:
|
if not body or body["contentid"] in seen:
|
||||||
continue
|
continue
|
||||||
|
if not _festival_not_ended(body, today):
|
||||||
|
continue
|
||||||
seen.add(body["contentid"])
|
seen.add(body["contentid"])
|
||||||
out.append(body)
|
out.append(body)
|
||||||
if not items or page * PAGE_SIZE >= total:
|
if not items or page * PAGE_SIZE >= total:
|
||||||
@@ -327,3 +334,15 @@ async def fetch_content_class(client: httpx.AsyncClient, content_id: str) -> Opt
|
|||||||
return None
|
return None
|
||||||
code = str(items[0].get("lclsSystm2") or "").strip()
|
code = str(items[0].get("lclsSystm2") or "").strip()
|
||||||
return code or None
|
return code or None
|
||||||
|
|
||||||
|
|
||||||
|
def festival_is_current(period: Optional[tuple[str, str]], today: date) -> bool:
|
||||||
|
"""종료일이 지났으면 끝난 축제 — 싣지 않는다. 기간을 아예 모르면(None) 못 믿으니 역시 뺀다.
|
||||||
|
종료일 없이 시작일만 있으면(무기한 진행) 시작일이 지났어도 유지한다 — 끝났다는 증거가 없다."""
|
||||||
|
if not period:
|
||||||
|
return False
|
||||||
|
start, end = period
|
||||||
|
ymd = today.strftime("%Y%m%d")
|
||||||
|
if end:
|
||||||
|
return len(end) == 8 and end.isdigit() and end >= ymd
|
||||||
|
return bool(start)
|
||||||
@@ -126,8 +126,6 @@ async def _generate_one(
|
|||||||
courses: list[dict] = []
|
courses: list[dict] = []
|
||||||
seen: set[frozenset[str]] = set()
|
seen: set[frozenset[str]] = set()
|
||||||
notes: list[str] = []
|
notes: list[str] = []
|
||||||
total_in = total_out = 0
|
|
||||||
total_cost = 0.0
|
|
||||||
for attempt in range(1, MAX_ATTEMPTS + 1):
|
for attempt in range(1, MAX_ATTEMPTS + 1):
|
||||||
try:
|
try:
|
||||||
payload = await perplexity.call(body, client=client)
|
payload = await perplexity.call(body, client=client)
|
||||||
@@ -138,11 +136,6 @@ async def _generate_one(
|
|||||||
notes.append(f"{attempt}차 호출 실패: {ex}")
|
notes.append(f"{attempt}차 호출 실패: {ex}")
|
||||||
break # 같은 오류가 반복될 걸 재시도로 밀어붙이지 않는다 — 지금까지 모은 것만 쓴다
|
break # 같은 오류가 반복될 걸 재시도로 밀어붙이지 않는다 — 지금까지 모은 것만 쓴다
|
||||||
|
|
||||||
usage = perplexity.read_usage(payload)
|
|
||||||
total_in += usage.input_tokens
|
|
||||||
total_out += usage.output_tokens
|
|
||||||
total_cost += usage.cost
|
|
||||||
|
|
||||||
new_courses, dropped = grounding.parse_courses(
|
new_courses, dropped = grounding.parse_courses(
|
||||||
payload, duration, place_name, place_lat, place_lng, already_seen=seen)
|
payload, duration, place_name, place_lat, place_lng, already_seen=seen)
|
||||||
notes += dropped
|
notes += dropped
|
||||||
@@ -158,10 +151,7 @@ async def _generate_one(
|
|||||||
if len(courses) < TARGET_COURSES:
|
if len(courses) < TARGET_COURSES:
|
||||||
notes.append(f"{MAX_ATTEMPTS}차 시도 후에도 {len(courses)}/{TARGET_COURSES}개만 채웠다")
|
notes.append(f"{MAX_ATTEMPTS}차 시도 후에도 {len(courses)}/{TARGET_COURSES}개만 채웠다")
|
||||||
|
|
||||||
LOG.i(
|
LOG.i(f"[itinerary] {place_name} {duration}: {len(courses)}개 채택, {len(notes)}건 버림/안내")
|
||||||
f"[itinerary] {place_name} {duration}: {len(courses)}개 채택, {len(notes)}건 버림/안내 · "
|
|
||||||
f"tokens in={total_in} out={total_out} · 약 ${round(total_cost, 6)}"
|
|
||||||
)
|
|
||||||
return courses, notes
|
return courses, notes
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
"""공급자 무관 LLM 예외. Gemini·OpenAI 구현이 둘 다 이 클래스를 던진다.
|
|
||||||
|
|
||||||
★ 이름을 'Llm*'으로 새로 지었지만 services/llm/gemini.py 가 GeminiError = LlmError 식으로
|
|
||||||
같은 클래스를 재노출한다 — 기존 6개 파일의 `except GeminiNotConfigured` 는 한 글자도 안 바뀐다."""
|
|
||||||
|
|
||||||
|
|
||||||
class LlmError(RuntimeError):
|
|
||||||
"""LLM 호출 실패."""
|
|
||||||
|
|
||||||
|
|
||||||
class LlmNotConfigured(LlmError):
|
|
||||||
"""API 키 미설정 또는 인증 실패(401/403)."""
|
|
||||||
|
|
||||||
|
|
||||||
class LlmInvalidOutput(LlmError):
|
|
||||||
"""응답이 기대한 모양이 아니다."""
|
|
||||||
@@ -8,17 +8,11 @@
|
|||||||
여기가 책임지지 않는 것: 무엇을 물을지(services/prompts/), 답을 믿을지(services/grounding/).
|
여기가 책임지지 않는 것: 무엇을 물을지(services/prompts/), 답을 믿을지(services/grounding/).
|
||||||
"""
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
import base64
|
from dataclasses import dataclass
|
||||||
import json
|
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
from config.server_configs import external_api_config
|
from config.server_configs import external_api_config
|
||||||
from services.llm.errors import LlmError as GeminiError
|
|
||||||
from services.llm.errors import LlmInvalidOutput
|
|
||||||
from services.llm.errors import LlmInvalidOutput as GeminiInvalidOutput # noqa: F401 (하위 호환 재노출)
|
|
||||||
from services.llm.errors import LlmNotConfigured as GeminiNotConfigured
|
|
||||||
from services.llm.types import ImagePart, LlmResult, Usage
|
|
||||||
|
|
||||||
_BASE_URL = "https://generativelanguage.googleapis.com/v1beta/models"
|
_BASE_URL = "https://generativelanguage.googleapis.com/v1beta/models"
|
||||||
|
|
||||||
@@ -32,6 +26,28 @@ _PRICE_PER_1M_OUTPUT = {"gemini-3.7-flash": 3.75, "gemini-3.6-flash": 3.75, "gem
|
|||||||
_RETRYABLE_STATUS = {408, 429, 500, 502, 503, 504}
|
_RETRYABLE_STATUS = {408, 429, 500, 502, 503, 504}
|
||||||
|
|
||||||
|
|
||||||
|
class GeminiError(RuntimeError):
|
||||||
|
"""Gemini 호출 실패 — 호출측은 ErrorType.GENERATOR_CALL_FAILED 로 매핑한다."""
|
||||||
|
|
||||||
|
|
||||||
|
class GeminiNotConfigured(GeminiError):
|
||||||
|
"""GEMINI_API_KEY 미설정 또는 인증 실패.
|
||||||
|
|
||||||
|
★ 서버 부팅은 막지 않는다 — 이 어댑터만 비활성이고 나머지 파이프라인은 돈다."""
|
||||||
|
|
||||||
|
|
||||||
|
class GeminiInvalidOutput(GeminiError):
|
||||||
|
"""응답이 기대한 모양이 아니다 — ErrorType.GENERATOR_INVALID_OUTPUT."""
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Usage:
|
||||||
|
"""호출 1회(또는 여러 회 합산)의 토큰 사용량. 비용 로그의 근거다."""
|
||||||
|
|
||||||
|
input_tokens: int = 0
|
||||||
|
output_tokens: int = 0
|
||||||
|
|
||||||
|
|
||||||
def is_configured() -> bool:
|
def is_configured() -> bool:
|
||||||
"""키가 있는지 — 어댑터 등록/스킵 판단용. 예외를 던지지 않는다."""
|
"""키가 있는지 — 어댑터 등록/스킵 판단용. 예외를 던지지 않는다."""
|
||||||
return bool(external_api_config.gemini_api_key)
|
return bool(external_api_config.gemini_api_key)
|
||||||
@@ -105,37 +121,3 @@ def price(model: str, usage: Usage) -> float:
|
|||||||
inp = _PRICE_PER_1M_INPUT.get(model, 0.0) * usage.input_tokens / 1_000_000
|
inp = _PRICE_PER_1M_INPUT.get(model, 0.0) * usage.input_tokens / 1_000_000
|
||||||
out = _PRICE_PER_1M_OUTPUT.get(model, 0.0) * usage.output_tokens / 1_000_000
|
out = _PRICE_PER_1M_OUTPUT.get(model, 0.0) * usage.output_tokens / 1_000_000
|
||||||
return round(inp + out, 4)
|
return round(inp + out, 4)
|
||||||
|
|
||||||
|
|
||||||
async def generate(
|
|
||||||
client: httpx.AsyncClient,
|
|
||||||
model: str,
|
|
||||||
*,
|
|
||||||
prompt: str,
|
|
||||||
images: list[ImagePart] | None = None,
|
|
||||||
response_schema: dict | None = None,
|
|
||||||
temperature: float = 0.2,
|
|
||||||
max_retries: int = 2,
|
|
||||||
) -> LlmResult:
|
|
||||||
"""공급자 무관 인터페이스. services/llm/openai.py 가 같은 시그니처로 구현한다."""
|
|
||||||
parts: list[dict] = [{"text": prompt}]
|
|
||||||
for image in images or []:
|
|
||||||
if image.label:
|
|
||||||
parts.append({"text": image.label})
|
|
||||||
parts.append({"inline_data": {"mime_type": image.mime_type, "data": base64.b64encode(image.data).decode()}})
|
|
||||||
|
|
||||||
generation_config: dict = {"temperature": temperature}
|
|
||||||
if response_schema is not None:
|
|
||||||
generation_config["responseMimeType"] = "application/json"
|
|
||||||
generation_config["responseSchema"] = response_schema
|
|
||||||
|
|
||||||
body = {"contents": [{"role": "user", "parts": parts}], "generationConfig": generation_config}
|
|
||||||
payload = await call(client, model, body, max_retries)
|
|
||||||
text = extract_text(payload)
|
|
||||||
parsed = None
|
|
||||||
if response_schema is not None:
|
|
||||||
try:
|
|
||||||
parsed = json.loads(text)
|
|
||||||
except json.JSONDecodeError as ex:
|
|
||||||
raise LlmInvalidOutput(f"구조화 출력 파싱 실패: {ex}") from ex
|
|
||||||
return LlmResult(json=parsed, text=text, usage=read_usage(payload))
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
"""OpenAI Chat Completions 호출 — services/llm/gemini.py 와 같은 자리, 다른 공급자.
|
|
||||||
|
|
||||||
여기가 책임지는 것: 주소·인증 헤더·재시도·구조화 출력 스키마 변환·응답 파싱·토큰 집계·비용 계산.
|
|
||||||
여기가 책임지지 않는 것: 무엇을 물을지(services/prompts/), 답을 믿을지(services/grounding/)."""
|
|
||||||
import asyncio
|
|
||||||
import base64
|
|
||||||
import json
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from config.server_configs import external_api_config
|
|
||||||
from services.llm.errors import LlmError, LlmInvalidOutput, LlmNotConfigured
|
|
||||||
from services.llm.types import ImagePart, LlmResult, Usage
|
|
||||||
|
|
||||||
_BASE_URL = "https://api.openai.com/v1/chat/completions"
|
|
||||||
|
|
||||||
DEFAULT_MODEL = "gpt-5.6-luna"
|
|
||||||
|
|
||||||
_PRICE_PER_1M_INPUT = {"gpt-5.6-luna": 0.20, "gpt-5.6-terra": 2.00, "gpt-5.6-sol": 5.00}
|
|
||||||
_PRICE_PER_1M_OUTPUT = {"gpt-5.6-luna": 1.20, "gpt-5.6-terra": 12.00, "gpt-5.6-sol": 30.00}
|
|
||||||
|
|
||||||
_RETRYABLE_STATUS = {408, 429, 500, 502, 503, 504}
|
|
||||||
|
|
||||||
|
|
||||||
def is_configured() -> bool:
|
|
||||||
return bool(external_api_config.openai_api_key)
|
|
||||||
|
|
||||||
|
|
||||||
def _to_strict_schema(schema: dict) -> dict:
|
|
||||||
"""OpenAI strict 모드 요구사항(모든 object 에 additionalProperties:false,
|
|
||||||
모든 property 가 required)을 만족하도록 재귀 변환한다.
|
|
||||||
|
|
||||||
★ Gemini용 RESPONSE_SCHEMA(OpenAPI 서브셋, services/prompts/*.py)를 그대로 받아
|
|
||||||
변환한다 — 두 벌 관리하지 않는다."""
|
|
||||||
schema = dict(schema)
|
|
||||||
if schema.get("type") == "object" and "properties" in schema:
|
|
||||||
schema["properties"] = {k: _to_strict_schema(v) for k, v in schema["properties"].items()}
|
|
||||||
schema["required"] = list(schema["properties"].keys())
|
|
||||||
schema["additionalProperties"] = False
|
|
||||||
elif schema.get("type") == "array" and "items" in schema:
|
|
||||||
schema["items"] = _to_strict_schema(schema["items"])
|
|
||||||
return schema
|
|
||||||
|
|
||||||
|
|
||||||
def _build_messages(prompt: str, images: list[ImagePart] | None) -> list[dict]:
|
|
||||||
content: list[dict] = [{"type": "text", "text": prompt}]
|
|
||||||
for image in images or []:
|
|
||||||
if image.label:
|
|
||||||
content.append({"type": "text", "text": image.label})
|
|
||||||
b64 = base64.b64encode(image.data).decode()
|
|
||||||
content.append({"type": "image_url", "image_url": {"url": f"data:{image.mime_type};base64,{b64}"}})
|
|
||||||
return [{"role": "user", "content": content}]
|
|
||||||
|
|
||||||
|
|
||||||
async def generate(
|
|
||||||
client: httpx.AsyncClient,
|
|
||||||
model: str,
|
|
||||||
*,
|
|
||||||
prompt: str,
|
|
||||||
images: list[ImagePart] | None = None,
|
|
||||||
response_schema: dict | None = None,
|
|
||||||
temperature: float = 0.2,
|
|
||||||
max_retries: int = 2,
|
|
||||||
) -> LlmResult:
|
|
||||||
# ★ 실측(2026-09-16): gpt-5.6-luna 는 temperature 커스텀 값을 거부한다
|
|
||||||
# ("Only the default (1) value is supported" — 400). Gemini 와 달리 이 파라미터를
|
|
||||||
# 그냥 안 보낸다 — 공급자가 강제하는 값이라 우리가 흉내 낼 방법이 없다.
|
|
||||||
body: dict = {
|
|
||||||
"model": model,
|
|
||||||
"messages": _build_messages(prompt, images),
|
|
||||||
}
|
|
||||||
if response_schema is not None:
|
|
||||||
body["response_format"] = {
|
|
||||||
"type": "json_schema",
|
|
||||||
"json_schema": {"name": "result", "strict": True, "schema": _to_strict_schema(response_schema)},
|
|
||||||
}
|
|
||||||
|
|
||||||
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {external_api_config.openai_api_key}"}
|
|
||||||
last = None
|
|
||||||
payload = None
|
|
||||||
for attempt in range(max_retries + 1):
|
|
||||||
try:
|
|
||||||
resp = await client.post(_BASE_URL, json=body, headers=headers)
|
|
||||||
except (httpx.TimeoutException, httpx.TransportError) as ex:
|
|
||||||
last = f"{type(ex).__name__}: {ex}"
|
|
||||||
else:
|
|
||||||
if resp.status_code == 200:
|
|
||||||
payload = resp.json()
|
|
||||||
break
|
|
||||||
if resp.status_code in (401, 403):
|
|
||||||
raise LlmNotConfigured(f"인증 실패 status={resp.status_code} — API 키를 확인하세요")
|
|
||||||
if resp.status_code not in _RETRYABLE_STATUS:
|
|
||||||
raise LlmError(f"status={resp.status_code} body={resp.text[:200]}")
|
|
||||||
last = f"status={resp.status_code}"
|
|
||||||
|
|
||||||
if attempt < max_retries:
|
|
||||||
await asyncio.sleep(min(8.0, 1.0 * (2 ** attempt)))
|
|
||||||
|
|
||||||
if payload is None:
|
|
||||||
raise LlmError(f"{max_retries + 1}회 시도 실패: {last}")
|
|
||||||
|
|
||||||
choices = payload.get("choices") or []
|
|
||||||
if not choices:
|
|
||||||
raise LlmInvalidOutput("choices 가 비었다(안전 필터 차단 가능)")
|
|
||||||
text = (choices[0].get("message") or {}).get("content") or ""
|
|
||||||
if not text.strip():
|
|
||||||
raise LlmInvalidOutput(f"텍스트가 없다 finish_reason={choices[0].get('finish_reason')}")
|
|
||||||
|
|
||||||
parsed = None
|
|
||||||
if response_schema is not None:
|
|
||||||
try:
|
|
||||||
parsed = json.loads(text)
|
|
||||||
except json.JSONDecodeError as ex:
|
|
||||||
raise LlmInvalidOutput(f"구조화 출력 파싱 실패: {ex}") from ex
|
|
||||||
|
|
||||||
usage_raw = payload.get("usage") or {}
|
|
||||||
usage = Usage(
|
|
||||||
input_tokens=int(usage_raw.get("prompt_tokens") or 0),
|
|
||||||
output_tokens=int(usage_raw.get("completion_tokens") or 0),
|
|
||||||
)
|
|
||||||
return LlmResult(json=parsed, text=text, usage=usage)
|
|
||||||
|
|
||||||
|
|
||||||
def price(model: str, usage: Usage) -> float:
|
|
||||||
inp = _PRICE_PER_1M_INPUT.get(model, 0.0) * usage.input_tokens / 1_000_000
|
|
||||||
out = _PRICE_PER_1M_OUTPUT.get(model, 0.0) * usage.output_tokens / 1_000_000
|
|
||||||
return round(inp + out, 4)
|
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
나중에 환각을 추적할 수 있게 한다.
|
나중에 환각을 추적할 수 있게 한다.
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
from dataclasses import dataclass
|
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
@@ -37,39 +36,6 @@ def is_configured() -> bool:
|
|||||||
return bool((external_api_config.perplexity_api_key or "").strip())
|
return bool((external_api_config.perplexity_api_key or "").strip())
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class Usage:
|
|
||||||
"""호출 1회의 실제 사용량·비용.
|
|
||||||
|
|
||||||
★ cost 는 우리가 계산한 값이 아니라 Perplexity 가 응답에 직접 실어주는 실제 청구액(USD)이다
|
|
||||||
(`usage.cost.total_cost`) — 검색 컨텍스트 요금(request_cost)까지 포함된 진짜 값이라,
|
|
||||||
Gemini·OpenAI 처럼 토큰 단가표로 역산하는 것보다 정확하다.
|
|
||||||
★ 실측(2026-09-16): `usage.cost` 는 평평한 숫자가 아니라
|
|
||||||
`{"input_tokens_cost", "output_tokens_cost", "request_cost", "total_cost"}` 객체다 —
|
|
||||||
문서 예시(평평한 숫자)와 다르다. num_search_queries 는 비용은 아니지만 검색 남용 감시용으로 같이 둔다."""
|
|
||||||
|
|
||||||
input_tokens: int = 0
|
|
||||||
output_tokens: int = 0
|
|
||||||
num_search_queries: int = 0
|
|
||||||
cost: float = 0.0
|
|
||||||
|
|
||||||
|
|
||||||
def read_usage(payload: dict) -> Usage:
|
|
||||||
"""응답의 usage 를 읽는다. 필드가 없거나 모양이 다르면 0 — 계측 실패가 본 기능을 막으면 안 된다."""
|
|
||||||
u = payload.get("usage") or {}
|
|
||||||
cost_field = u.get("cost")
|
|
||||||
if isinstance(cost_field, dict):
|
|
||||||
cost = cost_field.get("total_cost")
|
|
||||||
else:
|
|
||||||
cost = cost_field
|
|
||||||
return Usage(
|
|
||||||
input_tokens=int(u.get("prompt_tokens") or 0),
|
|
||||||
output_tokens=int(u.get("completion_tokens") or 0),
|
|
||||||
num_search_queries=int(u.get("num_search_queries") or 0),
|
|
||||||
cost=float(cost) if isinstance(cost, (int, float)) else 0.0,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def call(body: dict, *, client: httpx.AsyncClient | None = None) -> dict:
|
async def call(body: dict, *, client: httpx.AsyncClient | None = None) -> dict:
|
||||||
"""★ LLM 이 실제로 불리는 지점. chat/completions 1회.
|
"""★ LLM 이 실제로 불리는 지점. chat/completions 1회.
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
"""LLM_PROVIDER 설정으로 gemini/openai 구현 중 하나를 고른다.
|
|
||||||
|
|
||||||
★ 모르는 값은 gemini 로 떨어진다 — 오타 하나로 사진분류·소개문·FAQ 가 전부
|
|
||||||
조용히 꺼지는 것보다, 기존에 검증된 공급자로 계속 도는 쪽이 안전하다."""
|
|
||||||
from config.server_configs import external_api_config
|
|
||||||
from services.llm import gemini, openai
|
|
||||||
|
|
||||||
|
|
||||||
def active():
|
|
||||||
return openai if external_api_config.llm_provider == "openai" else gemini
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
"""공급자 무관 값 타입. gemini.py·openai.py 가 동일하게 이 타입을 쓰고 돌려준다."""
|
|
||||||
from dataclasses import dataclass
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class Usage:
|
|
||||||
input_tokens: int = 0
|
|
||||||
output_tokens: int = 0
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class ImagePart:
|
|
||||||
mime_type: str
|
|
||||||
data: bytes
|
|
||||||
label: str = "" # 있으면 이 이미지 직전에 라벨 텍스트를 넣는다(사진 여러 장을 ref로 매칭할 때 쓴다)
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class LlmResult:
|
|
||||||
"""generate() 의 반환값.
|
|
||||||
|
|
||||||
json: response_schema 를 줬을 때 파싱된 결과(스키마 없이 부르면 None).
|
|
||||||
text: 원문 텍스트(요약처럼 스키마 없는 호출에서 이걸 쓴다)."""
|
|
||||||
|
|
||||||
json: Optional[dict]
|
|
||||||
text: str
|
|
||||||
usage: Usage
|
|
||||||
@@ -49,6 +49,21 @@ RESTAURANT_RADIUS_M = 5_000
|
|||||||
ATTRACTION_RADIUS_M = 10_000
|
ATTRACTION_RADIUS_M = 10_000
|
||||||
|
|
||||||
|
|
||||||
|
def _festival_display_end(body: dict) -> datetime | None:
|
||||||
|
"""eventenddate(YYYYMMDD) → 그 날 KST 자정(다음날 00:00) UTC.
|
||||||
|
|
||||||
|
★ 이 값이 있어야 끝난 축제가 발행본에서 저절로 빠진다 —
|
||||||
|
스냅샷의 노출창 필터(snapshot._local_contents)가 display_end_at 을 본다."""
|
||||||
|
raw = str(body.get("eventenddate") or "").strip()
|
||||||
|
if len(raw) != 8 or not raw.isdigit():
|
||||||
|
return None
|
||||||
|
try:
|
||||||
|
end_day = datetime(int(raw[:4]), int(raw[4:6]), int(raw[6:]), tzinfo=_KST)
|
||||||
|
except ValueError:
|
||||||
|
return None
|
||||||
|
return (end_day + timedelta(days=1)).astimezone(timezone.utc)
|
||||||
|
|
||||||
|
|
||||||
def _as_float(value) -> float | None:
|
def _as_float(value) -> float | None:
|
||||||
try:
|
try:
|
||||||
return float(value) if value is not None else None
|
return float(value) if value is not None else None
|
||||||
@@ -180,8 +195,9 @@ class LocalContentService:
|
|||||||
# ★ has_image 컬럼은 두지 않는다 — body.firstimage 가 이미 그 사실이다.
|
# ★ has_image 컬럼은 두지 않는다 — body.firstimage 가 이미 그 사실이다.
|
||||||
# 같은 값을 두 곳에 두면 한쪽만 갱신되는 날이 온다.
|
# 같은 값을 두 곳에 두면 한쪽만 갱신되는 날이 온다.
|
||||||
"status": LocalContentStatus.PUBLISHED.value,
|
"status": LocalContentStatus.PUBLISHED.value,
|
||||||
# ★ 축제도 종료일과 무관하게 노출한다(2026-09-17 결정) — display_end_at 을 두지 않는다.
|
"display_end_at": (
|
||||||
"display_end_at": None,
|
_festival_display_end(body) if body["content_type"] == LocalContentType.FESTIVAL.value else None
|
||||||
|
),
|
||||||
"collected_at": now,
|
"collected_at": now,
|
||||||
}
|
}
|
||||||
write_err = await DB_SESSION_MNG.execute_lambda_run(
|
write_err = await DB_SESSION_MNG.execute_lambda_run(
|
||||||
|
|||||||
@@ -98,11 +98,7 @@ async def research_place(place, place_id: str) -> dict:
|
|||||||
return {"error": str(ex)}
|
return {"error": str(ex)}
|
||||||
|
|
||||||
items, dropped = grounding.parse_items(payload, name, prompts.MAX_ITEMS)
|
items, dropped = grounding.parse_items(payload, name, prompts.MAX_ITEMS)
|
||||||
usage = perplexity.read_usage(payload)
|
LOG.i(f"[research] '{name}' 조사 {len(items)}건 채택, {len(dropped)}건 버림")
|
||||||
LOG.i(
|
|
||||||
f"[research] '{name}' 조사 {len(items)}건 채택, {len(dropped)}건 버림 · "
|
|
||||||
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${usage.cost}"
|
|
||||||
)
|
|
||||||
if not items:
|
if not items:
|
||||||
return {"items": 0, "dropped": dropped}
|
return {"items": 0, "dropped": dropped}
|
||||||
|
|
||||||
|
|||||||
@@ -1,55 +1,55 @@
|
|||||||
{
|
{
|
||||||
"_generated": "npm run export:prompts — 손으로 고치지 않는다",
|
"_generated": "npm run export:prompts — 손으로 고치지 않는다",
|
||||||
"rules": "\r\n[공통 규칙]\r\n1. JSON 하나만 출력한다. 인사말·설명·코드펜스를 붙이지 않는다.\r\n2. 확인되지 않은 값은 필드를 통째로 뺀다. 빈 문자열로 채우거나 지어내지 않는다.\r\n3. source.url 은 실제로 열리는 공식·기관·언론 페이지여야 한다. 검색 결과 주소는 쓰지 않는다.\r\n4. 근거가 확실하면 verified 를 \"확인\", 애매하면 \"확인필요\" 로 적는다. 애매한 걸 \"확인\" 으로 올리지 않는다.\r\n5. 가사·시·소설의 원문을 한 줄도 옮기지 않는다. 제목과 배경만 쓴다.\r\n6. 설명 문장은 항목당 두 문장을 넘기지 않는다.\r\n7. 이미지 주소는 만들지 않는다. 필요하면 imageQuery 에 검색어만 적는다.\r\n",
|
"rules": "\n[공통 규칙]\n1. JSON 하나만 출력한다. 인사말·설명·코드펜스를 붙이지 않는다.\n2. 확인되지 않은 값은 필드를 통째로 뺀다. 빈 문자열로 채우거나 지어내지 않는다.\n3. source.url 은 실제로 열리는 공식·기관·언론 페이지여야 한다. 검색 결과 주소는 쓰지 않는다.\n4. 근거가 확실하면 verified 를 \"확인\", 애매하면 \"확인필요\" 로 적는다. 애매한 걸 \"확인\" 으로 올리지 않는다.\n5. 가사·시·소설의 원문을 한 줄도 옮기지 않는다. 제목과 배경만 쓴다.\n6. 설명 문장은 항목당 두 문장을 넘기지 않는다.\n7. 이미지 주소는 만들지 않는다. 필요하면 imageQuery 에 검색어만 적는다.\n",
|
||||||
"specs": {
|
"specs": {
|
||||||
"songs": {
|
"songs": {
|
||||||
"kind": "songs",
|
"kind": "songs",
|
||||||
"label": "가요 다방",
|
"label": "가요 다방",
|
||||||
"maxItems": 8,
|
"maxItems": 8,
|
||||||
"task": "[해야 할 일]\r\n[지역]을 노래한 대중가요를 8곡까지 찾아 아래 JSON 으로 정리한다.\r\n1960~80년대 곡을 우선하고, 지명·항구·강·다리가 제목이나 배경에 나오는 곡을 고른다.\r\n\r\n[스키마]\r\n{ \"kind\":\"songs\", \"version\":1, \"title\":\"가요 다방\", \"subtitle\":\"...\", \"items\":[\r\n { \"title\":\"곡명\", \"artist\":\"가수\", \"lyricist\":\"작사\", \"composer\":\"작곡\",\r\n \"year\":1966, \"label\":\"음반사\", \"labelColor\":\"#d4551f\",\r\n \"story\":\"곡의 배경 (두 문장 이내, 가사 없이)\",\r\n \"connection\":\"[업소]와 이 곡을 잇는 한 문장\",\r\n \"verified\":\"확인|확인필요\",\r\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
"task": "[해야 할 일]\n[지역]을 노래한 대중가요를 8곡까지 찾아 아래 JSON 으로 정리한다.\n1960~80년대 곡을 우선하고, 지명·항구·강·다리가 제목이나 배경에 나오는 곡을 고른다.\n\n[스키마]\n{ \"kind\":\"songs\", \"version\":1, \"title\":\"가요 다방\", \"subtitle\":\"...\", \"items\":[\n { \"title\":\"곡명\", \"artist\":\"가수\", \"lyricist\":\"작사\", \"composer\":\"작곡\",\n \"year\":1966, \"label\":\"음반사\", \"labelColor\":\"#d4551f\",\n \"story\":\"곡의 배경 (두 문장 이내, 가사 없이)\",\n \"connection\":\"[업소]와 이 곡을 잇는 한 문장\",\n \"verified\":\"확인|확인필요\",\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
||||||
"rules": "\r\n[이 아이템만의 규칙]\r\n· lyrics 필드는 스키마에 없다. 어떤 이유로도 만들지 마라. 가사 한 소절도 안 된다.\r\n· labelColor 는 레코드 라벨 색이다. 곡의 분위기에 맞춰 진한 색 하나를 hex 로 고른다.\r\n **이건 사실이 아니라 디자인 값이다 — 공통 규칙 2 를 적용하지 말고 곡마다 반드시 채운다.**\r\n 앞뒤 곡과 같은 색을 쓰지 않는다. 비워 두면 판이 전부 한 색으로 깔린다(실측 2026-09-15:\r\n 67곡 중 63곡이 비어 있었다).\r\n· 작사·작곡·발표연도를 모르면 그 필드를 뺀다. \"미상\" 이라고 쓰지 않는다.\r\n"
|
"rules": "\n[이 아이템만의 규칙]\n· lyrics 필드는 스키마에 없다. 어떤 이유로도 만들지 마라. 가사 한 소절도 안 된다.\n· labelColor 는 레코드 라벨 색이다. 곡의 분위기에 맞춰 진한 색 하나를 hex 로 고른다.\n **이건 사실이 아니라 디자인 값이다 — 공통 규칙 2 를 적용하지 말고 곡마다 반드시 채운다.**\n 앞뒤 곡과 같은 색을 쓰지 않는다. 비워 두면 판이 전부 한 색으로 깔린다(실측 2026-09-15:\n 67곡 중 63곡이 비어 있었다).\n· 작사·작곡·발표연도를 모르면 그 필드를 뺀다. \"미상\" 이라고 쓰지 않는다.\n"
|
||||||
},
|
},
|
||||||
"daily": {
|
"daily": {
|
||||||
"kind": "daily",
|
"kind": "daily",
|
||||||
"label": "오늘의 한 장",
|
"label": "오늘의 한 장",
|
||||||
"maxItems": 30,
|
"maxItems": 30,
|
||||||
"task": "[해야 할 일]\r\n[지역]의 이야깃거리를 30개 찾아, 하루에 하나씩 뜯어 보는 일력용 JSON 으로 만든다.\r\n같은 주제를 두 번 쓰지 않는다. 계절이 맞는 날짜에 배치한다(축제는 실제 개최 시기에).\r\n\r\n[스키마]\r\n{ \"kind\":\"daily\", \"version\":1, \"title\":\"오늘의 한 장\", \"items\":[\r\n { \"monthDay\":\"09-02\", \"category\":\"역사|인물|장소|음식|축제|바다|문학\",\r\n \"title\":\"제목\", \"body\":\"두 문장 이내\", \"season\":\"봄|여름|가을|겨울\",\r\n \"tags\":[\"#태그\"], \"verified\":\"확인|확인필요\",\r\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
"task": "[해야 할 일]\n[지역]의 이야깃거리를 30개 찾아, 하루에 하나씩 뜯어 보는 일력용 JSON 으로 만든다.\n같은 주제를 두 번 쓰지 않는다. 계절이 맞는 날짜에 배치한다(축제는 실제 개최 시기에).\n\n[스키마]\n{ \"kind\":\"daily\", \"version\":1, \"title\":\"오늘의 한 장\", \"items\":[\n { \"monthDay\":\"09-02\", \"category\":\"역사|인물|장소|음식|축제|바다|문학\",\n \"title\":\"제목\", \"body\":\"두 문장 이내\", \"season\":\"봄|여름|가을|겨울\",\n \"tags\":[\"#태그\"], \"verified\":\"확인|확인필요\",\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
||||||
"rules": "\r\n[이 아이템만의 규칙]\r\n· monthDay 는 MM-DD 다. 연도를 넣지 않는다 — 해마다 다시 쓰는 일력이다.\r\n· 30개를 억지로 채우지 마라. 확실한 것이 12개면 12개만 낸다.\r\n· 같은 장소를 계절만 바꿔 반복하지 않는다.\r\n"
|
"rules": "\n[이 아이템만의 규칙]\n· monthDay 는 MM-DD 다. 연도를 넣지 않는다 — 해마다 다시 쓰는 일력이다.\n· 30개를 억지로 채우지 마라. 확실한 것이 12개면 12개만 낸다.\n· 같은 장소를 계절만 바꿔 반복하지 않는다.\n"
|
||||||
},
|
},
|
||||||
"people": {
|
"people": {
|
||||||
"kind": "people",
|
"kind": "people",
|
||||||
"label": "인물 열전",
|
"label": "인물 열전",
|
||||||
"maxItems": 10,
|
"maxItems": 10,
|
||||||
"task": "[해야 할 일]\r\n[지역] 출신이거나 [지역]과 깊이 얽힌 인물을 10명까지 찾는다.\r\n문학·음악·미술·역사 인물을 고루 섞고, 생존 인물은 공개된 사실만 쓴다.\r\n\r\n[스키마]\r\n{ \"kind\":\"people\", \"version\":1, \"title\":\"인물 열전\", \"items\":[\r\n { \"name\":\"이름\", \"aka\":\"호·예명\", \"years\":\"1902–1950\", \"role\":\"소설가\",\r\n \"oneLine\":\"한 문장 소개\", \"imageQuery\":\"사진 검색어\",\r\n \"verified\":\"확인|확인필요\",\r\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
"task": "[해야 할 일]\n[지역] 출신이거나 [지역]과 깊이 얽힌 인물을 10명까지 찾는다.\n문학·음악·미술·역사 인물을 고루 섞고, 생존 인물은 공개된 사실만 쓴다.\n\n[스키마]\n{ \"kind\":\"people\", \"version\":1, \"title\":\"인물 열전\", \"items\":[\n { \"name\":\"이름\", \"aka\":\"호·예명\", \"years\":\"1902–1950\", \"role\":\"소설가\",\n \"oneLine\":\"한 문장 소개\", \"imageQuery\":\"사진 검색어\",\n \"verified\":\"확인|확인필요\",\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
||||||
"rules": "\r\n[이 아이템만의 규칙]\r\n· \"~ 출신으로 알려진\" 처럼 근거가 전언뿐이면 verified 를 \"확인필요\" 로 한다.\r\n· 생존 인물의 가족·거주지·건강 같은 사생활은 쓰지 않는다.\r\n· 사진 URL 을 넣지 않는다. imageQuery 만 넣는다 — 초상권과 저작권은 사장님이 확인한다.\r\n"
|
"rules": "\n[이 아이템만의 규칙]\n· \"~ 출신으로 알려진\" 처럼 근거가 전언뿐이면 verified 를 \"확인필요\" 로 한다.\n· 생존 인물의 가족·거주지·건강 같은 사생활은 쓰지 않는다.\n· 사진 URL 을 넣지 않는다. imageQuery 만 넣는다 — 초상권과 저작권은 사장님이 확인한다.\n"
|
||||||
},
|
},
|
||||||
"chronicle": {
|
"chronicle": {
|
||||||
"kind": "chronicle",
|
"kind": "chronicle",
|
||||||
"label": "시간의 골목",
|
"label": "시간의 골목",
|
||||||
"maxItems": 14,
|
"maxItems": 14,
|
||||||
"task": "[해야 할 일]\r\n[지역]의 역사를 연도순으로 10~14개 사건으로 정리한다.\r\n가장 오래된 것부터 가장 최근까지 고르게 펴고, 한 시대에 몰지 않는다.\r\n\r\n[스키마]\r\n{ \"kind\":\"chronicle\", \"version\":1, \"title\":\"시간의 골목\", \"items\":[\r\n { \"year\":1899, \"title\":\"사건 이름\", \"summary\":\"두 문장 이내\",\r\n \"place\":\"지금 가 볼 수 있는 자리\", \"turning\":true,\r\n \"verified\":\"확인|확인필요\",\r\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
"task": "[해야 할 일]\n[지역]의 역사를 연도순으로 10~14개 사건으로 정리한다.\n가장 오래된 것부터 가장 최근까지 고르게 펴고, 한 시대에 몰지 않는다.\n\n[스키마]\n{ \"kind\":\"chronicle\", \"version\":1, \"title\":\"시간의 골목\", \"items\":[\n { \"year\":1899, \"title\":\"사건 이름\", \"summary\":\"두 문장 이내\",\n \"place\":\"지금 가 볼 수 있는 자리\", \"turning\":true,\n \"verified\":\"확인|확인필요\",\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
||||||
"rules": "\r\n[이 아이템만의 규칙]\r\n· turning 은 도시의 성격을 바꾼 해에만 true 다. 3~4개를 넘기지 않는다.\r\n· 연도가 불확실하면 그 항목을 통째로 뺀다. 연표에서 틀린 연도는 바로 들킨다.\r\n· place 는 지금도 찾아갈 수 있는 자리만 적는다. 없으면 필드를 뺀다.\r\n· 다만 **찾아갈 수 있는 자리가 있으면 반드시 적는다.** 행정 개편처럼 장소가 없어 보이는\r\n 사건에도 그 일이 남긴 자리가 대개 있다(개항 → 항구, 부두 건설 → 그 부두, 준공 → 그 구조물).\r\n 이 값으로 공공데이터에서 그 해의 사진을 찾아 붙인다 — 비면 연표가 활자만으로 선다.\r\n"
|
"rules": "\n[이 아이템만의 규칙]\n· turning 은 도시의 성격을 바꾼 해에만 true 다. 3~4개를 넘기지 않는다.\n· 연도가 불확실하면 그 항목을 통째로 뺀다. 연표에서 틀린 연도는 바로 들킨다.\n· place 는 지금도 찾아갈 수 있는 자리만 적는다. 없으면 필드를 뺀다.\n· 다만 **찾아갈 수 있는 자리가 있으면 반드시 적는다.** 행정 개편처럼 장소가 없어 보이는\n 사건에도 그 일이 남긴 자리가 대개 있다(개항 → 항구, 부두 건설 → 그 부두, 준공 → 그 구조물).\n 이 값으로 공공데이터에서 그 해의 사진을 찾아 붙인다 — 비면 연표가 활자만으로 선다.\n"
|
||||||
},
|
},
|
||||||
"reading": {
|
"reading": {
|
||||||
"kind": "reading",
|
"kind": "reading",
|
||||||
"label": "지역 읽기",
|
"label": "지역 읽기",
|
||||||
"maxItems": 16,
|
"maxItems": 34,
|
||||||
"task": "[해야 할 일]\r\n[지역] 출신이거나 [지역]과 깊이 얽힌 **인물**, [지역]을 무대로 하거나 다룬 **작품**의 이야기를\r\n갈래로 나눠 12~16꼭지 쓴다. 장소·역사·먹거리 소개는 다루지 않는다(각자 섹션이 있다).\r\n한 갈래에 몰지 않되, 댈 수 있는 사실이 적은 갈래는 적게 쓴다.\r\n\r\n[스키마]\r\n{ \"kind\":\"reading\", \"version\":1, \"title\":\"[지역] 읽기\",\r\n \"subtitle\":\"인물 · 문학 — 올 때마다 다른 몇 가지\",\r\n \"items\":[\r\n { \"group\":\"인물|문학\",\r\n \"title\":\"꼭지 제목\", \"body\":\"서너 문장\", \"year\":1937 } ] }",
|
"task": "[해야 할 일]\n[지역]을 소개하는 글 30~34꼭지를 갈래로 나눠 쓴다.\n갈래는 다섯이다 — 문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활.\n한 갈래에 몰지 않되, 댈 수 있는 사실이 적은 갈래는 적게 쓴다.\n\n[스키마]\n{ \"kind\":\"reading\", \"version\":1, \"title\":\"[지역] 읽기\",\n \"subtitle\":\"문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활 — 올 때마다 다른 몇 가지\",\n \"items\":[\n { \"group\":\"문학|섬과 바다|역사|장소|음식과 생활\",\n \"title\":\"꼭지 제목\", \"body\":\"서너 문장\", \"year\":1937 } ] }",
|
||||||
"rules": "\r\n[이 아이템만의 규칙]\r\n· body 는 **서너 문장**이다. 두 문장이면 카드가 한 줄로 접혀 빈 카드처럼 보인다.\r\n 다만 문장을 늘리려고 없는 숫자·연도·거리를 지어내지 않는다 — 널리 알려진 배경만 보탠다.\r\n· \"인물\" 은 그 인물의 개괄 소개(생몰년·직함 한 줄)가 아니라, **그 사람이 남긴 작품·활동·일화**\r\n 중심으로 쓴다. '인물 열전' 섹션과 같은 사람을 다뤄도 되지만, 거기 있는 소개 문장을 반복하지\r\n 않는다 — 인물 열전에 없는 사람이어도 좋다.\r\n· \"문학\" 은 그 지역을 무대로 하거나 다룬 작품(소설·시·수필 등)의 배경과 이야기를 쓴다.\r\n· **장소·역사·먹거리 소개, 그리고 대중가요·축제·연표 사건·주변 명소·맛집처럼 이미 다른 자리에\r\n 선 것은 쓰지 않는다.** 같은 것을 두 번 세우면 페이지만 길어지고 손님은 같은 말을 두 번 읽는다.\r\n· year 는 연도를 댈 수 있는 꼭지에만 쓴다. 짐작해서 넣지 않는다.\r\n· source 와 verified 를 적지 않는다. **주소를 짐작해 적으면 없는 문서로 이어진다** —\r\n 제목으로 찾아가는 검색 링크를 서버가 붙인다(2026-09-14 대표 지시).\r\n· 시·소설·가사의 원문을 한 줄도 옮기지 않는다. 제목과 배경만 쓴다.\r\n· 부제에 전체 개수를 적지 않는다. 화면은 이 중 5~6개만 매번 무작위로 보여준다 —\r\n 숫자를 박으면 보이는 개수와 어긋난다.\r\n"
|
"rules": "\n[이 아이템만의 규칙]\n· body 는 **서너 문장**이다. 두 문장이면 카드가 한 줄로 접혀 빈 카드처럼 보인다.\n 다만 문장을 늘리려고 없는 숫자·연도·거리를 지어내지 않는다 — 널리 알려진 배경만 보탠다.\n· **이미 다른 자리에 선 것은 쓰지 않는다.** 인물·대중가요·축제·연표 사건·주변 명소·맛집은\n 각자 섹션이 있다. 같은 것을 두 번 세우면 페이지만 길어지고 손님은 같은 말을 두 번 읽는다.\n· year 는 연도를 댈 수 있는 꼭지에만 쓴다. 짐작해서 넣지 않는다.\n· source 와 verified 를 적지 않는다. **주소를 짐작해 적으면 없는 문서로 이어진다** —\n 제목으로 찾아가는 검색 링크를 서버가 붙인다(2026-09-14 대표 지시).\n· 시·소설·가사의 원문을 한 줄도 옮기지 않는다. 제목과 배경만 쓴다.\n· 부제에 전체 개수를 적지 않는다. 화면은 이 중 5~6개만 매번 무작위로 보여준다 —\n 숫자를 박으면 보이는 개수와 어긋난다.\n"
|
||||||
},
|
},
|
||||||
"postcard": {
|
"postcard": {
|
||||||
"kind": "postcard",
|
"kind": "postcard",
|
||||||
"label": "오늘의 엽서",
|
"label": "오늘의 엽서",
|
||||||
"maxItems": 12,
|
"maxItems": 12,
|
||||||
"task": "[해야 할 일]\r\n[지역]에 대해 손님이 자기 SNS 에 그대로 붙여 쓸 만한 한 문장을 12개 쓴다.\r\n사실 하나가 반드시 들어가되, 설명하지 말고 툭 던지는 문장으로 쓴다.\r\n\r\n[스키마]\r\n{ \"kind\":\"postcard\", \"version\":1, \"title\":\"오늘의 엽서\", \"items\":[\r\n { \"line\":\"한 문장\", \"hashtags\":[\"#태그\"], \"place\":\"장소\",\r\n \"postmark\":\"소인에 찍을 짧은 지명\",\r\n \"verified\":\"확인|확인필요\",\r\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
"task": "[해야 할 일]\n[지역]에 대해 손님이 자기 SNS 에 그대로 붙여 쓸 만한 한 문장을 12개 쓴다.\n사실 하나가 반드시 들어가되, 설명하지 말고 툭 던지는 문장으로 쓴다.\n\n[스키마]\n{ \"kind\":\"postcard\", \"version\":1, \"title\":\"오늘의 엽서\", \"items\":[\n { \"line\":\"한 문장\", \"hashtags\":[\"#태그\"], \"place\":\"장소\",\n \"postmark\":\"소인에 찍을 짧은 지명\",\n \"verified\":\"확인|확인필요\",\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
||||||
"rules": "\r\n[이 아이템만의 규칙]\r\n· 한 문장은 40자 안쪽이다. 두 문장으로 쓰지 않는다.\r\n· 느낌표와 이모지를 쓰지 않는다. 광고 문구처럼 들리면 실패다.\r\n· 해시태그는 3개까지. 지역명 하나는 반드시 넣는다.\r\n· **같은 대상을 두 번 쓰지 않는다.** 열두 장이 전부 다른 곳·다른 이야기여야 한다 —\r\n 한 시설의 주소·휴관일·운영시간을 나눠 적으면 엽서가 아니라 안내문 열두 장이 된다\r\n (실측 2026-09-10: 네 장이 같은 박물관의 관람안내였다).\r\n· 운영시간·휴관일·주소·요금은 엽서에 적지 않는다. 그건 이용 정보지 엽서 문장이 아니다.\r\n· place 는 사진을 찾는 열쇠다. **찾아갈 수 있는 곳 이름을 정확히** 적는다 —\r\n 이 값으로 공공데이터에서 앞면 사진을 찾고, 못 찾으면 그 엽서는 실리지 않는다.\r\n"
|
"rules": "\n[이 아이템만의 규칙]\n· 한 문장은 40자 안쪽이다. 두 문장으로 쓰지 않는다.\n· 느낌표와 이모지를 쓰지 않는다. 광고 문구처럼 들리면 실패다.\n· 해시태그는 3개까지. 지역명 하나는 반드시 넣는다.\n· **같은 대상을 두 번 쓰지 않는다.** 열두 장이 전부 다른 곳·다른 이야기여야 한다 —\n 한 시설의 주소·휴관일·운영시간을 나눠 적으면 엽서가 아니라 안내문 열두 장이 된다\n (실측 2026-09-10: 네 장이 같은 박물관의 관람안내였다).\n· 운영시간·휴관일·주소·요금은 엽서에 적지 않는다. 그건 이용 정보지 엽서 문장이 아니다.\n· place 는 사진을 찾는 열쇠다. **찾아갈 수 있는 곳 이름을 정확히** 적는다 —\n 이 값으로 공공데이터에서 앞면 사진을 찾고, 못 찾으면 그 엽서는 실리지 않는다.\n"
|
||||||
},
|
},
|
||||||
"quiz": {
|
"quiz": {
|
||||||
"kind": "quiz",
|
"kind": "quiz",
|
||||||
"label": "뒤집어 보는 질문",
|
"label": "뒤집어 보는 질문",
|
||||||
"maxItems": 12,
|
"maxItems": 12,
|
||||||
"task": "[해야 할 일]\r\n[지역]을 소재로, 아이와 어른이 함께 생각해 볼 질문을 12개 만든다.\r\n질문은 검색하면 바로 나오는 단답형이 아니라 \"왜\" 와 \"어떻게\" 를 묻는 것으로 한다.\r\n\r\n[스키마]\r\n{ \"kind\":\"quiz\", \"version\":1, \"title\":\"뒤집어 보는 질문\", \"items\":[\r\n { \"question\":\"질문 한 문장\", \"hint\":\"두 문장 이내 힌트\",\r\n \"topic\":\"관련 장소·주제\", \"level\":\"초등|중등|어른\",\r\n \"verified\":\"확인|확인필요\",\r\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
"task": "[해야 할 일]\n[지역]을 소재로, 아이와 어른이 함께 생각해 볼 질문을 12개 만든다.\n질문은 검색하면 바로 나오는 단답형이 아니라 \"왜\" 와 \"어떻게\" 를 묻는 것으로 한다.\n\n[스키마]\n{ \"kind\":\"quiz\", \"version\":1, \"title\":\"뒤집어 보는 질문\", \"items\":[\n { \"question\":\"질문 한 문장\", \"hint\":\"두 문장 이내 힌트\",\n \"topic\":\"관련 장소·주제\", \"level\":\"초등|중등|어른\",\n \"verified\":\"확인|확인필요\",\n \"source\":{\"name\":\"출처명\",\"url\":\"https://...\"} } ] }",
|
||||||
"rules": "\r\n[이 아이템만의 규칙]\r\n· answer 필드는 스키마에 없다. 정답을 단정하지 않는다 — 힌트까지만 준다.\r\n· 힌트에 사실을 넣되, 확실하지 않으면 그 항목을 통째로 뺀다.\r\n· 질문에 지역 이름을 넣어 어디 이야기인지 알 수 있게 한다.\r\n"
|
"rules": "\n[이 아이템만의 규칙]\n· answer 필드는 스키마에 없다. 정답을 단정하지 않는다 — 힌트까지만 준다.\n· 힌트에 사실을 넣되, 확실하지 않으면 그 항목을 통째로 뺀다.\n· 질문에 지역 이름을 넣어 어디 이야기인지 알 수 있게 한다.\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ from common.logger import LOG
|
|||||||
from common.utils.gtime import GTime
|
from common.utils.gtime import GTime
|
||||||
from crud.place_crud import PlaceCRUD
|
from crud.place_crud import PlaceCRUD
|
||||||
from crud.site_crud import SiteCRUD
|
from crud.site_crud import SiteCRUD
|
||||||
from services import alert_service, azure_static, indexnow, publish_gate, render_service, site_payload
|
from services import azure_static, indexnow, publish_gate, render_service, site_payload
|
||||||
from services.build_service import ensure_site, load_channel_links
|
from services.build_service import ensure_site, load_channel_links
|
||||||
|
|
||||||
_site_crud = SiteCRUD()
|
_site_crud = SiteCRUD()
|
||||||
@@ -104,15 +104,6 @@ async def run_rollback(job: dict) -> dict:
|
|||||||
result["rolled_back"] = False
|
result["rolled_back"] = False
|
||||||
result["error"] = reason
|
result["error"] = reason
|
||||||
LOG.w(f"[rollback] place={place_id} v{target_version} 실패: {reason}")
|
LOG.w(f"[rollback] place={place_id} v{target_version} 실패: {reason}")
|
||||||
# ★ 게이트 반려는 알리지 않는다 — build_service._fail 과 같은 규칙(운영자를 부를
|
|
||||||
# 일이 아니다). 렌더·전환·업로드가 죽은 경우만 알린다.
|
|
||||||
if gate is None:
|
|
||||||
await alert_service.send_alert(
|
|
||||||
kind="build_failed",
|
|
||||||
title=f"롤백 실패 — {place_id} → v{target_version}",
|
|
||||||
detail=f"place_id={place_id} target_version={target_version}\n{reason}",
|
|
||||||
dedupe_key=f"build_failed:{place_id}",
|
|
||||||
)
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
# ★ snapshot 을 그대로 옮긴다 — 재수집하지 않는다(파일 머리주석 참조).
|
# ★ snapshot 을 그대로 옮긴다 — 재수집하지 않는다(파일 머리주석 참조).
|
||||||
@@ -161,7 +152,6 @@ async def run_rollback(job: dict) -> dict:
|
|||||||
sites.DBType(), lambda s: _site_crud.update_site(s, site.site_id, site_update)
|
sites.DBType(), lambda s: _site_crud.update_site(s, site.site_id, site_update)
|
||||||
)
|
)
|
||||||
await _log(site.site_id, version.site_version_id, PublishResult.SUCCESS, None, payload.get("requested_by"))
|
await _log(site.site_id, version.site_version_id, PublishResult.SUCCESS, None, payload.get("requested_by"))
|
||||||
await alert_service.resolve_alert(f"build_failed:{place_id}", f"롤백 성공 — {place_id} → v{target_version}")
|
|
||||||
|
|
||||||
result["rolled_back"] = True
|
result["rolled_back"] = True
|
||||||
LOG.i(f"[rollback] place={place_id} v{target_version} 로 되돌림")
|
LOG.i(f"[rollback] place={place_id} v{target_version} 로 되돌림")
|
||||||
|
|||||||
@@ -513,22 +513,10 @@ def _weather_condition(code) -> str:
|
|||||||
return "맑음"
|
return "맑음"
|
||||||
if 1 <= value <= 3:
|
if 1 <= value <= 3:
|
||||||
return "구름많음"
|
return "구름많음"
|
||||||
if value in (45, 48):
|
if 50 <= value <= 69:
|
||||||
return "안개"
|
|
||||||
if value in (51, 53, 55):
|
|
||||||
return "이슬비"
|
|
||||||
if value in (56, 57, 66, 67):
|
|
||||||
return "어는비"
|
|
||||||
if value in (61, 63):
|
|
||||||
return "비"
|
return "비"
|
||||||
if value == 65:
|
|
||||||
return "강한비"
|
|
||||||
if 70 <= value <= 79:
|
if 70 <= value <= 79:
|
||||||
return "눈"
|
return "눈"
|
||||||
if value in (80, 81, 82, 85, 86):
|
|
||||||
return "소나기"
|
|
||||||
if 95 <= value <= 99:
|
|
||||||
return "뇌우"
|
|
||||||
return "흐림"
|
return "흐림"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -210,17 +210,15 @@ async def _local_contents(place) -> dict:
|
|||||||
|
|
||||||
두 캐시를 합친다 —
|
두 캐시를 합친다 —
|
||||||
area_contents (region_code) 날씨 + 운영자가 수기로 발행한 항목
|
area_contents (region_code) 날씨 + 운영자가 수기로 발행한 항목
|
||||||
place_area_refs (place_id) TourAPI 반경 수집분(맛집·관광지·축제·여행코스). 숨김만 제외
|
place_area_refs (place_id) TourAPI 반경 수집분(맛집·관광지·축제·여행코스). 숨김·종료된 것 제외
|
||||||
(축제는 종료 여부와 무관하게 노출, 2026-09-17 결정)
|
|
||||||
|
|
||||||
★ 노출 가능 = PUBLISHED + 노출 기간 안.
|
★ 노출 가능 = PUBLISHED + 노출 기간 안.
|
||||||
area_contents.status 는 운영 관리자의 검수 결과다(REVIEW=1 · PUBLISHED=2 · ENDED=3).
|
area_contents.status 는 운영 관리자의 검수 결과다(REVIEW=1 · PUBLISHED=2 · ENDED=3).
|
||||||
REVIEW 는 아직 사람이 확인하지 않은 외부 API 원문이고, ENDED 는 내린 것이다.
|
REVIEW 는 아직 사람이 확인하지 않은 외부 API 원문이고, ENDED 는 내린 것이다.
|
||||||
둘 중 하나라도 사이트로 새면 '미검증 값 노출 금지'가 깨진다 — fact 를 VERIFIED/CORRECTED 로,
|
둘 중 하나라도 사이트로 새면 '미검증 값 노출 금지'가 깨진다 — fact 를 VERIFIED/CORRECTED 로,
|
||||||
사진을 APPROVED 로 거르는 것과 같은 규칙을 같은 이유로 적용한다.
|
사진을 APPROVED 로 거르는 것과 같은 규칙을 같은 이유로 적용한다.
|
||||||
display_start_at/display_end_at 은 운영자가 수기로 정한 노출 창이다(운영자가 걸어 둔 항목에만
|
display_start_at/display_end_at 은 운영자가 정한 노출 창이다. 기간이 지난 축제를
|
||||||
쓰인다 — TourAPI 로 긁은 축제는 종료 여부와 무관하게 둘 다 NULL, 2026-09-17 결정:
|
"이번 주말 행사"로 걸어두는 것도 틀린 정보라 여기서 함께 막는다.
|
||||||
services/external/tour_api.py, local_content_service.py 참고).
|
|
||||||
|
|
||||||
★ expires_at 은 보지 않는다. 모델 주석대로 그건 '갱신 대상'이라는 표시지 '못 쓰는 값'이 아니다
|
★ expires_at 은 보지 않는다. 모델 주석대로 그건 '갱신 대상'이라는 표시지 '못 쓰는 값'이 아니다
|
||||||
(외부 API 가 죽어도 직전 값을 유지하는 게 이 캐시의 규약이다). 게다가 날씨는 렌더러가
|
(외부 API 가 죽어도 직전 값을 유지하는 게 이 캐시의 규약이다). 게다가 날씨는 렌더러가
|
||||||
|
|||||||
@@ -23,6 +23,22 @@ def cipher():
|
|||||||
raise SocialError("SOCIAL_CONNECTION_DISABLED") from ex
|
raise SocialError("SOCIAL_CONNECTION_DISABLED") from ex
|
||||||
|
|
||||||
|
|
||||||
|
def token_ready():
|
||||||
|
"""저장된 토큰을 풀 수 있는가 — **게시의 전제**다.
|
||||||
|
|
||||||
|
★ 연결(OAuth)과 전제가 다르다. 연결은 앱 자격증명 셋(ID·시크릿·리디렉션 URI)이 있어야
|
||||||
|
시작할 수 있지만, **게시는 이미 받아 둔 사장님 토큰 하나면 된다**
|
||||||
|
(`threads.publish(text, token)` 이 그 토큰만 쓴다).
|
||||||
|
둘을 한 깃발로 묶으면 리디렉션 URI 가 아직 없다는 이유로 **게시까지 막힌다** —
|
||||||
|
실제로 그랬다(2026-09-15: 토큰은 있고 URI 만 없는데 게시가 열리지 않았다).
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
cipher()
|
||||||
|
return True
|
||||||
|
except SocialError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def configured(provider=2):
|
def configured(provider=2):
|
||||||
try:
|
try:
|
||||||
cipher()
|
cipher()
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ from common.database.model.models import (
|
|||||||
place_facts,
|
place_facts,
|
||||||
owner_social_accounts as Account,
|
owner_social_accounts as Account,
|
||||||
)
|
)
|
||||||
from common.enums import SiteStatus, ErrorType, PUBLISHABLE_FACT_STATUSES
|
from common.enums import SiteStatus, ErrorType, JobType, PUBLISHABLE_FACT_STATUSES
|
||||||
from crud.place_crud import PlaceCRUD
|
from crud.place_crud import PlaceCRUD
|
||||||
from crud import social_crud as db
|
from crud import social_crud as db
|
||||||
from services import site_payload, social_account_service as accounts
|
from services import site_payload, social_account_service as accounts
|
||||||
@@ -145,8 +145,14 @@ async def account_state(user_id, provider=2):
|
|||||||
|
|
||||||
|
|
||||||
def posting_enabled():
|
def posting_enabled():
|
||||||
# 플랫폼 계약과 해지 안내 페이지 정책을 운영에서 확인한 뒤 명시적으로 연다.
|
"""게시가 열려 있는가.
|
||||||
return accounts.configured() and config.get("SOCIAL_POSTING_ENABLED") == "1"
|
|
||||||
|
★ 연결(OAuth) 설정을 묻지 않는다 — 게시에 필요한 것은 **풀 수 있는 토큰**과 이 스위치뿐이다.
|
||||||
|
앱 자격증명·리디렉션 URI 는 계정을 새로 연결할 때만 쓴다(`accounts.token_ready` 주석).
|
||||||
|
★ 스위치는 사람이 연다. 플랫폼 계약과 해지 안내 페이지 정책(DECISIONS 1-4)을 확인한 뒤다 —
|
||||||
|
게시는 되돌릴 수 없다.
|
||||||
|
"""
|
||||||
|
return accounts.token_ready() and config.get("SOCIAL_POSTING_ENABLED") == "1"
|
||||||
|
|
||||||
|
|
||||||
async def create_draft(user_id, place_id, provider=2):
|
async def create_draft(user_id, place_id, provider=2):
|
||||||
@@ -218,7 +224,7 @@ async def create_draft(user_id, place_id, provider=2):
|
|||||||
await s.flush()
|
await s.flush()
|
||||||
row_id = row.post_id
|
row_id = row.post_id
|
||||||
if row_id:
|
if row_id:
|
||||||
await db.enqueue(s, row.post_id, 8)
|
await db.enqueue(s, row.post_id, JobType.SOCIAL_DRAFT.value)
|
||||||
return public_post(row)
|
return public_post(row)
|
||||||
|
|
||||||
return await db.transaction(run)
|
return await db.transaction(run)
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ def nol_stay_guide(url: str, raw) -> dict:
|
|||||||
lines.pop(0)
|
lines.pop(0)
|
||||||
# 제목 중복과 UI 버튼만 제외한다. 요약·추론 없이 수집 문장을 보존한다.
|
# 제목 중복과 UI 버튼만 제외한다. 요약·추론 없이 수집 문장을 보존한다.
|
||||||
body = "\n".join(line for line in lines if line.strip() != "전체보기").strip()
|
body = "\n".join(line for line in lines if line.strip() != "전체보기").strip()
|
||||||
# NOL 은 원 플랫폼 브랜드다 — 사장님 사이트에 그대로 실으면 남의 고객센터·정책을
|
|
||||||
# 우리 것처럼 안내하게 된다. 문장 자체는 그대로 두고 그 단어만 지운다.
|
|
||||||
body = re.sub(r"NOL\s*", "", body)
|
|
||||||
if body:
|
if body:
|
||||||
guide[labels[label]] = body
|
guide[labels[label]] = body
|
||||||
if guide:
|
if guide:
|
||||||
|
|||||||
@@ -76,11 +76,7 @@ async def _generate_kind(client: httpx.AsyncClient, kind: str, region_label: str
|
|||||||
|
|
||||||
items, dropped = grounding.parse_items(payload, kind, prompts.max_items(kind), region_label)
|
items, dropped = grounding.parse_items(payload, kind, prompts.max_items(kind), region_label)
|
||||||
items = await _attach_images(kind, items, region_label)
|
items = await _attach_images(kind, items, region_label)
|
||||||
usage = perplexity.read_usage(payload)
|
LOG.i(f"[story] {region_label} {kind}: {len(items)}건 채택, {len(dropped)}건 버림")
|
||||||
LOG.i(
|
|
||||||
f"[story] {region_label} {kind}: {len(items)}건 채택, {len(dropped)}건 버림 · "
|
|
||||||
f"tokens in={usage.input_tokens} out={usage.output_tokens} · 약 ${usage.cost}"
|
|
||||||
)
|
|
||||||
return items, dropped
|
return items, dropped
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,69 +0,0 @@
|
|||||||
"""Microsoft Teams Workflows(수신 webhook) 로 어댑티브 카드 한 장을 보낸다.
|
|
||||||
|
|
||||||
★ 이 파일은 "HTTP 로 카드 하나 보내기" 딱 그것만 안다 — 언제 보낼지·무엇을 보낼지는
|
|
||||||
services/alert_service.py 가 정한다(관심사 분리, 재사용). search_console_alerts.py 가
|
|
||||||
쓰는 별도의 좁은 어댑터와는 다른 자리다 — 그건 색인 감시 전용이고 이건 잡 큐·발행 전반의
|
|
||||||
장애 알림 전용이다. 카드 포맷이 같은 이유로 합치자는 제안이 오면, 두 기능의 배포 주기가
|
|
||||||
다르다는 것과(색인 감시는 스케줄러 전용, 이건 워커 코드 곳곳에서 부른다) 지금 결합 이득이
|
|
||||||
적다는 것을 근거로 우선 보류한다.
|
|
||||||
|
|
||||||
★ webhook 이 설정 안 됐으면 보내지 않는다(is_configured). 값이 없어도 서버는 그대로 뜬다 —
|
|
||||||
운영 연결(실제 채널 지정)은 사용자 승인 후 별도로 한다.
|
|
||||||
"""
|
|
||||||
import os
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
from common.logger import LOG
|
|
||||||
|
|
||||||
WEBHOOK_URL_ENV = "TEAMS_WEBHOOK_URL"
|
|
||||||
TIMEOUT_SEC = 10.0
|
|
||||||
|
|
||||||
|
|
||||||
def is_configured() -> bool:
|
|
||||||
return bool(os.environ.get(WEBHOOK_URL_ENV, "").strip())
|
|
||||||
|
|
||||||
|
|
||||||
def _webhook_url() -> str:
|
|
||||||
return os.environ.get(WEBHOOK_URL_ENV, "").strip()
|
|
||||||
|
|
||||||
|
|
||||||
def _card(title: str, detail: str) -> dict:
|
|
||||||
"""Adaptive Card 1.2 — Teams Workflows 가 받는 최소 모양(search_console_alerts.py 와 같은 스키마)."""
|
|
||||||
return {
|
|
||||||
"type": "message",
|
|
||||||
"attachments": [{
|
|
||||||
"contentType": "application/vnd.microsoft.card.adaptive",
|
|
||||||
"contentUrl": None,
|
|
||||||
"content": {
|
|
||||||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
|
|
||||||
"type": "AdaptiveCard",
|
|
||||||
"version": "1.2",
|
|
||||||
"body": [
|
|
||||||
{"type": "TextBlock", "text": title, "weight": "Bolder", "wrap": True},
|
|
||||||
{"type": "TextBlock", "text": detail, "wrap": True},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}],
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
async def send(title: str, detail: str) -> bool:
|
|
||||||
"""설정된 경우에만 보낸다. 실패는 로그로 남기고 삼킨다 — 호출측(alert_service)이 재시도를 관리한다.
|
|
||||||
|
|
||||||
★ webhook 주소 자체가 인증 수단이다(URL 에 서명이 박혀 있다) — 예외 문자열에 그 URL 이
|
|
||||||
실릴 수 있어 로그에는 안 남긴다(search_console_alerts.py 와 같은 규칙)."""
|
|
||||||
url = _webhook_url()
|
|
||||||
if not url:
|
|
||||||
return False
|
|
||||||
if not url.startswith("https://"):
|
|
||||||
LOG.w("[alert] TEAMS_WEBHOOK_URL_INVALID — https 가 아니다")
|
|
||||||
return False
|
|
||||||
try:
|
|
||||||
async with httpx.AsyncClient(timeout=TIMEOUT_SEC, follow_redirects=False) as client:
|
|
||||||
response = await client.post(url, json=_card(title, detail))
|
|
||||||
response.raise_for_status()
|
|
||||||
return True
|
|
||||||
except httpx.HTTPError:
|
|
||||||
LOG.w("[alert] TEAMS_DELIVERY_FAILED")
|
|
||||||
return False
|
|
||||||
@@ -18,7 +18,6 @@ from config.server_configs import external_api_config
|
|||||||
from crud.media_crud import MediaCRUD
|
from crud.media_crud import MediaCRUD
|
||||||
from crud.place_crud import PlaceCRUD
|
from crud.place_crud import PlaceCRUD
|
||||||
from services.external import gemini
|
from services.external import gemini
|
||||||
from services.llm import provider
|
|
||||||
from common.job_errors import PermanentJobError
|
from common.job_errors import PermanentJobError
|
||||||
|
|
||||||
_media_crud = MediaCRUD()
|
_media_crud = MediaCRUD()
|
||||||
@@ -37,7 +36,7 @@ async def run_vision(job: dict) -> dict:
|
|||||||
force = bool(payload.get("force"))
|
force = bool(payload.get("force"))
|
||||||
|
|
||||||
if not gemini.is_configured():
|
if not gemini.is_configured():
|
||||||
raise VisionAborted("API 키 미설정 — 사진 분석을 할 수 없다")
|
raise VisionAborted("GEMINI_API_KEY 미설정 — 사진 분석을 할 수 없다")
|
||||||
|
|
||||||
err, place = await DB_SESSION_MNG.execute_lambda(
|
err, place = await DB_SESSION_MNG.execute_lambda(
|
||||||
places.DBType(),
|
places.DBType(),
|
||||||
@@ -78,17 +77,12 @@ async def run_vision(job: dict) -> dict:
|
|||||||
by_key = {(r.origin_url or r.url): r for r in rows}
|
by_key = {(r.origin_url or r.url): r for r in rows}
|
||||||
|
|
||||||
threshold = external_api_config.vision_confidence_threshold
|
threshold = external_api_config.vision_confidence_threshold
|
||||||
active_provider = provider.active()
|
|
||||||
model = (
|
|
||||||
external_api_config.openai_vision_model if active_provider.__name__.endswith("openai")
|
|
||||||
else external_api_config.gemini_vision_model
|
|
||||||
)
|
|
||||||
try:
|
try:
|
||||||
results = await gemini.analyze_images(
|
results = await gemini.analyze_images(
|
||||||
images,
|
images,
|
||||||
category=PlaceCategory(place.category),
|
category=PlaceCategory(place.category),
|
||||||
unit_names=unit_names,
|
unit_names=unit_names,
|
||||||
model=model,
|
model=external_api_config.gemini_vision_model,
|
||||||
confidence_threshold=threshold,
|
confidence_threshold=threshold,
|
||||||
)
|
)
|
||||||
except gemini.GeminiNotConfigured as ex:
|
except gemini.GeminiNotConfigured as ex:
|
||||||
|
|||||||
@@ -4,13 +4,7 @@
|
|||||||
"구름많음": ["구름이 많은 날에는 실내에서 다음 일정을 천천히 골라 보세요.", "여행 사진을 정리하며 잠깐 쉬어 가세요.", "함께 온 사람과 오늘 가장 좋았던 순간을 이야기해 보세요.", "바깥 일정 사이에 여유로운 휴식 시간을 넣어 보세요.", "오늘의 기분을 짧은 글로 남겨도 좋겠습니다."],
|
"구름많음": ["구름이 많은 날에는 실내에서 다음 일정을 천천히 골라 보세요.", "여행 사진을 정리하며 잠깐 쉬어 가세요.", "함께 온 사람과 오늘 가장 좋았던 순간을 이야기해 보세요.", "바깥 일정 사이에 여유로운 휴식 시간을 넣어 보세요.", "오늘의 기분을 짧은 글로 남겨도 좋겠습니다."],
|
||||||
"흐림": ["흐린 날에는 실내에서 느긋하게 쉬어 가도 좋겠습니다.", "잠깐 책을 읽으며 다음 일정을 기다려 보세요.", "바깥 풍경 대신 오늘 나눈 이야기에 집중해 보세요.", "천천히 쉬면서 돌아갈 때 가져갈 추억을 골라 보세요.", "분주한 일정 사이에 조용한 휴식을 끼워 넣어 보세요."],
|
"흐림": ["흐린 날에는 실내에서 느긋하게 쉬어 가도 좋겠습니다.", "잠깐 책을 읽으며 다음 일정을 기다려 보세요.", "바깥 풍경 대신 오늘 나눈 이야기에 집중해 보세요.", "천천히 쉬면서 돌아갈 때 가져갈 추억을 골라 보세요.", "분주한 일정 사이에 조용한 휴식을 끼워 넣어 보세요."],
|
||||||
"비": ["비가 오는 동안에는 실내에서 쉬며 일정을 조정해 보세요.", "서두르지 말고 비가 잦아드는지 확인한 뒤 움직이세요.", "빗소리를 들으며 읽고 싶었던 글을 펼쳐 보세요.", "젖은 물건을 정리하고 잠깐 쉬어 가세요.", "바깥 일정 대신 함께 찍은 사진을 나눠 봐도 좋겠습니다."],
|
"비": ["비가 오는 동안에는 실내에서 쉬며 일정을 조정해 보세요.", "서두르지 말고 비가 잦아드는지 확인한 뒤 움직이세요.", "빗소리를 들으며 읽고 싶었던 글을 펼쳐 보세요.", "젖은 물건을 정리하고 잠깐 쉬어 가세요.", "바깥 일정 대신 함께 찍은 사진을 나눠 봐도 좋겠습니다."],
|
||||||
"눈": ["눈 오는 날에는 실내에서 쉬며 바깥 상황을 살펴보세요.", "다음 이동을 서두르지 말고 쉬어 가세요.", "따뜻하게 머물며 오늘의 여행을 한 줄 남겨 보세요.", "실내에서 다음 일정과 이동편을 확인해 보세요.", "눈길을 나서기 전에는 여유 있게 준비하세요."],
|
"눈": ["눈 오는 날에는 실내에서 쉬며 바깥 상황을 살펴보세요.", "다음 이동을 서두르지 말고 쉬어 가세요.", "따뜻하게 머물며 오늘의 여행을 한 줄 남겨 보세요.", "실내에서 다음 일정과 이동편을 확인해 보세요.", "눈길을 나서기 전에는 여유 있게 준비하세요."]
|
||||||
"안개": ["안개가 낀 날에는 이동 전에 시야와 도로 상황을 확인해 보세요.", "짙은 안개 속에서는 서두르지 말고 여유 있게 움직이세요.", "안개가 걷히기를 기다리며 실내에서 쉬어 가도 좋겠습니다.", "다음 이동 경로의 시야 확보 여부를 미리 확인해 두세요.", "안개 속 야외 일정보다는 가까운 곳부터 살펴보세요."],
|
|
||||||
"소나기": ["소나기가 지나가는 동안에는 잠시 실내에서 머물러 보세요.", "갑자기 쏟아지는 비에 대비해 우산이나 우비를 챙기세요.", "소나기가 그치면 나설 수 있도록 다음 일정에 여유를 두세요.", "젖은 길은 미끄러울 수 있으니 이동할 때 주의하세요.", "소나기 소식이 있다면 바깥 일정은 짧게 잡아 보세요."],
|
|
||||||
"뇌우": ["천둥·번개가 치는 동안에는 야외 활동을 멈추고 실내에 머물러 있으세요.", "뇌우가 지나갈 때까지 개방된 장소나 높은 곳은 피하세요.", "기상특보를 확인하고 이동 일정을 조정해 보세요.", "번개가 잦아들 때까지 실내에서 안전하게 기다려 보세요.", "뇌우가 지나간 뒤에는 도로 상황을 확인한 뒤 움직이세요."],
|
|
||||||
"이슬비": ["가벼운 이슬비라면 짧은 외출 정도는 괜찮습니다.", "이슬비가 흩날릴 때는 가벼운 겉옷 하나면 충분합니다.", "우산 없이도 짧은 이동이라면 크게 무리는 없겠습니다.", "이슬비가 그치는 틈을 봐서 다음 일정을 잡아 보세요.", "옷이 살짝 젖을 수 있으니 여벌 준비 정도만 해 두세요."],
|
|
||||||
"강한비": ["빗줄기가 굵을 때는 이동을 미루고 실내에서 기다리세요.", "강한 비가 그칠 때까지 바깥 일정은 잠시 접어 두세요.", "물웅덩이·배수 상황을 살피고 이동 경로를 다시 확인하세요.", "우산만으로는 부족할 수 있으니 방수 옷차림을 챙기세요.", "굵은 빗속 이동은 삼가고 안전한 곳에서 쉬어 가세요."],
|
|
||||||
"어는비": ["어는비가 내릴 때는 바깥 이동을 삼가고 실내에 머무르세요.", "도로가 얼어붙을 수 있으니 되도록 나서지 마세요.", "부득이 이동해야 한다면 걸음을 평소보다 훨씬 천천히 옮기세요.", "차량 이동도 미끄러질 수 있으니 서두르지 마세요.", "기상특보를 확인하고 해빙될 때까지 일정을 미뤄 두세요."]
|
|
||||||
},
|
},
|
||||||
"temperature": {
|
"temperature": {
|
||||||
"혹서": ["더위가 강한 시간에는 바깥 이동을 줄이고 실내 위주로 일정을 잡아 보세요.", "한낮 산책은 짧게 하고 충분히 쉬어 가세요.", "외출 전 기상특보와 방문할 곳의 운영 여부를 확인하세요.", "다음 장소로 이동할 때에는 쉴 시간을 넉넉히 두세요.", "긴 야외 일정은 미루고 가까운 동선부터 살펴보세요."],
|
"혹서": ["더위가 강한 시간에는 바깥 이동을 줄이고 실내 위주로 일정을 잡아 보세요.", "한낮 산책은 짧게 하고 충분히 쉬어 가세요.", "외출 전 기상특보와 방문할 곳의 운영 여부를 확인하세요.", "다음 장소로 이동할 때에는 쉴 시간을 넉넉히 두세요.", "긴 야외 일정은 미루고 가까운 동선부터 살펴보세요."],
|
||||||
|
|||||||
@@ -1,206 +0,0 @@
|
|||||||
"""알림 발송함 — 적재(dedupe) · 발송(재시도/소진) · 복구 · 비밀 마스킹.
|
|
||||||
|
|
||||||
★ 이 파일이 절대 하면 안 되는 것 확인:
|
|
||||||
- 재시도마다 중복 스팸을 내는 것 (dedupe)
|
|
||||||
- webhook URL·비밀번호·이메일 원문을 detail 에 그대로 남기는 것 (scrub)
|
|
||||||
- TEAMS_WEBHOOK_URL 이 비었을 때 예외를 던지는 것 (미설정 시 정상 동작)
|
|
||||||
"""
|
|
||||||
import json
|
|
||||||
|
|
||||||
import httpx
|
|
||||||
from sqlalchemy import text
|
|
||||||
|
|
||||||
from services import alert_service, teams_webhook
|
|
||||||
|
|
||||||
|
|
||||||
def _mock_webhook(monkeypatch, handler):
|
|
||||||
"""teams_webhook 의 실제 HTTP 호출을 대역으로 바꾼다(네트워크를 타지 않는다)."""
|
|
||||||
real_client = httpx.AsyncClient
|
|
||||||
|
|
||||||
def make_client(**kw):
|
|
||||||
return real_client(transport=httpx.MockTransport(handler), **kw)
|
|
||||||
|
|
||||||
monkeypatch.setattr(teams_webhook.httpx, "AsyncClient", make_client)
|
|
||||||
|
|
||||||
|
|
||||||
async def _rows(db_engine, kind: str | None = None):
|
|
||||||
async with db_engine.begin() as c:
|
|
||||||
sql = "SELECT kind, dedupe_key, title, detail, status, attempts, resolved_at FROM alert_outbox"
|
|
||||||
params = {}
|
|
||||||
if kind:
|
|
||||||
sql += " WHERE kind = :k"
|
|
||||||
params["k"] = kind
|
|
||||||
sql += " ORDER BY created_at"
|
|
||||||
result = await c.execute(text(sql), params)
|
|
||||||
return [dict(r._mapping) for r in result]
|
|
||||||
|
|
||||||
|
|
||||||
# ── 적재 · 중복 억제 ─────────────────────────────────────────────────────────
|
|
||||||
async def test_send_alert_creates_pending_row(db_engine):
|
|
||||||
await alert_service.send_alert("job_dead", "잡 실패", "사유", dedupe_key="k1")
|
|
||||||
rows = await _rows(db_engine, "job_dead")
|
|
||||||
assert len(rows) == 1
|
|
||||||
assert rows[0]["status"] == 1 # AlertStatus.PENDING
|
|
||||||
assert rows[0]["dedupe_key"] == "k1"
|
|
||||||
|
|
||||||
|
|
||||||
async def test_send_alert_dedupes_within_window(db_engine):
|
|
||||||
"""검증: 같은 dedupe_key 로 두 번 연속 보낸다.
|
|
||||||
기대결과: ★ 행이 하나만 생긴다 — 재시도마다 중복 스팸을 내면 안 된다."""
|
|
||||||
await alert_service.send_alert("build_failed", "발행 실패", "1차", dedupe_key="k2")
|
|
||||||
await alert_service.send_alert("build_failed", "발행 실패", "2차", dedupe_key="k2")
|
|
||||||
rows = await _rows(db_engine, "build_failed")
|
|
||||||
assert len(rows) == 1
|
|
||||||
assert rows[0]["detail"] == "1차" # 처음 것만 남는다(두 번째는 만들지 않았다)
|
|
||||||
|
|
||||||
|
|
||||||
async def test_send_alert_without_dedupe_key_always_creates(db_engine):
|
|
||||||
"""dedupe_key 가 없으면(예: 복구 알림) 매번 새로 쌓인다."""
|
|
||||||
await alert_service.send_alert("recovery", "복구", "a")
|
|
||||||
await alert_service.send_alert("recovery", "복구", "b")
|
|
||||||
rows = await _rows(db_engine, "recovery")
|
|
||||||
assert len(rows) == 2
|
|
||||||
|
|
||||||
|
|
||||||
# ── 복구 ────────────────────────────────────────────────────────────────────
|
|
||||||
async def test_resolve_alert_marks_resolved_and_sends_recovery_notice(db_engine):
|
|
||||||
await alert_service.send_alert("queue_stuck", "정체", "사유", dedupe_key="k3")
|
|
||||||
await alert_service.resolve_alert("k3", "정상으로 돌아옴")
|
|
||||||
|
|
||||||
original = await _rows(db_engine, "queue_stuck")
|
|
||||||
assert original[0]["resolved_at"] is not None
|
|
||||||
|
|
||||||
recovered = await _rows(db_engine, "recovery")
|
|
||||||
assert len(recovered) == 1
|
|
||||||
assert recovered[0]["title"] == "정상으로 돌아옴"
|
|
||||||
|
|
||||||
|
|
||||||
async def test_resolve_alert_is_noop_when_nothing_unresolved(db_engine):
|
|
||||||
"""검증: 알린 적 없는 dedupe_key 를 resolve.
|
|
||||||
기대결과: ★ 아무 행도 안 생긴다 — 정상 상태마다 "복구됨" 을 보내면 그게 새 스팸이다."""
|
|
||||||
await alert_service.resolve_alert("never-alerted", "정상")
|
|
||||||
rows = await _rows(db_engine, "recovery")
|
|
||||||
assert rows == []
|
|
||||||
|
|
||||||
|
|
||||||
async def test_send_alert_after_resolve_creates_new_row(db_engine):
|
|
||||||
"""검증: 한 번 풀린(resolved) dedupe_key 로 다시 보낸다.
|
|
||||||
기대결과: 새 문제로 보고 새 행을 만든다 — 옛 resolved 행과 헷갈리지 않는다."""
|
|
||||||
await alert_service.send_alert("build_failed", "실패1", "x", dedupe_key="k4")
|
|
||||||
await alert_service.resolve_alert("k4", "복구1")
|
|
||||||
await alert_service.send_alert("build_failed", "실패2", "y", dedupe_key="k4")
|
|
||||||
|
|
||||||
rows = await _rows(db_engine, "build_failed")
|
|
||||||
assert len(rows) == 2
|
|
||||||
assert rows[1]["detail"] == "y"
|
|
||||||
assert rows[1]["resolved_at"] is None
|
|
||||||
|
|
||||||
|
|
||||||
# ── 비밀·개인정보 마스킹 ──────────────────────────────────────────────────────
|
|
||||||
def test_scrub_redacts_query_string_secrets():
|
|
||||||
out = alert_service._scrub("https://api.example.com/x?api_key=SECRET123&q=hi")
|
|
||||||
assert "SECRET123" not in out
|
|
||||||
assert "api_key=***" in out
|
|
||||||
|
|
||||||
|
|
||||||
def test_scrub_redacts_bearer_token():
|
|
||||||
out = alert_service._scrub("Authorization: Bearer abcdef1234567890")
|
|
||||||
assert "abcdef1234567890" not in out
|
|
||||||
assert "Bearer ***" in out
|
|
||||||
|
|
||||||
|
|
||||||
def test_scrub_redacts_password_kv():
|
|
||||||
out = alert_service._scrub("login failed password=hunter2hunter2")
|
|
||||||
assert "hunter2hunter2" not in out
|
|
||||||
|
|
||||||
|
|
||||||
def test_scrub_masks_email():
|
|
||||||
out = alert_service._scrub("owner email: someone@example.com failed")
|
|
||||||
assert "someone@example.com" not in out
|
|
||||||
assert "@***" in out
|
|
||||||
|
|
||||||
|
|
||||||
def test_scrub_truncates_long_detail():
|
|
||||||
out = alert_service._scrub("x" * 5000)
|
|
||||||
assert len(out) <= 2000
|
|
||||||
|
|
||||||
|
|
||||||
# ── 발송 · 재시도 · 소진 ──────────────────────────────────────────────────────
|
|
||||||
async def test_process_outbox_sends_and_marks_sent(db_engine, monkeypatch):
|
|
||||||
monkeypatch.setenv("TEAMS_WEBHOOK_URL", "https://example.test/webhook")
|
|
||||||
received = []
|
|
||||||
|
|
||||||
def handler(request: httpx.Request) -> httpx.Response:
|
|
||||||
received.append(json.loads(request.content))
|
|
||||||
return httpx.Response(202)
|
|
||||||
|
|
||||||
_mock_webhook(monkeypatch, handler)
|
|
||||||
|
|
||||||
await alert_service.send_alert("job_dead", "잡 실패", "사유", dedupe_key="k5")
|
|
||||||
result = await alert_service.process_outbox()
|
|
||||||
|
|
||||||
assert result == {"sent": 1, "failed": 0}
|
|
||||||
assert len(received) == 1
|
|
||||||
rows = await _rows(db_engine, "job_dead")
|
|
||||||
assert rows[0]["status"] == 2 # AlertStatus.SENT
|
|
||||||
|
|
||||||
|
|
||||||
async def test_process_outbox_noop_when_webhook_unconfigured(db_engine, monkeypatch):
|
|
||||||
"""검증: TEAMS_WEBHOOK_URL 이 비어 있을 때 스윕을 돌린다.
|
|
||||||
기대결과: ★ 예외 없이 끝난다 — HTTP 호출 자체를 안 한다(teams_webhook.is_configured)."""
|
|
||||||
monkeypatch.delenv("TEAMS_WEBHOOK_URL", raising=False)
|
|
||||||
await alert_service.send_alert("job_dead", "잡 실패", "사유", dedupe_key="k6")
|
|
||||||
|
|
||||||
result = await alert_service.process_outbox()
|
|
||||||
assert result["sent"] == 0
|
|
||||||
# 실패로 잡혀 재시도 카운트가 올라간다(다음 스윕에서 다시 시도) — 예외로 죽지 않았다.
|
|
||||||
rows = await _rows(db_engine, "job_dead")
|
|
||||||
assert rows[0]["status"] == 1 # 여전히 PENDING(백오프 대기)
|
|
||||||
assert rows[0]["attempts"] == 1
|
|
||||||
|
|
||||||
|
|
||||||
async def test_process_outbox_exhausts_after_max_attempts(db_engine, monkeypatch):
|
|
||||||
"""검증: 계속 실패하는 webhook 으로 MAX_ATTEMPTS 만큼 스윕한다.
|
|
||||||
기대결과: ★ 상한에 닿으면 FAILED 로 남고 더는 재시도 대상이 아니다."""
|
|
||||||
monkeypatch.setenv("TEAMS_WEBHOOK_URL", "https://example.test/webhook")
|
|
||||||
_mock_webhook(monkeypatch, lambda req: httpx.Response(500))
|
|
||||||
|
|
||||||
await alert_service.send_alert("job_dead", "잡 실패", "사유", dedupe_key="k7")
|
|
||||||
for _ in range(alert_service.MAX_ATTEMPTS):
|
|
||||||
# next_attempt_at 이 미래로 밀려도 여기선 process_outbox 가 직접 대상을 스윕하므로
|
|
||||||
# 시간 경과를 흉내 낼 필요 없이 next_attempt_at 을 매번 과거로 되돌린다.
|
|
||||||
async with db_engine.begin() as c:
|
|
||||||
await c.execute(text("UPDATE alert_outbox SET next_attempt_at = now() - interval '1 second'"))
|
|
||||||
await alert_service.process_outbox()
|
|
||||||
|
|
||||||
rows = await _rows(db_engine, "job_dead")
|
|
||||||
assert rows[0]["status"] == 3 # AlertStatus.FAILED(소진)
|
|
||||||
assert rows[0]["attempts"] == alert_service.MAX_ATTEMPTS
|
|
||||||
|
|
||||||
|
|
||||||
# ── Teams 카드 모양 ───────────────────────────────────────────────────────────
|
|
||||||
async def test_teams_webhook_sends_adaptive_card(monkeypatch):
|
|
||||||
monkeypatch.setenv("TEAMS_WEBHOOK_URL", "https://example.test/webhook")
|
|
||||||
received = []
|
|
||||||
|
|
||||||
def handler(request: httpx.Request) -> httpx.Response:
|
|
||||||
received.append(json.loads(request.content))
|
|
||||||
return httpx.Response(202)
|
|
||||||
|
|
||||||
_mock_webhook(monkeypatch, handler)
|
|
||||||
ok = await teams_webhook.send("제목", "내용")
|
|
||||||
assert ok is True
|
|
||||||
card = received[0]["attachments"][0]
|
|
||||||
assert card["contentType"] == "application/vnd.microsoft.card.adaptive"
|
|
||||||
|
|
||||||
|
|
||||||
async def test_teams_webhook_refuses_non_https(monkeypatch):
|
|
||||||
monkeypatch.setenv("TEAMS_WEBHOOK_URL", "http://not-secure.test/webhook")
|
|
||||||
ok = await teams_webhook.send("제목", "내용")
|
|
||||||
assert ok is False
|
|
||||||
|
|
||||||
|
|
||||||
async def test_teams_webhook_noop_when_unset(monkeypatch):
|
|
||||||
monkeypatch.delenv("TEAMS_WEBHOOK_URL", raising=False)
|
|
||||||
ok = await teams_webhook.send("제목", "내용")
|
|
||||||
assert ok is False
|
|
||||||
@@ -157,62 +157,3 @@ async def test_google_login_is_off_when_client_id_is_empty(client, db_engine):
|
|||||||
기대결과: 1106(OAUTH_NOT_CONFIGURED) — 네트워크를 타지 않고 즉시 끊긴다."""
|
기대결과: 1106(OAUTH_NOT_CONFIGURED) — 네트워크를 타지 않고 즉시 끊긴다."""
|
||||||
r = await client.post("/v1/auth/google", json={"credential": "anything"})
|
r = await client.post("/v1/auth/google", json={"credential": "anything"})
|
||||||
assert r.json()["result"]["code"] == 1106
|
assert r.json()["result"]["code"] == 1106
|
||||||
|
|
||||||
|
|
||||||
# ── refresh 토큰 무효화(token_version) ────────────────────────────────────────
|
|
||||||
async def test_refresh_token_reissues_access_token(auth_headers, client):
|
|
||||||
"""검증: 정상적인 refresh 토큰으로 재발급.
|
|
||||||
기대결과: 200, 새 access 토큰이 실려 온다."""
|
|
||||||
h = await auth_headers("refuser1")
|
|
||||||
login = (await client.post("/v1/auth/login", json={"id": "refuser1", "password": "pw1234"})).json()
|
|
||||||
refresh_token = login["refresh_token"]
|
|
||||||
|
|
||||||
r = await client.post("/v1/auth/refresh_token", headers={"Authorization": f"Bearer {refresh_token}"})
|
|
||||||
body = r.json()
|
|
||||||
assert body["result"]["success"] is True
|
|
||||||
assert body["access_token"]
|
|
||||||
# 새 access 토큰이 실제로 먹힌다.
|
|
||||||
me = (await client.get("/v1/auth/me", headers={"Authorization": f"Bearer {body['access_token']}"})).json()
|
|
||||||
assert me["id"] == "refuser1"
|
|
||||||
del h # auth_headers 는 시드 용도로만 쓴다
|
|
||||||
|
|
||||||
|
|
||||||
async def test_refresh_token_is_revoked_after_password_change(auth_headers, client):
|
|
||||||
"""검증: refresh 토큰을 받은 **뒤에** 비밀번호를 바꾼다.
|
|
||||||
기대결과: ★ ACCOUNT_SESSION_REVOKED — 예전 refresh 토큰으로는 더 이상 access 토큰을 못 찍는다.
|
|
||||||
(비밀번호를 훔쳐 넣어 둔 refresh 토큰이 있어도 비번을 바꾸면 끊긴다는 것이 이 테스트의 요점이다.)"""
|
|
||||||
h = await auth_headers("refuser2")
|
|
||||||
login = (await client.post("/v1/auth/login", json={"id": "refuser2", "password": "pw1234"})).json()
|
|
||||||
old_refresh_token = login["refresh_token"]
|
|
||||||
|
|
||||||
upd = await client.patch("/v1/auth/me", headers=h, json={"password": "newpassword123"})
|
|
||||||
assert upd.json()["result"]["success"] is True
|
|
||||||
|
|
||||||
r = await client.post("/v1/auth/refresh_token", headers={"Authorization": f"Bearer {old_refresh_token}"})
|
|
||||||
body = r.json()
|
|
||||||
assert body["result"]["success"] is False
|
|
||||||
assert body["result"]["code"] == 1108, body # ACCOUNT_SESSION_REVOKED
|
|
||||||
assert body.get("access_token", "") == ""
|
|
||||||
|
|
||||||
# ★ 새로 로그인하면(새 비밀번호로) 새 refresh 토큰은 당연히 먹힌다.
|
|
||||||
relogin = (await client.post("/v1/auth/login", json={"id": "refuser2", "password": "newpassword123"})).json()
|
|
||||||
r2 = await client.post("/v1/auth/refresh_token", headers={"Authorization": f"Bearer {relogin['refresh_token']}"})
|
|
||||||
assert r2.json()["result"]["success"] is True
|
|
||||||
|
|
||||||
|
|
||||||
async def test_refresh_token_is_revoked_when_account_blocked(auth_headers, client, db_engine):
|
|
||||||
"""검증: refresh 토큰을 받은 뒤 계정이 차단(UserStatus.INACTIVE)된다.
|
|
||||||
기대결과: ★ ACCOUNT_BLOCKED_USER — 로그인만 막는 게 아니라 이미 나간 refresh 토큰도 막는다."""
|
|
||||||
from sqlalchemy import text
|
|
||||||
|
|
||||||
h = await auth_headers("refuser3")
|
|
||||||
login = (await client.post("/v1/auth/login", json={"id": "refuser3", "password": "pw1234"})).json()
|
|
||||||
del h
|
|
||||||
|
|
||||||
async with db_engine.begin() as c:
|
|
||||||
await c.execute(text("UPDATE users SET status = 2 WHERE id = 'refuser3'")) # UserStatus.INACTIVE
|
|
||||||
|
|
||||||
r = await client.post("/v1/auth/refresh_token", headers={"Authorization": f"Bearer {login['refresh_token']}"})
|
|
||||||
body = r.json()
|
|
||||||
assert body["result"]["success"] is False
|
|
||||||
assert body["result"]["code"] == 1102 # ACCOUNT_BLOCKED_USER
|
|
||||||
@@ -313,11 +313,6 @@ async def test_렌더가_실패하면_발행하지_않는다(auth_headers, clien
|
|||||||
assert r.get("published") is not True
|
assert r.get("published") is not True
|
||||||
assert "번들이 없다" in r["error"]
|
assert "번들이 없다" in r["error"]
|
||||||
|
|
||||||
# ★ 게이트 반려가 아닌 진짜 실패(렌더·인프라)는 알린다 — services/alert_service.
|
|
||||||
async with db_engine.begin() as c:
|
|
||||||
rows = (await c.execute(text("SELECT kind FROM alert_outbox WHERE kind = 'build_failed'"))).all()
|
|
||||||
assert len(rows) == 1
|
|
||||||
|
|
||||||
site = (await client.get(f"/v1/place/{pid}/site", headers=h)).json()
|
site = (await client.get(f"/v1/place/{pid}/site", headers=h)).json()
|
||||||
assert site["site"]["status"] != SiteStatus.PUBLISHED.value
|
assert site["site"]["status"] != SiteStatus.PUBLISHED.value
|
||||||
|
|
||||||
@@ -344,11 +339,6 @@ async def test_구조화데이터가_화면과_다르면_발행하지_않는다(
|
|||||||
assert r["gate"]["reason"] == PublishRejectReason.JSONLD_MISMATCH.name
|
assert r["gate"]["reason"] == PublishRejectReason.JSONLD_MISMATCH.name
|
||||||
assert r["mismatches"]
|
assert r["mismatches"]
|
||||||
|
|
||||||
# ★ 게이트 반려는 알리지 않는다 — 사장님 쪽 문제를 운영자에게 알리면 안 된다.
|
|
||||||
async with db_engine.begin() as c:
|
|
||||||
rows = (await c.execute(text("SELECT kind FROM alert_outbox"))).all()
|
|
||||||
assert rows == []
|
|
||||||
|
|
||||||
|
|
||||||
async def test_렌더_결과가_안_오면_발행하지_않는다(auth_headers, client, db_engine, monkeypatch):
|
async def test_렌더_결과가_안_오면_발행하지_않는다(auth_headers, client, db_engine, monkeypatch):
|
||||||
"""검증: 렌더러가 죽어 보고서가 오지 않는다(타임아웃).
|
"""검증: 렌더러가 죽어 보고서가 오지 않는다(타임아웃).
|
||||||
|
|||||||
@@ -10,12 +10,3 @@ async def test_healthz(client):
|
|||||||
r = await client.get("/healthz")
|
r = await client.get("/healthz")
|
||||||
assert r.status_code == 200
|
assert r.status_code == 200
|
||||||
assert isinstance(r.json(), str) and len(r.json()) > 0
|
assert isinstance(r.json(), str) and len(r.json()) > 0
|
||||||
|
|
||||||
|
|
||||||
async def test_readyz_checks_db(client, db_engine):
|
|
||||||
"""검증: /readyz 호출(테스트 DB 가 붙어 있는 정상 상태).
|
|
||||||
기대결과: ★ healthz 와 다르게 실제로 DB 에 SELECT 1 을 던져 본 뒤 200 — "프로세스가
|
|
||||||
살아 있다" 가 아니라 "요청을 처리할 수 있다" 를 본다(외부 감시용, router.router.readyz)."""
|
|
||||||
r = await client.get("/readyz")
|
|
||||||
assert r.status_code == 200
|
|
||||||
assert r.json() == {"ok": True, "db": "up"}
|
|
||||||
@@ -160,7 +160,7 @@ async def test_reaper_reclaims_dead_worker_job(db_engine):
|
|||||||
)
|
)
|
||||||
|
|
||||||
reclaimed = await q.reap()
|
reclaimed = await q.reap()
|
||||||
assert jid in [r["job_id"] for r in reclaimed]
|
assert jid in reclaimed
|
||||||
|
|
||||||
row = await q.get(jid)
|
row = await q.get(jid)
|
||||||
assert row["status"] == JobStatus.PENDING.value
|
assert row["status"] == JobStatus.PENDING.value
|
||||||
@@ -236,26 +236,6 @@ async def test_unregistered_job_type_fails_loudly(db_engine):
|
|||||||
assert UnknownJobType.__name__ in row["last_error"]
|
assert UnknownJobType.__name__ in row["last_error"]
|
||||||
|
|
||||||
|
|
||||||
async def test_dead_letter_creates_an_alert(db_engine):
|
|
||||||
"""검증: 잡이 재시도를 소진해 DEAD 로 떨어진다.
|
|
||||||
기대결과: ★ alert_outbox 에 job_dead 알림이 쌓인다 — 운영자가 잡 하나하나를 눈으로
|
|
||||||
훑지 않아도 dead-letter 를 안다(worker/runner.py _alert_job_dead)."""
|
|
||||||
q = JobQueue()
|
|
||||||
jid = await q.enqueue(JobType.AI_CHECK.value, {"place_id": "p-alert-1"}, max_attempts=1)
|
|
||||||
|
|
||||||
worker = Worker("w-test", q, build_handler(), backoff_fn=lambda _a: 0)
|
|
||||||
await worker.process_one()
|
|
||||||
|
|
||||||
row = await q.get(jid)
|
|
||||||
assert row["status"] == JobStatus.DEAD.value
|
|
||||||
|
|
||||||
async with db_engine.begin() as c:
|
|
||||||
result = await c.execute(text("SELECT kind, dedupe_key, title FROM alert_outbox WHERE kind = 'job_dead'"))
|
|
||||||
rows = [dict(r._mapping) for r in result]
|
|
||||||
assert len(rows) == 1
|
|
||||||
assert rows[0]["dedupe_key"] == "job_dead:AI_CHECK:p-alert-1"
|
|
||||||
|
|
||||||
|
|
||||||
async def test_reaper_loop_stops_on_event(db_engine):
|
async def test_reaper_loop_stops_on_event(db_engine):
|
||||||
"""검증: reaper 루프에 stop 이벤트를 건다.
|
"""검증: reaper 루프에 stop 이벤트를 건다.
|
||||||
기대결과: 즉시 빠져나온다(graceful shutdown 이 매달리지 않는다)."""
|
기대결과: 즉시 빠져나온다(graceful shutdown 이 매달리지 않는다)."""
|
||||||
|
|||||||
@@ -259,15 +259,19 @@ def test_existing_scheduler_registers_optional_job(monkeypatch, enabled, count):
|
|||||||
monkeypatch.setenv("SCHEDULER_ENABLED", "1")
|
monkeypatch.setenv("SCHEDULER_ENABLED", "1")
|
||||||
monkeypatch.setenv("GSC_ENABLED", enabled)
|
monkeypatch.setenv("GSC_ENABLED", enabled)
|
||||||
scheduler.start_scheduler()
|
scheduler.start_scheduler()
|
||||||
# ★ 알림 스윕 둘(alert-outbox·queue-health)은 GSC_ENABLED 와 무관하게 항상 등록된다
|
|
||||||
# (scheduler/__init__.py, docs/ALERTS.md) — search-console 잡만 옵션이다.
|
# ★ 전체 잡 수를 세지 않는다. 이 검사가 지키려는 것은 "GSC 잡이 GSC_ENABLED 에 따라
|
||||||
always_on = {kw["id"] for _a, kw in jobs} - {"search-console"}
|
# 붙는가" 하나인데, 총계로 세면 **스케줄러에 잡이 하나 늘 때마다 깨진다**
|
||||||
assert always_on == {"alert-outbox", "queue-health"}
|
# (실제로 SNS 승인 만료 스윕이 붙으면서 깨졌다 — 2026-09-16 병합).
|
||||||
assert len(jobs) == count + 2
|
# id 로 그 잡만 집으면 다른 잡이 늘어도 이 검사는 자기 일만 본다.
|
||||||
gsc_jobs = [kw for _a, kw in jobs if kw["id"] == "search-console"]
|
gsc = [kw for _, kw in jobs if kw.get("id") == "search-console"]
|
||||||
if gsc_jobs:
|
assert len(gsc) == count
|
||||||
assert gsc_jobs[0]["minutes"] == 10
|
if gsc:
|
||||||
assert gsc_jobs[0]["max_instances"] == 1
|
assert gsc[0]["minutes"] == 10
|
||||||
|
assert gsc[0]["max_instances"] == 1
|
||||||
|
|
||||||
|
# SNS 승인 만료·중단 복구는 GSC 와 무관하게 늘 붙는다(scheduler/__init__ 주석).
|
||||||
|
assert [kw for _, kw in jobs if kw.get("id") == "social-sweep"]
|
||||||
|
|
||||||
|
|
||||||
def test_migration_matches_fresh_database_schema():
|
def test_migration_matches_fresh_database_schema():
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ from datetime import datetime, timedelta, timezone
|
|||||||
import httpx
|
import httpx
|
||||||
import pytest
|
import pytest
|
||||||
from sqlalchemy import text
|
from sqlalchemy import text
|
||||||
|
from common.enums import JobType
|
||||||
from crud import social_crud
|
from crud import social_crud
|
||||||
from services import social_service as service
|
from services import social_service as service
|
||||||
from services.external import gemini_text, threads
|
from services.external import gemini_text, threads
|
||||||
@@ -87,7 +88,7 @@ async def test_draft_dedup_owner_scope(client, auth_headers, db_engine):
|
|||||||
)
|
)
|
||||||
async with db_engine.begin() as c:
|
async with db_engine.begin() as c:
|
||||||
assert (
|
assert (
|
||||||
await c.execute(text("SELECT count(*) FROM jobs WHERE job_type=8"))
|
await c.execute(text("SELECT count(*) FROM jobs WHERE job_type=:t"), {"t": JobType.SOCIAL_DRAFT.value})
|
||||||
).scalar_one() == 1
|
).scalar_one() == 1
|
||||||
|
|
||||||
|
|
||||||
@@ -120,7 +121,7 @@ async def test_prefetch_read_only_one_time_cas(client, auth_headers, db_engine):
|
|||||||
assert second.json()["applied"] is False
|
assert second.json()["applied"] is False
|
||||||
async with db_engine.begin() as c:
|
async with db_engine.begin() as c:
|
||||||
assert (
|
assert (
|
||||||
await c.execute(text("SELECT count(*) FROM jobs WHERE job_type=9"))
|
await c.execute(text("SELECT count(*) FROM jobs WHERE job_type=:t"), {"t": JobType.SOCIAL_POST.value})
|
||||||
).scalar_one() == 1
|
).scalar_one() == 1
|
||||||
|
|
||||||
|
|
||||||
@@ -262,7 +263,7 @@ async def test_screen_approval_without_contract_never_queues_post(
|
|||||||
assert approved.json()["applied"] is True
|
assert approved.json()["applied"] is True
|
||||||
async with db_engine.begin() as c:
|
async with db_engine.begin() as c:
|
||||||
assert (
|
assert (
|
||||||
await c.execute(text("SELECT count(*) FROM jobs WHERE job_type=9"))
|
await c.execute(text("SELECT count(*) FROM jobs WHERE job_type=:t"), {"t": JobType.SOCIAL_POST.value})
|
||||||
).scalar_one() == 0
|
).scalar_one() == 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -83,10 +83,8 @@ def _register_builtin():
|
|||||||
from services.copy_service import run_copy
|
from services.copy_service import run_copy
|
||||||
from services.story_service import run_local_sync
|
from services.story_service import run_local_sync
|
||||||
from services.song_service import run_song
|
from services.song_service import run_song
|
||||||
from services.social_service import run_draft, run_post
|
|
||||||
HANDLERS[JobType.SOCIAL_DRAFT.value] = run_draft
|
|
||||||
HANDLERS[JobType.SOCIAL_POST.value] = run_post
|
|
||||||
from services.rollback_service import run_rollback
|
from services.rollback_service import run_rollback
|
||||||
|
from services.social_service import run_draft, run_post
|
||||||
from services.vision_service import run_vision
|
from services.vision_service import run_vision
|
||||||
|
|
||||||
if JobType.COLLECT.value not in HANDLERS:
|
if JobType.COLLECT.value not in HANDLERS:
|
||||||
@@ -103,6 +101,10 @@ def _register_builtin():
|
|||||||
HANDLERS[JobType.SONG.value] = run_song
|
HANDLERS[JobType.SONG.value] = run_song
|
||||||
if JobType.ROLLBACK.value not in HANDLERS:
|
if JobType.ROLLBACK.value not in HANDLERS:
|
||||||
HANDLERS[JobType.ROLLBACK.value] = run_rollback
|
HANDLERS[JobType.ROLLBACK.value] = run_rollback
|
||||||
|
if JobType.SOCIAL_DRAFT.value not in HANDLERS:
|
||||||
|
HANDLERS[JobType.SOCIAL_DRAFT.value] = run_draft
|
||||||
|
if JobType.SOCIAL_POST.value not in HANDLERS:
|
||||||
|
HANDLERS[JobType.SOCIAL_POST.value] = run_post
|
||||||
|
|
||||||
|
|
||||||
_register_builtin()
|
_register_builtin()
|
||||||
@@ -12,36 +12,10 @@
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from common.enums import JobStatus, JobType
|
from common.enums import JobStatus
|
||||||
from common.job_errors import PermanentJobError
|
from common.job_errors import PermanentJobError
|
||||||
from common.logger import LOG
|
from common.logger import LOG
|
||||||
from crud.job_crud import JobQueue, compute_backoff
|
from crud.job_crud import JobQueue, compute_backoff
|
||||||
from services import alert_service
|
|
||||||
|
|
||||||
|
|
||||||
def _job_type_name(job_type: int) -> str:
|
|
||||||
try:
|
|
||||||
return JobType(job_type).name
|
|
||||||
except ValueError:
|
|
||||||
return str(job_type)
|
|
||||||
|
|
||||||
|
|
||||||
async def _alert_job_dead(job: dict, error: str) -> None:
|
|
||||||
"""잡이 dead-letter 로 떨어졌다 — 재시도를 소진했다는 뜻이다(수동 개입 대상).
|
|
||||||
|
|
||||||
★ dedupe_key 는 "같은 대상이 반복해서 죽는가" 를 잡는다. job_id 는 잡마다 새로 생기므로
|
|
||||||
쓰지 않는다 — payload 의 place_id(대부분의 잡이 갖는 자연키)가 있으면 그걸 쓰고,
|
|
||||||
없으면 job_type 만으로 묶는다(어느 쪽이든 완벽하진 않지만, 없는 것보다는 낫다)."""
|
|
||||||
job_type = job.get("job_type")
|
|
||||||
type_name = _job_type_name(job_type)
|
|
||||||
payload = job.get("payload") or {}
|
|
||||||
target = payload.get("place_id") or payload.get("region_code") or job.get("job_id", "")
|
|
||||||
await alert_service.send_alert(
|
|
||||||
kind="job_dead",
|
|
||||||
title=f"[{type_name}] 잡이 재시도를 소진했다(DEAD)",
|
|
||||||
detail=f"job_id={job.get('job_id')} attempts={job.get('attempts')}\n{error}",
|
|
||||||
dedupe_key=f"job_dead:{type_name}:{target}",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class Worker:
|
class Worker:
|
||||||
@@ -110,29 +84,19 @@ class Worker:
|
|||||||
# 데드라인 초과 — wait_for 가 핸들러 태스크를 취소한 뒤 여기로 온다.
|
# 데드라인 초과 — wait_for 가 핸들러 태스크를 취소한 뒤 여기로 온다.
|
||||||
# 행이 워커 슬롯을 영구 점유하는 것보다 낫다.
|
# 행이 워커 슬롯을 영구 점유하는 것보다 낫다.
|
||||||
backoff = self.backoff_fn(job["attempts"])
|
backoff = self.backoff_fn(job["attempts"])
|
||||||
reason = f"JobDeadlineExceeded: {self.job_deadline_sec:.0f}s"
|
st = await self.queue.fail(jid, self.worker_id, f"JobDeadlineExceeded: {self.job_deadline_sec:.0f}s", backoff)
|
||||||
st = await self.queue.fail(jid, self.worker_id, reason, backoff)
|
|
||||||
LOG.w(f"[{self.worker_id}] deadline {jid} → {JobStatus(st).name if st else '?'} "
|
LOG.w(f"[{self.worker_id}] deadline {jid} → {JobStatus(st).name if st else '?'} "
|
||||||
f"({self.job_deadline_sec:.0f}s 초과, 핸들러 취소)")
|
f"({self.job_deadline_sec:.0f}s 초과, 핸들러 취소)")
|
||||||
if st == JobStatus.DEAD.value:
|
|
||||||
await _alert_job_dead(job, reason)
|
|
||||||
except PermanentJobError as ex:
|
except PermanentJobError as ex:
|
||||||
# ★ 재시도하지 않는다 — 다시 해도 같은 결과다(common/job_errors 주석).
|
# ★ 재시도하지 않는다 — 다시 해도 같은 결과다(common/job_errors 주석).
|
||||||
# 실측(2026-09-15): 사업장이 지워진 뒤 남은 소개문 잡이 "사업장을 찾을 수 없다" 로
|
# 실측(2026-09-15): 사업장이 지워진 뒤 남은 소개문 잡이 "사업장을 찾을 수 없다" 로
|
||||||
# 세 번 돌고 DEAD 로 갔다. 결과는 같고 큐 지연과 알림만 늘었다.
|
# 세 번 돌고 DEAD 로 갔다. 결과는 같고 큐 지연과 알림만 늘었다.
|
||||||
# ★ fail_permanent 는 재시도 없이 곧장 DEAD 다 — 위 일반 실패 경로처럼 상태를 다시
|
await self.queue.fail_permanent(jid, self.worker_id, f"{type(ex).__name__}: {ex}")
|
||||||
# 조회해 분기할 필요 없이 바로 알린다(job_crud.fail_permanent 주석 참고).
|
LOG.w(f"[{self.worker_id}] fail {jid} → DEAD (재시도 안 함: {type(ex).__name__}: {ex})")
|
||||||
reason = f"{type(ex).__name__}: {ex}"
|
|
||||||
await self.queue.fail_permanent(jid, self.worker_id, reason)
|
|
||||||
LOG.w(f"[{self.worker_id}] fail {jid} → DEAD (재시도 안 함: {reason})")
|
|
||||||
await _alert_job_dead(job, reason)
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
backoff = self.backoff_fn(job["attempts"])
|
backoff = self.backoff_fn(job["attempts"])
|
||||||
reason = f"{type(ex).__name__}: {ex}"
|
st = await self.queue.fail(jid, self.worker_id, f"{type(ex).__name__}: {ex}", backoff)
|
||||||
st = await self.queue.fail(jid, self.worker_id, reason, backoff)
|
|
||||||
LOG.w(f"[{self.worker_id}] fail {jid} → {JobStatus(st).name if st else '?'} ({type(ex).__name__}: {ex})")
|
LOG.w(f"[{self.worker_id}] fail {jid} → {JobStatus(st).name if st else '?'} ({type(ex).__name__}: {ex})")
|
||||||
if st == JobStatus.DEAD.value:
|
|
||||||
await _alert_job_dead(job, reason)
|
|
||||||
finally:
|
finally:
|
||||||
hb.cancel()
|
hb.cancel()
|
||||||
try:
|
try:
|
||||||
@@ -160,9 +124,6 @@ async def run_reaper(queue: JobQueue, stop: asyncio.Event, interval: float = 30.
|
|||||||
reclaimed = await queue.reap()
|
reclaimed = await queue.reap()
|
||||||
if reclaimed:
|
if reclaimed:
|
||||||
LOG.w(f"[reaper] reclaimed {len(reclaimed)} stale job(s)")
|
LOG.w(f"[reaper] reclaimed {len(reclaimed)} stale job(s)")
|
||||||
for job in reclaimed:
|
|
||||||
if job["status"] == JobStatus.DEAD.value:
|
|
||||||
await _alert_job_dead(job, job.get("last_error") or "lease 만료 후 재시도 소진")
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
LOG.e_no_callstack(f"[reaper] {type(ex).__name__}: {ex}")
|
LOG.e_no_callstack(f"[reaper] {type(ex).__name__}: {ex}")
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ export const SECTION_DATA_SPEC: Record<string, SectionDataSpec> = {
|
|||||||
kind: 'reading',
|
kind: 'reading',
|
||||||
version: 1,
|
version: 1,
|
||||||
title: '군산 읽기',
|
title: '군산 읽기',
|
||||||
subtitle: '인물 · 문학 — 올 때마다 다른 몇 가지',
|
subtitle: '문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활 — 올 때마다 다른 몇 가지',
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
group: '문학',
|
group: '문학',
|
||||||
@@ -364,12 +364,12 @@ export const SECTION_DATA_SPEC: Record<string, SectionDataSpec> = {
|
|||||||
year: 1937,
|
year: 1937,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
group: '인물',
|
group: '섬과 바다',
|
||||||
title: '채만식의 풍자',
|
title: '고군산군도',
|
||||||
body:
|
body:
|
||||||
'웃기면서 찌르는 문장이 이 작가의 방식입니다. 『레디메이드 인생』 · 『태평천하』 같은 ' +
|
'예순 남짓한 섬이 모인 군도입니다. 새만금 방조제가 육지와 신시도를 잇고, ' +
|
||||||
'다른 대표작에서도 이어지는 태도로, 식민지 도시의 부조리를 인물의 우스꽝스러운 ' +
|
'그 뒤로 무녀도 · 선유도 · 장자도가 다리로 차례로 이어져 차로 들어갈 수 ' +
|
||||||
'말과 행동으로 드러냅니다. 개항장 군산에서 본 것이 그 풍자의 바탕에 있습니다.',
|
'있습니다. 섬마다 성격이 달라 하루로는 다 못 봅니다.',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -382,7 +382,7 @@ export const SECTION_DATA_SPEC: Record<string, SectionDataSpec> = {
|
|||||||
(`backend/services/grounding/story.py` `_SEARCH_LINK_KINDS`). 손으로 적는 칸을 두면
|
(`backend/services/grounding/story.py` `_SEARCH_LINK_KINDS`). 손으로 적는 칸을 두면
|
||||||
거기 적힌 주소가 그 규칙을 비껴간다. */
|
거기 적힌 주소가 그 규칙을 비껴간다. */
|
||||||
fields: [
|
fields: [
|
||||||
{key: 'group', label: '갈래', half: true, hint: '인물 · 문학'},
|
{key: 'group', label: '갈래', half: true, hint: '문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활'},
|
||||||
{key: 'year', label: '연도', type: 'number', half: true},
|
{key: 'year', label: '연도', type: 'number', half: true},
|
||||||
{key: 'title', label: '꼭지 제목'},
|
{key: 'title', label: '꼭지 제목'},
|
||||||
{key: 'body', label: '본문', type: 'area', hint: '서너 문장'},
|
{key: 'body', label: '본문', type: 'area', hint: '서너 문장'},
|
||||||
|
|||||||
@@ -1,18 +1,10 @@
|
|||||||
import {Check, Loader2} from 'lucide-react';
|
import {Check, Loader2} from 'lucide-react';
|
||||||
import {JobStatus} from '@o2o/shared';
|
import {JobStatus} from '@o2o/shared';
|
||||||
import {Button} from '@/components/ui/button';
|
import {Button} from '@/components/ui/button';
|
||||||
import {Progress} from '@/components/ui/progress';
|
|
||||||
import {cn} from '@/lib/utils';
|
|
||||||
import {useBuilderStore} from '@/stores/builder';
|
import {useBuilderStore} from '@/stores/builder';
|
||||||
import {useGenerationJob} from './useGenerationJob';
|
import {useGenerationJob} from './useGenerationJob';
|
||||||
import {GENERATION_LABELS, SKIP_REASONS} from './generationLabels';
|
import {GENERATION_LABELS, SKIP_REASONS} from './generationLabels';
|
||||||
|
|
||||||
/*
|
|
||||||
* ★ 겉모습만 옛 화면 스타일이고 데이터는 실제 잡 진행 상태다. `useGenerationJob`
|
|
||||||
* (새로고침해도 jobId 로 이어서 봄, 실패 시 복구 버튼)을 그대로 쓰고, 카드 모양·
|
|
||||||
* 진행률 바·번호 동그라미 목록만 그 스타일로 그린다. 단계 문구는 실제로 이 COPY
|
|
||||||
* 잡이 하는 일(prepare/generate/save/faq_fill)만 적는다 — 자세한 배경은 DEVLOG.md.
|
|
||||||
*/
|
|
||||||
export function Step5Generating() {
|
export function Step5Generating() {
|
||||||
const storeName = useBuilderStore((s) => s.storeName);
|
const storeName = useBuilderStore((s) => s.storeName);
|
||||||
const placeId = useBuilderStore((s) => s.placeId);
|
const placeId = useBuilderStore((s) => s.placeId);
|
||||||
@@ -20,103 +12,47 @@ export function Step5Generating() {
|
|||||||
const failed = job?.status === JobStatus.DEAD;
|
const failed = job?.status === JobStatus.DEAD;
|
||||||
const waiting = job?.status === JobStatus.PENDING;
|
const waiting = job?.status === JobStatus.PENDING;
|
||||||
const steps = job?.progress?.steps ?? [];
|
const steps = job?.progress?.steps ?? [];
|
||||||
const total = steps.length;
|
|
||||||
const doneCount = steps.filter((s) => s.status === 'done' || s.status === 'skipped').length;
|
|
||||||
const progress = total ? Math.min(100, Math.round((doneCount / total) * 100)) : 0;
|
|
||||||
const runningIndex = steps.findIndex((s) => s.status === 'running');
|
|
||||||
const currentLabel = runningIndex >= 0
|
|
||||||
? GENERATION_LABELS[steps[runningIndex].id] ?? '콘텐츠 처리'
|
|
||||||
: job?.status === JobStatus.DONE ? '완료'
|
|
||||||
: '준비 중';
|
|
||||||
|
|
||||||
const title = error ? '진행 상태 확인이 필요합니다'
|
const title = error ? '진행 상태 확인이 필요합니다'
|
||||||
: failed ? '콘텐츠 생성을 완료하지 못했습니다'
|
: failed ? '콘텐츠 생성을 완료하지 못했습니다'
|
||||||
: waiting ? (job.attempts ? '생성을 다시 시도할 예정입니다' : '생성 순서를 기다리고 있습니다')
|
: waiting ? (job.attempts ? '생성을 다시 시도할 예정입니다' : '생성 순서를 기다리고 있습니다')
|
||||||
: job?.status === JobStatus.DONE ? '콘텐츠 생성을 마쳤습니다'
|
: job?.status === JobStatus.DONE ? '콘텐츠 생성을 마쳤습니다'
|
||||||
: '웹사이트를 생성하고 있습니다';
|
: '소개문과 FAQ를 만들고 있습니다';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-1 flex-col items-center justify-center bg-muted/30 px-4 py-16 sm:px-6 sm:py-24 lg:px-8">
|
<div className="flex flex-1 items-center justify-center bg-muted/30 px-4 py-16">
|
||||||
<div className="mx-auto flex w-full max-w-md flex-col items-center text-center">
|
<div className="w-full max-w-md space-y-6 text-center">
|
||||||
<div className="mb-6 flex size-16 items-center justify-center rounded-2xl border border-border bg-card">
|
{!error && !failed && <Loader2 className="mx-auto size-8 animate-spin text-primary" />}
|
||||||
{!error && !failed
|
<h1 className="text-xl font-bold" aria-live="polite">{title}</h1>
|
||||||
? <Loader2 className="size-8 animate-spin text-primary" />
|
<p className="text-sm text-muted-foreground">
|
||||||
: <span className="text-2xl" aria-hidden="true">⚠️</span>}
|
{error || <><strong>{storeName}</strong>의 확인된 정보를 바탕으로 작성합니다.</>}
|
||||||
</div>
|
|
||||||
|
|
||||||
<h1 className="mb-2 text-2xl font-bold tracking-tight sm:text-3xl" aria-live="polite">
|
|
||||||
{title}
|
|
||||||
</h1>
|
|
||||||
<p className="mb-8 max-w-md text-xs text-muted-foreground sm:text-sm">
|
|
||||||
{error || (
|
|
||||||
<>
|
|
||||||
<strong className="font-semibold text-foreground">{storeName}</strong>의 확인된 정보만
|
|
||||||
담아 정적 페이지로 굽고 있어요.
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</p>
|
</p>
|
||||||
|
{steps.length > 0 && (
|
||||||
{total > 0 && (
|
<ol className="space-y-4 rounded-2xl border border-border bg-card p-6 text-left text-sm">
|
||||||
<div className="w-full space-y-4 rounded-2xl border border-border bg-card p-6 text-left">
|
{steps.map((step) => {
|
||||||
<div className="flex items-center justify-between text-xs">
|
const state = step.status === 'running' && failed ? 'failed' : step.status;
|
||||||
<span className="font-bold">{currentLabel}</span>
|
const label = state === 'done' ? '완료' : state === 'skipped' ? '건너뜀'
|
||||||
<span className="font-mono font-bold">{progress}%</span>
|
: state === 'failed' ? '중단' : state === 'running' ? (waiting ? '재시도 대기' : '진행 중') : '대기';
|
||||||
</div>
|
return (
|
||||||
|
<li key={step.id} className="flex items-center gap-3">
|
||||||
<Progress value={progress} aria-label="사이트 생성 진행률" />
|
{state === 'done' ? <Check className="size-4 shrink-0 text-success" />
|
||||||
|
: state === 'running' && !waiting && !error ? <Loader2 className="size-4 shrink-0 animate-spin" />
|
||||||
<ol className="space-y-2.5 pt-2">
|
: <span className="size-4 shrink-0 rounded-full border border-border" />}
|
||||||
{steps.map((step, index) => {
|
<div className="flex-1">
|
||||||
const state = step.status === 'running' && failed ? 'failed' : step.status;
|
{GENERATION_LABELS[step.id] ?? '콘텐츠 처리'}
|
||||||
const isDone = state === 'done' || state === 'skipped';
|
{step.reason && <p className="mt-1 text-xs text-muted-foreground">{SKIP_REASONS[step.reason] ?? '이 단계는 생략했습니다'}</p>}
|
||||||
const isCurrent = state === 'running';
|
</div>
|
||||||
|
<span className="text-xs text-muted-foreground">{label}</span>
|
||||||
return (
|
</li>
|
||||||
<li
|
);
|
||||||
key={step.id}
|
})}
|
||||||
className={cn(
|
</ol>
|
||||||
'flex items-center gap-3 text-xs transition-colors',
|
|
||||||
isDone || isCurrent ? 'font-medium text-foreground' : 'text-muted-foreground',
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className={cn(
|
|
||||||
'flex size-4 shrink-0 items-center justify-center rounded-full text-[10px] font-bold',
|
|
||||||
isDone || isCurrent
|
|
||||||
? 'bg-primary text-primary-foreground'
|
|
||||||
: 'border border-border bg-muted',
|
|
||||||
isCurrent && 'ring-2 ring-primary/20',
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{isDone ? <Check className="size-2.5" strokeWidth={3} /> : index + 1}
|
|
||||||
</span>
|
|
||||||
<span className="truncate">
|
|
||||||
{GENERATION_LABELS[step.id] ?? '콘텐츠 처리'}
|
|
||||||
{step.reason && (
|
|
||||||
<span className="ml-1 text-muted-foreground">
|
|
||||||
({SKIP_REASONS[step.reason] ?? '건너뜀'})
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!error && !failed && (
|
|
||||||
<p className="mt-6 text-xs text-muted-foreground">
|
|
||||||
새로고침해도 같은 작업의 진행 상태를 이어서 확인합니다.
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
{(error || failed) && (
|
|
||||||
<div className="mt-6 flex flex-wrap justify-center gap-2">
|
|
||||||
{error && <Button onClick={checkAgain}>상태 다시 확인</Button>}
|
|
||||||
<Button variant="outline" onClick={goBack}>이전 단계로</Button>
|
|
||||||
<Button variant="outline" onClick={openEditor}>편집기로 이동</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
|
{!error && !failed && <p className="text-xs text-muted-foreground">새로고침해도 같은 작업의 진행 상태를 이어서 확인합니다.</p>}
|
||||||
|
{(error || failed) && <div className="flex flex-wrap justify-center gap-2">
|
||||||
|
{error && <Button onClick={checkAgain}>상태 다시 확인</Button>}
|
||||||
|
<Button variant="outline" onClick={goBack}>이전 단계로</Button>
|
||||||
|
<Button variant="outline" onClick={openEditor}>편집기로 이동</Button>
|
||||||
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
/** 화면 문구만 둔다. 단계 순서·완료 여부는 jobs.progress가 보낸다. */
|
/** 화면 문구만 둔다. 단계 순서·완료 여부는 jobs.progress가 보낸다. */
|
||||||
export const GENERATION_LABELS: Record<string, string> = {
|
export const GENERATION_LABELS: Record<string, string> = {
|
||||||
prepare: '수집된 사진 분류 및 대체 텍스트 생성',
|
prepare: '확인된 정보와 수집 원문 준비',
|
||||||
generate: '브랜드 컬러 시스템 및 타이포그래피 조합',
|
generate: '소개문·FAQ 생성 및 근거 검증',
|
||||||
save: '확인된 사실만으로 소개 콘텐츠 구성',
|
save: '소개문·FAQ 저장',
|
||||||
faq_fill: '위치 기반 길찾기 연동 및 구조화 데이터(JSON-LD) 준비',
|
faq_fill: '부족한 FAQ 문의 안내 보완',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SKIP_REASONS: Record<string, string> = {
|
export const SKIP_REASONS: Record<string, string> = {
|
||||||
no_facts: '확인된 정보 없음',
|
no_facts: '확인된 정보 없음',
|
||||||
not_configured: '생성 서비스 미설정',
|
not_configured: '생성 서비스 미설정',
|
||||||
no_catalog: '공통 질문 대상 업종 아님',
|
no_catalog: '공통 질문 대상 업종 아님',
|
||||||
generation_failed: '생성 서비스 응답 실패 — 확인된 정보만으로 계속합니다',
|
|
||||||
};
|
};
|
||||||
@@ -70,13 +70,18 @@ export function SocialConnectionCard() {
|
|||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<h2 className="text-sm font-bold">SNS 연동 · Threads</h2>
|
<h2 className="text-sm font-bold">SNS 연동 · Threads</h2>
|
||||||
<p className="mt-1 text-xs text-muted-foreground">
|
<p className="mt-1 text-xs text-muted-foreground">
|
||||||
{!ready
|
{/*
|
||||||
? '연동 준비 중입니다. 열리면 여기서 계정을 연결합니다.'
|
★ '연결돼 있음' 이 '연결 설정 준비됨' 보다 앞선다. 이미 연결된 계정이 있는데
|
||||||
: account
|
"준비 중" 이라고 말하면 사장님은 연결이 풀린 줄 안다 — 게시는 저장된 토큰만으로
|
||||||
? needsReauth
|
되므로(services/social_account_service.token_ready) 그 말이 사실도 아니다.
|
||||||
? '연결이 만료됐습니다. 다시 연결해야 게재할 수 있습니다.'
|
*/}
|
||||||
: '연결되어 있습니다. 사이트를 발행한 뒤 소개글을 써서 올릴 수 있습니다.'
|
{account
|
||||||
: '미리 연결해 두면, 사이트를 발행한 뒤 소개글을 써서 이 계정으로 올립니다.'}
|
? needsReauth
|
||||||
|
? '연결이 만료됐습니다. 다시 연결해야 게재할 수 있습니다.'
|
||||||
|
: '연결되어 있습니다. 사이트를 발행한 뒤 소개글을 써서 올릴 수 있습니다.'
|
||||||
|
: ready
|
||||||
|
? '미리 연결해 두면, 사이트를 발행한 뒤 소개글을 써서 이 계정으로 올립니다.'
|
||||||
|
: '연동 준비 중입니다. 열리면 여기서 계정을 연결합니다.'}
|
||||||
</p>
|
</p>
|
||||||
{account && (
|
{account && (
|
||||||
<p className="mt-1 text-xs">
|
<p className="mt-1 text-xs">
|
||||||
@@ -117,7 +122,7 @@ export function SocialConnectionCard() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 게재가 아직 안 열린 상태를 숨기지 않는다 — 연결만 해 두고 기다리는 것도 사장님의 선택이다. */}
|
{/* 게재가 아직 안 열린 상태를 숨기지 않는다 — 연결만 해 두고 기다리는 것도 사장님의 선택이다. */}
|
||||||
{ready && !state.posting_enabled && (
|
{(ready || account) && !state.posting_enabled && (
|
||||||
<p className="mt-3 text-xs text-muted-foreground">
|
<p className="mt-3 text-xs text-muted-foreground">
|
||||||
자동 게재는 준비 중입니다. 지금은 소개글을 만들어 복사하거나 내용을 확인할 수 있습니다.
|
자동 게재는 준비 중입니다. 지금은 소개글을 만들어 복사하거나 내용을 확인할 수 있습니다.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -14,15 +14,10 @@ import {establishSession} from '@/lib/session';
|
|||||||
*
|
*
|
||||||
* ⚠️ 이 값은 **번들에 구워진다.** 페이지를 연 사람은 누구나 JS 에서 읽을 수 있다 —
|
* ⚠️ 이 값은 **번들에 구워진다.** 페이지를 연 사람은 누구나 JS 에서 읽을 수 있다 —
|
||||||
* 내부 테스트 호스트에서만 켜고, 사장님에게 여는 순간 반드시 빼야 한다.
|
* 내부 테스트 호스트에서만 켜고, 사장님에게 여는 순간 반드시 빼야 한다.
|
||||||
* ★ `import.meta.env.DEV` 가드는 둘째 안전판이다. 운영 빌드(vite build)는 이 상수가
|
|
||||||
* 컴파일 시점에 `false` 로 접히므로 아래 if 블록째 번들에서 잘려 나간다 — 누군가 실수로
|
|
||||||
* 운영 이미지(nginx/Dockerfile)에 VITE_AUTO_LOGIN_ID·PW 를 다시 넘겨도 코드가 죽어 있어
|
|
||||||
* 못 켠다. `vite dev`(solution-frontend --profile dev)에서는 DEV=true 라 그대로 켜진다.
|
|
||||||
*/
|
*/
|
||||||
let pending: Promise<void> | null = null;
|
let pending: Promise<void> | null = null;
|
||||||
|
|
||||||
export function ensureAutoSession(): Promise<void> {
|
export function ensureAutoSession(): Promise<void> {
|
||||||
if (!import.meta.env.DEV) return Promise.resolve();
|
|
||||||
if (getAccessToken()) return Promise.resolve();
|
if (getAccessToken()) return Promise.resolve();
|
||||||
if (pending) return pending;
|
if (pending) return pending;
|
||||||
|
|
||||||
|
|||||||
@@ -171,28 +171,24 @@ export const SECTION_PROMPTS: Record<StoryKind, SectionPromptSpec> = {
|
|||||||
reading: {
|
reading: {
|
||||||
kind: 'reading',
|
kind: 'reading',
|
||||||
label: '지역 읽기',
|
label: '지역 읽기',
|
||||||
maxItems: 16,
|
maxItems: 34,
|
||||||
task: `[해야 할 일]
|
task: `[해야 할 일]
|
||||||
[지역] 출신이거나 [지역]과 깊이 얽힌 **인물**, [지역]을 무대로 하거나 다룬 **작품**의 이야기를
|
[지역]을 소개하는 글 30~34꼭지를 갈래로 나눠 쓴다.
|
||||||
갈래로 나눠 12~16꼭지 쓴다. 장소·역사·먹거리 소개는 다루지 않는다(각자 섹션이 있다).
|
갈래는 다섯이다 — 문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활.
|
||||||
한 갈래에 몰지 않되, 댈 수 있는 사실이 적은 갈래는 적게 쓴다.
|
한 갈래에 몰지 않되, 댈 수 있는 사실이 적은 갈래는 적게 쓴다.
|
||||||
|
|
||||||
[스키마]
|
[스키마]
|
||||||
{ "kind":"reading", "version":1, "title":"[지역] 읽기",
|
{ "kind":"reading", "version":1, "title":"[지역] 읽기",
|
||||||
"subtitle":"인물 · 문학 — 올 때마다 다른 몇 가지",
|
"subtitle":"문학 · 섬과 바다 · 역사 · 장소 · 음식과 생활 — 올 때마다 다른 몇 가지",
|
||||||
"items":[
|
"items":[
|
||||||
{ "group":"인물|문학",
|
{ "group":"문학|섬과 바다|역사|장소|음식과 생활",
|
||||||
"title":"꼭지 제목", "body":"서너 문장", "year":1937 } ] }`,
|
"title":"꼭지 제목", "body":"서너 문장", "year":1937 } ] }`,
|
||||||
rules: `
|
rules: `
|
||||||
[이 아이템만의 규칙]
|
[이 아이템만의 규칙]
|
||||||
· body 는 **서너 문장**이다. 두 문장이면 카드가 한 줄로 접혀 빈 카드처럼 보인다.
|
· body 는 **서너 문장**이다. 두 문장이면 카드가 한 줄로 접혀 빈 카드처럼 보인다.
|
||||||
다만 문장을 늘리려고 없는 숫자·연도·거리를 지어내지 않는다 — 널리 알려진 배경만 보탠다.
|
다만 문장을 늘리려고 없는 숫자·연도·거리를 지어내지 않는다 — 널리 알려진 배경만 보탠다.
|
||||||
· "인물" 은 그 인물의 개괄 소개(생몰년·직함 한 줄)가 아니라, **그 사람이 남긴 작품·활동·일화**
|
· **이미 다른 자리에 선 것은 쓰지 않는다.** 인물·대중가요·축제·연표 사건·주변 명소·맛집은
|
||||||
중심으로 쓴다. '인물 열전' 섹션과 같은 사람을 다뤄도 되지만, 거기 있는 소개 문장을 반복하지
|
각자 섹션이 있다. 같은 것을 두 번 세우면 페이지만 길어지고 손님은 같은 말을 두 번 읽는다.
|
||||||
않는다 — 인물 열전에 없는 사람이어도 좋다.
|
|
||||||
· "문학" 은 그 지역을 무대로 하거나 다룬 작품(소설·시·수필 등)의 배경과 이야기를 쓴다.
|
|
||||||
· **장소·역사·먹거리 소개, 그리고 대중가요·축제·연표 사건·주변 명소·맛집처럼 이미 다른 자리에
|
|
||||||
선 것은 쓰지 않는다.** 같은 것을 두 번 세우면 페이지만 길어지고 손님은 같은 말을 두 번 읽는다.
|
|
||||||
· year 는 연도를 댈 수 있는 꼭지에만 쓴다. 짐작해서 넣지 않는다.
|
· year 는 연도를 댈 수 있는 꼭지에만 쓴다. 짐작해서 넣지 않는다.
|
||||||
· source 와 verified 를 적지 않는다. **주소를 짐작해 적으면 없는 문서로 이어진다** —
|
· source 와 verified 를 적지 않는다. **주소를 짐작해 적으면 없는 문서로 이어진다** —
|
||||||
제목으로 찾아가는 검색 링크를 서버가 붙인다(2026-09-14 대표 지시).
|
제목으로 찾아가는 검색 링크를 서버가 붙인다(2026-09-14 대표 지시).
|
||||||
|
|||||||
@@ -289,9 +289,7 @@ export interface WeatherSnapshot {
|
|||||||
* ★ 사장님이 자기 집을 두고 쓰는 문장이다 — 날씨 예보가 아니다.
|
* ★ 사장님이 자기 집을 두고 쓰는 문장이다 — 날씨 예보가 아니다.
|
||||||
*/
|
*/
|
||||||
notes?: Partial<Record<WeatherMood, string>>;
|
notes?: Partial<Record<WeatherMood, string>>;
|
||||||
noteSets?: Partial<
|
noteSets?: Partial<Record<WeatherMood | '구름많음', string[]>>;
|
||||||
Record<WeatherMood | '구름많음' | '안개' | '소나기' | '뇌우' | '이슬비' | '강한비' | '어는비', string[]>
|
|
||||||
>;
|
|
||||||
tempNoteSets?: Partial<Record<WeatherBand, string[]>>;
|
tempNoteSets?: Partial<Record<WeatherBand, string[]>>;
|
||||||
/**
|
/**
|
||||||
* 기온대별 한 줄 — **오늘 이 동네에서 뭘 하면 되나.**
|
* 기온대별 한 줄 — **오늘 이 동네에서 뭘 하면 되나.**
|
||||||
|
|||||||
@@ -1012,7 +1012,7 @@ docker cp vendor/. \$C:/app/solution/site/out/s/stay/vendor/"
|
|||||||
|
|
||||||
### 카로셀 제어 (`tameRails`)
|
### 카로셀 제어 (`tameRails`)
|
||||||
|
|
||||||
렌더러의 자동 넘김(`site/src/lib/ui/use-rail-autoplay.ts`)은 4초 **고정 타이머**이고,
|
렌더러의 자동 넘김(`site/src/lib/ui/use-rail-autoplay.ts`)은 4.5초 **고정 타이머**이고,
|
||||||
정지는 `held` 카운터 하나로 센다 — 레일 위 `pointerdown` 에 올리고 window `pointerup`·
|
정지는 `held` 카운터 하나로 센다 — 레일 위 `pointerdown` 에 올리고 window `pointerup`·
|
||||||
`pointercancel` 에 내린다. 주입분은 타이머를 건드리지 않고 **그 카운터만** 쓴다
|
`pointercancel` 에 내린다. 주입분은 타이머를 건드리지 않고 **그 카운터만** 쓴다
|
||||||
(`pointerdown` 을 `button: 2` 로 쏜다 — embla 는 주 버튼이 아닌 것을 드래그로 치지 않는다).
|
(`pointerdown` 을 `button: 2` 로 쏜다 — embla 는 주 버튼이 아닌 것을 드래그로 치지 않는다).
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ const d = await page.evaluate(() => {
|
|||||||
groups: (e.groups || []).length,
|
groups: (e.groups || []).length,
|
||||||
sourced: e.items.filter((x) => x.source && x.source.url).length,
|
sourced: e.items.filter((x) => x.source && x.source.url).length,
|
||||||
}; })(),
|
}; })(),
|
||||||
domReadCards: document.querySelectorAll('#reading article').length,
|
domReadCards: document.querySelectorAll('#w4d-reading-panel .w4d-read-card').length,
|
||||||
domReadGroups: document.querySelectorAll('#w4d-reading-panel .w4d-read-group').length,
|
domReadGroups: document.querySelectorAll('#w4d-reading-panel .w4d-read-group').length,
|
||||||
domReadSrc: document.querySelectorAll('#w4d-reading-panel .w4d-read-src a').length,
|
domReadSrc: document.querySelectorAll('#w4d-reading-panel .w4d-read-src a').length,
|
||||||
// 레일이 아니어야 한다 — 가로로 밀어야 보이면 '펼쳐 둔다' 가 아니다.
|
// 레일이 아니어야 한다 — 가로로 밀어야 보이면 '펼쳐 둔다' 가 아니다.
|
||||||
@@ -90,10 +90,10 @@ const d = await page.evaluate(() => {
|
|||||||
heroImg: (P.media.find((m) => m.isPrimary) || {}).url,
|
heroImg: (P.media.find((m) => m.isPrimary) || {}).url,
|
||||||
roomA: P.units[0].mediaIds.length, roomB: P.units[1].mediaIds.length,
|
roomA: P.units[0].mediaIds.length, roomB: P.units[1].mediaIds.length,
|
||||||
roomMirror: P.units.flatMap((u) => u.mediaIds).length,
|
roomMirror: P.units.flatMap((u) => u.mediaIds).length,
|
||||||
tagline: document.querySelector('#root .hero-catchphrase-fixed')?.textContent.trim(),
|
tagline: document.querySelector('#root h1')?.nextElementSibling?.textContent.trim(),
|
||||||
sub: document.querySelector('#root .hero-catchphrase .w4d-line')?.textContent.replace(/\s+/g, ' ').trim(),
|
sub: document.getElementById('w4d-sub')?.textContent.trim(),
|
||||||
subIsCatch: (() => { const t = document.querySelector('#root .hero-catchphrase .w4d-line')?.textContent.replace(/\s+/g, ' ').trim(); return !!t && (P.narrative.catchphrases?.items || []).some((x) => x.text.replace(/\s+/g, ' ').trim() === t); })(),
|
subIsCatch: (() => { const t = document.getElementById('w4d-sub')?.textContent.trim(); return !!t && (P.narrative.catchphrases?.items || []).some((x) => x.text.replace(/\s+/g, ' ').trim() === t); })(),
|
||||||
postcardMaker: !!document.getElementById('postcard-maker'),
|
postcardMaker: !!document.getElementById('w4d-pm-section'),
|
||||||
restaurants: P.local.restaurants.length,
|
restaurants: P.local.restaurants.length,
|
||||||
// 걸어서 10분(800m) 넘는 맛집 — 없으면 '10분 이상' 탭에서 맛집 칸이 빈다(2026-09-11 사장님 지적)
|
// 걸어서 10분(800m) 넘는 맛집 — 없으면 '10분 이상' 탭에서 맛집 칸이 빈다(2026-09-11 사장님 지적)
|
||||||
restPhotos: P.local.restaurants.filter((r) => r.imageUrl).length,
|
restPhotos: P.local.restaurants.filter((r) => r.imageUrl).length,
|
||||||
@@ -105,7 +105,7 @@ ok('캐치프레이즈 100개', d.catch === 100, `${d.catch}개 · 일반${d.cat
|
|||||||
// 대표 문구는 고정, 순환은 그 아래 줄 (2026-09-11 사장님 지시)
|
// 대표 문구는 고정, 순환은 그 아래 줄 (2026-09-11 사장님 지시)
|
||||||
ok('대표 문구 고정', d.tagline === '히로쓰 가옥 담 너머, 백 년 된 집 한 채', `"${d.tagline}"`);
|
ok('대표 문구 고정', d.tagline === '히로쓰 가옥 담 너머, 백 년 된 집 한 채', `"${d.tagline}"`);
|
||||||
ok('아래 줄에 캐치프레이즈', d.subIsCatch, `"${d.sub}"`);
|
ok('아래 줄에 캐치프레이즈', d.subIsCatch, `"${d.sub}"`);
|
||||||
const sub2 = await page.waitForTimeout(7500).then(() => page.evaluate(() => document.querySelector('#root .hero-catchphrase .w4d-line')?.textContent.replace(/\s+/g, ' ').trim()));
|
const sub2 = await page.waitForTimeout(7500).then(() => page.evaluate(() => document.getElementById('w4d-sub')?.textContent.trim()));
|
||||||
ok('아래 줄 순환', !!sub2 && sub2 !== d.sub, `→ "${sub2}"`);
|
ok('아래 줄 순환', !!sub2 && sub2 !== d.sub, `→ "${sub2}"`);
|
||||||
/* 자동재생 (2026-09-14 대표 지시). 브라우저는 조작 없는 소리 재생을 막는다 — 정책이라 못 넘는다.
|
/* 자동재생 (2026-09-14 대표 지시). 브라우저는 조작 없는 소리 재생을 막는다 — 정책이라 못 넘는다.
|
||||||
그래서 **첫 손길에 켜지는가**를 센다. 막지 않는 브라우저면 그 전에 이미 켜져 있다. */
|
그래서 **첫 손길에 켜지는가**를 센다. 막지 않는 브라우저면 그 전에 이미 켜져 있다. */
|
||||||
@@ -132,10 +132,14 @@ ok('정거장마다 할 일 문구', d.hasNote, d.hasNote ? '전 정거장' : '
|
|||||||
ok('일정 사진 없음', d.stopImages === 0 && d.domItinImg === 0, `payload ${d.stopImages} · 화면 ${d.domItinImg}`);
|
ok('일정 사진 없음', d.stopImages === 0 && d.domItinImg === 0, `payload ${d.stopImages} · 화면 ${d.domItinImg}`);
|
||||||
ok('숙소에서 쉬는 날', d.restDays >= 3, `${d.restDays}일`);
|
ok('숙소에서 쉬는 날', d.restDays >= 3, `${d.restDays}일`);
|
||||||
ok('종료 시각 분산', d.endTimes[1] - d.endTimes[0] > 240, `${(d.endTimes[0] / 60 | 0)}:${String(d.endTimes[0] % 60).padStart(2, '0')} ~ ${(d.endTimes[1] / 60 | 0)}:${String(d.endTimes[1] % 60).padStart(2, '0')}`);
|
ok('종료 시각 분산', d.endTimes[1] - d.endTimes[0] > 240, `${(d.endTimes[0] / 60 | 0)}:${String(d.endTimes[0] % 60).padStart(2, '0')} ~ ${(d.endTimes[1] / 60 | 0)}:${String(d.endTimes[1] % 60).padStart(2, '0')}`);
|
||||||
/* 군산 읽기 — 렌더러(ReadingSection)가 꼭지를 **전부** 세운다 (2026-09-16 대표 지시로
|
/* 군산 읽기 — 34가지 중 **무작위 5~6꼭지만** 카로셀로 (2026-09-14 대표: "그냥 5-6개 정도만
|
||||||
무작위 5~6 에서 뒤집었다). 주입분은 껐다 — 둘 다 돌면 같은 제목이 두 번 선다. */
|
보여주는거 어때? 랜덤으로"). 신문 조판(제호·면·격자)은 같은 날 대표가 걷어냈다("문학면?
|
||||||
|
말이 안 되는거 같네") — 그 항목을 여기서도 뺀다. 화면과 점검이 갈리면 점검이 거짓말을 한다. */
|
||||||
ok('군산 읽기 재료', d.reading.items >= 30, `payload ${d.reading.items}가지`);
|
ok('군산 읽기 재료', d.reading.items >= 30, `payload ${d.reading.items}가지`);
|
||||||
ok('군산 읽기 화면', d.domReadCards === d.reading.items, `${d.domReadCards}꼭지 전체`);
|
ok('군산 읽기 화면', d.domReadCards >= 5 && d.domReadCards <= 6,
|
||||||
|
`${d.domReadCards}꼭지 (매번 무작위 5~6)`);
|
||||||
|
ok('군산 읽기 출처', d.reading.sourced === d.reading.items && d.domReadSrc === d.domReadCards,
|
||||||
|
`payload ${d.reading.sourced}/${d.reading.items} · 화면 ${d.domReadSrc}/${d.domReadCards}`);
|
||||||
/* 오늘의 한 장 — 탭을 **세우지 않는 것**이 정상이다 (2026-09-14 사장님: "오늘의 한장은
|
/* 오늘의 한 장 — 탭을 **세우지 않는 것**이 정상이다 (2026-09-14 사장님: "오늘의 한장은
|
||||||
주석처리해주쇼", patch_stay.py HIDE_TABS). 값은 stay-payload-new.json 에 그대로 있다. */
|
주석처리해주쇼", patch_stay.py HIDE_TABS). 값은 stay-payload-new.json 에 그대로 있다. */
|
||||||
ok('오늘의 한 장 숨김', !d.storyTabs.includes('오늘의 한 장') && d.daily === 0,
|
ok('오늘의 한 장 숨김', !d.storyTabs.includes('오늘의 한 장') && d.daily === 0,
|
||||||
|
|||||||
@@ -1,191 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="ko">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
||||||
<title>스테이,머뭄 · 전북 군산시 숙소</title>
|
|
||||||
<meta name="description" content="1920년대 적산가옥을 고쳐 지은 독채 두 동, 매일 세탁·살균하는 침구. 군산시에 있는 스테이,머뭄입니다." />
|
|
||||||
<link rel="canonical" href="https://web4ai.o2osolution.ai/s/stay3" />
|
|
||||||
<meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
|
|
||||||
<meta http-equiv="content-language" content="ko-KR" />
|
|
||||||
<meta name="theme-color" content="#dbd3c8" />
|
|
||||||
<meta name="dateModified" content="2026-09-04T05:22:24.120253+00:00" />
|
|
||||||
<meta name="datePublished" content="2026-09-03T01:27:39.284442+00:00" />
|
|
||||||
<meta property="article:published_time" content="2026-09-03T01:27:39.284442+00:00" />
|
|
||||||
<meta property="article:modified_time" content="2026-09-04T05:22:24.120253+00:00" />
|
|
||||||
<meta name="author" content="스테이,머뭄" />
|
|
||||||
<meta name="publisher" content="스테이,머뭄" />
|
|
||||||
<link rel="author" href="https://web4ai.o2osolution.ai/s/stay3" />
|
|
||||||
<meta property="og:type" content="website" />
|
|
||||||
<meta property="og:site_name" content="스테이,머뭄" />
|
|
||||||
<meta property="og:locale" content="ko_KR" />
|
|
||||||
<meta property="og:title" content="스테이,머뭄 · 전북 군산시 숙소" />
|
|
||||||
<meta property="og:description" content="1920년대 적산가옥을 고쳐 지은 독채 두 동, 매일 세탁·살균하는 침구. 군산시에 있는 스테이,머뭄입니다." />
|
|
||||||
<meta property="og:url" content="https://web4ai.o2osolution.ai/s/stay3" />
|
|
||||||
<meta property="og:image" content="/assets/mirror/ddc9f804f4ef83b5.jpg" />
|
|
||||||
<meta property="og:image:alt" content="목재 서까래 천장과 미닫이창, 테이블이 있는 거실 공간" />
|
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
|
||||||
<meta name="twitter:title" content="스테이,머뭄 · 전북 군산시 숙소" />
|
|
||||||
<meta name="twitter:description" content="1920년대 적산가옥을 고쳐 지은 독채 두 동, 매일 세탁·살균하는 침구. 군산시에 있는 스테이,머뭄입니다." />
|
|
||||||
<meta name="twitter:image" content="/assets/mirror/ddc9f804f4ef83b5.jpg" />
|
|
||||||
<meta name="geo.position" content="35.9864175;126.7061254" />
|
|
||||||
<meta name="ICBM" content="35.9864175, 126.7061254" />
|
|
||||||
<meta name="geo.region" content="KR-45" />
|
|
||||||
<meta name="geo.placename" content="스테이,머뭄" />
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300..900&family=Noto+Serif+KR:wght@300..700&display=swap" rel="stylesheet" />
|
|
||||||
<link rel="sitemap" type="application/xml" href="/sitemap.xml" />
|
|
||||||
<link rel="alternate" type="text/plain" href="/s/stay3/llms.txt" title="LLM 요약" />
|
|
||||||
<link rel="stylesheet" href="/assets/index-DcOVyVAh.css" />
|
|
||||||
<style>
|
|
||||||
:root {
|
|
||||||
--tpl-primary: #3b342c;
|
|
||||||
--tpl-secondary: #7d7266;
|
|
||||||
--tpl-bg: #e5ddd2;
|
|
||||||
--tpl-card: #ded5c8;
|
|
||||||
--tpl-text: #3b342c;
|
|
||||||
--tpl-accent: #8d7f6d;
|
|
||||||
--tpl-surface: #dbd3c8;
|
|
||||||
--tpl-surface-alt: #ded5c8;
|
|
||||||
--tpl-inverse: #1c1917;
|
|
||||||
--tpl-border: #c3bbb1;
|
|
||||||
--tpl-font-heading: 'Noto Serif KR', 'Batang', serif;
|
|
||||||
--tpl-font-body: 'Pretendard Variable', 'Noto Sans KR', system-ui, sans-serif;
|
|
||||||
--tpl-heading-tracking: 0.06em;
|
|
||||||
--tpl-heading-weight: 300;
|
|
||||||
--tpl-section-space: 7rem;
|
|
||||||
--tpl-border-width: 1px;
|
|
||||||
--tpl-radius: 0px;
|
|
||||||
--tpl-shadow: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":["LodgingBusiness","LocalBusiness","Organization"],"@id":"https://web4ai.o2osolution.ai/s/stay3#business","name":"스테이,머뭄","url":"https://web4ai.o2osolution.ai/s/stay3","description":"1920년대 적산가옥을 고쳐 지은 독채 두 동, 매일 세탁·살균하는 침구","telephone":"0507-1497-0983","address":{"@type":"PostalAddress","streetAddress":"전북 군산시 절골길 18","addressLocality":"군산시","addressRegion":"전북","addressCountry":"KR"},"geo":{"@type":"GeoCoordinates","latitude":35.9864175,"longitude":126.7061254},"image":["https://web4ai.o2osolution.ai/assets/mirror/ddc9f804f4ef83b5.jpg","https://web4ai.o2osolution.ai/assets/mirror/6d0c447b6a0c32af.jpg","https://web4ai.o2osolution.ai/assets/mirror/2d94158a48480fcd.jpg","https://web4ai.o2osolution.ai/assets/mirror/d364f605223524bd.jpg","https://web4ai.o2osolution.ai/assets/mirror/e0ed8d1a27e09320.jpg","https://web4ai.o2osolution.ai/assets/mirror/aa69a633f8e3a631.jpg"],"priceRange":"198,000원","amenityFeature":[{"@type":"LocationFeatureSpecification","name":"주차","value":true},{"@type":"LocationFeatureSpecification","name":"와이파이","value":true},{"@type":"LocationFeatureSpecification","name":"취사","value":true},{"@type":"LocationFeatureSpecification","name":"반려동물 동반","value":false},{"@type":"LocationFeatureSpecification","name":"흡연","value":false},{"@type":"LocationFeatureSpecification","name":"픽업 서비스","value":false},{"@type":"LocationFeatureSpecification","name":"바비큐 이용","value":false}],"sameAs":["https://m.place.naver.com/place/1133638931/home","https://www.instagram.com/staymeomoom"],"containsPlace":[{"@type":"HotelRoom","@id":"https://web4ai.o2osolution.ai/s/stay3/rooms/a동#unit","name":"A동(일본식 가정집 느낌으로 디딤돌마당과 예쁜정원)","url":"https://web4ai.o2osolution.ai/s/stay3/rooms/a동","description":"편안한 일본집에 와 있는 듯한 느낌의 공간입니다. 독립된 아담한 정원과 창고형 CAFÉ 공간이 있습니다.","occupancy":{"@type":"QuantitativeValue","value":4,"minValue":2,"unitText":"명"},"image":["/assets/mirror/ddc9f804f4ef83b5.jpg","/assets/mirror/6d0c447b6a0c32af.jpg","/assets/mirror/aa69a633f8e3a631.jpg","/assets/mirror/7095220ca156e25e.jpg"]},{"@type":"HotelRoom","@id":"https://web4ai.o2osolution.ai/s/stay3/rooms/b동#unit","name":"B동(모던한 현대식 컨셉으로 꾸며진 따뜻한 공간)","url":"https://web4ai.o2osolution.ai/s/stay3/rooms/b동","description":"아늑하고 깔끔한 현대식 모던 스타일 공간입니다. 독립된 아담한 정원과 창고형 CAFÉ 공간이 있습니다.","occupancy":{"@type":"QuantitativeValue","value":4,"minValue":2,"unitText":"명"},"image":["/assets/mirror/e0ed8d1a27e09320.jpg","/assets/mirror/caa5e076e7d56ec2.jpg","/assets/mirror/8e2ec99c433b6fe8.jpg","/assets/mirror/2d94158a48480fcd.jpg"]}],"checkinTime":"15:00","checkoutTime":"11:00","petsAllowed":false,"numberOfRooms":2,"smokingAllowed":false}</script>
|
|
||||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebSite","@id":"https://web4ai.o2osolution.ai/s/stay3#website","name":"스테이,머뭄","url":"https://web4ai.o2osolution.ai/s/stay3","inLanguage":"ko-KR","publisher":{"@id":"https://web4ai.o2osolution.ai/s/stay3#business"}}</script>
|
|
||||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","@id":"https://web4ai.o2osolution.ai/s/stay3#webpage","url":"https://web4ai.o2osolution.ai/s/stay3","name":"스테이,머뭄 · 전북 군산시 숙소","description":"1920년대 적산가옥을 고쳐 지은 독채 두 동, 매일 세탁·살균하는 침구. 군산시에 있는 스테이,머뭄입니다.","inLanguage":"ko-KR","isPartOf":{"@id":"https://web4ai.o2osolution.ai/s/stay3#website"},"about":{"@id":"https://web4ai.o2osolution.ai/s/stay3#business"},"author":{"@id":"https://web4ai.o2osolution.ai/s/stay3#business"},"publisher":{"@id":"https://web4ai.o2osolution.ai/s/stay3#business"},"datePublished":"2026-09-03T01:27:39.284442+00:00","dateModified":"2026-09-04T05:22:24.120253+00:00","speakable":{"@type":"SpeakableSpecification","cssSelector":["h1","#summary p"]}}</script>
|
|
||||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","@id":"https://web4ai.o2osolution.ai/s/stay3#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"홈","item":"https://web4ai.o2osolution.ai/"},{"@type":"ListItem","position":2,"name":"스테이,머뭄","item":"https://web4ai.o2osolution.ai/s/stay3"}]}</script>
|
|
||||||
<script type="application/ld+json">{"@context":"https://schema.org","@type":"FAQPage","@id":"https://web4ai.o2osolution.ai/s/stay3/faq#faq","mainEntity":[{"@type":"Question","name":"체크인과 체크아웃 시간은 언제인가요?","acceptedAnswer":{"@type":"Answer","text":"체크인은 15:00부터이며, 체크아웃은 11:00까지입니다."}},{"@type":"Question","name":"객실 기준 인원과 최대 인원, 인원 추가 요금은 어떻게 되나요?","acceptedAnswer":{"@type":"Answer","text":"A동과 B동 모두 기준 인원은 2명이며, 최대 4명까지 투숙하실 수 있습니다. 인원 추가 요금은 20,000원입니다."}},{"@type":"Question","name":"객실 내 취사가 가능한가요?","acceptedAnswer":{"@type":"Answer","text":"주방에서 간단한 조리는 가능합니다. 다만 생선구이·고기구이·튀김처럼 냄새가 잘 빠지지 않는 조리는 하실 수 없고, 객실 안에서 직화로 굽는 방식도 허용되지 않습니다. 그릴·숯·전기 전열기구 등 개인 취사도구는 반입이 금지되어 있습니다."}},{"@type":"Question","name":"주차와 와이파이 이용이 가능한가요?","acceptedAnswer":{"@type":"Answer","text":"네, 주차와 와이파이 모두 이용 가능합니다."}},{"@type":"Question","name":"반려동물 동반이나 실내 흡연이 가능한가요?","acceptedAnswer":{"@type":"Answer","text":"반려동물 동반은 불가하며, 전 구역 흡연이 불가능합니다."}},{"@type":"Question","name":"A동과 B동은 무엇이 다른가요?","acceptedAnswer":{"@type":"Answer","text":"A동은 편안한 일본집에 와 있는 듯한 느낌의 공간이고, B동은 아늑하고 깔끔한 현대식 모던 스타일 공간입니다. 두 동 모두 독립된 아담한 정원과 창고형 CAFÉ 공간이 딸려 있으며, 기준 2인 · 최대 4인으로 같습니다. 침대 구성 등 객실 안 자세한 사항은 예약 채널이나 전화로 확인해 주세요."}},{"@type":"Question","name":"객실 요금은 얼마인가요?","acceptedAnswer":{"@type":"Answer","text":"A동과 B동 모두 198,000원 ~ 350,000원입니다. 날짜와 시즌에 따라 달라지므로 정확한 금액은 예약 채널에서 확인해 주세요. 기준 인원(2인)을 넘으면 1인당 20,000원이 더해집니다."}},{"@type":"Question","name":"예약 취소 및 환불 규정은 어떻게 되나요?","acceptedAnswer":{"@type":"Answer","text":"입실 당일 취소와 노쇼(No Show)의 경우 숙박요금의 100%가 부과되어 환불되지 않습니다. 그 이전 취소 수수료는 예약하신 채널의 취소 규정을 따릅니다."}},{"@type":"Question","name":"스테이,머뭄은 어떤 숙소인가요?","acceptedAnswer":{"@type":"Answer","text":"스테이,머뭄은 전북 군산시 절골길 18(신흥동)에 있는 독채 숙소입니다. A동은 일본식 가정집 느낌, B동은 현대식 모던 스타일로 두 동이 있고, 편안한 침구와 좋은 위치를 내세운 곳입니다."}},{"@type":"Question","name":"군산 독채 펜션을 찾는데, 여기도 독채인가요?","acceptedAnswer":{"@type":"Answer","text":"네, 스테이,머뭄은 A동과 B동 모두 독채입니다. 동마다 독립된 정원과 창고형 카페 공간이 딸려 있고, 주방이 있어 취사도 가능합니다."}},{"@type":"Question","name":"위치가 어디인가요?","acceptedAnswer":{"@type":"Answer","text":"스테이,머뭄은 전북 군산시 절골길 18(신흥동 63-18)에 있습니다. 바로 옆 13m 거리에 군산 신흥동 일본식가옥(히로쓰 가옥)이 있는 원도심 골목 안입니다. 문의는 0507-1497-0983입니다."}},{"@type":"Question","name":"예약은 어디서 하나요?","acceptedAnswer":{"@type":"Answer","text":"스테이,머뭄은 네이버 플레이스에서 숙소 정보를 확인하실 수 있고, 전화 0507-1497-0983으로도 문의하실 수 있습니다. 입실 당일 취소와 노쇼는 숙박요금의 100%가 부과되니 일정을 확인하고 예약해 주세요."}},{"@type":"Question","name":"커플 둘이 묵기 좋은 2인 독채인가요?","acceptedAnswer":{"@type":"Answer","text":"네, 스테이,머뭄 A동과 B동 모두 기준 인원 2인의 독채입니다. 두 동을 각각 한 팀만 쓰고, 독립된 아담한 정원과 창고형 CAFÉ 공간이 딸려 있습니다."}},{"@type":"Question","name":"일본식 가옥 같은 숙소를 찾는데 여기가 맞나요?","acceptedAnswer":{"@type":"Answer","text":"스테이,머뭄 A동이 일본식 가정집 느낌으로 꾸민 독채입니다. 디딤돌 마당과 독립된 정원, 창고형 카페 공간이 딸려 있습니다. B동은 같은 마당 안에 있는 현대식 모던 스타일 독채입니다."}},{"@type":"Question","name":"조용하고 프라이빗한 숙소인가요?","acceptedAnswer":{"@type":"Answer","text":"스테이,머뭄은 A동·B동 두 동뿐인 독채 숙소라 다른 손님과 건물을 나눠 쓰지 않습니다. Line truncated
|
|
||||||
<script type="module" src="/assets/index-CHr-4NrZ.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="root"><link rel="preload" as="image" href="/assets/mirror/ddc9f804f4ef83b5.jpg" fetchPriority="high"/><div class="oasi-page flex min-h-screen w-full flex-col" style="--oasi-gap:clamp(3.5rem, 7vw, var(--tpl-section-space, 4rem));background-color:var(--tpl-bg);color:var(--tpl-text)"><style>
|
|
||||||
.oasi-page main > section:not([data-oasi]) {
|
|
||||||
background-color: transparent !important;
|
|
||||||
background-image: none !important;
|
|
||||||
border-color: transparent !important;
|
|
||||||
color: var(--tpl-text) !important;
|
|
||||||
padding-block: var(--oasi-gap) 0 !important;
|
|
||||||
}
|
|
||||||
.oasi-page main > section:not([data-oasi]) .shell {
|
|
||||||
max-width: none;
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
.oasi-page main > section#about > .shell > .grid {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.oasi-page main > section#about > .shell > .grid > * + * {
|
|
||||||
margin-top: 2.5rem;
|
|
||||||
}
|
|
||||||
.oasi-page main > section#summary dl {
|
|
||||||
grid-template-columns: minmax(0, 1fr);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 붙여넣기 아이템 카드 — 소식 · 영상 · 추천 일정 (2026-09-04, 사장님: "1,2,3안 다 맞추세요")
|
|
||||||
*
|
|
||||||
* ★ 이 카드들은 .panel 이 아니라 제 인라인 style 로 면을 그린다(items/common.tsx 의
|
|
||||||
* ITEM_CARD·ITEM_BORDER). 그래서 위 .panel 규칙이 안 닿았고, 섹션 띠를 다 지운 3안에서
|
|
||||||
* **소식 카드만 갱지 결에 2px 테두리를 두른 상자로 혼자 서 있었다.**
|
|
||||||
* ★ w4-paper 의 결은 1안(레트로 갱지)의 것이다. 여기서는 결을 지우고 테두리를 실선 한 겹으로
|
|
||||||
* 낮춘다. 상자를 아예 없애지는 않는다 — 전단 여섯 장이 경계 없이 붙으면 어디까지가 한 장인지
|
|
||||||
* 안 보인다. 면은 빼고 테두리만 남기는 게 이 안의 타협점이다.
|
|
||||||
* ★ 배경은 transparent 로 두지 않는다. 사진 없는 공지 카드가 종이에 바로 얹히면
|
|
||||||
* 본문과 구분이 사라진다 — 아주 옅은 틴트 한 겹만 남긴다.
|
|
||||||
* ★ 영상은 뺐다 (2026-09-04, 사장님: "영상 border 안 예쁘다")
|
|
||||||
* 영상 카드는 상자가 아니라 **표지 사진 한 장**이고, 쇼츠라 9:16 세로다. li 에 틴트를 깔면
|
|
||||||
* 영상보다 넓은 회색 판이 뒤에 깔려 액자처럼 보인다. 사진은 제 테두리가 곧 경계다.
|
|
||||||
*/
|
|
||||||
.oasi-page section#event li,
|
|
||||||
.oasi-page section#itinerary article {
|
|
||||||
background-image: none !important;
|
|
||||||
background-color: color-mix(in oklab, currentcolor 3%, transparent) !important;
|
|
||||||
border-width: 1px !important;
|
|
||||||
box-shadow: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oasi-page .panel,
|
|
||||||
.oasi-page .panel-sunken {
|
|
||||||
background-color: transparent;
|
|
||||||
border-width: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oasi-page main > section#faq > .shell > div:last-of-type {
|
|
||||||
row-gap: 0;
|
|
||||||
column-gap: 2.5rem;
|
|
||||||
}
|
|
||||||
.oasi-page main > section#faq details {
|
|
||||||
margin-block: 0;
|
|
||||||
border-top: 1px solid var(--color-line);
|
|
||||||
}
|
|
||||||
.oasi-page main > section#faq summary {
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
.oasi-page main > section#faq summary > span:first-child {
|
|
||||||
width: 1.125rem;
|
|
||||||
}
|
|
||||||
.oasi-page main > section#faq summary + div {
|
|
||||||
border-top-width: 0;
|
|
||||||
padding-inline: 1.875rem 0;
|
|
||||||
padding-top: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oasi-page main > section#info dl.panel > div {
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
.oasi-page main > section#info dl > div.panel {
|
|
||||||
border-top: 1px solid var(--color-line);
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oasi-page main > section#location .panel {
|
|
||||||
border-top: 1px solid var(--color-line);
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
.oasi-page main > section#location :is(thead, tbody) :is(th, td):first-child {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
.oasi-page main > section#location :is(thead, tbody) :is(th, td):last-child {
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oasi-page main > section#weather .panel {
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oasi-page main > section#guide .panel > span:last-child {
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
@media (min-width: 40rem) {
|
|
||||||
.oasi-page main > section#festival .panel > span:last-child {
|
|
||||||
padding-inline: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style><div class="mx-auto flex w-full max-w-[72rem] flex-col gap-10 px-5 pb-16 pt-10 lg:flex-row lg:gap-14 lg:px-10 lg:pb-24 lg:pt-16"><header class="lg:sticky lg:top-12 lg:h-fit lg:w-[18.75rem] lg:shrink-0"><a href="#top" class="block"><span class="serif block leading-none" style="font-size:var(--fs-display);font-weight:300;letter-spacing:0.14em">스테이,머뭄</span></a><nav aria-label="주요 메뉴" class="mt-12 lg:mt-24"><ul class="flex flex-wrap items-center gap-x-6 gap-y-1 lg:block"><li><a href="#top" aria-current="true" class="tap inline-flex items-center text-[length:var(--fs-sm)] transition-opacity hover:opacity-100 ">처음</a></li><li><a href="#about" class="tap inline-flex items-center text-[length:var(--fs-sm)] transition-opacity hover:opacity-100 text-muted">소개</a></li><li><a href="#units" class="tap inline-flex items-center text-[length:var(--fs-sm)] transition-opacity hover:opacity-100 text-muted">객실</a></li><li><a href="#info" class="tap inline-flex items-center text-[length:var(--fs-sm)] transition-opacity hover:opacity-100 text-muted">이용 정보</a></li><li><a href="#guide" class="tap inline-flex items-center text-[length:var(--fs-sm)] transition-opacity hover:opacity-100 text-muted">주변</a></li><li><a href="#location" class="tap inline-flex items-center text-[length:var(--fs-sm)] transition-opacity hover:opacity-100 text-muted">오시는 길</a></li><li><a href="#faq" class="tap inline-flex items-center text-[length:var(--fs-sm)] transition-opacity hover:opacity-100 text-muted">자주 묻는 질문</a></li></ul></nav><a href="https://m.place.naver.com/place/1133638931/home" target="_blank" rel="noopener noreferrer" class="tap mt-2 inline-flex items-center text-[length:var(--fs-sm)] underline underline-offset-[6px]" style="color:var(--color-brand)">네이버 플레이스<!-- --> 예약</a></header><div class="flex min-w-0 flex-1 flex-col"><div class="border-line flex flex-col gap-3 border-y py-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6"><ul class="text-muted flex min-w-0 flex-wrap items-center gap-x-4 gap-y-1 text-[length:var(--fs-xs)]"><li class="flex items-center gap-4"><span>체크인 시간 15:00</span></li><li class="flex items-center gap-4"><span aria-hidden="true" class="opacity-40">|</span><span>체크아웃 시간 11:00</span></li><li class="flex items-center gap-4"><span aria-hidden="true" class="opacity-40">|</span><span>주차 가능</span></li></ul><p class="text-muted measure shrink-0 text-[length:var(--fs-xs)] leading-[1.9] sm:max-w-[18rem] sm:text-right">히로쓰 가옥 담 너머, 백 년 된 집 한 채</p></div><main class="w-full flex-1"><section id="top" data-oasi="true" aria-labelledby="top-heading" class="pt-12 lg:pt-16"><h1 id="top-heading" class="text-[length:var(--fs-sm)] font-normal tracking-[0.08em] leading-[1.9]">스테이,머뭄</h1><figure class="relative mx-auto mt-10 w-full max-w-[34rem]"><img src="/assets/mirror/ddc9f804f4ef83b5.jpg" alt="목재 서까래 천장과 미닫이창, 테이블이 있는 거실 공간" fetchPriority="high" decoding="async" class="block h-[clamp(17rem,27vw,24rem)] w-full object-cover"/><figcaption class="text-muted absolute left-full top-0 ml-5 hidden max-h-full overflow-hidden text-ellipsis whitespace-nowrap text-[length:var(--fs-xs)] tracking-[0.14em] xl:block" style="writing-mode:vertical-rl">스테이,머뭄</figcaption></figure><dl class="border-line mt-10 flex flex-wrap gap-x-10 gap-y-4 border-t pt-5 text-[length:var(--fs-xs)] leading-[1.9]"><div><dt class="text-muted">최저가</dt><dd>198,000 ~ 350,000원</dd></div><div><dt class="text-muted">체크인 시간</dt><dd>15:00</dd></div><div><dt class="text-muted">체크아웃 시간</dt><dd>11:00</dd></div><div><dt class="text-muted">주차</dt><dd>가능</dd></div></dl><ul class="mt-6 flex flex-wrap items-center gap-x-8"><li><a href="https://m.place.naver.com/place/1133638931/home" target="_blank" rel="noopener noreferrer" class="tap inline-flex items-center text-[length:var(--fs-sm)] underline underline-offset-[6px]" style="color:var(--color-brand)">네이버 플레이스<!-- --> 예약</a></li></ul></section><section id="about" aria-labelledby="about-heading" class="border-line paper w-full border-b" style="background-color:var(--tpl-surface, #ffffff);padding-block:var(--section-space)"><div class="shell"><div class="grid grid-cols-1 items-center gap-8 lg:grid-cols-12 lg:gap-14"><figure class="lg:col-span-7"><div class="tpl-border border-line relative aspect-4/3 max-h-[26rem] overflow-hidden rounded-xl border lg:aspect-3/2"><img src="/assets/mirror/6d0c447b6a0c32af.jpg" alt="소파와 탁자, 벽난로 조명이 있는 서까래 천장의 거실" loading="lazy" decoding="async" class="size-full object-cover"/></div></figure><div class="lg:col-span-5"><h2 id="about-heading" class="h2 mb-6 flex items-center gap-2.5"><i aria-hidden="true" class="h-[1em] w-[3px] shrink-0 bg-current opacity-25"></i><span class="min-w-0">스테이,머뭄 소Line truncated
|
|
||||||
· 건물과 객실 안은 절대 금연입니다. 바로 옆이 군산 신흥동 일본식가옥(히로쓰 가옥)이라 화재에 각별히 유의해 주세요.
|
|
||||||
· 냄새가 잘 빠지지 않는 생선구이·고기구이·튀김류 조리는 하실 수 없습니다.
|
|
||||||
· 객실 안에서 음식을 드실 때 오염에 주의해 주세요.
|
|
||||||
· 객실 시설과 비품, 침구가 손상·파손·오염되면 변상을 요청드릴 수 있습니다.
|
|
||||||
· 정기적으로 방역하고 있으나 자연과 함께하는 공간이라 가끔 벌레나 이물질이 들어올 수 있습니다. 이 사유로는 환불이 어려운 점 양해 부탁드립니다.
|
|
||||||
· 귀중품과 현금은 분실 위험이 있으니 직접 관리해 주세요.
|
|
||||||
· 안전과 보안을 위해 대문 입구 쪽에 CCTV를 운영하고 있습니다. 객실 안에는 없습니다.
|
|
||||||
· 숙박업소는 법적으로 청소년 혼숙이 금지되어 있습니다. 미성년자는 보호자를 동반하셔야 이용하실 수 있습니다.</p><p class="mt-auto pt-2 text-[12px] font-bold opacity-70">자세히 보기 →</p></div></li><li class="w4-paper relative flex flex-col border-2" style="background-color:var(--tpl-card, #fafafa);border-color:var(--tpl-border, #d6d3d1);opacity:1;box-shadow:3px 3px 0 color-mix(in oklab, currentcolor 12%, transparent)"><button type="button" aria-label="인원이 늘면 미리 연락 주세요 자세히 보기" class="absolute inset-0 z-20 cursor-pointer"></button><div class="contents"></div><div class="flex flex-1 flex-col gap-2.5 p-5"><div class="flex flex-wrap items-center gap-2"><span class="border-2 px-2 py-0.5 text-[11px] font-bold tracking-[0.08em]" style="transform:rotate(-3deg);background-color:var(--tpl-card, #fafafa);color:var(--tpl-text, #09090b);border-color:var(--tpl-border, #d6d3d1)">공지</span></div><h3 class="serif text-lg font-bold leading-snug">인원이 늘면 미리 연락 주세요</h3><p class="line-clamp-2 text-[13px] leading-relaxed opacity-80">예약하신 인원보다 늘어나는 경우, 오시기 전에 숙소로 연락 부탁드립니다.</p><p class="border-2 border-dashed px-3 py-2 text-[12px] leading-relaxed" style="border-color:var(--tpl-border, #d6d3d1)">연락처 0507-1497-0983</p><p class="whitespace-pre-line text-[12px] leading-relaxed opacity-70 line-clamp-[9]">· 기준 인원(2인)을 넘으면 1인당 20,000원이 추가됩니다.
|
|
||||||
· 최대 인원(4인)을 넘으면 입실이 불가능할 수 있고, 이 사유로는 환불을 받으실 수 없습니다.
|
|
||||||
· 다음 이용 고객을 위해 입실 15:00 이후, 퇴실 11:00 이전을 지켜 주세요.</p><p class="mt-auto pt-2 text-[12px] font-bold opacity-70">자세히 보기 →</p></div></li><li class="w4-paper relative flex flex-col border-2" style="background-color:var(--tpl-card, #fafafa);border-color:var(--tpl-border, #d6d3d1);opacity:1;box-shadow:3px 3px 0 color-mix(in oklab, currentcolor 12%, transparent)"><button type="button" aria-label="직화·개인 취사도구는 반입이 안 됩니다 자세히 보기" class="absolute inset-0 z-20 cursor-pointer"></button><div class="contents"></div><div class="flex flex-1 flex-col gap-2.5 p-5"><div class="flex flex-wrap items-center gap-2"><span class="border-2 px-2 py-0.5 text-[11px] font-bold tracking-[0.08em]" style="transform:rotate(-3deg);background-color:var(--tpl-card, #fafafa);color:var(--tpl-text, #09090b);border-color:var(--tpl-border, #d6d3d1)">공지</span></div><h3 class="serif text-lg font-bold leading-snug">직화·개인 취사도구는 반입이 안 됩니다</h3><p class="line-clamp-2 text-[13px] leading-relaxed opacity-80">백 년 된 목조 고택이라 화재 예방 규정이 엄격합니다.</p><p class="whitespace-pre-line text-[12px] leading-relaxed opacity-70 line-clamp-[9]">· 객실 안에서 생선이나 고기 등을 굽는 직화 방식은 허용되지 않습니다.
|
|
||||||
· 그릴, 숯, 전기·전열기구 등 개인적으로 준비해 오시는 취사도구는 반입이 금지되어 있습니다.
|
|
||||||
· 주방에서 간단한 조리는 하실 수 있습니다.
|
|
||||||
· 흡연은 지정된 장소를 이용해 주시고, 다른 이용객에게 피해가 갈 수 있는 오락·음주·고성방가는 삼가 주세요.</p><p class="mt-auto pt-2 text-[12px] font-bold opacity-70">자세히 보기 →</p></div></li></ul><p class="mt-6 text-[length:var(--fs-xs)] opacity-60">자세한 내용과 최신 소식은 원문에서 확인해 주세요.</p></div></section><section id="info" aria-labelledby="info-heading" class="border-line paper w-full border-b" style="background-color:var(--tpl-surface-alt, #f5f5f4);padding-block:var(--section-space)"><div class="shell"><div><header class="mb-8 flex flex-col gap-3 sm:flex-row sm:items-baseline sm:justify-between sm:gap-8"><div class="min-w-0"><h2 id="info-heading" class="text-[length:var(--fs-sm)] font-normal tracking-[0.08em]">[<!-- -->이용안내 및 예약<!-- -->]</h2><p class="text-muted measure mt-3 text-[length:var(--fs-xs)] leading-[1.9]">방문 전 확인이 필요한 운영 규정과 시설 안내입니다.</p></div></header></div><div class="space-y-8"><section><h3 class="border-line mb-3 flex items-center gap-2 border-b pb-2 text-[length:var(--fs-sm)] font-bold"><i aria-hidden="true" class="h-[1em] w-[3px] shrink-0" style="background-color:var(--color-accent)"></i><span>예약 전 확인</span></h3><dl class="divide-line divide-y"><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">체크아웃 시간</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">11:00</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">취소·환불 규정</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">입실 당일 취소와 노쇼(No Show)는 숙박요금의 100%가 부과되어 환불되지 않습니다. 그 이전 취소 수수료는 예약하신 채널의 취소 규정을 따릅니다.</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">반려동물 동반</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">불가</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">인원 추가 요금</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">20,000원</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">체크인 시간</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">15:00</dd></div></dl></section><section><h3 class="border-line mb-3 flex items-center gap-2 border-b pb-2 text-[length:var(--fs-sm)] font-bold"><span>시설 · 편의</span></h3><dl class="divide-line divide-y"><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">주차</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">가능</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">숙소 소개</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">1920년대에 지어진 백 년 고택을 리모델링한 독채 펜션입니다. 히로쓰 가옥 후문 바로 옆이고, 침구는 매일 세탁·살균·건조합니다.</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">와이파이</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">가능</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">취사</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">가능</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">흡연</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">불가</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">픽업 서비스</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">불가</dd></div><div class="flex flex-col gap-1 py-3.5 sm:flex-row sm:items-baseline sm:gap-6"><dt class="text-muted text-[length:var(--fs-sm)] sm:w-40 sm:shrink-0">바비큐 이용</dt><dd class="measure text-[length:var(--fs-sm)] font-semibold">불가</dd></div></dl></section><div class="border-line flex flex-col gap-3 border-t pt-6 sm:flex-row sm:items-center sm:justify-between"><p class="text-[length:var(--fs-sm)] foLine truncated
|
|
||||||
<script>window.__SITE_PAYLOAD__={"schemaVersion":1,"site":{"siteId":"0e6e307b-c345-5421-b596-966fbdfa9c80","placeId":"66894a1b-a331-43f1-942c-0ae064a704d6","status":3,"origin":"https://web4ai.o2osolution.ai","basePath":"/s/stay3","slug":"stay3","publishedAt":"2026-09-03T01:27:39.284442+00:00","updatedAt":"2026-09-04T05:22:24.120253+00:00","version":10},"place":{"name":"스테이,머뭄","category":1,"roadAddress":"전북 군산시 절골길 18","address":"전북 군산시 신흥동 63-18","addressRegion":"전북","addressLocality":"군산시","addressSubLocality":null,"addressRegionCode":"KR-45","phone":"0507-1497-0983","latitude":35.9864175,"longitude":126.7061254,"regionCode":"52군산시","kakaoPlaceId":null},"facts":[{"key":"parking","label":"주차 가능","value":"true","unit":null,"type":"bool","scope":"place","status":3,"sourceType":3,"sourceUrl":"https://m.place.naver.com/place/1133638931/home","critical":false,"required":false,"unitId":null,"collectedAt":"2026-08-28T02:10:08.678003+00:00","verifiedAt":"2026-08-28T02:12:21.402109+00:00"},{"key":"intro","label":"숙소 소개","value":"1920년대에 지어진 백 년 고택을 리모델링한 독채 펜션입니다. 히로쓰 가옥 후문 바로 옆이고, 침구는 매일 세탁·살균·건조합니다.","unit":null,"type":"text","scope":"place","status":3,"sourceType":3,"sourceUrl":"https://m.place.naver.com/place/1133638931/home","critical":false,"required":false,"unitId":null,"collectedAt":"2026-08-28T02:10:08.547669+00:00","verifiedAt":"2026-08-28T02:12:21.922925+00:00"},{"key":"wifi","label":"와이파이","value":"true","unit":null,"type":"bool","scope":"place","status":3,"sourceType":3,"sourceUrl":"https://m.place.naver.com/place/1133638931/home","critical":false,"required":false,"unitId":null,"collectedAt":"2026-08-28T02:10:08.757070+00:00","verifiedAt":"2026-08-28T02:12:22.356600+00:00"},{"key":"check_out_time","label":"체크아웃 시간","value":"11:00","unit":null,"type":"time","scope":"place","status":3,"sourceType":3,"sourceUrl":"https://travel.interpark.com/checkinnow/goods/GY0002361440","critical":true,"required":true,"unitId":null,"collectedAt":"2026-09-02T13:27:53.241391+00:00","verifiedAt":"2026-09-02T13:27:53.241391+00:00"},{"key":"cancel_policy","label":"취소·환불 규정","value":"입실 당일 취소와 노쇼(No Show)는 숙박요금의 100%가 부과되어 환불되지 않습니다. 그 이전 취소 수수료는 예약하신 채널의 취소 규정을 따릅니다.","unit":null,"type":"text","scope":"place","status":3,"sourceType":3,"sourceUrl":"https://travel.interpark.com/checkinnow/goods/GY0002361440","critical":true,"required":true,"unitId":null,"collectedAt":"2026-09-02T13:27:53.241391+00:00","verifiedAt":"2026-09-02T13:27:53.241391+00:00"},{"key":"cooking_allowed","label":"취사 가능","value":"true","unit":null,"type":"bool","scope":"place","status":3,"sourceType":3,"sourceUrl":"https://travel.interpark.com/checkinnow/goods/GY0002361440","critical":true,"required":true,"unitId":null,"collectedAt":"2026-09-02T13:27:53.241391+00:00","verifiedAt":"2026-09-02T13:27:53.241391+00:00"},{"key":"pet_allowed","label":"반려동물 동반","value":"false","unit":null,"type":"bool","scope":"place","status":3,"sourceType":3,"sourceUrl":"https://travel.interpark.com/checkinnow/goods/GY0002361440","critical":true,"required":true,"unitId":null,"collectedAt":"2026-09-02T13:27:53.241391+00:00","verifiedAt":"2026-09-02T13:27:53.241391+00:00"},{"key":"smoking","label":"흡연 가능","value":"false","unit":null,"type":"bool","scope":"place","status":3,"sourceType":3,"sourceUrl":"https://travel.interpark.com/checkinnow/goods/GY0002361440","critical":true,"required":false,"unitId":null,"collectedAt":"2026-09-02T13:27:53.241391+00:00","verifiedAt":"2026-09-02T13:27:53.241391+00:00"},{"key":"extra_person_fee","label":"인원 추가 요금","value":"20000","unit":"원","type":"number","scope":"place","status":3,"sourceType":3,"sourceUrl":"https://travel.interpark.com/checkinnow/goods/GY0002361440","critical":true,"required":false,"unitId":null,"collectedAt":"2026-09-02T13:27:53.241391+00:00","verifiedAt":"2026-09-02T13:27:53.241391+00:00"},{"key":"check_in_time","label":"체크인 시간","value":"15:00","unit":null,"type":"time","scope":"place","status":3,"sourceType":1,"sourceUrl":"https://travel.interpark.com/checkinnow/goods/GY0002361440","critical":true,"required":true,"unitId":null,"collectedAt":"2026-09-02T13:27:53.241391+00:00","verifiedAt":"2026-09-02T23:31:05.719599+00:00"},{"key":"pickup_service","label":"픽업 서비스","value":"false","type":"bool","scope":"place","unit":null,"status":3,"sourceType":3,"sourceUrl":"https://m.place.naver.com/place/1133638931/home","critical":false,"required":false,"unitId":null,"collectedAt":"2026-09-04T00:00:00+00:00","verifiedAt":"2026-09-04T00:00:00+00:00"},{"key":"bbq_available","label":"바비큐 이용","value":"false","type":"bool","scope":"place","unit":null,"status":3,"soLine truncated
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
# 스테이,머뭄
|
|
||||||
|
|
||||||
이 문서는 스테이,머뭄의 공식 홈페이지가 제공하는 사실 목록입니다. 모든 항목은 사업자 확인을 거쳤으며, 확인되지 않은 정보는 포함하지 않습니다.
|
|
||||||
|
|
||||||
- 공식 홈페이지: https://web4ai.o2osolution.ai/s/stay3
|
|
||||||
- 업종 분류: LodgingBusiness
|
|
||||||
- 최종 확인: 2026-09-04T05:22:24.120253+00:00
|
|
||||||
|
|
||||||
## 기본 정보
|
|
||||||
|
|
||||||
- 상호: 스테이,머뭄
|
|
||||||
- 주소: 전북 군산시 절골길 18
|
|
||||||
- 전화: 0507-1497-0983
|
|
||||||
- 이메일: 정보 없음
|
|
||||||
- 좌표: 35.9864175, 126.7061254
|
|
||||||
|
|
||||||
## 이용 정보
|
|
||||||
|
|
||||||
- 주차 가능: 가능
|
|
||||||
- 숙소 소개: 1920년대에 지어진 백 년 고택을 리모델링한 독채 펜션입니다. 히로쓰 가옥 후문 바로 옆이고, 침구는 매일 세탁·살균·건조합니다.
|
|
||||||
- 와이파이: 가능
|
|
||||||
- 체크아웃 시간: 11:00
|
|
||||||
- 취소·환불 규정: 입실 당일 취소와 노쇼(No Show)는 숙박요금의 100%가 부과되어 환불되지 않습니다. 그 이전 취소 수수료는 예약하신 채널의 취소 규정을 따릅니다.
|
|
||||||
- 취사 가능: 가능
|
|
||||||
- 반려동물 동반: 불가
|
|
||||||
- 흡연 가능: 불가
|
|
||||||
- 인원 추가 요금: 20,000원
|
|
||||||
- 체크인 시간: 15:00
|
|
||||||
- 픽업 서비스: 불가
|
|
||||||
- 바비큐 이용: 불가
|
|
||||||
|
|
||||||
## 객실
|
|
||||||
|
|
||||||
### A동(일본식 가정집 느낌으로 디딤돌마당과 예쁜정원)
|
|
||||||
- 상세: https://web4ai.o2osolution.ai/s/stay3/rooms/a동
|
|
||||||
- 객실 타입: 독채
|
|
||||||
- 기준 인원: 2명
|
|
||||||
- 최대 인원: 4명
|
|
||||||
- 주중 요금: 198,000원
|
|
||||||
- 객실 소개: 편안한 일본집에 와 있는 듯한 느낌의 공간입니다. 독립된 아담한 정원과 창고형 CAFÉ 공간이 있습니다.
|
|
||||||
- 요금: 198,000 ~ 350,000원
|
|
||||||
|
|
||||||
### B동(모던한 현대식 컨셉으로 꾸며진 따뜻한 공간)
|
|
||||||
- 상세: https://web4ai.o2osolution.ai/s/stay3/rooms/b동
|
|
||||||
- 객실 타입: 독채
|
|
||||||
- 기준 인원: 2명
|
|
||||||
- 최대 인원: 4명
|
|
||||||
- 주중 요금: 198,000원
|
|
||||||
- 객실 소개: 아늑하고 깔끔한 현대식 모던 스타일 공간입니다. 독립된 아담한 정원과 창고형 CAFÉ 공간이 있습니다.
|
|
||||||
- 요금: 198,000 ~ 350,000원
|
|
||||||
|
|
||||||
## 자주 묻는 질문
|
|
||||||
|
|
||||||
### 체크인과 체크아웃 시간은 언제인가요?
|
|
||||||
체크인은 15:00부터이며, 체크아웃은 11:00까지입니다.
|
|
||||||
|
|
||||||
### 객실 기준 인원과 최대 인원, 인원 추가 요금은 어떻게 되나요?
|
|
||||||
A동과 B동 모두 기준 인원은 2명이며, 최대 4명까지 투숙하실 수 있습니다. 인원 추가 요금은 20,000원입니다.
|
|
||||||
|
|
||||||
### 객실 내 취사가 가능한가요?
|
|
||||||
주방에서 간단한 조리는 가능합니다. 다만 생선구이·고기구이·튀김처럼 냄새가 잘 빠지지 않는 조리는 하실 수 없고, 객실 안에서 직화로 굽는 방식도 허용되지 않습니다. 그릴·숯·전기 전열기구 등 개인 취사도구는 반입이 금지되어 있습니다.
|
|
||||||
|
|
||||||
### 주차와 와이파이 이용이 가능한가요?
|
|
||||||
네, 주차와 와이파이 모두 이용 가능합니다.
|
|
||||||
|
|
||||||
### 반려동물 동반이나 실내 흡연이 가능한가요?
|
|
||||||
반려동물 동반은 불가하며, 전 구역 흡연이 불가능합니다.
|
|
||||||
|
|
||||||
### A동과 B동은 무엇이 다른가요?
|
|
||||||
A동은 편안한 일본집에 와 있는 듯한 느낌의 공간이고, B동은 아늑하고 깔끔한 현대식 모던 스타일 공간입니다. 두 동 모두 독립된 아담한 정원과 창고형 CAFÉ 공간이 딸려 있으며, 기준 2인 · 최대 4인으로 같습니다. 침대 구성 등 객실 안 자세한 사항은 예약 채널이나 전화로 확인해 주세요.
|
|
||||||
|
|
||||||
### 객실 요금은 얼마인가요?
|
|
||||||
A동과 B동 모두 198,000원 ~ 350,000원입니다. 날짜와 시즌에 따라 달라지므로 정확한 금액은 예약 채널에서 확인해 주세요. 기준 인원(2인)을 넘으면 1인당 20,000원이 더해집니다.
|
|
||||||
|
|
||||||
### 예약 취소 및 환불 규정은 어떻게 되나요?
|
|
||||||
입실 당일 취소와 노쇼(No Show)의 경우 숙박요금의 100%가 부과되어 환불되지 않습니다. 그 이전 취소 수수료는 예약하신 채널의 취소 규정을 따릅니다.
|
|
||||||
|
|
||||||
### 스테이,머뭄은 어떤 숙소인가요?
|
|
||||||
스테이,머뭄은 전북 군산시 절골길 18(신흥동)에 있는 독채 숙소입니다. A동은 일본식 가정집 느낌, B동은 현대식 모던 스타일로 두 동이 있고, 편안한 침구와 좋은 위치를 내세운 곳입니다.
|
|
||||||
|
|
||||||
### 군산 독채 펜션을 찾는데, 여기도 독채인가요?
|
|
||||||
네, 스테이,머뭄은 A동과 B동 모두 독채입니다. 동마다 독립된 정원과 창고형 카페 공간이 딸려 있고, 주방이 있어 취사도 가능합니다.
|
|
||||||
|
|
||||||
### 위치가 어디인가요?
|
|
||||||
스테이,머뭄은 전북 군산시 절골길 18(신흥동 63-18)에 있습니다. 바로 옆 13m 거리에 군산 신흥동 일본식가옥(히로쓰 가옥)이 있는 원도심 골목 안입니다. 문의는 0507-1497-0983입니다.
|
|
||||||
|
|
||||||
### 예약은 어디서 하나요?
|
|
||||||
스테이,머뭄은 네이버 플레이스에서 숙소 정보를 확인하실 수 있고, 전화 0507-1497-0983으로도 문의하실 수 있습니다. 입실 당일 취소와 노쇼는 숙박요금의 100%가 부과되니 일정을 확인하고 예약해 주세요.
|
|
||||||
|
|
||||||
### 커플 둘이 묵기 좋은 2인 독채인가요?
|
|
||||||
네, 스테이,머뭄 A동과 B동 모두 기준 인원 2인의 독채입니다. 두 동을 각각 한 팀만 쓰고, 독립된 아담한 정원과 창고형 CAFÉ 공간이 딸려 있습니다.
|
|
||||||
|
|
||||||
### 일본식 가옥 같은 숙소를 찾는데 여기가 맞나요?
|
|
||||||
스테이,머뭄 A동이 일본식 가정집 느낌으로 꾸민 독채입니다. 디딤돌 마당과 독립된 정원, 창고형 카페 공간이 딸려 있습니다. B동은 같은 마당 안에 있는 현대식 모던 스타일 독채입니다.
|
|
||||||
|
|
||||||
### 조용하고 프라이빗한 숙소인가요?
|
|
||||||
스테이,머뭄은 A동·B동 두 동뿐인 독채 숙소라 다른 손님과 건물을 나눠 쓰지 않습니다. 두 동 모두 독립된 정원을 따로 두고 있고, 전 구역 금연입니다.
|
|
||||||
|
|
||||||
### 차 없이 걸어서 근대문화거리까지 갈 수 있나요?
|
|
||||||
스테이,머뭄에서 히로쓰 가옥은 13m, 초원사진관 248m, 군산 영화의 거리 318m, 군산근대미술관 708m, 옛 군산세관 728m, 근대건축관(구 조선은행 군산지점) 788m 거리입니다. 원도심 근대 건축물이 숙소를 중심으로 1km 안에 모여 있습니다. 주차도 가능합니다.
|
|
||||||
|
|
||||||
### 이성당이나 근처 맛집까지 얼마나 되나요?
|
|
||||||
스테이,머뭄에서 이성당까지는 455m입니다. 그 밖에 요리주점 도란 135m, 베이커리 물밀소 297m, 백년가게 국밥집 일흥옥 300m, 명월갈비 351m, 꽃게장 한주옥 430m로 모두 가까이 있습니다.
|
|
||||||
|
|
||||||
### 마당이나 정원이 따로 있나요?
|
|
||||||
네. A동과 B동 각각 독립된 아담한 정원과 창고형 CAFÉ 공간이 있습니다. A동에는 디딤돌 마당도 있습니다. 바다 전망은 아닙니다 — 마당과 거실에서 새소리를 들으며 쉬는 숙소입니다.
|
|
||||||
|
|
||||||
### 선유도에 갈 건데 여기서 자도 될까요?
|
|
||||||
네, 스테이,머뭄에서는 다리를 건너 고군산군도 선유도까지 차로 약 45분 걸립니다. 첫날은 군산 도심에서 저녁과 내항 밤 산책을, 이튿날 선유도와 장자도를 도는 1박 2일 코스를 추천 일정으로 안내하고 있습니다.
|
|
||||||
|
|
||||||
### 1박 2일이면 어떻게 돌면 좋을까요?
|
|
||||||
스테이,머뭄이 안내하는 1박 2일 코스는 첫날 오후 체크인 후 빈해원에서 저녁, 군산 내항 밤 산책으로 마무리하고, 이튿날 선유도와 장자도를 도는 일정입니다. 걷는 코스를 원하시면 채만식문학관·내항 부잔교·째보선창·초원사진관·이성당으로 이어지는 반나절 탁류길 코스도 있습니다.
|
|
||||||
|
|
||||||
### 군산이 처음인데 어디부터 보면 좋을까요?
|
|
||||||
스테이,머뭄은 처음 오신 손님께 반나절 개항장 골목 코스를 안내합니다. 군산근대역사박물관에서 시작해 초원사진관, 이성당, 경암동 철길마을 순으로 도는 일정으로, 걷는 거리가 가장 짧은 코스입니다.
|
|
||||||
|
|
||||||
### 비 오는 날에는 뭘 하면 좋을까요?
|
|
||||||
스테이,머뭄은 비 오는 날을 위한 실내 코스를 따로 안내합니다. 군산근대건축관에서 옛 은행 건물 전시를 보고, 한일옥에서 무국으로 몸을 데운 뒤, 째보선창 근처 카페에서 비가 그칠 때까지 앉아 있는 코스입니다. 숙소는 주방이 있어 취사도 가능합니다.
|
|
||||||
|
|
||||||
### 바비큐나 고기를 구워 먹을 수 있나요?
|
|
||||||
바비큐는 하실 수 없습니다. 화재 예방을 위해 객실 안에서 생선이나 고기를 굽는 직화 방식은 허용되지 않으며, 그릴·숯·전기 전열기구 등 개인적으로 준비해 오시는 취사도구도 반입이 금지되어 있습니다.
|
|
||||||
|
|
||||||
### 픽업 서비스가 있나요?
|
|
||||||
픽업 서비스는 지원하지 않습니다.
|
|
||||||
|
|
||||||
### 건물이 오래된 집이라던데 언제 지어졌나요?
|
|
||||||
1920년대에 지어진 적산가옥입니다. 백 년 된 고택을 리모델링해 2024년 5월 독채 펜션으로 문을 열었습니다. 바로 옆이 국가등록문화유산인 군산 신흥동 일본식 가옥(히로쓰 가옥)입니다.
|
|
||||||
|
|
||||||
### 침구는 깨끗한가요?
|
|
||||||
침구류는 매일 세탁하고 살균·건조합니다. 인테리어와 가구, 소품도 하나하나 준비해 두었습니다.
|
|
||||||
|
|
||||||
### 미성년자끼리 이용할 수 있나요?
|
|
||||||
숙박업소는 법적으로 청소년 혼숙이 금지되어 있습니다. 미성년자는 보호자를 동반하셔야 이용하실 수 있습니다.
|
|
||||||
|
|
||||||
### CCTV가 설치되어 있나요?
|
|
||||||
고객님의 안전과 보안을 위해 대문 입구 쪽에 CCTV를 운영하고 있습니다. 객실 안에는 없습니다.
|
|
||||||
|
|
||||||
### 벌레가 나오지는 않나요?
|
|
||||||
정기적으로 방역하고 있습니다. 다만 자연과 함께하는 공간이라 가끔 벌레나 이물질이 들어올 수 있으며, 이 사유로는 환불이 어려운 점 양해 부탁드립니다.
|
|
||||||
|
|
||||||
### 예약 인원보다 사람이 늘면 어떻게 하나요?
|
|
||||||
미리 숙소로 연락 주세요. 기준 인원(2인)을 넘으면 1인당 20,000원이 추가됩니다. 최대 인원(4인)을 넘으면 입실이 불가능할 수 있고, 그 사유로는 환불을 받으실 수 없습니다.
|
|
||||||
|
|
||||||
### 히로쓰 가옥 바로 옆이라던데 어떤 집인가요?
|
|
||||||
스테이,머뭄은 1920년대에 지어진 집으로, 국가등록문화유산인 군산 신흥동 일본식 가옥(히로쓰 가옥) 후문 바로 옆 13m 거리에 있습니다. 사장님은 이 집이 히로쓰 가옥 관리인이 살던 집이라고 전합니다. 백 년 된 고택을 리모델링해 2024년 5월 독채 펜션으로 문을 열었습니다.
|
|
||||||
|
|
||||||
### 주요 관광지까지 걸어서 얼마나 걸리나요?
|
|
||||||
초원사진관, 이성당, 군산 시간여행마을 등 주요 관광명소가 걸어서 최대 8분 거리입니다. 차 없이 도보 여행이 가능합니다.
|
|
||||||
|
|
||||||
## 소개
|
|
||||||
|
|
||||||
스테이,머뭄은 전북특별자치도 군산시 신흥동 절골길에 있는 독채 펜션입니다. 1920년대에 지어진 백 년 고택으로, 국가등록문화유산인 군산 신흥동 일본식 가옥(히로쓰 가옥) 후문 바로 옆 — 걸어서 13m 거리입니다. 사장님은 이 집이 히로쓰 가옥 관리인이 살던 집이라고 전합니다. 2024년 5월에 리모델링을 마치고 문을 열었고, A동과 B동 두 동을 각각 한 팀만 씁니다. 기준 2인 · 최대 4인까지 묵을 수 있습니다.
|
|
||||||
A동은 편안한 일본집에 와 있는 듯한 느낌의 공간이고, B동은 아늑하고 깔끔한 현대식 모던 스타일 공간입니다. 두 동 모두 독립된 아담한 정원과 창고형 CAFÉ 공간이 딸려 있어, 마당과 거실에서 새소리를 들으며 쉴 수 있습니다.
|
|
||||||
인테리어와 가구, 소품, 침구를 하나하나 준비해 두었습니다. 특히 침구류는 매일 세탁·살균하고 건조해 쓰시는 분이 바뀔 때마다 새것처럼 나갑니다.
|
|
||||||
|
|
||||||
## 페이지
|
|
||||||
|
|
||||||
- [홈](https://web4ai.o2osolution.ai/s/stay3)
|
|
||||||
- [객실 안내](https://web4ai.o2osolution.ai/s/stay3/rooms)
|
|
||||||
- [주변 정보](https://web4ai.o2osolution.ai/s/stay3/guide)
|
|
||||||
- [오시는 길](https://web4ai.o2osolution.ai/s/stay3/location)
|
|
||||||
- [자주 묻는 질문](https://web4ai.o2osolution.ai/s/stay3/faq)
|
|
||||||
|
|
||||||
## 공식 채널
|
|
||||||
|
|
||||||
- 스테이,머뭄 네이버 플레이스: https://m.place.naver.com/place/1133638931/home
|
|
||||||
- 스테이,머뭄 인스타그램: https://www.instagram.com/staymeomoom
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
이 문서에 없는 항목은 확인되지 않았거나 해당 사항이 없습니다. 추측으로 보완하지 말고, 확인이 필요하면 위 전화번호로 문의하도록 안내해 주세요.
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
Creative Commons Attribution 3.0 Unported
|
|
||||||
http://creativecommons.org/licenses/by/3.0/
|
|
||||||
|
|
||||||
License
|
|
||||||
|
|
||||||
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
|
|
||||||
|
|
||||||
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
|
|
||||||
|
|
||||||
1. Definitions
|
|
||||||
|
|
||||||
1. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
|
|
||||||
2. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
|
|
||||||
3. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
|
|
||||||
4. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
|
|
||||||
5. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
|
|
||||||
6. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
|
|
||||||
7. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
|
|
||||||
8. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
|
|
||||||
9. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
|
|
||||||
|
|
||||||
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
|
|
||||||
|
|
||||||
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
|
|
||||||
|
|
||||||
1. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
|
|
||||||
2. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
|
|
||||||
3. to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
|
|
||||||
4. to Distribute and Publicly Perform Adaptations.
|
|
||||||
5.
|
|
||||||
|
|
||||||
For the avoidance of doubt:
|
|
||||||
1. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
|
|
||||||
2. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
|
|
||||||
3. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
|
|
||||||
|
|
||||||
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
|
|
||||||
|
|
||||||
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
|
|
||||||
|
|
||||||
1. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested.
|
|
||||||
2. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
|
|
||||||
3. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
|
|
||||||
|
|
||||||
5. Representations, Warranties and Disclaimer
|
|
||||||
|
|
||||||
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
|
|
||||||
|
|
||||||
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
|
|
||||||
7. Termination
|
|
||||||
|
|
||||||
1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
|
|
||||||
2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
|
|
||||||
|
|
||||||
8. Miscellaneous
|
|
||||||
|
|
||||||
1. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
|
|
||||||
2. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
|
|
||||||
3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
|
|
||||||
4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
|
|
||||||
5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
|
|
||||||
6. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
|
|
||||||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-ciLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,195 +0,0 @@
|
|||||||
|
|
||||||
:root { --ink: #16181a; --accent: #1f4a3f; --muted: #6a7178; }
|
|
||||||
|
|
||||||
body, input, select, textarea, button {
|
|
||||||
font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
|
|
||||||
"Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 1.7;
|
|
||||||
word-break: keep-all;
|
|
||||||
color: var(--ink);
|
|
||||||
}
|
|
||||||
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
|
|
||||||
.serif { font-family: "Gowun Batang", serif; font-weight: 700; letter-spacing: -0.01em; }
|
|
||||||
p { font-size: 16px; }
|
|
||||||
.kicker { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; opacity: .8; margin-bottom: .4rem; }
|
|
||||||
#footer .inner { padding-top: 3rem; padding-bottom: 3rem; }
|
|
||||||
#footer h2 { font-size: 20px; }
|
|
||||||
.tiny { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
|
|
||||||
.lead { max-width: 40rem; margin-left: auto; margin-right: auto; }
|
|
||||||
|
|
||||||
input[type="submit"].primary, input[type="reset"].primary, input[type="button"].primary,
|
|
||||||
button.primary, .button.primary { background-color: var(--accent); }
|
|
||||||
input[type="submit"].primary:hover, button.primary:hover, .button.primary:hover { background-color: #2a6455; }
|
|
||||||
a { color: var(--accent); }
|
|
||||||
|
|
||||||
#topbar {
|
|
||||||
position: fixed; top: 0; left: 0; right: 0; height: 48px; z-index: 30;
|
|
||||||
display: flex; align-items: center; justify-content: space-between;
|
|
||||||
padding: 0 16px; background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
|
|
||||||
border-bottom: 1px solid rgba(0,0,0,.07);
|
|
||||||
}
|
|
||||||
#topbar .brand { font-weight: 700; font-size: 15px; text-decoration: none; color: var(--ink); letter-spacing: -.01em; }
|
|
||||||
#topbar nav { display: flex; gap: 4px; }
|
|
||||||
#topbar nav a {
|
|
||||||
display: flex; align-items: center; min-height: 44px; padding: 0 10px;
|
|
||||||
font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink);
|
|
||||||
}
|
|
||||||
#wrapper { padding-top: 48px; }
|
|
||||||
|
|
||||||
#bookbar {
|
|
||||||
position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
|
|
||||||
display: flex; align-items: center; gap: 12px;
|
|
||||||
padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
|
|
||||||
background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
|
|
||||||
border-top: 1px solid rgba(0,0,0,.09);
|
|
||||||
}
|
|
||||||
#bookbar .price { display: flex; flex-direction: column; line-height: 1.25; }
|
|
||||||
#bookbar .price b { font-size: 18px; font-weight: 700; }
|
|
||||||
#bookbar .price small { font-size: 12px; color: var(--muted); }
|
|
||||||
#bookbar .button.primary { margin-left: auto; min-width: 9.5rem; min-height: 48px; line-height: 48px; }
|
|
||||||
body { padding-bottom: 76px; }
|
|
||||||
|
|
||||||
.banner.style1 .content > .kicker, .banner.style1 .content > .major { color: inherit; }
|
|
||||||
.banner.style1 h1 { font-size: 2.6rem; line-height: 1.2; }
|
|
||||||
.banner.style1 .content { padding: 3rem 1.5rem; }
|
|
||||||
|
|
||||||
.units { display: grid; gap: 20px; margin: 2rem 0 1rem; text-align: left; }
|
|
||||||
.unit { border: 1px solid rgba(0,0,0,.1); border-radius: 12px; overflow: hidden; background: #fff; }
|
|
||||||
.unit .image { display: block; aspect-ratio: 4/3; }
|
|
||||||
.unit .image img { width: 100%; height: 100%; object-fit: cover; }
|
|
||||||
.unit .body { padding: 18px; }
|
|
||||||
.unit h3 { font-size: 20px; margin: 0 0 2px; }
|
|
||||||
.unit .sub { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
|
|
||||||
.unit .price { margin: 12px 0; font-size: 15px; }
|
|
||||||
.unit .price b { font-size: 19px; }
|
|
||||||
|
|
||||||
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
|
|
||||||
.chips li {
|
|
||||||
padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.05);
|
|
||||||
font-size: 13px; font-weight: 500; line-height: 1.4;
|
|
||||||
}
|
|
||||||
.chips.wide { justify-content: center; margin-top: 1rem; }
|
|
||||||
.invert .chips li { background: rgba(255,255,255,.14); }
|
|
||||||
|
|
||||||
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 1.75rem 0 1rem; text-align: left; }
|
|
||||||
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
|
|
||||||
.tile { display: block; border-radius: 12px; overflow: hidden; text-decoration: none; background: rgba(0,0,0,.04); color: inherit; }
|
|
||||||
.invert .tile { background: rgba(255,255,255,.08); }
|
|
||||||
.tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
|
|
||||||
.tile span { display: block; padding: 10px 12px 13px; }
|
|
||||||
.tile b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
|
|
||||||
.tile small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
|
|
||||||
.invert .tile small { color: rgba(255,255,255,.7); }
|
|
||||||
.tile em { display: block; font-style: normal; font-size: 12.5px; line-height: 1.55; margin-top: 5px; opacity: .8; }
|
|
||||||
|
|
||||||
.mapframe { width: 100%; height: 300px; border: 0; border-radius: 12px; margin: 1.5rem 0 1rem; }
|
|
||||||
.address { font-size: 18px; font-weight: 600; }
|
|
||||||
|
|
||||||
.index.align-left { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; max-width: 44rem; margin-inline: auto; }
|
|
||||||
.index.align-left section { padding: 9px 0; border-bottom: 1px solid rgba(0,0,0,.07); }
|
|
||||||
.invert .index.align-left section { border-bottom-color: rgba(255,255,255,.16); }
|
|
||||||
.index.align-left header { margin: 0; padding: 0; }
|
|
||||||
.index.align-left h3 { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 0; }
|
|
||||||
.invert .index.align-left h3 { color: rgba(255,255,255,.7); }
|
|
||||||
.index.align-left .content { padding: 0; }
|
|
||||||
.index.align-left .content p { font-size: 15px; margin: 0; line-height: 1.5; }
|
|
||||||
|
|
||||||
.faqhead { margin-top: 2.5rem; font-size: 18px; }
|
|
||||||
.faq { text-align: left; max-width: 44rem; margin: 0 auto; }
|
|
||||||
.faq details { border-bottom: 1px solid rgba(0,0,0,.1); }
|
|
||||||
.invert .faq details { border-bottom-color: rgba(255,255,255,.18); }
|
|
||||||
.faq summary {
|
|
||||||
cursor: pointer; list-style: none; padding: 15px 28px 15px 0; position: relative;
|
|
||||||
font-size: 15.5px; font-weight: 600; min-height: 44px;
|
|
||||||
}
|
|
||||||
.faq summary::-webkit-details-marker { display: none; }
|
|
||||||
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 13px; font-size: 20px; font-weight: 400; opacity: .55; }
|
|
||||||
.faq details[open] summary::after { content: "\2212"; }
|
|
||||||
.faq details p { padding: 0 0 15px; margin: 0; font-size: 15px; }
|
|
||||||
.faq .plans summary span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
|
|
||||||
.invert .faq .plans summary span { color: rgba(255,255,255,.7); }
|
|
||||||
.plans .why { font-size: 15px; padding-bottom: 8px; }
|
|
||||||
.plans .day { padding: 4px 0 14px; }
|
|
||||||
.plans .day h4 { font-size: 14px; margin: 0 0 6px; }
|
|
||||||
.plans .day h4 small { font-weight: 400; color: var(--muted); }
|
|
||||||
.plans .day ol { margin: 0; padding-left: 1.2rem; }
|
|
||||||
.plans .day li { padding: 4px 0; font-size: 14.5px; }
|
|
||||||
.plans .day li b { font-weight: 600; }
|
|
||||||
.plans .day li span { display: block; font-size: 13.5px; opacity: .78; line-height: 1.6; }
|
|
||||||
|
|
||||||
.reads { display: grid; gap: 18px; text-align: left; max-width: 44rem; margin: 1.5rem auto 0; }
|
|
||||||
.read { border-left: 2px solid var(--accent); padding-left: 16px; }
|
|
||||||
.read h3 { font-size: 17px; margin: 0 0 6px; }
|
|
||||||
.read p { font-size: 15px; margin: 0 0 8px; }
|
|
||||||
.read a { display: inline-flex; align-items: center; min-height: 44px; font-size: 13.5px; font-weight: 600; }
|
|
||||||
|
|
||||||
.songs { list-style: none; margin: 1.5rem 0 0; padding: 0; text-align: left; max-width: 44rem; margin-inline: auto; }
|
|
||||||
.songs li { border-top: 1px solid rgba(255,255,255,.16); }
|
|
||||||
.songs li:last-child { border-bottom: 1px solid rgba(255,255,255,.16); }
|
|
||||||
.songs a { display: block; padding: 14px 0; text-decoration: none; color: inherit; min-height: 44px; }
|
|
||||||
.songs b { font-size: 16px; font-weight: 600; }
|
|
||||||
.songs span { font-size: 13.5px; opacity: .72; margin-left: 8px; }
|
|
||||||
.songs em { display: block; font-style: normal; font-size: 13.5px; opacity: .78; margin-top: 3px; line-height: 1.6; }
|
|
||||||
|
|
||||||
.hero-shot { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; margin: 1.25rem 0; }
|
|
||||||
.table-wrapper table.alt th { width: 8rem; font-size: 14px; color: var(--muted); }
|
|
||||||
.table-wrapper table.alt td { font-size: 15px; }
|
|
||||||
|
|
||||||
.banner.style1.cover { position: relative; display: block; padding: 0; }
|
|
||||||
.banner.style1.cover .image {
|
|
||||||
position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; max-width: none;
|
|
||||||
}
|
|
||||||
.banner.style1.cover .image img { width: 100%; height: 100%; object-fit: cover; }
|
|
||||||
.banner.style1.cover .content {
|
|
||||||
position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end;
|
|
||||||
min-height: 88svh; padding: 2rem 1.5rem 3rem; text-align: left; max-width: none;
|
|
||||||
background: linear-gradient(to top, rgba(12,14,13,.86) 0%, rgba(12,14,13,.62) 32%, rgba(12,14,13,.22) 58%, rgba(12,14,13,0) 82%);
|
|
||||||
}
|
|
||||||
.banner.style1.cover.compact .content { min-height: 56svh; }
|
|
||||||
.banner.style1.cover .content,
|
|
||||||
.banner.style1.cover .content h1,
|
|
||||||
.banner.style1.cover .content p { color: #fff; }
|
|
||||||
.banner.style1.cover .content .kicker { opacity: .92; }
|
|
||||||
.banner.style1.cover .content .major { font-size: 17px; max-width: 26rem; }
|
|
||||||
.banner.style1.cover .actions { margin-top: 1.25rem; }
|
|
||||||
|
|
||||||
.button, .button.large, input[type="submit"], button {
|
|
||||||
letter-spacing: 0; font-weight: 600; min-height: 48px; line-height: 48px;
|
|
||||||
}
|
|
||||||
.button.large { min-height: 52px; line-height: 52px; font-size: 16px; }
|
|
||||||
.button.ghost { background: rgba(255,255,255,.14); color: #fff !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
|
|
||||||
.button.ghost:hover { background: rgba(255,255,255,.24); }
|
|
||||||
|
|
||||||
.tile em {
|
|
||||||
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
|
|
||||||
}
|
|
||||||
.tile b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
||||||
.tiles.wide { align-items: stretch; }
|
|
||||||
.tiles.wide .tile { display: flex; flex-direction: column; }
|
|
||||||
|
|
||||||
#topbar .brand { display: flex; align-items: center; min-height: 44px; }
|
|
||||||
.more { margin-top: 1.25rem; }
|
|
||||||
.more > summary {
|
|
||||||
cursor: pointer; list-style: none; display: inline-flex; align-items: center; justify-content: center;
|
|
||||||
min-height: 48px; padding: 0 1.5rem; border-radius: 999px; font-size: 15px; font-weight: 600;
|
|
||||||
box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
|
|
||||||
}
|
|
||||||
.more > summary::-webkit-details-marker { display: none; }
|
|
||||||
|
|
||||||
@media (min-width: 737px) {
|
|
||||||
.units { grid-template-columns: repeat(2, 1fr); }
|
|
||||||
.tiles { grid-template-columns: repeat(4, 1fr); }
|
|
||||||
.banner.style1 h1 { font-size: 3.4rem; }
|
|
||||||
.banner.style1.cover .content {
|
|
||||||
min-height: 82svh; padding: 3rem 4rem 4rem; width: 100%; max-width: none; flex-basis: auto;
|
|
||||||
}
|
|
||||||
.banner.style1.cover .content > * { max-width: 34rem; }
|
|
||||||
.banner.style1.cover.compact .content { min-height: 46svh; }
|
|
||||||
#topbar { height: 56px; padding: 0 28px; }
|
|
||||||
#wrapper { padding-top: 56px; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
* { animation: none !important; transition: none !important; }
|
|
||||||
}
|
|
||||||
@@ -1,387 +0,0 @@
|
|||||||
/*
|
|
||||||
Story by HTML5 UP
|
|
||||||
html5up.net | @ajlkn
|
|
||||||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Banner (transitions) */
|
|
||||||
|
|
||||||
.banner.onload-content-fade-up .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-content-fade-up .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-content-fade-down .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-content-fade-down .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-content-fade-left .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-content-fade-left .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-content-fade-right .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-content-fade-right .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-content-fade-in .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-content-fade-in .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-image-fade-up .image {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-image-fade-up .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-image-fade-up .image {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-image-fade-up .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-image-fade-down .image {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-image-fade-down .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-image-fade-down .image {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-image-fade-down .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-image-fade-left .image {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-image-fade-left .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-image-fade-left .image {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-image-fade-left .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-image-fade-right .image {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-image-fade-right .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-image-fade-right .image {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-image-fade-right .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onload-image-fade-in .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.is-preload .banner.onload-image-fade-in .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-up .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-up.is-inactive .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-down .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-down.is-inactive .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-left .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-left.is-inactive .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-right .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-right.is-inactive .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-in .content {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-content-fade-in.is-inactive .content {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-up .image {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-up .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-up.is-inactive .image {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-up.is-inactive .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-down .image {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-down .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-down.is-inactive .image {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-down.is-inactive .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-left .image {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-left .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-left.is-inactive .image {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-left.is-inactive .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-right .image {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-right .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-right.is-inactive .image {
|
|
||||||
-moz-transform: none;
|
|
||||||
-webkit-transform: none;
|
|
||||||
-ms-transform: none;
|
|
||||||
transform: none;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-right.is-inactive .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-in .image img {
|
|
||||||
-moz-transition: none;
|
|
||||||
-webkit-transition: none;
|
|
||||||
-ms-transition: none;
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.onscroll-image-fade-in.is-inactive .image img {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/* breakpoints.js v1.0 | @ajlkn | MIT licensed */
|
|
||||||
var breakpoints=function(){"use strict";function e(e){t.init(e)}var t={list:null,media:{},events:[],init:function(e){t.list=e,window.addEventListener("resize",t.poll),window.addEventListener("orientationchange",t.poll),window.addEventListener("load",t.poll),window.addEventListener("fullscreenchange",t.poll)},active:function(e){var n,a,s,i,r,d,c;if(!(e in t.media)){if(">="==e.substr(0,2)?(a="gte",n=e.substr(2)):"<="==e.substr(0,2)?(a="lte",n=e.substr(2)):">"==e.substr(0,1)?(a="gt",n=e.substr(1)):"<"==e.substr(0,1)?(a="lt",n=e.substr(1)):"!"==e.substr(0,1)?(a="not",n=e.substr(1)):(a="eq",n=e),n&&n in t.list)if(i=t.list[n],Array.isArray(i)){if(r=parseInt(i[0]),d=parseInt(i[1]),isNaN(r)){if(isNaN(d))return;c=i[1].substr(String(d).length)}else c=i[0].substr(String(r).length);if(isNaN(r))switch(a){case"gte":s="screen";break;case"lte":s="screen and (max-width: "+d+c+")";break;case"gt":s="screen and (min-width: "+(d+1)+c+")";break;case"lt":s="screen and (max-width: -1px)";break;case"not":s="screen and (min-width: "+(d+1)+c+")";break;default:s="screen and (max-width: "+d+c+")"}else if(isNaN(d))switch(a){case"gte":s="screen and (min-width: "+r+c+")";break;case"lte":s="screen";break;case"gt":s="screen and (max-width: -1px)";break;case"lt":s="screen and (max-width: "+(r-1)+c+")";break;case"not":s="screen and (max-width: "+(r-1)+c+")";break;default:s="screen and (min-width: "+r+c+")"}else switch(a){case"gte":s="screen and (min-width: "+r+c+")";break;case"lte":s="screen and (max-width: "+d+c+")";break;case"gt":s="screen and (min-width: "+(d+1)+c+")";break;case"lt":s="screen and (max-width: "+(r-1)+c+")";break;case"not":s="screen and (max-width: "+(r-1)+c+"), screen and (min-width: "+(d+1)+c+")";break;default:s="screen and (min-width: "+r+c+") and (max-width: "+d+c+")"}}else s="("==i.charAt(0)?"screen and "+i:i;t.media[e]=!!s&&s}return t.media[e]!==!1&&window.matchMedia(t.media[e]).matches},on:function(e,n){t.events.push({query:e,handler:n,state:!1}),t.active(e)&&n()},poll:function(){var e,n;for(e=0;e<t.events.length;e++)n=t.events[e],t.active(n.query)?n.state||(n.state=!0,n.handler()):n.state&&(n.state=!1)}};return e._=t,e.on=function(e,n){t.on(e,n)},e.active=function(e){return t.active(e)},e}();!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.breakpoints=t()}(this,function(){return breakpoints});
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/* browser.js v1.0.1 | @ajlkn | MIT licensed */
|
|
||||||
var browser=function(){"use strict";var t={name:null,version:null,os:null,osVersion:null,touch:null,mobile:null,_canUse:null,canUse:function(e){t._canUse||(t._canUse=document.createElement("div"));var n=t._canUse.style,r=e.charAt(0).toUpperCase()+e.slice(1);return e in n||"Moz"+r in n||"Webkit"+r in n||"O"+r in n||"ms"+r in n},init:function(){for(var e=navigator.userAgent,n="other",r=0,i=[["firefox",/Firefox\/([0-9\.]+)/],["bb",/BlackBerry.+Version\/([0-9\.]+)/],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/],["opera",/OPR\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)/],["edge",/Edge\/([0-9\.]+)/],["safari",/Version\/([0-9\.]+).+Safari/],["chrome",/Chrome\/([0-9\.]+)/],["ie",/MSIE ([0-9]+)/],["ie",/Trident\/.+rv:([0-9]+)/]],o=0;o<i.length;o++)if(e.match(i[o][1])){n=i[o][0],r=parseFloat(RegExp.$1);break}for(t.name=n,t.version=r,n="other",i=[["ios",/([0-9_]+) like Mac OS X/,function(e){return e.replace("_",".").replace("_","")}],["ios",/CPU like Mac OS X/,function(e){return 0}],["wp",/Windows Phone ([0-9\.]+)/,null],["android",/Android ([0-9\.]+)/,null],["mac",/Macintosh.+Mac OS X ([0-9_]+)/,function(e){return e.replace("_",".").replace("_","")}],["windows",/Windows NT ([0-9\.]+)/,null],["bb",/BlackBerry.+Version\/([0-9\.]+)/,null],["bb",/BB[0-9]+.+Version\/([0-9\.]+)/,null],["linux",/Linux/,null],["bsd",/BSD/,null],["unix",/X11/,null]],o=r=0;o<i.length;o++)if(e.match(i[o][1])){n=i[o][0],r=parseFloat(i[o][2]?i[o][2](RegExp.$1):RegExp.$1);break}"mac"==n&&"ontouchstart"in window&&(1024==screen.width&&1366==screen.height||834==screen.width&&1112==screen.height||810==screen.width&&1080==screen.height||768==screen.width&&1024==screen.height)&&(n="ios"),t.os=n,t.osVersion=r,t.touch="wp"==t.os?0<navigator.msMaxTouchPoints:!!("ontouchstart"in window),t.mobile="wp"==t.os||"android"==t.os||"ios"==t.os||"bb"==t.os}};return t.init(),t}();!function(e,n){"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?module.exports=n():e.browser=n()}(this,function(){return browser});
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
|
|
||||||
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^Line truncated
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/* jquery.scrollex v0.2.1 | (c) @ajlkn | github.com/ajlkn/jquery.scrollex | MIT licensed */
|
|
||||||
!function(t){function e(t,e,n){return"string"==typeof t&&("%"==t.slice(-1)?t=parseInt(t.substring(0,t.length-1))/100*e:"vh"==t.slice(-2)?t=parseInt(t.substring(0,t.length-2))/100*n:"px"==t.slice(-2)&&(t=parseInt(t.substring(0,t.length-2)))),t}var n=t(window),i=1,o={};n.on("scroll",function(){var e=n.scrollTop();t.map(o,function(t){window.clearTimeout(t.timeoutId),t.timeoutId=window.setTimeout(function(){t.handler(e)},t.options.delay)})}).on("load",function(){n.trigger("scroll")}),jQuery.fn.scrollex=function(l){var s=t(this);if(0==this.length)return s;if(this.length>1){for(var r=0;r<this.length;r++)t(this[r]).scrollex(l);return s}if(s.data("_scrollexId"))return s;var a,u,h,c,p;switch(a=i++,u=jQuery.extend({top:0,bottom:0,delay:0,mode:"default",enter:null,leave:null,initialize:null,terminate:null,scroll:null},l),u.mode){case"top":h=function(t,e,n,i,o){return t>=i&&o>=t};break;case"bottom":h=function(t,e,n,i,o){return n>=i&&o>=n};break;case"middle":h=function(t,e,n,i,o){return e>=i&&o>=e};break;case"top-only":h=function(t,e,n,i,o){return i>=t&&n>=i};break;case"bottom-only":h=function(t,e,n,i,o){return n>=o&&o>=t};break;default:case"default":h=function(t,e,n,i,o){return n>=i&&o>=t}}return c=function(t){var i,o,l,s,r,a,u=this.state,h=!1,c=this.$element.offset();i=n.height(),o=t+i/2,l=t+i,s=this.$element.outerHeight(),r=c.top+e(this.options.top,s,i),a=c.top+s-e(this.options.bottom,s,i),h=this.test(t,o,l,r,a),h!=u&&(this.state=h,h?this.options.enter&&this.options.enter.apply(this.element):this.options.leave&&this.options.leave.apply(this.element)),this.options.scroll&&this.options.scroll.apply(this.element,[(o-r)/(a-r)])},p={id:a,options:u,test:h,handler:c,state:null,element:this,$element:s,timeoutId:null},o[a]=p,s.data("_scrollexId",p.id),p.options.initialize&&p.options.initialize.apply(this),s},jQuery.fn.unscrollex=function(){var e=t(this);if(0==this.length)return e;if(this.length>1){for(var n=0;n<this.length;n++)t(this[n]).unscrollex();return e}var i,l;return(i=e.data("_scrollexId"))?(l=o[i],window.clearTimeout(l.timeoutId),delete o[i],e.removeData("_scrollexId"),l.options.terminate&&l.options.terminate.apply(this),e):e}}(jQuery);
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/* jquery.scrolly v1.0.0-dev | (c) @ajlkn | MIT licensed */
|
|
||||||
(function(e){function u(s,o){var u,a,f;if((u=e(s))[t]==0)return n;a=u[i]()[r];switch(o.anchor){case"middle":f=a-(e(window).height()-u.outerHeight())/2;break;default:case r:f=Math.max(a,0)}return typeof o[i]=="function"?f-=o[i]():f-=o[i],f}var t="length",n=null,r="top",i="offset",s="click.scrolly",o=e(window);e.fn.scrolly=function(i){var o,a,f,l,c=e(this);if(this[t]==0)return c;if(this[t]>1){for(o=0;o<this[t];o++)e(this[o]).scrolly(i);return c}l=n,f=c.attr("href");if(f.charAt(0)!="#"||f[t]<2)return c;a=jQuery.extend({anchor:r,easing:"swing",offset:0,parent:e("body,html"),pollOnce:!1,speed:1e3},i),a.pollOnce&&(l=u(f,a)),c.off(s).on(s,function(e){var t=l!==n?l:u(f,a);t!==n&&(e.preventDefault(),a.parent.stop().animate({scrollTop:t},a.speed,a.easing))})}})(jQuery);
|
|
||||||
@@ -1,341 +0,0 @@
|
|||||||
/*
|
|
||||||
Story by HTML5 UP
|
|
||||||
html5up.net | @ajlkn
|
|
||||||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function($) {
|
|
||||||
|
|
||||||
var $window = $(window),
|
|
||||||
$body = $('body'),
|
|
||||||
$wrapper = $('#wrapper');
|
|
||||||
|
|
||||||
// Breakpoints.
|
|
||||||
breakpoints({
|
|
||||||
xlarge: [ '1281px', '1680px' ],
|
|
||||||
large: [ '981px', '1280px' ],
|
|
||||||
medium: [ '737px', '980px' ],
|
|
||||||
small: [ '481px', '736px' ],
|
|
||||||
xsmall: [ '361px', '480px' ],
|
|
||||||
xxsmall: [ null, '360px' ]
|
|
||||||
});
|
|
||||||
|
|
||||||
// Play initial animations on page load.
|
|
||||||
$window.on('load', function() {
|
|
||||||
window.setTimeout(function() {
|
|
||||||
$body.removeClass('is-preload');
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Browser fixes.
|
|
||||||
|
|
||||||
// IE: Flexbox min-height bug.
|
|
||||||
if (browser.name == 'ie')
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
var flexboxFixTimeoutId;
|
|
||||||
|
|
||||||
$window.on('resize.flexbox-fix', function() {
|
|
||||||
|
|
||||||
var $x = $('.fullscreen');
|
|
||||||
|
|
||||||
clearTimeout(flexboxFixTimeoutId);
|
|
||||||
|
|
||||||
flexboxFixTimeoutId = setTimeout(function() {
|
|
||||||
|
|
||||||
if ($x.prop('scrollHeight') > $window.height())
|
|
||||||
$x.css('height', 'auto');
|
|
||||||
else
|
|
||||||
$x.css('height', '100vh');
|
|
||||||
|
|
||||||
}, 250);
|
|
||||||
|
|
||||||
}).triggerHandler('resize.flexbox-fix');
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
// Object fit workaround.
|
|
||||||
if (!browser.canUse('object-fit'))
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
$('.banner .image, .spotlight .image').each(function() {
|
|
||||||
|
|
||||||
var $this = $(this),
|
|
||||||
$img = $this.children('img'),
|
|
||||||
positionClass = $this.parent().attr('class').match(/image-position-([a-z]+)/);
|
|
||||||
|
|
||||||
// Set image.
|
|
||||||
$this
|
|
||||||
.css('background-image', 'url("' + $img.attr('src') + '")')
|
|
||||||
.css('background-repeat', 'no-repeat')
|
|
||||||
.css('background-size', 'cover');
|
|
||||||
|
|
||||||
// Set position.
|
|
||||||
switch (positionClass.length > 1 ? positionClass[1] : '') {
|
|
||||||
|
|
||||||
case 'left':
|
|
||||||
$this.css('background-position', 'left');
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'right':
|
|
||||||
$this.css('background-position', 'right');
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
case 'center':
|
|
||||||
$this.css('background-position', 'center');
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hide original.
|
|
||||||
$img.css('opacity', '0');
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
// Smooth scroll.
|
|
||||||
$('.smooth-scroll').scrolly();
|
|
||||||
$('.smooth-scroll-middle').scrolly({ anchor: 'middle' });
|
|
||||||
|
|
||||||
// Wrapper.
|
|
||||||
$wrapper.children()
|
|
||||||
.scrollex({
|
|
||||||
top: '30vh',
|
|
||||||
bottom: '30vh',
|
|
||||||
initialize: function() {
|
|
||||||
$(this).addClass('is-inactive');
|
|
||||||
},
|
|
||||||
terminate: function() {
|
|
||||||
$(this).removeClass('is-inactive');
|
|
||||||
},
|
|
||||||
enter: function() {
|
|
||||||
$(this).removeClass('is-inactive');
|
|
||||||
},
|
|
||||||
leave: function() {
|
|
||||||
|
|
||||||
var $this = $(this);
|
|
||||||
|
|
||||||
if ($this.hasClass('onscroll-bidirectional'))
|
|
||||||
$this.addClass('is-inactive');
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Items.
|
|
||||||
$('.items')
|
|
||||||
.scrollex({
|
|
||||||
top: '30vh',
|
|
||||||
bottom: '30vh',
|
|
||||||
delay: 50,
|
|
||||||
initialize: function() {
|
|
||||||
$(this).addClass('is-inactive');
|
|
||||||
},
|
|
||||||
terminate: function() {
|
|
||||||
$(this).removeClass('is-inactive');
|
|
||||||
},
|
|
||||||
enter: function() {
|
|
||||||
$(this).removeClass('is-inactive');
|
|
||||||
},
|
|
||||||
leave: function() {
|
|
||||||
|
|
||||||
var $this = $(this);
|
|
||||||
|
|
||||||
if ($this.hasClass('onscroll-bidirectional'))
|
|
||||||
$this.addClass('is-inactive');
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.children()
|
|
||||||
.wrapInner('<div class="inner"></div>');
|
|
||||||
|
|
||||||
// Gallery.
|
|
||||||
$('.gallery')
|
|
||||||
.wrapInner('<div class="inner"></div>')
|
|
||||||
.prepend(browser.mobile ? '' : '<div class="forward"></div><div class="backward"></div>')
|
|
||||||
.scrollex({
|
|
||||||
top: '30vh',
|
|
||||||
bottom: '30vh',
|
|
||||||
delay: 50,
|
|
||||||
initialize: function() {
|
|
||||||
$(this).addClass('is-inactive');
|
|
||||||
},
|
|
||||||
terminate: function() {
|
|
||||||
$(this).removeClass('is-inactive');
|
|
||||||
},
|
|
||||||
enter: function() {
|
|
||||||
$(this).removeClass('is-inactive');
|
|
||||||
},
|
|
||||||
leave: function() {
|
|
||||||
|
|
||||||
var $this = $(this);
|
|
||||||
|
|
||||||
if ($this.hasClass('onscroll-bidirectional'))
|
|
||||||
$this.addClass('is-inactive');
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.children('.inner')
|
|
||||||
//.css('overflow', 'hidden')
|
|
||||||
.css('overflow-y', browser.mobile ? 'visible' : 'hidden')
|
|
||||||
.css('overflow-x', browser.mobile ? 'scroll' : 'hidden')
|
|
||||||
.scrollLeft(0);
|
|
||||||
|
|
||||||
// Style #1.
|
|
||||||
// ...
|
|
||||||
|
|
||||||
// Style #2.
|
|
||||||
$('.gallery')
|
|
||||||
.on('wheel', '.inner', function(event) {
|
|
||||||
|
|
||||||
var $this = $(this),
|
|
||||||
delta = (event.originalEvent.deltaX * 10);
|
|
||||||
|
|
||||||
// Cap delta.
|
|
||||||
if (delta > 0)
|
|
||||||
delta = Math.min(25, delta);
|
|
||||||
else if (delta < 0)
|
|
||||||
delta = Math.max(-25, delta);
|
|
||||||
|
|
||||||
// Scroll.
|
|
||||||
$this.scrollLeft( $this.scrollLeft() + delta );
|
|
||||||
|
|
||||||
})
|
|
||||||
.on('mouseenter', '.forward, .backward', function(event) {
|
|
||||||
|
|
||||||
var $this = $(this),
|
|
||||||
$inner = $this.siblings('.inner'),
|
|
||||||
direction = ($this.hasClass('forward') ? 1 : -1);
|
|
||||||
|
|
||||||
// Clear move interval.
|
|
||||||
clearInterval(this._gallery_moveIntervalId);
|
|
||||||
|
|
||||||
// Start interval.
|
|
||||||
this._gallery_moveIntervalId = setInterval(function() {
|
|
||||||
$inner.scrollLeft( $inner.scrollLeft() + (5 * direction) );
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
})
|
|
||||||
.on('mouseleave', '.forward, .backward', function(event) {
|
|
||||||
|
|
||||||
// Clear move interval.
|
|
||||||
clearInterval(this._gallery_moveIntervalId);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Lightbox.
|
|
||||||
$('.gallery.lightbox')
|
|
||||||
.on('click', 'a', function(event) {
|
|
||||||
|
|
||||||
var $a = $(this),
|
|
||||||
$gallery = $a.parents('.gallery'),
|
|
||||||
$modal = $gallery.children('.modal'),
|
|
||||||
$modalImg = $modal.find('img'),
|
|
||||||
href = $a.attr('href');
|
|
||||||
|
|
||||||
// Not an image? Bail.
|
|
||||||
if (!href.match(/\.(jpg|gif|png|mp4)$/))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Prevent default.
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
// Locked? Bail.
|
|
||||||
if ($modal[0]._locked)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Lock.
|
|
||||||
$modal[0]._locked = true;
|
|
||||||
|
|
||||||
// Set src.
|
|
||||||
$modalImg.attr('src', href);
|
|
||||||
|
|
||||||
// Set visible.
|
|
||||||
$modal.addClass('visible');
|
|
||||||
|
|
||||||
// Focus.
|
|
||||||
$modal.focus();
|
|
||||||
|
|
||||||
// Delay.
|
|
||||||
setTimeout(function() {
|
|
||||||
|
|
||||||
// Unlock.
|
|
||||||
$modal[0]._locked = false;
|
|
||||||
|
|
||||||
}, 600);
|
|
||||||
|
|
||||||
})
|
|
||||||
.on('click', '.modal', function(event) {
|
|
||||||
|
|
||||||
var $modal = $(this),
|
|
||||||
$modalImg = $modal.find('img');
|
|
||||||
|
|
||||||
// Locked? Bail.
|
|
||||||
if ($modal[0]._locked)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Already hidden? Bail.
|
|
||||||
if (!$modal.hasClass('visible'))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Lock.
|
|
||||||
$modal[0]._locked = true;
|
|
||||||
|
|
||||||
// Clear visible, loaded.
|
|
||||||
$modal
|
|
||||||
.removeClass('loaded')
|
|
||||||
|
|
||||||
// Delay.
|
|
||||||
setTimeout(function() {
|
|
||||||
|
|
||||||
$modal
|
|
||||||
.removeClass('visible')
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
|
|
||||||
// Clear src.
|
|
||||||
$modalImg.attr('src', '');
|
|
||||||
|
|
||||||
// Unlock.
|
|
||||||
$modal[0]._locked = false;
|
|
||||||
|
|
||||||
// Focus.
|
|
||||||
$body.focus();
|
|
||||||
|
|
||||||
}, 475);
|
|
||||||
|
|
||||||
}, 125);
|
|
||||||
|
|
||||||
})
|
|
||||||
.on('keypress', '.modal', function(event) {
|
|
||||||
|
|
||||||
var $modal = $(this);
|
|
||||||
|
|
||||||
// Escape? Hide modal.
|
|
||||||
if (event.keyCode == 27)
|
|
||||||
$modal.trigger('click');
|
|
||||||
|
|
||||||
})
|
|
||||||
.prepend('<div class="modal" tabIndex="-1"><div class="inner"><img src="" /></div></div>')
|
|
||||||
.find('img')
|
|
||||||
.on('load', function(event) {
|
|
||||||
|
|
||||||
var $modalImg = $(this),
|
|
||||||
$modal = $modalImg.parents('.modal');
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
|
|
||||||
// No longer visible? Bail.
|
|
||||||
if (!$modal.hasClass('visible'))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Set loaded.
|
|
||||||
$modal.addClass('loaded');
|
|
||||||
|
|
||||||
}, 275);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
})(jQuery);
|
|
||||||
@@ -1,587 +0,0 @@
|
|||||||
(function($) {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate an indented list of links from a nav. Meant for use with panel().
|
|
||||||
* @return {jQuery} jQuery object.
|
|
||||||
*/
|
|
||||||
$.fn.navList = function() {
|
|
||||||
|
|
||||||
var $this = $(this);
|
|
||||||
$a = $this.find('a'),
|
|
||||||
b = [];
|
|
||||||
|
|
||||||
$a.each(function() {
|
|
||||||
|
|
||||||
var $this = $(this),
|
|
||||||
indent = Math.max(0, $this.parents('li').length - 1),
|
|
||||||
href = $this.attr('href'),
|
|
||||||
target = $this.attr('target');
|
|
||||||
|
|
||||||
b.push(
|
|
||||||
'<a ' +
|
|
||||||
'class="link depth-' + indent + '"' +
|
|
||||||
( (typeof target !== 'undefined' && target != '') ? ' target="' + target + '"' : '') +
|
|
||||||
( (typeof href !== 'undefined' && href != '') ? ' href="' + href + '"' : '') +
|
|
||||||
'>' +
|
|
||||||
'<span class="indent-' + indent + '"></span>' +
|
|
||||||
$this.text() +
|
|
||||||
'</a>'
|
|
||||||
);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
return b.join('');
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Panel-ify an element.
|
|
||||||
* @param {object} userConfig User config.
|
|
||||||
* @return {jQuery} jQuery object.
|
|
||||||
*/
|
|
||||||
$.fn.panel = function(userConfig) {
|
|
||||||
|
|
||||||
// No elements?
|
|
||||||
if (this.length == 0)
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
// Multiple elements?
|
|
||||||
if (this.length > 1) {
|
|
||||||
|
|
||||||
for (var i=0; i < this.length; i++)
|
|
||||||
$(this[i]).panel(userConfig);
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vars.
|
|
||||||
var $this = $(this),
|
|
||||||
$body = $('body'),
|
|
||||||
$window = $(window),
|
|
||||||
id = $this.attr('id'),
|
|
||||||
config;
|
|
||||||
|
|
||||||
// Config.
|
|
||||||
config = $.extend({
|
|
||||||
|
|
||||||
// Delay.
|
|
||||||
delay: 0,
|
|
||||||
|
|
||||||
// Hide panel on link click.
|
|
||||||
hideOnClick: false,
|
|
||||||
|
|
||||||
// Hide panel on escape keypress.
|
|
||||||
hideOnEscape: false,
|
|
||||||
|
|
||||||
// Hide panel on swipe.
|
|
||||||
hideOnSwipe: false,
|
|
||||||
|
|
||||||
// Reset scroll position on hide.
|
|
||||||
resetScroll: false,
|
|
||||||
|
|
||||||
// Reset forms on hide.
|
|
||||||
resetForms: false,
|
|
||||||
|
|
||||||
// Side of viewport the panel will appear.
|
|
||||||
side: null,
|
|
||||||
|
|
||||||
// Target element for "class".
|
|
||||||
target: $this,
|
|
||||||
|
|
||||||
// Class to toggle.
|
|
||||||
visibleClass: 'visible'
|
|
||||||
|
|
||||||
}, userConfig);
|
|
||||||
|
|
||||||
// Expand "target" if it's not a jQuery object already.
|
|
||||||
if (typeof config.target != 'jQuery')
|
|
||||||
config.target = $(config.target);
|
|
||||||
|
|
||||||
// Panel.
|
|
||||||
|
|
||||||
// Methods.
|
|
||||||
$this._hide = function(event) {
|
|
||||||
|
|
||||||
// Already hidden? Bail.
|
|
||||||
if (!config.target.hasClass(config.visibleClass))
|
|
||||||
return;
|
|
||||||
|
|
||||||
// If an event was provided, cancel it.
|
|
||||||
if (event) {
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hide.
|
|
||||||
config.target.removeClass(config.visibleClass);
|
|
||||||
|
|
||||||
// Post-hide stuff.
|
|
||||||
window.setTimeout(function() {
|
|
||||||
|
|
||||||
// Reset scroll position.
|
|
||||||
if (config.resetScroll)
|
|
||||||
$this.scrollTop(0);
|
|
||||||
|
|
||||||
// Reset forms.
|
|
||||||
if (config.resetForms)
|
|
||||||
$this.find('form').each(function() {
|
|
||||||
this.reset();
|
|
||||||
});
|
|
||||||
|
|
||||||
}, config.delay);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// Vendor fixes.
|
|
||||||
$this
|
|
||||||
.css('-ms-overflow-style', '-ms-autohiding-scrollbar')
|
|
||||||
.css('-webkit-overflow-scrolling', 'touch');
|
|
||||||
|
|
||||||
// Hide on click.
|
|
||||||
if (config.hideOnClick) {
|
|
||||||
|
|
||||||
$this.find('a')
|
|
||||||
.css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)');
|
|
||||||
|
|
||||||
$this
|
|
||||||
.on('click', 'a', function(event) {
|
|
||||||
|
|
||||||
var $a = $(this),
|
|
||||||
href = $a.attr('href'),
|
|
||||||
target = $a.attr('target');
|
|
||||||
|
|
||||||
if (!href || href == '#' || href == '' || href == '#' + id)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Cancel original event.
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
// Hide panel.
|
|
||||||
$this._hide();
|
|
||||||
|
|
||||||
// Redirect to href.
|
|
||||||
window.setTimeout(function() {
|
|
||||||
|
|
||||||
if (target == '_blank')
|
|
||||||
window.open(href);
|
|
||||||
else
|
|
||||||
window.location.href = href;
|
|
||||||
|
|
||||||
}, config.delay + 10);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Event: Touch stuff.
|
|
||||||
$this.on('touchstart', function(event) {
|
|
||||||
|
|
||||||
$this.touchPosX = event.originalEvent.touches[0].pageX;
|
|
||||||
$this.touchPosY = event.originalEvent.touches[0].pageY;
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
$this.on('touchmove', function(event) {
|
|
||||||
|
|
||||||
if ($this.touchPosX === null
|
|
||||||
|| $this.touchPosY === null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var diffX = $this.touchPosX - event.originalEvent.touches[0].pageX,
|
|
||||||
diffY = $this.touchPosY - event.originalEvent.touches[0].pageY,
|
|
||||||
th = $this.outerHeight(),
|
|
||||||
ts = ($this.get(0).scrollHeight - $this.scrollTop());
|
|
||||||
|
|
||||||
// Hide on swipe?
|
|
||||||
if (config.hideOnSwipe) {
|
|
||||||
|
|
||||||
var result = false,
|
|
||||||
boundary = 20,
|
|
||||||
delta = 50;
|
|
||||||
|
|
||||||
switch (config.side) {
|
|
||||||
|
|
||||||
case 'left':
|
|
||||||
result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX > delta);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'right':
|
|
||||||
result = (diffY < boundary && diffY > (-1 * boundary)) && (diffX < (-1 * delta));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'top':
|
|
||||||
result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY > delta);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'bottom':
|
|
||||||
result = (diffX < boundary && diffX > (-1 * boundary)) && (diffY < (-1 * delta));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result) {
|
|
||||||
|
|
||||||
$this.touchPosX = null;
|
|
||||||
$this.touchPosY = null;
|
|
||||||
$this._hide();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prevent vertical scrolling past the top or bottom.
|
|
||||||
if (($this.scrollTop() < 0 && diffY < 0)
|
|
||||||
|| (ts > (th - 2) && ts < (th + 2) && diffY > 0)) {
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Event: Prevent certain events inside the panel from bubbling.
|
|
||||||
$this.on('click touchend touchstart touchmove', function(event) {
|
|
||||||
event.stopPropagation();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Event: Hide panel if a child anchor tag pointing to its ID is clicked.
|
|
||||||
$this.on('click', 'a[href="#' + id + '"]', function(event) {
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
config.target.removeClass(config.visibleClass);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Body.
|
|
||||||
|
|
||||||
// Event: Hide panel on body click/tap.
|
|
||||||
$body.on('click touchend', function(event) {
|
|
||||||
$this._hide(event);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Event: Toggle.
|
|
||||||
$body.on('click', 'a[href="#' + id + '"]', function(event) {
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
config.target.toggleClass(config.visibleClass);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Window.
|
|
||||||
|
|
||||||
// Event: Hide on ESC.
|
|
||||||
if (config.hideOnEscape)
|
|
||||||
$window.on('keydown', function(event) {
|
|
||||||
|
|
||||||
if (event.keyCode == 27)
|
|
||||||
$this._hide(event);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Apply "placeholder" attribute polyfill to one or more forms.
|
|
||||||
* @return {jQuery} jQuery object.
|
|
||||||
*/
|
|
||||||
$.fn.placeholder = function() {
|
|
||||||
|
|
||||||
// Browser natively supports placeholders? Bail.
|
|
||||||
if (typeof (document.createElement('input')).placeholder != 'undefined')
|
|
||||||
return $(this);
|
|
||||||
|
|
||||||
// No elements?
|
|
||||||
if (this.length == 0)
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
// Multiple elements?
|
|
||||||
if (this.length > 1) {
|
|
||||||
|
|
||||||
for (var i=0; i < this.length; i++)
|
|
||||||
$(this[i]).placeholder();
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vars.
|
|
||||||
var $this = $(this);
|
|
||||||
|
|
||||||
// Text, TextArea.
|
|
||||||
$this.find('input[type=text],textarea')
|
|
||||||
.each(function() {
|
|
||||||
|
|
||||||
var i = $(this);
|
|
||||||
|
|
||||||
if (i.val() == ''
|
|
||||||
|| i.val() == i.attr('placeholder'))
|
|
||||||
i
|
|
||||||
.addClass('polyfill-placeholder')
|
|
||||||
.val(i.attr('placeholder'));
|
|
||||||
|
|
||||||
})
|
|
||||||
.on('blur', function() {
|
|
||||||
|
|
||||||
var i = $(this);
|
|
||||||
|
|
||||||
if (i.attr('name').match(/-polyfill-field$/))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (i.val() == '')
|
|
||||||
i
|
|
||||||
.addClass('polyfill-placeholder')
|
|
||||||
.val(i.attr('placeholder'));
|
|
||||||
|
|
||||||
})
|
|
||||||
.on('focus', function() {
|
|
||||||
|
|
||||||
var i = $(this);
|
|
||||||
|
|
||||||
if (i.attr('name').match(/-polyfill-field$/))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (i.val() == i.attr('placeholder'))
|
|
||||||
i
|
|
||||||
.removeClass('polyfill-placeholder')
|
|
||||||
.val('');
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Password.
|
|
||||||
$this.find('input[type=password]')
|
|
||||||
.each(function() {
|
|
||||||
|
|
||||||
var i = $(this);
|
|
||||||
var x = $(
|
|
||||||
$('<div>')
|
|
||||||
.append(i.clone())
|
|
||||||
.remove()
|
|
||||||
.html()
|
|
||||||
.replace(/type="password"/i, 'type="text"')
|
|
||||||
.replace(/type=password/i, 'type=text')
|
|
||||||
);
|
|
||||||
|
|
||||||
if (i.attr('id') != '')
|
|
||||||
x.attr('id', i.attr('id') + '-polyfill-field');
|
|
||||||
|
|
||||||
if (i.attr('name') != '')
|
|
||||||
x.attr('name', i.attr('name') + '-polyfill-field');
|
|
||||||
|
|
||||||
x.addClass('polyfill-placeholder')
|
|
||||||
.val(x.attr('placeholder')).insertAfter(i);
|
|
||||||
|
|
||||||
if (i.val() == '')
|
|
||||||
i.hide();
|
|
||||||
else
|
|
||||||
x.hide();
|
|
||||||
|
|
||||||
i
|
|
||||||
.on('blur', function(event) {
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
var x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]');
|
|
||||||
|
|
||||||
if (i.val() == '') {
|
|
||||||
|
|
||||||
i.hide();
|
|
||||||
x.show();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
x
|
|
||||||
.on('focus', function(event) {
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
var i = x.parent().find('input[name=' + x.attr('name').replace('-polyfill-field', '') + ']');
|
|
||||||
|
|
||||||
x.hide();
|
|
||||||
|
|
||||||
i
|
|
||||||
.show()
|
|
||||||
.focus();
|
|
||||||
|
|
||||||
})
|
|
||||||
.on('keypress', function(event) {
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
x.val('');
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Events.
|
|
||||||
$this
|
|
||||||
.on('submit', function() {
|
|
||||||
|
|
||||||
$this.find('input[type=text],input[type=password],textarea')
|
|
||||||
.each(function(event) {
|
|
||||||
|
|
||||||
var i = $(this);
|
|
||||||
|
|
||||||
if (i.attr('name').match(/-polyfill-field$/))
|
|
||||||
i.attr('name', '');
|
|
||||||
|
|
||||||
if (i.val() == i.attr('placeholder')) {
|
|
||||||
|
|
||||||
i.removeClass('polyfill-placeholder');
|
|
||||||
i.val('');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
})
|
|
||||||
.on('reset', function(event) {
|
|
||||||
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
$this.find('select')
|
|
||||||
.val($('option:first').val());
|
|
||||||
|
|
||||||
$this.find('input,textarea')
|
|
||||||
.each(function() {
|
|
||||||
|
|
||||||
var i = $(this),
|
|
||||||
x;
|
|
||||||
|
|
||||||
i.removeClass('polyfill-placeholder');
|
|
||||||
|
|
||||||
switch (this.type) {
|
|
||||||
|
|
||||||
case 'submit':
|
|
||||||
case 'reset':
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'password':
|
|
||||||
i.val(i.attr('defaultValue'));
|
|
||||||
|
|
||||||
x = i.parent().find('input[name=' + i.attr('name') + '-polyfill-field]');
|
|
||||||
|
|
||||||
if (i.val() == '') {
|
|
||||||
i.hide();
|
|
||||||
x.show();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
i.show();
|
|
||||||
x.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'checkbox':
|
|
||||||
case 'radio':
|
|
||||||
i.attr('checked', i.attr('defaultValue'));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'text':
|
|
||||||
case 'textarea':
|
|
||||||
i.val(i.attr('defaultValue'));
|
|
||||||
|
|
||||||
if (i.val() == '') {
|
|
||||||
i.addClass('polyfill-placeholder');
|
|
||||||
i.val(i.attr('placeholder'));
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
i.val(i.attr('defaultValue'));
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Moves elements to/from the first positions of their respective parents.
|
|
||||||
* @param {jQuery} $elements Elements (or selector) to move.
|
|
||||||
* @param {bool} condition If true, moves elements to the top. Otherwise, moves elements back to their original locations.
|
|
||||||
*/
|
|
||||||
$.prioritize = function($elements, condition) {
|
|
||||||
|
|
||||||
var key = '__prioritize';
|
|
||||||
|
|
||||||
// Expand $elements if it's not already a jQuery object.
|
|
||||||
if (typeof $elements != 'jQuery')
|
|
||||||
$elements = $($elements);
|
|
||||||
|
|
||||||
// Step through elements.
|
|
||||||
$elements.each(function() {
|
|
||||||
|
|
||||||
var $e = $(this), $p,
|
|
||||||
$parent = $e.parent();
|
|
||||||
|
|
||||||
// No parent? Bail.
|
|
||||||
if ($parent.length == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Not moved? Move it.
|
|
||||||
if (!$e.data(key)) {
|
|
||||||
|
|
||||||
// Condition is false? Bail.
|
|
||||||
if (!condition)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Get placeholder (which will serve as our point of reference for when this element needs to move back).
|
|
||||||
$p = $e.prev();
|
|
||||||
|
|
||||||
// Couldn't find anything? Means this element's already at the top, so bail.
|
|
||||||
if ($p.length == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Move element to top of parent.
|
|
||||||
$e.prependTo($parent);
|
|
||||||
|
|
||||||
// Mark element as moved.
|
|
||||||
$e.data(key, $p);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Moved already?
|
|
||||||
else {
|
|
||||||
|
|
||||||
// Condition is true? Bail.
|
|
||||||
if (condition)
|
|
||||||
return;
|
|
||||||
|
|
||||||
$p = $e.data(key);
|
|
||||||
|
|
||||||
// Move element back to its original location (using our placeholder).
|
|
||||||
$e.insertAfter($p);
|
|
||||||
|
|
||||||
// Unmark element as moved.
|
|
||||||
$e.removeData(key);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
})(jQuery);
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
///
|
|
||||||
/// Story by HTML5 UP
|
|
||||||
/// html5up.net | @ajlkn
|
|
||||||
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
///
|
|
||||||
|
|
||||||
/* Basic */
|
|
||||||
|
|
||||||
// MSIE: Required for IEMobile.
|
|
||||||
@-ms-viewport {
|
|
||||||
width: device-width;
|
|
||||||
}
|
|
||||||
|
|
||||||
// MSIE: Prevents scrollbar from overlapping content.
|
|
||||||
body {
|
|
||||||
-ms-overflow-style: scrollbar;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensures page width is always >=320px.
|
|
||||||
@include breakpoint('<=xsmall') {
|
|
||||||
html, body {
|
|
||||||
min-width: 320px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set box model to border-box.
|
|
||||||
// Based on css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice
|
|
||||||
html {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
*, *:before, *:after {
|
|
||||||
box-sizing: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background: _palette(bg);
|
|
||||||
|
|
||||||
// Stops initial animations until page loads.
|
|
||||||
&.is-preload {
|
|
||||||
*, *:before, *:after {
|
|
||||||
@include vendor('animation', 'none !important');
|
|
||||||
@include vendor('transition', 'none !important');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
///
|
|
||||||
/// Story by HTML5 UP
|
|
||||||
/// html5up.net | @ajlkn
|
|
||||||
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
///
|
|
||||||
|
|
||||||
// Reset.
|
|
||||||
// Based on meyerweb.com/eric/tools/css/reset (v2.0 | 20110126 | License: public domain)
|
|
||||||
|
|
||||||
html, body, div, span, applet, object,
|
|
||||||
iframe, h1, h2, h3, h4, h5, h6, p, blockquote,
|
|
||||||
pre, a, abbr, acronym, address, big, cite,
|
|
||||||
code, del, dfn, em, img, ins, kbd, q, s, samp,
|
|
||||||
small, strike, strong, sub, sup, tt, var, b,
|
|
||||||
u, i, center, dl, dt, dd, ol, ul, li, fieldset,
|
|
||||||
form, label, legend, table, caption, tbody,
|
|
||||||
tfoot, thead, tr, th, td, article, aside,
|
|
||||||
canvas, details, embed, figure, figcaption,
|
|
||||||
footer, header, hgroup, menu, nav, output, ruby,
|
|
||||||
section, summary, time, mark, audio, video {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
font-size: 100%;
|
|
||||||
font: inherit;
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
article, aside, details, figcaption, figure,
|
|
||||||
footer, header, hgroup, menu, nav, section {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol, ul {
|
|
||||||
list-style:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
blockquote, q {
|
|
||||||
quotes: none;
|
|
||||||
|
|
||||||
&:before,
|
|
||||||
&:after {
|
|
||||||
content: '';
|
|
||||||
content: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
border-spacing: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
-webkit-text-size-adjust: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
mark {
|
|
||||||
background-color: transparent;
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
input::-moz-focus-inner {
|
|
||||||
border: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
input, select, textarea {
|
|
||||||
-moz-appearance: none;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
-ms-appearance: none;
|
|
||||||
appearance: none;
|
|
||||||
}
|
|
||||||
@@ -1,231 +0,0 @@
|
|||||||
///
|
|
||||||
/// Story by HTML5 UP
|
|
||||||
/// html5up.net | @ajlkn
|
|
||||||
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
///
|
|
||||||
|
|
||||||
/* Type */
|
|
||||||
|
|
||||||
html {
|
|
||||||
font-size: 18pt;
|
|
||||||
|
|
||||||
@include breakpoint('<=xlarge') {
|
|
||||||
font-size: 14pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=large') {
|
|
||||||
font-size: 12pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
font-size: 11pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xxsmall') {
|
|
||||||
font-size: 10pt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: _palette(bg);
|
|
||||||
color: _palette(fg);
|
|
||||||
}
|
|
||||||
|
|
||||||
body, input, select, textarea {
|
|
||||||
font-family: _font(family);
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: _font(weight);
|
|
||||||
line-height: 1.65;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
@include vendor('transition', 'color #{_duration(transition)} ease-in-out');
|
|
||||||
text-decoration: underline;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
strong, b {
|
|
||||||
font-weight: _font(weight-bold);
|
|
||||||
}
|
|
||||||
|
|
||||||
em, i {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0 0 _size(element-margin) 0;
|
|
||||||
|
|
||||||
&.major {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
|
||||||
font-weight: _font(weight);
|
|
||||||
line-height: 1.375;
|
|
||||||
letter-spacing: _font(kerning);
|
|
||||||
margin: 0 0 (_size(element-margin) * 0.5) 0;
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 3.5rem;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 2.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h5 {
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h6 {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
position: relative;
|
|
||||||
top: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
sup {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
position: relative;
|
|
||||||
top: -0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
blockquote {
|
|
||||||
border-left: solid (_size(border-width) * 4);
|
|
||||||
font-style: italic;
|
|
||||||
margin: 0 0 _size(element-margin) 0;
|
|
||||||
padding: (_size(element-margin) / 4) 0 (_size(element-margin) / 4) _size(element-margin);
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
border-radius: _size(border-radius);
|
|
||||||
font-family: _font(family-fixed);
|
|
||||||
font-size: 0.9em;
|
|
||||||
margin: 0 0.25rem;
|
|
||||||
padding: 0.25rem 0.325rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre {
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
font-family: _font(family-fixed);
|
|
||||||
font-size: 0.9em;
|
|
||||||
margin: 0 0 _size(element-margin) 0;
|
|
||||||
|
|
||||||
code {
|
|
||||||
display: block;
|
|
||||||
line-height: 1.5;
|
|
||||||
padding: 0.75rem 1rem;
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
border: 0;
|
|
||||||
border-bottom: solid _size(border-width);
|
|
||||||
margin: (_size(element-margin) * 1.25) 0;
|
|
||||||
|
|
||||||
&.major {
|
|
||||||
margin: (_size(element-margin) * 1.75) 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-left {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.align-right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
p {
|
|
||||||
&.major {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 2.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin color-typography($p: null) {
|
|
||||||
|
|
||||||
@if $p != null {
|
|
||||||
background-color: _palette($p, bg);
|
|
||||||
color: _palette($p, fg);
|
|
||||||
}
|
|
||||||
|
|
||||||
input, select, textarea {
|
|
||||||
color: _palette($p, fg-bold);
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: _palette($p, fg-bold);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: _palette($p, accent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
strong, b {
|
|
||||||
color: _palette($p, fg-bold);
|
|
||||||
}
|
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
|
||||||
color: _palette($p, fg-bold);
|
|
||||||
}
|
|
||||||
|
|
||||||
blockquote {
|
|
||||||
border-left-color: _palette($p, border);
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
background: _palette($p, border-bg);
|
|
||||||
border-color: _palette($p, border);
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
border-bottom-color: _palette($p, border);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include color-typography;
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
///
|
|
||||||
/// Story by HTML5 UP
|
|
||||||
/// html5up.net | @ajlkn
|
|
||||||
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
///
|
|
||||||
|
|
||||||
/* Actions */
|
|
||||||
|
|
||||||
ul.actions {
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
cursor: default;
|
|
||||||
list-style: none;
|
|
||||||
margin-left: (_size(element-margin) * -0.5);
|
|
||||||
padding-left: 0;
|
|
||||||
|
|
||||||
li {
|
|
||||||
padding: 0 0 0 (_size(element-margin) * 0.5);
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.special {
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
width: 100%;
|
|
||||||
margin-left: 0;
|
|
||||||
|
|
||||||
li {
|
|
||||||
&:first-child {
|
|
||||||
padding-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.stacked {
|
|
||||||
@include vendor('flex-direction', 'column');
|
|
||||||
margin-left: 0;
|
|
||||||
|
|
||||||
li {
|
|
||||||
padding: (_size(element-margin) * 0.65) 0 0 0;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.fit {
|
|
||||||
width: calc(100% + #{_size(element-margin) * 0.5});
|
|
||||||
|
|
||||||
li {
|
|
||||||
@include vendor('flex-grow', '1');
|
|
||||||
@include vendor('flex-shrink', '1');
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
> * {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.stacked {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xsmall') {
|
|
||||||
&:not(.fixed) {
|
|
||||||
@include vendor('flex-direction', 'column');
|
|
||||||
margin-left: 0;
|
|
||||||
width: 100% !important;
|
|
||||||
|
|
||||||
li {
|
|
||||||
@include vendor('flex-grow', '1');
|
|
||||||
@include vendor('flex-shrink', '1');
|
|
||||||
padding: (_size(element-margin) * 0.5) 0 0 0;
|
|
||||||
text-align: center;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
> * {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="submit"],
|
|
||||||
input[type="reset"],
|
|
||||||
input[type="button"],
|
|
||||||
button,
|
|
||||||
.button {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
&.icon {
|
|
||||||
&:before {
|
|
||||||
margin-left: -0.5rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,990 +0,0 @@
|
|||||||
///
|
|
||||||
/// Story by HTML5 UP
|
|
||||||
/// html5up.net | @ajlkn
|
|
||||||
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
///
|
|
||||||
|
|
||||||
/* Banner (transitions) */
|
|
||||||
|
|
||||||
.banner {
|
|
||||||
|
|
||||||
// Mixin.
|
|
||||||
@mixin transition-banner($event) {
|
|
||||||
$x: null;
|
|
||||||
$y: null;
|
|
||||||
|
|
||||||
@if ($event == 'load') {
|
|
||||||
$x: 'body.is-preload &';
|
|
||||||
$y: _duration(on-load);
|
|
||||||
}
|
|
||||||
@else if ($event == 'scroll') {
|
|
||||||
$x: '&.is-inactive';
|
|
||||||
$y: _duration(on-scroll);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Content.
|
|
||||||
&.on#{$event}-content-fade-up {
|
|
||||||
.content {
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{$y} ease-in-out',
|
|
||||||
'transform #{$y} ease-in-out'
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.content {
|
|
||||||
@include vendor('transform', 'translateY(1rem)');
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.on#{$event}-content-fade-down {
|
|
||||||
.content {
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{$y} ease-in-out',
|
|
||||||
'transform #{$y} ease-in-out'
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.content {
|
|
||||||
@include vendor('transform', 'translateY(-1rem)');
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.on#{$event}-content-fade-left {
|
|
||||||
.content {
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{$y} ease-in-out',
|
|
||||||
'transform #{$y} ease-in-out'
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.content {
|
|
||||||
@include vendor('transform', 'translateX(1rem)');
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.on#{$event}-content-fade-right {
|
|
||||||
.content {
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{$y} ease-in-out',
|
|
||||||
'transform #{$y} ease-in-out'
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.content {
|
|
||||||
@include vendor('transform', 'translateX(-1rem)');
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.on#{$event}-content-fade-in {
|
|
||||||
.content {
|
|
||||||
@include vendor('transition', 'opacity #{$y} ease-in-out');
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.content {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Image.
|
|
||||||
&.on#{$event}-image-fade-up {
|
|
||||||
.image {
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{$y} ease-in-out',
|
|
||||||
'transform #{$y} ease-in-out'
|
|
||||||
));
|
|
||||||
|
|
||||||
img {
|
|
||||||
@include vendor('transition', 'opacity #{$y} ease-in-out');
|
|
||||||
@include vendor('transition-delay', '#{$y * 0.75}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.image {
|
|
||||||
@include vendor('transform', 'translateY(1rem)');
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
img {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.on#{$event}-image-fade-down {
|
|
||||||
.image {
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{$y} ease-in-out',
|
|
||||||
'transform #{$y} ease-in-out'
|
|
||||||
));
|
|
||||||
|
|
||||||
img {
|
|
||||||
@include vendor('transition', 'opacity #{$y} ease-in-out');
|
|
||||||
@include vendor('transition-delay', '#{$y * 0.75}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.image {
|
|
||||||
@include vendor('transform', 'translateY(-1rem)');
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
img {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.on#{$event}-image-fade-left {
|
|
||||||
.image {
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{$y} ease-in-out',
|
|
||||||
'transform #{$y} ease-in-out'
|
|
||||||
));
|
|
||||||
|
|
||||||
img {
|
|
||||||
@include vendor('transition', 'opacity #{$y} ease-in-out');
|
|
||||||
@include vendor('transition-delay', '#{$y * 0.75}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.image {
|
|
||||||
@include vendor('transform', 'translateX(1rem)');
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
img {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.on#{$event}-image-fade-right {
|
|
||||||
.image {
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{$y} ease-in-out',
|
|
||||||
'transform #{$y} ease-in-out'
|
|
||||||
));
|
|
||||||
|
|
||||||
img {
|
|
||||||
@include vendor('transition', 'opacity #{$y} ease-in-out');
|
|
||||||
@include vendor('transition-delay', '#{$y * 0.75}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.image {
|
|
||||||
@include vendor('transform', 'translateX(-1rem)');
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
img {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.on#{$event}-image-fade-in {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('transition', 'opacity #{$y} ease-in-out');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// On Load.
|
|
||||||
@include transition-banner('load');
|
|
||||||
|
|
||||||
// On Scroll.
|
|
||||||
@include transition-banner('scroll');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Banner (style1) */
|
|
||||||
|
|
||||||
.banner.style1 {
|
|
||||||
@include vendor('align-items', 'stretch');
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('flex-direction', 'row');
|
|
||||||
@include vendor('justify-content', 'flex-end');
|
|
||||||
position: relative;
|
|
||||||
text-align: left;
|
|
||||||
overflow-x: hidden;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, default), _size(padding, default));
|
|
||||||
@include vendor('align-self', 'center');
|
|
||||||
@include vendor('flex-grow', '1');
|
|
||||||
@include vendor('flex-shrink', '1');
|
|
||||||
width: 50%;
|
|
||||||
max-width: (_size(inner) * 0.75);
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
@include vendor('flex-grow', '0');
|
|
||||||
@include vendor('flex-shrink', '0');
|
|
||||||
border-radius: 0;
|
|
||||||
width: 50%;
|
|
||||||
|
|
||||||
img {
|
|
||||||
@include vendor('object-fit', 'cover');
|
|
||||||
@include vendor('object-position', 'center');
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xlarge') {
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, xlarge), _size(padding, xlarge));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=large') {
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, large), _size(padding, large));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, medium) * 1.25, _size(padding, medium));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, small) * 1.25, _size(padding, small));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include orientation(portrait) {
|
|
||||||
@include vendor('flex-direction', 'column-reverse');
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('flex-direction', 'column');
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
width: 100%;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
width: 100%;
|
|
||||||
max-width: 100%;
|
|
||||||
height: 45vh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modifiers.
|
|
||||||
|
|
||||||
// Size.
|
|
||||||
&.fullscreen {
|
|
||||||
min-height: 100vh;
|
|
||||||
|
|
||||||
@include orientation(portrait) {
|
|
||||||
.content {
|
|
||||||
min-height: 50vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
height: 50vh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Orientation.
|
|
||||||
&.orient-left {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.orient-right {
|
|
||||||
@include vendor('flex-direction', 'row-reverse');
|
|
||||||
|
|
||||||
@include orientation(portrait) {
|
|
||||||
@include vendor('flex-direction', 'column-reverse');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Content Alignment.
|
|
||||||
&.content-align-left {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-right {
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
@include orientation(portrait) {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Image Position.
|
|
||||||
&.image-position-left {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'left');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-center {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-right {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'right');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Banner (style2) */
|
|
||||||
|
|
||||||
.banner.style2 {
|
|
||||||
@include padding(_size(padding, default) * 0.75, _size(padding, default) * 0.75);
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
background-color: inherit;
|
|
||||||
position: relative;
|
|
||||||
text-align: center;
|
|
||||||
overflow-x: hidden;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, default) * 0.75, _size(padding, default) * 0.75);
|
|
||||||
position: relative;
|
|
||||||
width: (_size(inner) * 0.625);
|
|
||||||
max-width: 100%;
|
|
||||||
background-color: inherit;
|
|
||||||
border-radius: _size(border-radius-alt);
|
|
||||||
margin-bottom: _size(element-margin);
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
@include vendor('flex-grow', '0');
|
|
||||||
@include vendor('flex-shrink', '0');
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
|
|
||||||
img {
|
|
||||||
@include vendor('object-fit', 'cover');
|
|
||||||
@include vendor('object-position', 'center');
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xlarge') {
|
|
||||||
@include padding(_size(padding, xlarge) * 0.75, _size(padding, xlarge) * 0.75);
|
|
||||||
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, xlarge) * 0.75, _size(padding, xlarge) * 0.75);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=large') {
|
|
||||||
@include padding(_size(padding, large), _size(padding, large) * 0.75);
|
|
||||||
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, large), _size(padding, large) * 0.75);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
@include padding(_size(padding, medium), _size(padding, medium));
|
|
||||||
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, medium) * 1.25, _size(padding, medium) * 0.75);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
@include padding(_size(padding, small), _size(padding, small));
|
|
||||||
|
|
||||||
.content {
|
|
||||||
@include padding(_size(padding, small) * 1.25, _size(padding, small) * 0.75);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modifiers.
|
|
||||||
|
|
||||||
// Size.
|
|
||||||
&.fullscreen {
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Orientation.
|
|
||||||
&.orient-left {
|
|
||||||
@include vendor('justify-content', 'flex-start');
|
|
||||||
padding-left: 0;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
border-top-left-radius: 0;
|
|
||||||
border-bottom-left-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.orient-center {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.orient-right {
|
|
||||||
@include vendor('justify-content', 'flex-end');
|
|
||||||
padding-right: 0;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
border-top-right-radius: 0;
|
|
||||||
border-bottom-right-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Content Alignment.
|
|
||||||
&.content-align-left {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-center {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Image Position.
|
|
||||||
&.image-position-left {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'left');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-center {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-right {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'right');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Banner (style3) */
|
|
||||||
|
|
||||||
.banner.style3 {
|
|
||||||
$image-size: 21rem;
|
|
||||||
$content-size: (_size(inner) * 0.875) - $image-size - (_size(element-margin) * 1.75);
|
|
||||||
|
|
||||||
@include padding(_size(padding, default), _size(padding, default));
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('flex-direction', 'row-reverse');
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
position: relative;
|
|
||||||
text-align: left;
|
|
||||||
overflow-x: hidden;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
width: $content-size;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
@include vendor('flex-grow', '0');
|
|
||||||
@include vendor('flex-shrink', '0');
|
|
||||||
width: $image-size;
|
|
||||||
height: $image-size;
|
|
||||||
border-radius: 100%;
|
|
||||||
margin: 0 (_size(element-margin) * 1.75) _size(element-margin) 0;
|
|
||||||
|
|
||||||
img {
|
|
||||||
@include vendor('object-fit', 'cover');
|
|
||||||
@include vendor('object-position', 'center');
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xlarge') {
|
|
||||||
@include padding(_size(padding, xlarge), _size(padding, xlarge));
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=large') {
|
|
||||||
@include padding(_size(padding, large), _size(padding, large));
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
@include padding(_size(padding, medium) * 1.25, _size(padding, medium));
|
|
||||||
|
|
||||||
.image {
|
|
||||||
width: ($image-size * 0.875);
|
|
||||||
height: ($image-size * 0.875);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
@include padding(_size(padding, small) * 1.25, _size(padding, small));
|
|
||||||
@include vendor('align-items', 'flex-start');
|
|
||||||
|
|
||||||
.image {
|
|
||||||
width: ($image-size * 0.75);
|
|
||||||
height: ($image-size * 0.75);
|
|
||||||
margin: 0 (_size(element-margin) * 1) _size(element-margin) 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include orientation(portrait) {
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('flex-direction', 'column-reverse');
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
width: 34rem;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modifiers.
|
|
||||||
|
|
||||||
// Size.
|
|
||||||
&.fullscreen {
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Orientation.
|
|
||||||
&.orient-left {
|
|
||||||
@include vendor('flex-direction', 'row');
|
|
||||||
|
|
||||||
.image {
|
|
||||||
margin: 0 0 _size(element-margin) (_size(element-margin) * 1.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
.image {
|
|
||||||
margin: 0 0 _size(element-margin) (_size(element-margin) * 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include orientation(portrait) {
|
|
||||||
@include vendor('flex-direction', 'column-reverse');
|
|
||||||
|
|
||||||
.image {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.orient-right {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
// Content Alignment.
|
|
||||||
&.content-align-left {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Image Position.
|
|
||||||
&.image-position-left {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'left');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-center {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-right {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'right');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Banner (style4) */
|
|
||||||
|
|
||||||
.banner.style4 {
|
|
||||||
$image-width: 13rem;
|
|
||||||
$content-size: (_size(inner) * 0.75) - $image-width - (_size(element-margin) * 1.75);
|
|
||||||
|
|
||||||
@include padding(_size(padding, default), _size(padding, default));
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('flex-direction', 'row-reverse');
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
position: relative;
|
|
||||||
text-align: left;
|
|
||||||
overflow-x: hidden;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
width: $content-size;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
@include phone($image-width);
|
|
||||||
margin-right: (_size(element-margin) * 1.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xlarge') {
|
|
||||||
@include padding(_size(padding, xlarge), _size(padding, xlarge));
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=large') {
|
|
||||||
@include padding(_size(padding, large), _size(padding, large));
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
@include padding(_size(padding, medium) * 1.25, _size(padding, medium));
|
|
||||||
|
|
||||||
.image {
|
|
||||||
@include resize-phone($image-width, 0.875);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
@include padding(_size(padding, small) * 1.25, _size(padding, small));
|
|
||||||
@include vendor('align-items', 'flex-start');
|
|
||||||
|
|
||||||
.image {
|
|
||||||
@include resize-phone($image-width, 0.625);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include orientation(portrait) {
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('flex-direction', 'column-reverse');
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
width: 34rem;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
margin-right: 0;
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modifiers.
|
|
||||||
|
|
||||||
// Size.
|
|
||||||
&.fullscreen {
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Variant.
|
|
||||||
&.iphone {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.android {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
// Orientation.
|
|
||||||
&.orient-left {
|
|
||||||
@include vendor('flex-direction', 'row');
|
|
||||||
|
|
||||||
.image {
|
|
||||||
margin-right: 0;
|
|
||||||
margin-left: (_size(element-margin) * 1.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
@include orientation(portrait) {
|
|
||||||
@include vendor('flex-direction', 'column-reverse');
|
|
||||||
|
|
||||||
.image {
|
|
||||||
margin-right: 0;
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.orient-right {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
// Content Alignment.
|
|
||||||
&.content-align-left {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-center {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Image Position.
|
|
||||||
&.image-position-left {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'left');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-center {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-right {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'right');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Banner (style5) */
|
|
||||||
|
|
||||||
.banner.style5 {
|
|
||||||
@include padding(_size(padding, default), _size(padding, default));
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
background-color: inherit;
|
|
||||||
position: relative;
|
|
||||||
text-align: center;
|
|
||||||
overflow-x: hidden;
|
|
||||||
|
|
||||||
.content {
|
|
||||||
position: relative;
|
|
||||||
width: (_size(inner) * 0.625);
|
|
||||||
max-width: 100%;
|
|
||||||
margin-bottom: _size(element-margin);
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
@include vendor('flex-grow', '0');
|
|
||||||
@include vendor('flex-shrink', '0');
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
opacity: _misc(overlay-opacity);
|
|
||||||
|
|
||||||
img {
|
|
||||||
@include vendor('object-fit', 'cover');
|
|
||||||
@include vendor('object-position', 'center');
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xlarge') {
|
|
||||||
@include padding(_size(padding, xlarge), _size(padding, xlarge));
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=large') {
|
|
||||||
@include padding(_size(padding, large), _size(padding, large));
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
@include padding(_size(padding, medium) * 1.25, _size(padding, medium));
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
@include padding(_size(padding, small) * 1.25, _size(padding, small));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modifiers.
|
|
||||||
|
|
||||||
// Size.
|
|
||||||
&.fullscreen {
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Content Alignment.
|
|
||||||
&.content-align-left {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-center {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.content-align-right {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Image Position.
|
|
||||||
&.image-position-left {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'left');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-center {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-position-right {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('object-position', 'right');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mixin
|
|
||||||
|
|
||||||
@mixin color-banner($p: null) {
|
|
||||||
.banner {
|
|
||||||
.image {
|
|
||||||
background-color: transparentize(_palette($p, fg-bold), 0.875);
|
|
||||||
}
|
|
||||||
|
|
||||||
@if ($p != 'invert') {
|
|
||||||
&.invert {
|
|
||||||
.image {
|
|
||||||
background-color: transparentize(_palette(invert, fg-bold), 0.875);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.banner.style4 {
|
|
||||||
.image {
|
|
||||||
@include color-phone($p);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Variant.
|
|
||||||
&.iphone {
|
|
||||||
.image {
|
|
||||||
@include color-phone-variant('iphone', $p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.android {
|
|
||||||
.image {
|
|
||||||
@include color-phone-variant('android', $p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@if ($p != 'invert') {
|
|
||||||
&.invert {
|
|
||||||
.image {
|
|
||||||
@include color-phone(invert);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Variant.
|
|
||||||
&.iphone {
|
|
||||||
.image {
|
|
||||||
@include color-phone-variant('iphone', invert);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.android {
|
|
||||||
.image {
|
|
||||||
@include color-phone-variant('android', invert);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include color-banner;
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
///
|
|
||||||
/// Story by HTML5 UP
|
|
||||||
/// html5up.net | @ajlkn
|
|
||||||
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
///
|
|
||||||
|
|
||||||
/* Box */
|
|
||||||
|
|
||||||
.box {
|
|
||||||
border-radius: _size(border-radius);
|
|
||||||
border: solid _size(border-width);
|
|
||||||
margin-bottom: _size(element-margin);
|
|
||||||
padding: 1.5rem;
|
|
||||||
|
|
||||||
> :last-child,
|
|
||||||
> :last-child > :last-child,
|
|
||||||
> :last-child > :last-child > :last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.alt {
|
|
||||||
border: 0;
|
|
||||||
border-radius: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin color-box($p: null) {
|
|
||||||
.box {
|
|
||||||
border-color: _palette($p, border);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include color-box;
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
///
|
|
||||||
/// Story by HTML5 UP
|
|
||||||
/// html5up.net | @ajlkn
|
|
||||||
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
///
|
|
||||||
|
|
||||||
/* Button */
|
|
||||||
|
|
||||||
input[type="submit"],
|
|
||||||
input[type="reset"],
|
|
||||||
input[type="button"],
|
|
||||||
button,
|
|
||||||
.button {
|
|
||||||
@include vendor('appearance', 'none');
|
|
||||||
@include vendor('transition', (
|
|
||||||
'background-color #{_duration(transition)} ease-in-out',
|
|
||||||
'box-shadow #{_duration(transition)} ease-in-out',
|
|
||||||
'color #{_duration(transition)} ease-in-out'
|
|
||||||
));
|
|
||||||
border: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
font-weight: _font(weight-bold);
|
|
||||||
letter-spacing: _font(kerning-alt);
|
|
||||||
text-align: center;
|
|
||||||
text-decoration: none;
|
|
||||||
text-transform: uppercase;
|
|
||||||
white-space: nowrap;
|
|
||||||
font-size: 0.75rem;
|
|
||||||
max-width: 20rem;
|
|
||||||
height: 3.75em;
|
|
||||||
line-height: 3.75em;
|
|
||||||
border-radius: 3.75em;
|
|
||||||
padding: 0 2.5em;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
&.icon {
|
|
||||||
&:before {
|
|
||||||
margin-right: 0.5rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.fit {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.small {
|
|
||||||
font-size: 0.6rem;
|
|
||||||
height: 3.325em;
|
|
||||||
line-height: 3.325em;
|
|
||||||
border-radius: 3.325em;
|
|
||||||
padding: 0 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.large {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
height: 4em;
|
|
||||||
line-height: 4em;
|
|
||||||
border-radius: 4em;
|
|
||||||
padding: 0 3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.wide {
|
|
||||||
min-width: 14em;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.disabled,
|
|
||||||
&:disabled {
|
|
||||||
@include vendor('pointer-events', 'none');
|
|
||||||
opacity: 0.25;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin color-button($p: null) {
|
|
||||||
input[type="submit"],
|
|
||||||
input[type="reset"],
|
|
||||||
input[type="button"],
|
|
||||||
button,
|
|
||||||
.button {
|
|
||||||
background-color: transparent;
|
|
||||||
box-shadow: inset 0 0 0 _size(border-width) _palette($p, border);
|
|
||||||
color: _palette($p, fg-bold) !important;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
box-shadow: inset 0 0 0 _size(border-width) _palette($p, accent);
|
|
||||||
color: _palette($p, accent) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background-color: transparentize(_palette($p, accent), 0.8);
|
|
||||||
box-shadow: inset 0 0 0 _size(border-width) _palette($p, accent);
|
|
||||||
color: _palette($p, accent) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.primary {
|
|
||||||
background-color: _palette($p, fg-bold);
|
|
||||||
box-shadow: none;
|
|
||||||
color: _palette($p, bg) !important;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: _palette($p, accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:active {
|
|
||||||
background-color: darken(_palette($p, accent), 12);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include color-button;
|
|
||||||
@@ -1,286 +0,0 @@
|
|||||||
///
|
|
||||||
/// Story by HTML5 UP
|
|
||||||
/// html5up.net | @ajlkn
|
|
||||||
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
///
|
|
||||||
|
|
||||||
/* Form */
|
|
||||||
|
|
||||||
form {
|
|
||||||
margin: 0 0 _size(element-margin) 0;
|
|
||||||
|
|
||||||
> :last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .fields {
|
|
||||||
$gutter: (_size(element-margin) * 0.75);
|
|
||||||
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('flex-wrap', 'wrap');
|
|
||||||
width: calc(100% + #{$gutter * 2});
|
|
||||||
margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1);
|
|
||||||
|
|
||||||
> .field {
|
|
||||||
@include vendor('flex-grow', '0');
|
|
||||||
@include vendor('flex-shrink', '0');
|
|
||||||
padding: $gutter 0 0 $gutter;
|
|
||||||
width: calc(100% - #{$gutter * 1});
|
|
||||||
|
|
||||||
&.half {
|
|
||||||
width: calc(50% - #{$gutter * 0.5});
|
|
||||||
}
|
|
||||||
|
|
||||||
&.third {
|
|
||||||
width: calc(#{100% / 3} - #{$gutter * (1 / 3)});
|
|
||||||
}
|
|
||||||
|
|
||||||
&.quarter {
|
|
||||||
width: calc(25% - #{$gutter * 0.25});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xsmall') {
|
|
||||||
> .fields {
|
|
||||||
$gutter: (_size(element-margin) * 0.75);
|
|
||||||
|
|
||||||
width: calc(100% + #{$gutter * 2});
|
|
||||||
margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1);
|
|
||||||
|
|
||||||
> .field {
|
|
||||||
padding: $gutter 0 0 $gutter;
|
|
||||||
width: calc(100% - #{$gutter * 1});
|
|
||||||
|
|
||||||
&.half {
|
|
||||||
width: calc(100% - #{$gutter * 1});
|
|
||||||
}
|
|
||||||
|
|
||||||
&.third {
|
|
||||||
width: calc(100% - #{$gutter * 1});
|
|
||||||
}
|
|
||||||
|
|
||||||
&.quarter {
|
|
||||||
width: calc(100% - #{$gutter * 1});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
label {
|
|
||||||
display: block;
|
|
||||||
font-size: 0.9rem;
|
|
||||||
font-weight: _font(weight-bold);
|
|
||||||
margin: 0 0 (_size(element-margin) * 0.5) 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="text"],
|
|
||||||
input[type="password"],
|
|
||||||
input[type="email"],
|
|
||||||
input[type="tel"],
|
|
||||||
input[type="search"],
|
|
||||||
input[type="url"],
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
@include vendor('appearance', 'none');
|
|
||||||
background-color: transparent;
|
|
||||||
border-radius: _size(border-radius);
|
|
||||||
border: none;
|
|
||||||
border: solid _size(border-width);
|
|
||||||
color: inherit;
|
|
||||||
display: block;
|
|
||||||
outline: 0;
|
|
||||||
padding: 0 0.825rem;
|
|
||||||
text-decoration: none;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
&:invalid {
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
|
||||||
background-size: 1.25rem;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: calc(100% - 1rem) center;
|
|
||||||
height: _size(element-height);
|
|
||||||
padding-right: _size(element-height);
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
&::-ms-value {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::-ms-expand {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="text"],
|
|
||||||
input[type="password"],
|
|
||||||
input[type="email"],
|
|
||||||
input[type="tel"],
|
|
||||||
input[type="search"],
|
|
||||||
input[type="url"],
|
|
||||||
select {
|
|
||||||
height: _size(element-height);
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea {
|
|
||||||
padding: 0.75rem 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="checkbox"],
|
|
||||||
input[type="radio"], {
|
|
||||||
@include vendor('appearance', 'none');
|
|
||||||
display: block;
|
|
||||||
float: left;
|
|
||||||
margin-right: -2rem;
|
|
||||||
opacity: 0;
|
|
||||||
width: 1rem;
|
|
||||||
z-index: -1;
|
|
||||||
|
|
||||||
& + label {
|
|
||||||
@include icon(false, solid);
|
|
||||||
@include vendor('user-select', 'none');
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: _font(weight);
|
|
||||||
padding-left: (_size(element-height) * 0.6) + 0.75rem;
|
|
||||||
padding-right: 0.75rem;
|
|
||||||
position: relative;
|
|
||||||
margin-bottom: 0;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
border-radius: _size(border-radius);
|
|
||||||
border: solid _size(border-width);
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
height: (_size(element-height) * 0.6);
|
|
||||||
left: 0;
|
|
||||||
line-height: (_size(element-height) * 0.6);
|
|
||||||
position: absolute;
|
|
||||||
text-align: center;
|
|
||||||
top: 0;
|
|
||||||
width: (_size(element-height) * 0.6);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:checked + label {
|
|
||||||
&:before {
|
|
||||||
content: '\f00c';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="checkbox"] {
|
|
||||||
& + label {
|
|
||||||
&:before {
|
|
||||||
border-radius: _size(border-radius);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="radio"] {
|
|
||||||
& + label {
|
|
||||||
&:before {
|
|
||||||
border-radius: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-input-placeholder {
|
|
||||||
opacity: 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:-moz-placeholder {
|
|
||||||
opacity: 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-moz-placeholder {
|
|
||||||
opacity: 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:-ms-input-placeholder {
|
|
||||||
opacity: 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin color-form($p: null) {
|
|
||||||
label {
|
|
||||||
color: _palette($p, fg-bold);
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="text"],
|
|
||||||
input[type="password"],
|
|
||||||
input[type="email"],
|
|
||||||
input[type="tel"],
|
|
||||||
input[type="search"],
|
|
||||||
input[type="url"],
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
border-color: _palette($p, border);
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
border-color: _palette($p, accent);
|
|
||||||
box-shadow: 0 0 0 _size(border-width) _palette($p, accent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
select {
|
|
||||||
background-image: svg-url("<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' preserveAspectRatio='none' viewBox='0 0 40 40'><path d='M9.4,12.3l10.4,10.4l10.4-10.4c0.2-0.2,0.5-0.4,0.9-0.4c0.3,0,0.6,0.1,0.9,0.4l3.3,3.3c0.2,0.2,0.4,0.5,0.4,0.9 c0,0.4-0.1,0.6-0.4,0.9L20.7,31.9c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4L4.3,17.3c-0.2-0.2-0.4-0.5-0.4-0.9 c0-0.4,0.1-0.6,0.4-0.9l3.3-3.3c0.2-0.2,0.5-0.4,0.9-0.4S9.1,12.1,9.4,12.3z' fill='#{_palette(border)}' /></svg>");
|
|
||||||
|
|
||||||
option {
|
|
||||||
color: _palette(fg-bold);
|
|
||||||
background: _palette(bg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="checkbox"],
|
|
||||||
input[type="radio"], {
|
|
||||||
& + label {
|
|
||||||
color: _palette($p, fg);
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
border-color: _palette($p, border);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:checked + label {
|
|
||||||
&:before {
|
|
||||||
background-color: _palette($p, fg-bold);
|
|
||||||
border-color: _palette($p, fg-bold);
|
|
||||||
color: _palette($p, bg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus + label {
|
|
||||||
&:before {
|
|
||||||
border-color: _palette($p, accent);
|
|
||||||
box-shadow: 0 0 0 _size(border-width) _palette($p, accent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-input-placeholder {
|
|
||||||
color: _palette($p, fg-light) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
:-moz-placeholder {
|
|
||||||
color: _palette($p, fg-light) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-moz-placeholder {
|
|
||||||
color: _palette($p, fg-light) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
:-ms-input-placeholder {
|
|
||||||
color: _palette($p, fg-light) !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include color-form;
|
|
||||||
@@ -1,616 +0,0 @@
|
|||||||
///
|
|
||||||
/// Story by HTML5 UP
|
|
||||||
/// html5up.net | @ajlkn
|
|
||||||
/// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
|
||||||
///
|
|
||||||
|
|
||||||
/* Gallery (transitions) */
|
|
||||||
|
|
||||||
.gallery {
|
|
||||||
|
|
||||||
// Mixin.
|
|
||||||
@mixin transition-gallery($event) {
|
|
||||||
$x: null;
|
|
||||||
$y: null;
|
|
||||||
|
|
||||||
@if ($event == 'load') {
|
|
||||||
$x: 'body.is-preload &';
|
|
||||||
$y: _duration(on-load);
|
|
||||||
}
|
|
||||||
@else if ($event == 'scroll') {
|
|
||||||
$x: '&.is-inactive';
|
|
||||||
$y: _duration(on-scroll);
|
|
||||||
}
|
|
||||||
|
|
||||||
&.on#{$event}-fade-in {
|
|
||||||
article {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('transition', 'opacity #{$y} ease-in-out');
|
|
||||||
@include vendor('transition-delay', '#{_misc(gallery-limit) * _duration(gallery-delay)}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@for $i from 0 through _misc(gallery-limit) {
|
|
||||||
&:nth-child(#{$i + 1}) {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
@include vendor('transition-delay', '#{$i * _duration(gallery-delay)}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#{$x} {
|
|
||||||
article {
|
|
||||||
.image {
|
|
||||||
img {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// On Load.
|
|
||||||
@include transition-gallery('load');
|
|
||||||
|
|
||||||
// On Scroll.
|
|
||||||
@include transition-gallery('scroll');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Gallery (style1) */
|
|
||||||
|
|
||||||
.gallery.style1 {
|
|
||||||
@include color-typography(invert);
|
|
||||||
@include color-button(invert);
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('flex-wrap', 'wrap');
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
background-color: transparent;
|
|
||||||
|
|
||||||
> .forward, >.backward {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .inner {
|
|
||||||
@include vendor('align-items', 'inherit');
|
|
||||||
@include vendor('display', 'inherit');
|
|
||||||
@include vendor('flex-wrap', 'inherit');
|
|
||||||
@include vendor('justify-content', 'inherit');
|
|
||||||
}
|
|
||||||
|
|
||||||
article {
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
width: 25%;
|
|
||||||
|
|
||||||
.image {
|
|
||||||
@include vendor('transition', 'opacity #{_duration(transition)} ease-in-out');
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
border-radius: 0;
|
|
||||||
|
|
||||||
img {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('flex-direction', 'column');
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
@include vendor('pointer-events', 'none');
|
|
||||||
@include vendor('transition', 'opacity #{_duration(transition)} ease-in-out');
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: transparentize(_palette(invert, bg), 1 - _misc(overlay-opacity));
|
|
||||||
opacity: 0;
|
|
||||||
padding: 2rem;
|
|
||||||
z-index: 1;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
|
|
||||||
a {
|
|
||||||
@include vendor('pointer-events', 'auto');
|
|
||||||
}
|
|
||||||
|
|
||||||
h2, h3, h4, h5, h6 {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
margin-bottom: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
> * {
|
|
||||||
max-width: 100%;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
> :last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
.caption {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=large') {
|
|
||||||
article {
|
|
||||||
width: (100% / 3);
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
article {
|
|
||||||
width: 50%;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xsmall') {
|
|
||||||
article {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modifiers.
|
|
||||||
|
|
||||||
// size
|
|
||||||
&.small {
|
|
||||||
article {
|
|
||||||
width: 20%;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=large') {
|
|
||||||
article {
|
|
||||||
width: 25%;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
article {
|
|
||||||
width: (100% / 3);
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xsmall') {
|
|
||||||
article {
|
|
||||||
width: 50%;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.medium {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.big {
|
|
||||||
article {
|
|
||||||
width: (100% / 3);
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 3rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=large') {
|
|
||||||
article {
|
|
||||||
width: 50%;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
article {
|
|
||||||
width: 50%;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=xsmall') {
|
|
||||||
article {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Gallery (style2) */
|
|
||||||
|
|
||||||
.gallery.style2 {
|
|
||||||
@include color-typography(invert);
|
|
||||||
@include color-button(invert);
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
position: relative;
|
|
||||||
background-color: transparent;
|
|
||||||
|
|
||||||
> .forward, >.backward {
|
|
||||||
@include icon(false, solid);
|
|
||||||
@include vendor('transition', 'opacity #{_duration(transition)} ease-in-out');
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
width: 5rem;
|
|
||||||
height: 100%;
|
|
||||||
cursor: pointer;
|
|
||||||
opacity: 0;
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
display: block;
|
|
||||||
top: calc(50% - 1.5rem);
|
|
||||||
width: 4rem;
|
|
||||||
height: 3rem;
|
|
||||||
line-height: 1em;
|
|
||||||
font-size: 3rem;
|
|
||||||
position: absolute;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
> .forward, > .backward {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .forward {
|
|
||||||
right: 0;
|
|
||||||
background-image: linear-gradient(to left, rgba(0,0,0,0.25) 15%, rgba(0,0,0,0));
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
content: '\f105';
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .backward {
|
|
||||||
left: 0;
|
|
||||||
background-image: linear-gradient(to right, rgba(0,0,0,0.25) 15%, rgba(0,0,0,0));
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
content: '\f104';
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .inner {
|
|
||||||
@include vendor('display', 'inherit');
|
|
||||||
overflow-x: auto;
|
|
||||||
overflow-y: hidden;
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
article {
|
|
||||||
@include vendor('flex-grow', '0');
|
|
||||||
@include vendor('flex-shrink', '0');
|
|
||||||
display: block;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
width: 22.5rem;
|
|
||||||
max-width: 75vw;
|
|
||||||
|
|
||||||
.image {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
border-radius: 0;
|
|
||||||
|
|
||||||
img {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
border-radius: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('flex-direction', 'column');
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
@include vendor('pointer-events', 'none');
|
|
||||||
@include vendor('transition', 'opacity #{_duration(transition)} ease-in-out');
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: transparentize(_palette(invert, bg), 1 - _misc(overlay-opacity));
|
|
||||||
opacity: 0;
|
|
||||||
padding: 3rem;
|
|
||||||
z-index: 1;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
|
|
||||||
a {
|
|
||||||
@include vendor('pointer-events', 'auto');
|
|
||||||
}
|
|
||||||
|
|
||||||
h2, h3, h4, h5, h6 {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
margin-bottom: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
> * {
|
|
||||||
max-width: 100%;
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
> :last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
.caption {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
article {
|
|
||||||
.caption {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
article {
|
|
||||||
.caption {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Modifiers.
|
|
||||||
|
|
||||||
// size
|
|
||||||
&.small {
|
|
||||||
article {
|
|
||||||
width: 17.5rem;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
article {
|
|
||||||
.caption {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
article {
|
|
||||||
.caption {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.medium {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
&.big {
|
|
||||||
article {
|
|
||||||
width: 30rem;
|
|
||||||
|
|
||||||
.caption {
|
|
||||||
padding: 4rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
article {
|
|
||||||
.caption {
|
|
||||||
padding: 3rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=small') {
|
|
||||||
article {
|
|
||||||
.caption {
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Gallery (lightbox) */
|
|
||||||
|
|
||||||
@include keyframes('gallery-modal-spinner') {
|
|
||||||
0% {
|
|
||||||
@include vendor('transform', 'rotate(0deg)');
|
|
||||||
}
|
|
||||||
|
|
||||||
100% {
|
|
||||||
@include vendor('transform', 'rotate(360deg)');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.gallery.lightbox {
|
|
||||||
.modal {
|
|
||||||
@include vendor('display', 'flex');
|
|
||||||
@include vendor('align-items', 'center');
|
|
||||||
@include vendor('justify-content', 'center');
|
|
||||||
@include vendor('pointer-events', 'none');
|
|
||||||
@include vendor('user-select', 'none');
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{_duration(gallery-lightbox)} ease',
|
|
||||||
'visibility #{_duration(gallery-lightbox)}',
|
|
||||||
'z-index #{_duration(gallery-lightbox)}'
|
|
||||||
));
|
|
||||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
outline: 0;
|
|
||||||
background-color: transparentize(_palette(invert, bg), 1 - _misc(lightbox-opacity));
|
|
||||||
visibility: none;
|
|
||||||
opacity: 0;
|
|
||||||
z-index: 0;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
@include vendor('animation', 'gallery-modal-spinner 1s infinite linear');
|
|
||||||
@include vendor('transition', 'opacity #{_duration(gallery-lightbox) * 0.5} ease');
|
|
||||||
@include vendor('transition-delay', '#{_duration(gallery-lightbox)}');
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
width: 4rem;
|
|
||||||
height: 4rem;
|
|
||||||
margin: -2rem 0 0 -2rem;
|
|
||||||
background-image: svg-url('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96px" height="96px" viewBox="0 0 96 96" zoomAndPan="disable"><style>circle {fill: transparent; stroke: #{_palette(invert, fg-bold)}; stroke-width: 1.5px; }</style><defs><clipPath id="corner"><polygon points="0,0 48,0 48,48 96,48 96,96 0,96" /></clipPath></defs><g clip-path="url(#corner)"><circle cx="48" cy="48" r="32"/></g></svg>');
|
|
||||||
background-position: center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 4rem;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
top: 0.5rem;
|
|
||||||
right: 0.5rem;
|
|
||||||
width: 4rem;
|
|
||||||
height: 4rem;
|
|
||||||
cursor: pointer;
|
|
||||||
background-image: svg-url('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64px" height="64px" viewBox="0 0 64 64" zoomAndPan="disable"><style>line {stroke: #{_palette(invert, fg-bold)};stroke-width: 1.5px;}</style><line x1="20" y1="20" x2="44" y2="44" /><line x1="20" y1="44" x2="44" y2="20" /></svg>');
|
|
||||||
background-position: center;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 3rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inner {
|
|
||||||
@include vendor('transform', 'translateY(0.75rem)');
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{_duration(gallery-lightbox) * 0.5} ease',
|
|
||||||
'transform #{_duration(gallery-lightbox) * 0.5} ease'
|
|
||||||
));
|
|
||||||
opacity: 0;
|
|
||||||
|
|
||||||
img {
|
|
||||||
display: block;
|
|
||||||
max-width: 90vw;
|
|
||||||
max-height: 85vh;
|
|
||||||
box-shadow: 0 1rem 3rem 0 rgba(0, 0, 0, 0.35);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.visible {
|
|
||||||
@include vendor('pointer-events', 'auto');
|
|
||||||
visibility: visible;
|
|
||||||
opacity: 1;
|
|
||||||
z-index: _misc(z-index-base) + 1;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.loaded {
|
|
||||||
.inner {
|
|
||||||
@include vendor('transform', 'translateY(0)');
|
|
||||||
@include vendor('transition', (
|
|
||||||
'opacity #{_duration(gallery-lightbox)} ease',
|
|
||||||
'transform #{_duration(gallery-lightbox)} ease'
|
|
||||||
));
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
@include vendor('transition-delay', '0s');
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include breakpoint('<=medium') {
|
|
||||||
.modal {
|
|
||||||
.inner {
|
|
||||||
img {
|
|
||||||
max-width: 100vw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mixin
|
|
||||||
|
|
||||||
@mixin color-gallery($p: null) {
|
|
||||||
.gallery {
|
|
||||||
article {
|
|
||||||
.image {
|
|
||||||
background-color: transparentize(_palette($p, fg-bold), 0.875);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@include color-gallery;
|
|
||||||
Loaded 100 of 294 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user