Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dba34675c8 | ||
|
|
3f3a3ea039 | ||
|
|
fbebdcb796 | ||
|
|
5cde680cb6 | ||
|
|
66125473eb | ||
|
|
242129d036 | ||
|
|
2bffc721d4 | ||
|
|
82a401340a | ||
|
|
aa9f22a166 | ||
|
|
368a576bdb | ||
|
|
fde2f9f2a6 | ||
|
|
d9cf8d5874 | ||
|
|
885dd71cad | ||
|
|
bfa766d6d6 | ||
|
|
711fbbe7c6 | ||
|
|
94ee8c2939 | ||
|
|
c1d2d7c74a | ||
|
|
f2eed74e9d | ||
|
|
615dd27404 | ||
|
|
1e4426f133 | ||
|
|
a406d60a1f | ||
|
|
644ba6ccb9 | ||
|
|
bf94b14918 | ||
|
|
010d90656f | ||
|
|
64ca463591 | ||
|
|
86a0ea26ca | ||
|
|
dd2d02758b | ||
|
|
1bc39655c9 | ||
|
|
d1143e4207 | ||
|
|
61080c6eb2 | ||
|
|
86401983fb | ||
|
|
4fc9214de5 | ||
|
|
b5d9adf396 | ||
|
|
865c521ab8 | ||
|
|
d56e906371 | ||
|
|
26bb6a00d2 | ||
|
|
f71dd2cebb | ||
|
|
28ff032160 | ||
|
|
e52f93fdbb | ||
|
|
2ab2271d61 |
No files matched your search
@@ -0,0 +1,16 @@
|
||||
---
|
||||
description: 오늘 날씨 타로·코디 카드를 만들어 검수하고 킹서버에 승인 대기로 저장한다 (올리지는 않는다)
|
||||
argument-hint: <타로 주제> <코디 스타일: casual|semi|formal|street|minimal>
|
||||
---
|
||||
|
||||
오늘 인스타 카드를 만든다. 인자: `$ARGUMENTS` (앞은 타로 주제, 마지막 단어는 코디 스타일. 비어 있으면 타로 주제는 비우고 코디는 casual).
|
||||
재확인 질문 없이 순서대로 진행하고, 막히면 그 자리에서 보고하고 멈춘다. **인스타·날씨각 피드에 올리지 않는다** — 승인 대기 저장까지만.
|
||||
|
||||
1. 관리자 서버: `curl -s http://localhost:5175/api/targets` 에 `king` 이 있어야 한다. 없으면 `admin/` 에서 백그라운드로 켠다 (`admin/AGENTS.md` '켜기', 킹서버 키는 `ssh King_admin` 의 `~/proj/o2o-weather/.env` `ADMIN_API_KEY`, 값은 출력하지 않는다).
|
||||
2. 예보: `curl -s "https://weather.o2o.kr/v1/weather/today?region=1114000000"` 의 `day` 가 오늘인지 보고 slots 의 기온·하늘·비 확률을 적어 둔다.
|
||||
3. 타로: `cd admin && VITE_API_BASE_URL=https://weather.o2o.kr ADMIN_URL=http://localhost:5175 npm run card -- tarot --topic "<주제>" --color sky --post-wait`.
|
||||
출력된 기획 문구를 2의 예보와 대조한다(숫자·하늘 묘사가 틀리면 `--copy <값> --feedback "실제 수치…"` 로 한 번만 다시). "일부 그림을 못 만들어" 가 나오면 멈추고 보고한다. 크롬이 한 장에서 45초 넘게 멈추면 그 프로세스를 죽이고 그 장만 다시 찍는다.
|
||||
4. 코디: `{"style":"<스타일>","theme":"sky"}` 를 base64url 로 만들어 `npm run card -- ootd --copy <값> --post-wait`. 빠진 그림은 자동 생성된다(장당 1~5분).
|
||||
5. 검수(예외 없음): 만든 JPEG 전부를 **한 장씩 원본 크기로** Read 로 연다. 축소 시트로 판단하지 않는다. 볼 것: 글자 잘림·겹침, 그림 누락, 그림 속 사람·얼굴·글자, 코디는 옷 목록 줄의 옷이 그림에 전부 있고 추가 옷이 없는지, 날씨 줄 수치가 예보와 맞는지. 틀리면 고치고 다시 찍어 다시 본다.
|
||||
6. 새 그림이 생겼으면 `git add admin/src/assets/gak-card admin/src/assets/ootd admin/src/assets/tarot-bg` 후 `feat: <날짜> 카드 그림(…)` 로 커밋한다 (Claude 서명 없이).
|
||||
7. 보고(한국어, 짧게): 킹서버 카드 번호 2개(승인 대기), 만든 JPEG 경로, 새 그림 수, 검수에서 고친 것, 남은 이슈. 올리는 건 사용자가 관리자 '만든 카드' 탭이나 "올려" 로 한다.
|
||||
@@ -0,0 +1,11 @@
|
||||
# 저장소 루트를 빌드 대상으로 쓰는 건 frontend 이미지뿐이라 frontend·shared·루트 package 파일만 넘긴다
|
||||
*
|
||||
!package.json
|
||||
!package-lock.json
|
||||
!frontend
|
||||
!shared
|
||||
!mobile/package.json
|
||||
**/node_modules
|
||||
**/dist
|
||||
**/*.log
|
||||
**/.DS_Store
|
||||
@@ -4,6 +4,9 @@
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# npm workspaces 의존성 (frontend·mobile·shared 가 루트 하나를 같이 쓴다)
|
||||
node_modules/
|
||||
|
||||
# Python 바이트코드/캐시
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
@@ -266,4 +266,54 @@
|
||||
| [x] | 10/24 나들이 타로(등산각·드라이브각·한강각, 질문 "어느 곳으로 나들이를 가면 좋을까요?") 킹서버 카드 2 → 포스트 3648, 인스타 https://www.instagram.com/p/De3N7LnIJyZ/ 게시. 같은 날 오늘의 코디(캐주얼, mild 구간 그림 재사용) 킹서버 카드 3 → 포스트 3649, 인스타 https://www.instagram.com/p/De3OVz6oC9e/. 그림 생성 모델: `gpt-6-luna`는 그림을 파일로 저장 못 해 실패, `gpt-6-sol`·low로 바꿔 성공(장당 ~28k 토큰) | 사용자 요청 (10/24) | `admin/scripts/gen-image.mjs` |
|
||||
| [x] | 10/24 날씨각 소개 카드(인스타 전용, 8장, `intro` 템플릿 — Codex gpt-6-sol이 설계) 인스타 https://www.instagram.com/p/De3SUTtoDGR/ 게시. 킹서버엔 카드 4로 저장만(승인 대기, 피드엔 안 나감). 해시태그는 `card_set.hashtags`로 인스타 캡션에만 붙음(타로·코디 템플릿도 적용) | 사용자 요청 (10/24) | `admin/src/cards/templates.tsx`, `backend/router/v1/card/card.py` |
|
||||
| [ ] | 인스타 릴스(20초, 2.5D: Codex 3D 렌더풍 배경 + 카메라 패럴랙스, 무료 BGM, API로 업로드) — 백엔드에 mp4 공개 주소 + REELS 게시 추가 필요 | 사용자 요청 (10/24) | `backend/services/external/instagram.py` |
|
||||
| [ ] | 인스타에 올라간 불량 게시물 삭제(앱에서만 가능): 소개 카드 De3SUTtoDGR·De3ycbAIPVw(스샷 잘림)·De31G7VIBEc(7·8번 장 치우침), 릴스 18152745022535272(폰 잘림), 10/25 꾸안꾸 코디 De58VfXINy0(20-30대와 40대~ 옷이 같음)·De5-8gboL-c(40대 여자 롱가디건·여름 옷)·De6B2gwIMXF(이름표 자리 어긋남) — 킹서버 포스트 3961·3962·3963은 deleted=true로 숨김 | 10/24·10/25 검수 실패 | — |
|
||||
| [ ] | 소개 카드 최종본(`admin/out/2026-10-24/소개카드_1~8.jpg`, 10/24 21:54 — 8장 1:1 검수 완료, 모서리 캐릭터는 1번만·4·6·8번은 3D 스틸 안 캐릭터)과 3D 릴스(`admin/out/2026-10-24/릴스_3D.mp4`·표지 `릴스_3D_표지.jpg`, 21프레임 검수 완료) — 사용자가 "올려"라고 할 때만 올림. 릴스 음악은 HeyGen 로그인(`~/.local/bin/heygen auth login --oauth`) 뒤 `npx hyperframes media-use resolve --type bgm` | 10/24 | `admin/reels/intro3d/` |
|
||||
| [ ] | 코디 옷 데이터 — 세미정장·정장·스트릿·꾸안꾸 4스타일은 7개 기온 구간 전부 20-30대와 40대~ 옷이 같음(캐주얼만 다름, warm·꾸안꾸는 10/25 고침). 40대~ 여/남 옷 목록 54개를 새로 써서 검토받고 반영 | 10/25 발견 | `admin/image-prompts/ootd.json` |
|
||||
| [ ] | 앱 헤더가 400~448px 폭에서 컨테이너를 넘쳐 로그인 버튼이 잘림(`frontend/src/b/BLayout.tsx` TopBar). 캡처는 456px로 찍어 피했지만 실제 폰(430·440px)에서도 잘릴 수 있음 | 10/24 캡처 중 발견 | `frontend/src/b/BLayout.tsx` |
|
||||
| [ ] | `npm run card`가 크롬 멈춤에 시간 제한이 없음 — 10/24 소개 카드 7번 장에서 헤드리스 크롬이 75분 멈춰 있었음(`--virtual-time-budget`만으론 안 끝남). `execFileSync`에 `timeout`(예: 60초) 주고 실패 시 그 장만 재시도 | 10/24 렌더 중 발견 | `admin/scripts/card.mjs` |
|
||||
| [x] | 10/25 건강·운동 타로(킹서버 카드 7→포스트 3960, 인스타 https://www.instagram.com/p/De5iLg4AS_M/)·꾸안꾸 코디는 처음 올린 카드 8→포스트 3961(인스타 De58VfXINy0)이 40대~ 옷이 20-30대와 같아 숨기고, 40대~ 옷을 새로 써서 카드 9→포스트 3962(인스타 De5-8gboL-c)로 재게시했으나 40대 여자 그림에 롱가디건이 끼고 전체가 여름 옷으로 보여 다시 숨김. 일교차 8도 이상이면 겉옷을 5번째 옷으로 넣게 고쳐 카드 10→포스트 3963(인스타 De6B2gwIMXF)으로 올렸으나 그림 배치와 이름표 자리가 어긋나 숨김. 프롬프트에 옷 자리를 적고 다시 그려 카드 11→포스트 3964, 인스타 https://www.instagram.com/p/De6JRIkoKbT/ 로 최종 게시. 07:52 예약(세션 크론)이 세션 종료로 안 돌아 09:46 수동 실행. 코디는 사용자 결정으로 사람 구분을 20-30대·40대~ 4장으로 바꿈(f30·m30 그림 파일 8장은 남아 있으나 미사용). 새 그림 8장(러닝각·자전거각·warm 꾸안꾸 6) | 사용자 요청 (10/24) | `admin/image-prompts/ootd.json`, `admin/scripts/card.mjs` |
|
||||
|
||||
## 앱(React Native) 마이그레이션
|
||||
|
||||
| 상태 | 할 일 | 이유 | 관련 파일 |
|
||||
|---|---|---|---|
|
||||
| [x] | 1단계: 웹·앱 공통 코드 `shared/`(`@nalssigak/shared`) 분리, 루트 npm workspaces, 웹 Docker 빌드 대상을 루트로 | 앱과 API 클라이언트·로직 공유 | `package.json`, `shared/`, `frontend/Dockerfile`, `compose.yaml`, `.dockerignore` |
|
||||
| [x] | 2단계: 앱에 react-query·Uniwind 설정 + Metro가 `react`를 `mobile/node_modules`(19.2.3) 것만 쓰게 설정 — 루트에는 웹용 react 19.3.0이 있고 RN 렌더러는 19.2.3에서만 돌아감 | 앱 시작 준비 | `mobile/metro.config.js`, `mobile/src/app/_layout.tsx`, `mobile/src/lib/query-client.ts` |
|
||||
| [x] | 앱 토큰 저장소 `expo-secure-store`로 `configureApi` 연결, API 주소는 `EXPO_PUBLIC_API_BASE_URL` | 웹은 localStorage | `mobile/src/lib/api.ts`, `mobile/.env.example` |
|
||||
| [x] | 안드로이드 에뮬레이터(Expo Go)에서 확인: 오늘 화면 실데이터, 위치 권한 창, 탭 이동, 각 근거 시트 | | `mobile/` |
|
||||
| [x] | 안드로이드 개발 빌드에서 가입·로그인(아바타 표시)·좋아요·이미지 공유·위치로 지역 찾기 확인 | | `mobile/` |
|
||||
| [ ] | 안드로이드 댓글 쓰기·내 정보 바꾸기·로그아웃 확인 | 아직 안 눌러 봄 | `mobile/src/components/sheets/` |
|
||||
| [x] | 출시 빌드 설정: `eas.json`(production 은 운영 API·사이트 주소, 빌드 번호 자동 증가), iOS 수출 규정 암호화 없음, 안드로이드 권한은 대략 위치만(정밀 위치·저장소·다른 앱 위에 그리기 뺌) | | `mobile/eas.json`, `mobile/app.json` |
|
||||
| [ ] | 출시 빌드 전 준비(사용자): Apple Developer·Google Play Console·Expo 계정, 스토어 스크린샷·설명·데이터 안전 양식 | 서명·제출에 필요 | |
|
||||
| [x] | 회원 탈퇴(스토어 심사 필수): `DELETE /v1/auth/me` — 계정·댓글·좋아요·저장 모두 삭제, 게시물·댓글 수 맞춤. 웹·앱 내 정보 시트 '탈퇴하기'(한 번 더 확인) | Apple 5.1.1(v), Google Play 계정 삭제 정책 | `backend/crud/user_crud.py`, `backend/services/auth_service.py`, `frontend/src/b/Sheets.tsx`, `mobile/src/components/sheets/me.tsx` |
|
||||
| [ ] | 운영 배포 때 탈퇴 API 같이 나감 — 배포 전 웹 내 정보 시트 '탈퇴하기' 화면 확인 (앱은 안드로이드에서 확인, 웹은 빌드·린트만) | | `frontend/src/b/Sheets.tsx` |
|
||||
| [ ] | 백엔드 테스트 3개가 날짜 때문에 실패 (10/19): `test_feed`(제철 각 수 42≠40), `test_watch`, `test_weather_today`(10월 하순 18시가 일몰 뒤라 'sunset' 아이콘 아님) — 탈퇴 작업과 무관 | 기대값을 날짜에 안 묶이게 고쳐야 함 | `backend/tests/` |
|
||||
| [ ] | Xcode 설치 후 iOS 시뮬레이터에서 전체 확인 | | `mobile/` |
|
||||
| [x] | 안드로이드 개발 빌드(`expo run:android`) 설치 확인: 홈 화면 해 아이콘·'날씨각' 이름, 실데이터 화면 | | `mobile/` |
|
||||
| [x] | 앱 ID: 안드로이드 패키지 `kr.o2o.nalssigak` — Play Console 기존 '날씨각'(Wear OS 트랙에 워치 앱 있음)에 휴대전화 앱으로 추가하려면 패키지명이 같아야 함. iOS 번들 ID는 미정 | 스토어에 올리면 못 바꿈 | `mobile/app.json` |
|
||||
| [x] | Play 제출: 휴대전화 versionCode 1000부터 (10/23 `app.json` versionCode 1000, 로컬 빌드)(워치가 1 사용) — `eas login` 후 `eas build:version:set -p android` | 같은 앱 안에서 versionCode 겹치면 안 됨 | `mobile/eas.json` |
|
||||
| [x] | Play 제출: 워치 앱과 같은 업로드 키 (10/23 로컬 빌드로 서명 확인, SHA-1 D3:51…44:79. 비밀번호는 ~/.gradle/gradle.properties `NALSSIGAK_UPLOAD_*`)(.jks)를 `eas credentials -p android`로 등록 (사용자: 키 파일·비밀번호 준비, 분실 시 Play Console에서 업로드 키 재설정) | EAS는 안 넣으면 새 키를 만듦 | |
|
||||
| [ ] | 출시 aab 서명 설정이 생성 폴더 `mobile/android/app/build.gradle`에만 있음 — `expo prebuild --clean` 하면 지워지니 다시 넣거나 config plugin으로 옮기기 | `android/`는 gitignore·재생성 | `mobile/android/app/build.gradle` |
|
||||
| [ ] | 앱 구글 로그인 기기 확인: 네이티브 다시 빌드 → 구글 계정 로그인된 에뮬레이터(Play 서비스 이미지)에서 구글로 계속하기 | 새 네이티브 모듈이라 지금 설치된 개발 빌드엔 없음. Android 클라이언트(개발·Play SHA-1)는 콘솔에 등록됨 | `mobile/src/components/sheets/google.tsx` |
|
||||
| [ ] | 운영 서버 `.env`에 `GOOGLE_CLIENT_ID`(웹 클라이언트 ID) 넣고 구글 로그인 백엔드 배포 | 비어 있으면 `/v1/auth/config`가 ID를 안 줘서 앱·웹 구글 버튼이 숨음 | `backend/config/settings.py` |
|
||||
| [ ] | Play 제출(사용자): 휴대전화 스크린샷 2장+, 개인정보처리방침 URL, 계정 삭제 URL(웹 '탈퇴하기' 운영 배포 후), 데이터 보안 양식(대략 위치·계정 정보·댓글), 콘텐츠 등급, 앱 액세스용 심사 테스트 계정. 개인 계정(2023.11 이후)이면 비공개 테스트 12명·14일 | | |
|
||||
| [x] | Play UGC 정책(댓글): 처음 댓글 쓸 때 이용약관 동의(`POST /v1/auth/terms`), 남의 댓글 ⋯ → 신고(이유 4가지, 신고한 사람에겐 바로 숨김, 3건이면 모두에게 숨김) / 이 사람 차단, 내 정보 '차단한 사람'·풀기, 운영 조치 `scripts/moderate.py`(숨김·되살림·정지), 탈퇴 때 신고·차단도 삭제 | Play 'User Generated Content' 정책 | `backend/`, `frontend/src/b/Sheets.tsx`, `frontend/public/terms.html`, `mobile/src/components/sheets/` |
|
||||
| [ ] | 운영 DB 반영: `init.sql`의 `users.terms_agreed_at`, `comment.report_count`·`is_hidden`, `comment_report`, `user_block` (ALTER·CREATE IF NOT EXISTS) — 코드 배포 전에 먼저 | 새 코드가 이 칼럼을 읽음 | `backend/postgres-init/init.sql` |
|
||||
| [ ] | **[검토 필요]** 이용약관 초안 문구 검토 | 법무 문구라 확인 필요 | `frontend/public/terms.html` |
|
||||
| [ ] | 개인정보처리방침에 휴대전화 앱·댓글·신고·차단 기록 추가 (지금은 웹·워치 앱만 적혀 있음) | Play 데이터 보안 양식과 맞아야 함 | `frontend/public/privacy.html` |
|
||||
| [x] | 앱 신고·차단·약관 화면 안드로이드 확인: ⋯ 메뉴, 차단 확인·안내·목록에서 빠짐, 약관 동의 후 바로 게시, 내 정보 '차단한 사람' 풀기 (신고 흐름은 백엔드 테스트로만). 새 패키지 `kr.o2o.nalssigak` 개발 빌드로 다시 설치함 | | `mobile/` |
|
||||
| [ ] | 오늘 날씨 칸(3시·6시 등)이 '?' — 백엔드가 며칠 꺼져 있다 켜지면 최신 발표(예: 8시, 9시부터 예보)만 받아 새벽 칸 행이 없음. 0시 재수신(`_midnight_missing`)은 0시에 묵은 값이 있으면 안 돎. 운영은 늘 켜져 있어 드묾 — 고칠 땐 오늘 칸 중 비거나 묵은 칸이 있으면 다시 받기 | 10/19 로컬(9811)에서 확인, 앱·웹 버그 아님 | `backend/services/weather_service.py` (`today`, `ensure_vilage`, `_midnight_missing`) |
|
||||
| [x] | 앱 아이콘 3D 해 그림(600px 원본)으로: iOS 1024, 안드로이드 적응형(앞·뒤·단색), 스플래시. Expo Go 에선 안 보이고 개발 빌드부터 보임. 스토어용으로는 1024px 이상 원본이 있으면 더 선명 | | `mobile/assets/images/` |
|
||||
| [x] | 3단계-1: 탭 5개 구조·위 막대·하늘 배경·밤 테마(Uniwind dark), Today 히어로·각 순위·행사/TOP5/계절 띠 | | `mobile/src/app/`, `mobile/src/components/` |
|
||||
| [x] | Today 게시물 카드(슬라이드 7종·넘기기·좋아요·댓글·텍스트 공유), 3·6·9번째 글 뒤 띠 | | `mobile/src/components/post/`, `mobile/src/app/index.tsx` |
|
||||
| [x] | 시트 7종(각 근거·읽을거리·댓글·이번 주 특집·로그인/가입·내 정보·지역 고르기)을 RN `Modal`로, 위 막대 로그인/아바타 | 새 패키지 없이 | `mobile/src/components/sheets/`, `mobile/src/components/top-bar.tsx` |
|
||||
| [x] | 고른 지역 저장 (SecureStore) | | `mobile/src/lib/region.tsx` |
|
||||
| [x] | 위치로 지역 찾기(`expo-location`): 처음 켠 사람은 가장 가까운 구로, 지역 시트 '지금 위치로 찾기' | 웹과 같게 | `mobile/src/lib/region.tsx`, `mobile/src/components/sheets/region.tsx` |
|
||||
| [x] | 움직임: 해·구름 떨어지기/둥둥, 비·눈, 스켈레톤 깜빡임, 첫 로딩 덮개, 하늘색 서서히 바뀜, 밤 별 반짝임 ('동작 줄이기' 켜면 멈춤) | | `mobile/src/components/today/hero.tsx`, `first-load.tsx`, `sky-bg.tsx` |
|
||||
| [x] | 나머지 탭(각·노을·주말·행사·계절·상식) 옮기기 | | `mobile/src/app/`, `mobile/src/components/{gak,sky,week,season}/` |
|
||||
| [x] | 이미지로 공유(`react-native-view-shot` + `expo-sharing`): 게시물은 보고 있는 슬라이드, 주말은 고른 날 추천 카드 | 웹 스토리 이미지(머리말·주소 붙인 9:16)와는 다름 | `mobile/src/lib/share-image.ts` |
|
||||
| [x] | 웹과 다른 작은 것들 맞춤: 좋아요 튀는 하트·토스트, 밤 별똥별, 단풍잎 떨어짐, 시 구절 고운바탕, 실패·빈 안내 높이 유지(hold), 시트 배경은 제자리 페이드 | | `mobile/src/` |
|
||||
| [ ] | 공유 이미지를 웹처럼 9:16 스토리(머리말·사이트 주소)로 — 지금은 화면 그대로 찍음. 좋아요 효과는 카드 안에만 뜸(RN에 portal 없음) | 남은 차이 | `mobile/src/lib/share-image.ts`, `mobile/src/components/post/` |
|
||||
| [x] | `mobile/` 템플릿 예제 화면·`.vscode`·`LICENSE`·README 지움, `AGENTS.md`·`.claude`는 둠 | 사용자 결정 | `mobile/` |
|
||||
| [ ] | `frontend-dev` 개발 컨테이너 실제로 띄워 확인 (이미지 빌드만 확인, 5173이 사용 중이라 실행은 못 함) | 볼륨 경로 바뀜 | `compose.yaml` |
|
||||
| [ ] | 운영 서버가 git pull 뒤 루트 `package-lock.json`으로 빌드되는지 배포 때 확인 | 빌드 대상이 `./frontend` → `.` | `deploy.sh`, `compose.yaml` |
|
||||
@@ -76,6 +76,17 @@ npm run gen-image -- ootd cool-f20-casual --force # 한 장 다시 그리기
|
||||
- 유행: `styles.<스타일>.trends.<사람>`에 요즘 한국 유행(실루엣·색·소재)을, `bands.<구간>.layering`에 기온별 레이어링을 적어 프롬프트에 넣는다. 2026-10-23 조사(무신사·에이블리·29CM·W컨셉·지그재그·크림 기사·보그·엘르). 연령별 판매 자료는 거의 없어 플랫폼 주 고객층(에이블리·지그재그·W컨셉=2030 여성, 무신사·크림=2030 남성)으로 나눈 것이다. 철이 바뀌면 다시 조사해 고친다.
|
||||
- 만든 그림은 직접 열어 사람·얼굴·글자가 없는지 확인한다.
|
||||
|
||||
## 올리기 전 검수 (예외 없음)
|
||||
|
||||
인스타·날씨각에 올리는 건 되돌릴 수 없다(인스타는 API로 삭제도 못 한다). 올리기 전에 반드시:
|
||||
|
||||
1. **장마다 1:1(원본 크기)로 본다.** 축소한 시안 시트(contact sheet)만 보고 판단하지 않는다. 스크린샷·그림이 들어간 장은 그 부분을 잘라 원본 크기로 본다.
|
||||
2. **스크린샷은 찍힌 원본부터 확인한다.** 앱 화면은 뷰포트가 좁으면 오른쪽이 잘려 찍힌다(머리 줄의 로그인 버튼까지 다 보이려면 가로 470px 이상, `--force-device-scale-factor=2`). 카드 CSS를 고치기 전에 원본 파일이 온전한지 본다.
|
||||
3. **고친 뒤에는 고친 부분을 다시 1:1로 본다.** "고쳤으니 됐다"로 올리지 않는다. 같은 포스트를 다시 올리면 예전 글은 사용자가 앱에서 지워야 하므로, 재게시는 확인된 뒤 한 번만.
|
||||
4. 영상(릴스)은 렌더된 mp4에서 프레임을 뽑아 본다(`ffmpeg -vf fps=2,tile=…`). 스크린샷이 들어간 장면은 그 프레임을 원본 크기로.
|
||||
|
||||
2026-10-24 소개 카드를 축소 시트만 보고 두 번 올렸다가 두 번 다 폰 스크린샷 오른쪽이 잘린 채 나간 일에서 정한 규칙이다.
|
||||
|
||||
## 규칙
|
||||
|
||||
- 카드 모양은 `src/cards/templates.tsx`(템플릿)와 `src/cards/cards.css`(모양)에서만 정한다. 웹 화면과 `npm run card`가 같은 템플릿을 쓰므로, 한 번 바꾸면 둘 다 바뀐다. 포스트마다 따로 디자인하지 않는다.
|
||||
|
||||
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 82 KiB |
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<style>
|
||||
@font-face { font-family: 'Jua'; src: url('assets/fonts/Jua-Regular.ttf'); }
|
||||
@font-face { font-family: 'Pretendard'; src: url('assets/fonts/PretendardVariable.woff2'); font-weight: 100 900; }
|
||||
/* 릴스 표지. 프로필 격자는 4:5(세로 285~1635px)로 가운데만 보이므로 글자를 그 안에 둔다 */
|
||||
#root { position: absolute; inset: 0; overflow: hidden; background: #cfe3fb; }
|
||||
#cover-bg { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; object-fit: cover; }
|
||||
#cover-title { position: absolute; margin: 0; left: 90px; top: 560px; width: 900px; font: 400 124px/1.18 'Jua', sans-serif; letter-spacing: -2px; color: #28304a; text-shadow: 0 0 22px rgba(255, 255, 255, 0.85), 0 4px 14px rgba(255, 255, 255, 0.6); word-break: keep-all; }
|
||||
#cover-sub { position: absolute; left: 90px; top: 920px; display: inline-flex; align-items: center; gap: 18px; padding: 18px 34px 18px 20px; border-radius: 30px; background: #fff; color: #28304a; font: 800 48px/1 'Pretendard', sans-serif; letter-spacing: -1px; box-shadow: 0 12px 34px rgba(40, 48, 74, 0.25); }
|
||||
#cover-sub img { width: 72px; height: 72px; border-radius: 18px; }
|
||||
#cover-sub b { color: #d4552a; }
|
||||
#cover-rabbit { position: absolute; left: 110px; top: 1250px; width: 240px; }
|
||||
#cover-bear { position: absolute; left: 730px; top: 1270px; width: 240px; }
|
||||
</style>
|
||||
<div id="root" data-composition-id="cover" data-width="1080" data-height="1920" data-no-timeline>
|
||||
<img id="cover-bg" src="assets/bg/sky.webp" alt="" />
|
||||
<h1 id="cover-title">오늘 뭐 하기<br />좋은 날이지?</h1>
|
||||
<div id="cover-sub"><img src="assets/img/app-icon.png" alt="" />날씨각이 <b>점수</b>로 알려 줘요</div>
|
||||
<img id="cover-rabbit" src="assets/icons/rabbit.png" alt="" />
|
||||
<img id="cover-bear" src="assets/icons/bear.png" alt="" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -6,8 +6,8 @@
|
||||
#s7-world { position: absolute; inset: 0; }
|
||||
#s7-title { position: absolute; left: 90px; top: 230px; width: 900px; font: 400 112px/1.18 'Jua', sans-serif; letter-spacing: -2px; word-break: keep-all; }
|
||||
#s7-title .w { display: inline-block; margin-right: 0.22em; }
|
||||
#s7-phone { position: absolute; left: 180px; top: 560px; width: 720px; height: 1500px; padding: 22px; border: 12px solid #28304a; border-radius: 88px; background: #28304a; box-shadow: 0 30px 70px rgba(40, 48, 74, 0.3); overflow: hidden; }
|
||||
#s7-phone img { display: block; width: 100%; border-radius: 52px; }
|
||||
#s7-phone { position: absolute; left: 180px; top: 560px; width: 720px; height: 1500px; box-sizing: border-box; padding: 22px; border: 12px solid #28304a; border-radius: 88px; background: #28304a; box-shadow: 0 30px 70px rgba(40, 48, 74, 0.3); overflow: hidden; }
|
||||
#s7-phone img { display: block; width: 652px; height: auto; max-width: none; border-radius: 52px; }
|
||||
#s7-chip { position: absolute; left: 560px; top: 480px; padding: 18px 36px; border-radius: 28px; background: #d4552a; color: #fff; font: 800 56px/1 'Pretendard', sans-serif; letter-spacing: -1px; box-shadow: 0 12px 34px rgba(212, 85, 42, 0.35); white-space: nowrap; transform-origin: 50% 50%; z-index: 2; }
|
||||
#s7-note { position: absolute; left: 90px; top: 500px; font: 600 36px/1 'Pretendard', sans-serif; color: #546078; }
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
# HyperFrames Composition Project
|
||||
|
||||
This folder is a [HyperFrames](https://hyperframes.heygen.com) video: HTML, CSS and seekable
|
||||
animations (GSAP by default) that the `hyperframes` CLI previews in the browser and renders to
|
||||
MP4.
|
||||
|
||||
## Skills — read these first
|
||||
|
||||
**Invoke the relevant skill before writing or modifying compositions.** Skills encode framework-specific patterns (e.g., `window.__timelines` registration, `data-*` attribute semantics, shader-compatible CSS rules) that generic web docs don't cover, so compositions written without them break.
|
||||
|
||||
**Doing anything with HyperFrames?** Start at `/hyperframes`. Make any video by asking for it; the `/hyperframes` skill carries the contract and the references (each kind of film, story, motion, look, sound, review, captions, overlays). Read it first, especially when there's no project context to orient you.
|
||||
|
||||
- `/hyperframes` — read first for any request to make, edit, animate or render a video, motion graphic, captions or overlays. Holds the render contract and the work loop.
|
||||
- `/hyperframes-cli` — the CLI by job: scaffold, check, look at frames, edit the timeline, preview, render, publish, project history.
|
||||
- `/hyperframes-registry` — ready-made blocks and components installed as editable source. Search it before hand-building any named visual.
|
||||
- `/media-use` — get or make any media (music, sound effects, images, voiceover, avatar and generated video, transcripts, cutouts, colour grades) and mix placed audio.
|
||||
- `/figma` — bring a Figma design, frame, logo or brand into a video.
|
||||
- `/slideshow` — a presentation or pitch deck. Output is a navigable deck, not a rendered MP4.
|
||||
- `/remotion-to-hyperframes` — bring existing video code or footage into HyperFrames (Remotion first; also Motion Canvas, Lottie, Three.js, canvas, or renders from other tools) and verify it frame by frame against the original.
|
||||
|
||||
**Changing how real footage or images look or reveal?** Load `/media-use` and read its `references/media-treatments.md` before editing, even when the request only says dark, flat, boring, retro, private, or “make the reveal cooler.” It governs how footage is treated, never whether media may be used. Use canonical media treatments and seek-safe motion; do not improvise equivalent CSS/SVG filters or overlays.
|
||||
|
||||
> **Tailwind v4 projects** (`hyperframes init --tailwind`): see `hyperframes-cli/references/init-and-scaffold.md` (Tailwind).
|
||||
|
||||
> **Using a HyperFrames plugin?** Load skills from that installed bundle and follow
|
||||
> its `hyperframes/references/plugin-installation.md` execution rules. Update via
|
||||
> the plugin manager, not the standalone commands below.
|
||||
>
|
||||
> **Standalone skill missing or stale?** Run `npx hyperframes skills update <name>` to install/refresh
|
||||
> the specific skill you need, or bare `npx hyperframes skills update` to refresh the core set plus
|
||||
> everything already installed — neither pulls the full set. Restart the agent session so
|
||||
> newly installed skills load.
|
||||
|
||||
## Commands
|
||||
|
||||
```bash
|
||||
npm run dev # human-operated foreground preview (blocks until stopped)
|
||||
npx hyperframes preview --background # agent-safe persistent Studio preview
|
||||
npx hyperframes preview --status # verify the persistent preview is listening
|
||||
npx hyperframes preview --stop # stop it when review is finished
|
||||
npm run check # lint + runtime + layout + motion + contrast (one command)
|
||||
npx hyperframes snapshot --at 1,3,5 # PNG frames at those seconds, to look at before rendering
|
||||
npm run render # render to MP4
|
||||
npm run publish # publish and get a shareable link
|
||||
npx hyperframes lint --verbose # include info-level findings
|
||||
npx hyperframes lint --json # machine-readable output for CI
|
||||
npx hyperframes docs <topic> # reference docs in terminal
|
||||
```
|
||||
|
||||
> **Agents must use `npx hyperframes preview --background` for Studio handoff.** Do not rely
|
||||
> on a shell/tool `run_in_background` wrapper around `npm run dev`: that foreground process
|
||||
> remains owned by the invoking session and can disappear while the browser stays open,
|
||||
> leaving refreshes at `ERR_CONNECTION_TIMED_OUT`. Verify with `preview --status`, keep it
|
||||
> alive through review, and stop it explicitly with `preview --stop` afterward.
|
||||
|
||||
> **Back from the desktop app.** Once this project was opened in the HyperFrames desktop app, run `npx hyperframes catch-up` before your next change here: it lists what the person asked Framey in the app and which files changed since.
|
||||
|
||||
> **Pinned CLI version.** These scripts pin an exact `hyperframes@X.Y.Z` so this project re-renders identically over time. Weeks later that pin lags fixes shipped since. To move up: `npx hyperframes@latest upgrade --project . --check` (shows the delta), then `npx hyperframes@latest upgrade --project .` to rewrite the pins. Always unpinned — the pinned script re-runs the old version against itself.
|
||||
|
||||
## Documentation
|
||||
|
||||
**For quick reference**, use the local CLI docs command (no network required):
|
||||
|
||||
```bash
|
||||
npx hyperframes docs <topic>
|
||||
```
|
||||
|
||||
Topics: `data-attributes`, `gsap`, `compositions`, `rendering`, `examples`, `troubleshooting`
|
||||
|
||||
**For full documentation**, discover pages via the machine-readable index — do NOT guess URLs:
|
||||
|
||||
```
|
||||
https://hyperframes.heygen.com/llms.txt
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
- `index.html` — main composition (root timeline)
|
||||
- `compositions/` — sub-compositions referenced via `data-composition-src`
|
||||
- `meta.json` — project metadata (id, name)
|
||||
- `transcript.json` — whisper word-level transcript (if generated)
|
||||
|
||||
## Linting — ALWAYS RUN AFTER CHANGES
|
||||
|
||||
After creating or editing any `.html` composition, **always** run the full check before considering the task complete:
|
||||
|
||||
```bash
|
||||
npm run check
|
||||
```
|
||||
|
||||
Fix all errors before presenting the result. Warnings should be reviewed before rendering.
|
||||
|
||||
Then look at what you changed: `npx hyperframes snapshot --at <seconds>` (or `--range START,END`, `--composition <id>`) at the moments you edited, and read the frames before you reply. A passing check does not show how it looks.
|
||||
|
||||
## Key Rules
|
||||
|
||||
1. Every timed element needs `data-start` and a duration. `data-start` is what marks it as timed; `data-track-index` is an optional Studio display lane the render never reads
|
||||
2. Give timed visual elements `class="clip"`. The framework keys visibility off `data-start`, not the class, but the shared `.clip` CSS is what gives a scene its full-frame box, and `lint` warns without it
|
||||
3. Register one paused root timeline per composition on `window.__timelines`:
|
||||
```js
|
||||
window.__timelines = window.__timelines || {};
|
||||
window.__timelines["composition-id"] = gsap.timeline({ paused: true });
|
||||
```
|
||||
Scene timelines manually added to this root must not be paused. A paused
|
||||
child does not advance when the root is seeked. The runtime activates
|
||||
registered composition siblings, not arbitrary nested scene timelines.
|
||||
4. A video with sound keeps it on the `<video>` (`data-has-audio="true"`, no `muted`). Use a separate `<audio>` for music, voiceover, replacement audio, J/L cuts, or audio detached in Studio. Silent footage and b-roll: `muted`.
|
||||
5. Sub-compositions use `data-composition-src="compositions/file.html"` to reference other HTML files
|
||||
6. Only deterministic logic — no `Date.now()`, no `Math.random()`, no network fetches
|
||||
@@ -0,0 +1,15 @@
|
||||
GOAL: 20~50대가 "날씨를 보면 오늘 할 일을 알려 주는 앱"을 20초 안에 알고 프로필 링크(또는 토스 검색)로 열어 본다. 진짜 3D(Three.js 섬·하늘·구름·아이콘)로.
|
||||
OUTPUT: HyperFrames, 1080 x 1920, 30 fps, 21 s = 630 frames. 음악은 HeyGen 로그인 후 붙인다(지금 무음).
|
||||
WORLD: index.html 의 Three.js 장면 하나가 21초 내내 돈다. test-design/weather 디오라마(Kenney Nature Kit CC0 모델 15개, Fluent 3D 아이콘 스프라이트, 구름 스프라이트)를 가져오고
|
||||
하늘은 브랜드 색 그라데이션 돔(새벽 복숭아 → 낮 파랑 #3f8fe0 → 흐림 회색 → 노을 보라·주황 → 밤 남색) + 해 글로우. 섬은 가을 팔레트(잎 #ff7a2e, 잔디 #c8b25a), 섬 z=-118, scale 2.
|
||||
결정적: 별·구름 자리는 mulberry32(20261024), 모든 움직임은 t 의 함수(hf-seek). 모델 로드는 window.__hf.buildReady.main.
|
||||
LOOK: 글은 sub-composition(o1~o6)으로 얹음. 낮 장면 글자는 흰색+남색 그림자, 위쪽 980px 에 어둠 띠(0.5→0)로 가독성. 첫 제목만 잉크색+흰 후광. 칩은 흰 둥근 사각, 점수 주황 #d4552a.
|
||||
글자 x ≤ 900(오른쪽 액션 레일), y 168~1330. 폰은 720px 폭, 테두리 12px, 스크린샷 696px(여백 0), 가운데(좌우 180).
|
||||
SHOTS: 0–3 새벽→낮. 해가 뜨고(rise) 카메라가 구름 덩어리를 뚫고 전진(camZ 12→-20). 하늘 아이콘 해·우산·자전거·빨래가 둥둥. "오늘 뭐 하기 / 좋은 날이지?"
|
||||
3–6 흐림. 하늘 회색, 비 아이콘 낙하, 칩 흐림·19°·습도 70%, "…그래서 오늘 뭐 하죠?"
|
||||
6–8.5 맑아지며 섬으로 하강(camZ -34→-103, lookY 3.2). 앱 아이콘 스프링 + "날씨각" + "날씨를 할 일로 바꿔요".
|
||||
8.5–14.5 섬 주위를 돌며(spin 1.6) 하늘이 황금→노을로. 산책각 79(걷기 아이콘) → 캠핑각 75(캠핑 아이콘·텐트) → 한강각 84(노을 아이콘). 2026-10-24 서울 중구 API 점수.
|
||||
14.5–17.5 밤. 별이 켜지고 카메라가 위를 본다. 폰(실제 홈 화면, 밤 테마)이 아래서 올라옴, "지금 내 동네 1위는?", "68가지 각".
|
||||
17.5–21 엔드카드: 아이콘·날씨각·설치 없이 바로 무료·weather.o2o.kr·토스 검색, 토끼·곰.
|
||||
BANNED: 검은 보이드, 글로우 남발(해 글로우만), 유리 카드, 세 카드 나란히, 코너 로고, 착지 뒤 떠다니는 제목, 지어낸 점수, 사용자 글 노출, 잘린 폰 화면.
|
||||
QA: 전체 프레임 1초 간격 21장을 본다(잘라서 보지 않는다). 16.5초 폰 테두리 좌우 180/180 을 픽셀로 잰다. 글자가 오른쪽 레일(x>900)에 걸리지 않는지. 썸네일(cover)은 4:5 가운데 영역(y 285~1635) 안에 글이 들어가는 프레임.
|
||||
@@ -0,0 +1,141 @@
|
||||
// 날씨각 캐릭터 (career/shorts/nalssigak-shorts 에서 가져옴): 구름 캐릭터 = 맑은 날파 초록 털뭉치(셸 텍스처 퍼), 물방울 캐릭터 = 비 오는 날파 반투명 파란 젤리
|
||||
import * as THREE from 'three';
|
||||
import { mergeGeometries } from 'three/addons/utils/BufferGeometryUtils.js';
|
||||
|
||||
const eyeWhite = new THREE.MeshStandardMaterial({ color: 0xffffff, roughness: 0.25 });
|
||||
const pupilMat = new THREE.MeshStandardMaterial({ color: 0x1b2240, roughness: 0.15 });
|
||||
|
||||
function makeEyes(z, spread, size) {
|
||||
const g = new THREE.Group();
|
||||
const pupils = [];
|
||||
for (const sx of [-1, 1]) {
|
||||
const w = new THREE.Mesh(new THREE.SphereGeometry(size, 32, 24), eyeWhite);
|
||||
w.scale.set(1, 1.15, 0.7);
|
||||
w.position.set(sx * spread, 0, z);
|
||||
const p = new THREE.Mesh(new THREE.SphereGeometry(size * 0.55, 24, 16), pupilMat);
|
||||
p.position.set(sx * spread, 0, z + size * 0.62);
|
||||
g.add(w, p);
|
||||
pupils.push(p);
|
||||
}
|
||||
g.userData.pupils = pupils;
|
||||
g.userData.base = pupils.map((p) => p.position.x);
|
||||
return g;
|
||||
}
|
||||
|
||||
// 털 노이즈는 고정 시드라 어느 프레임을 먼저 그려도 같다
|
||||
let noiseTex = null;
|
||||
function noise() {
|
||||
if (noiseTex) return noiseTex;
|
||||
const n = 128, data = new Uint8Array(n * n * 4);
|
||||
let seed = 1234567;
|
||||
const rnd = () => ((seed = (seed * 16807) % 2147483647) / 2147483647);
|
||||
for (let i = 0; i < n * n; i++) { const v = Math.floor(rnd() * 255); data.set([v, v, v, 255], i * 4); }
|
||||
noiseTex = new THREE.DataTexture(data, n, n, THREE.RGBAFormat);
|
||||
noiseTex.wrapS = noiseTex.wrapT = THREE.RepeatWrapping;
|
||||
noiseTex.magFilter = noiseTex.minFilter = THREE.NearestFilter;
|
||||
noiseTex.needsUpdate = true;
|
||||
return noiseTex;
|
||||
}
|
||||
|
||||
const furVert = `
|
||||
uniform float uLayer; varying vec2 vUv; varying vec3 vN; varying vec3 vView; varying float vL;
|
||||
void main(){
|
||||
vUv = uv; vL = uLayer;
|
||||
vec3 p = position + normal * uLayer * 0.17;
|
||||
p.y -= uLayer * uLayer * 0.04;
|
||||
vN = normalize(normalMatrix * normal);
|
||||
vec4 mv = modelViewMatrix * vec4(p, 1.0);
|
||||
vView = -mv.xyz;
|
||||
gl_Position = projectionMatrix * mv;
|
||||
}`;
|
||||
const furFrag = `
|
||||
uniform sampler2D uNoise; uniform vec3 uRoot; uniform vec3 uTip; uniform vec3 uWarm;
|
||||
uniform float uTint; uniform float uNight;
|
||||
varying vec2 vUv; varying vec3 vN; varying vec3 vView; varying float vL;
|
||||
void main(){
|
||||
float n = texture2D(uNoise, vUv * vec2(70.0, 36.0)).r;
|
||||
if (vL > 0.0 && n < vL * 0.98) discard;
|
||||
vec3 N = normalize(vN);
|
||||
float d = max(dot(N, normalize(vec3(0.4, 0.7, 0.6))), 0.0);
|
||||
float rim = pow(1.0 - max(dot(N, normalize(vView)), 0.0), 2.2);
|
||||
vec3 c = mix(uRoot, uTip, vL);
|
||||
c = mix(c, uWarm * mix(0.7, 1.1, vL), uTint * 0.6);
|
||||
vec3 col = c * (0.42 + 0.8 * d) * mix(0.45, 1.0, vL) + rim * 0.35 * mix(uTip, uWarm, uTint);
|
||||
col *= mix(1.0, 0.62, uNight);
|
||||
gl_FragColor = vec4(col, 1.0);
|
||||
#include <colorspace_fragment>
|
||||
}`;
|
||||
|
||||
let furGeo = null;
|
||||
function fur() {
|
||||
if (furGeo) return furGeo;
|
||||
const parts = [new THREE.SphereGeometry(0.78, 64, 48)];
|
||||
for (let k = 0; k < 8; k++) { const a = (k / 8) * Math.PI * 2 + Math.PI / 8; const g = new THREE.SphereGeometry(0.44, 48, 32); g.translate(Math.cos(a) * 0.8, Math.sin(a) * 0.8, 0); parts.push(g); }
|
||||
for (let k = 0; k < 5; k++) { const a = (k / 5) * Math.PI * 2; const g = new THREE.SphereGeometry(0.36, 48, 32); g.translate(Math.cos(a) * 0.4, Math.sin(a) * 0.4, 0.48); parts.push(g); }
|
||||
furGeo = mergeGeometries(parts);
|
||||
return furGeo;
|
||||
}
|
||||
|
||||
/** 구름 캐릭터. 돌려주는 값: { group, eyes, uniforms(uTint 0~1 노을, uNight 0~1 밤) } */
|
||||
export function makeCloud(shells = 34) {
|
||||
const uniforms = { uNoise: { value: noise() }, uRoot: { value: new THREE.Color(0x1f8a1a) }, uTip: { value: new THREE.Color(0x8ef06a) }, uWarm: { value: new THREE.Color(0xff9a4a) }, uTint: { value: 0 }, uNight: { value: 0 } };
|
||||
const group = new THREE.Group();
|
||||
const body = new THREE.Group();
|
||||
for (let i = 0; i < shells; i++) {
|
||||
const mat = new THREE.ShaderMaterial({ uniforms: { ...uniforms, uLayer: { value: i / (shells - 1) } }, vertexShader: furVert, fragmentShader: furFrag });
|
||||
const m = new THREE.Mesh(fur(), mat);
|
||||
m.renderOrder = i;
|
||||
body.add(m);
|
||||
}
|
||||
group.add(body);
|
||||
const eyes = makeEyes(1.05, 0.13, 0.1);
|
||||
eyes.position.y = 0.06;
|
||||
group.add(eyes);
|
||||
return { group, eyes, uniforms };
|
||||
}
|
||||
|
||||
/** 물방울 캐릭터. 돌려주는 값: { group, eyes, arms, front, back } — front.color 를 바꾸면 전체 색이 바뀐다 */
|
||||
export function makeDrop(envMap) {
|
||||
const group = new THREE.Group();
|
||||
const body = new THREE.Group();
|
||||
const front = new THREE.MeshPhysicalMaterial({ color: 0x7cbcff, transparent: true, opacity: 0.58, roughness: 0.06, metalness: 0, clearcoat: 1, clearcoatRoughness: 0.04, envMapIntensity: 1.6, iridescence: 0.25, depthWrite: false, envMap });
|
||||
const back = front.clone();
|
||||
back.side = THREE.BackSide;
|
||||
back.opacity = 0.32;
|
||||
const coreMat = new THREE.MeshPhysicalMaterial({ color: 0xbfe0ff, transparent: true, opacity: 0.45, roughness: 0.3, depthWrite: false, envMap });
|
||||
const addJelly = (geo, parent) => { const b = new THREE.Mesh(geo, back); b.renderOrder = 1; const f = new THREE.Mesh(geo, front); f.renderOrder = 3; parent.add(b, f); };
|
||||
const center = new THREE.SphereGeometry(0.72, 64, 48);
|
||||
center.scale(1, 0.95, 0.72);
|
||||
addJelly(center, body);
|
||||
const core = new THREE.Mesh(new THREE.SphereGeometry(0.42, 40, 30), coreMat);
|
||||
core.scale.set(1, 0.9, 0.6); core.position.set(0.12, -0.1, -0.1); core.renderOrder = 2;
|
||||
body.add(core);
|
||||
const arms = [];
|
||||
for (let k = 0; k < 6; k++) {
|
||||
const a = Math.PI / 2 + (k / 6) * Math.PI * 2 + (k % 2 ? 0.08 : -0.05);
|
||||
const arm = new THREE.Group();
|
||||
const stem = new THREE.CapsuleGeometry(0.2 + (k % 3) * 0.02, 0.62, 12, 24);
|
||||
stem.rotateZ(-Math.PI / 2); stem.translate(0.78, 0, 0); stem.scale(1, 1, 0.8);
|
||||
addJelly(stem, arm);
|
||||
const tip = new THREE.SphereGeometry(0.27, 40, 30);
|
||||
tip.scale(1, 1, 0.8); tip.translate(1.18, 0, 0);
|
||||
addJelly(tip, arm);
|
||||
arm.rotation.z = a; arm.userData.a = a;
|
||||
arms.push(arm);
|
||||
body.add(arm);
|
||||
}
|
||||
group.add(body);
|
||||
const eyes = makeEyes(0.6, 0.15, 0.1);
|
||||
eyes.position.set(0.05, -0.02, 0);
|
||||
group.add(eyes);
|
||||
return { group, eyes, arms, front, back };
|
||||
}
|
||||
|
||||
export const JELLY = { blue: new THREE.Color(0x7cbcff), warm: new THREE.Color(0xffb27a), night: new THREE.Color(0x5b78c8) };
|
||||
|
||||
/** 숨쉬기·팔 흔들기: t 의 함수 */
|
||||
export function animate(b, m, t, phase = 0) {
|
||||
b.group.rotation.set(Math.sin(t * 1.3 + phase) * 0.06, Math.sin(t * 0.9 + phase) * 0.18, Math.sin(t * 1.7 + phase) * 0.03);
|
||||
m.group.rotation.set(Math.sin(t * 1.3 + phase + 1.7) * 0.06, Math.sin(t * 0.9 + phase + 1.7) * 0.18, Math.sin(t * 1.7 + phase + 1.7) * 0.03);
|
||||
m.arms.forEach((arm, i) => { arm.rotation.z = arm.userData.a + Math.sin(t * 2.6 + i * 1.1) * 0.07; arm.scale.setScalar(1 + Math.sin(t * 3.1 + i) * 0.04); });
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
3D icons in this folder are from Microsoft Fluent Emoji (https://github.com/microsoft/fluentui-emoji), licensed under the MIT License. Copyright (c) Microsoft Corporation.
|
||||
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 9.7 KiB |
@@ -0,0 +1,7 @@
|
||||
# 3D 모델 출처
|
||||
|
||||
| 파일 | 출처 | 라이선스 |
|
||||
|---|---|---|
|
||||
| `*.glb` | Nature Kit 2.1 by Kenney, https://kenney.nl/assets/nature-kit | CC0 1.0 |
|
||||
|
||||
구름과 아이콘(`../icons`)은 Microsoft Fluent Emoji, MIT. `../icons/LICENSE-fluent-emoji.txt` 참고.
|
||||
@@ -0,0 +1,19 @@
|
||||
<!doctype html><html><head><meta charset="utf-8">
|
||||
<script type="importmap">{ "imports": { "three": "https://cdn.jsdelivr.net/npm/three@0.169.0/build/three.module.js", "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.169.0/examples/jsm/" } }</script>
|
||||
<style>html,body{margin:0;background:transparent}canvas{display:block}</style></head><body>
|
||||
<canvas id="c" width="1200" height="600"></canvas>
|
||||
<script type="module">
|
||||
import * as THREE from 'three';
|
||||
import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
|
||||
import { makeCloud, makeDrop } from './assets/characters.js';
|
||||
const renderer = new THREE.WebGLRenderer({ canvas: document.getElementById('c'), alpha: true, antialias: true, premultipliedAlpha: true });
|
||||
renderer.setPixelRatio(1); renderer.setSize(1200, 600, false); renderer.setClearColor(0x000000, 0);
|
||||
const scene = new THREE.Scene();
|
||||
const camera = new THREE.PerspectiveCamera(30, 2, 0.1, 100); camera.position.set(0, 0, 11);
|
||||
const env = new THREE.PMREMGenerator(renderer).fromScene(new RoomEnvironment(), 0.04).texture;
|
||||
scene.add(new THREE.HemisphereLight(0xffffff, 0x8aa0c8, 1.5)); const key = new THREE.DirectionalLight(0xffffff, 2.2); key.position.set(3, 5, 8); scene.add(key);
|
||||
const b = makeCloud(), m = makeDrop(env);
|
||||
b.group.position.set(-2.6, 0, 0); b.group.scale.setScalar(1.25); m.group.position.set(2.6, 0, 0); m.group.scale.setScalar(1.2);
|
||||
scene.add(b.group, m.group);
|
||||
renderer.render(scene, camera); document.title = 'ready';
|
||||
</script></body></html>
|
||||
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<style>
|
||||
@font-face { font-family: 'Jua'; src: url('assets/fonts/Jua-Regular.ttf'); }
|
||||
#root { position: absolute; inset: 0; overflow: hidden; }
|
||||
#o1-title { position: absolute; left: 90px; top: 300px; width: 900px; margin: 0; font: 400 120px/1.18 'Jua', sans-serif; letter-spacing: -2px; color: #28304a; text-shadow: 0 0 22px rgba(255, 255, 255, 0.9), 0 4px 14px rgba(255, 255, 255, 0.7); word-break: keep-all; }
|
||||
#o1-title .w { display: inline-block; margin-right: 0.22em; }
|
||||
</style>
|
||||
<div id="root" data-composition-id="o1" data-width="1080" data-height="1920">
|
||||
<div id="o1-world" class="clip" data-start="0" data-duration="3">
|
||||
<h1 id="o1-title"><span class="w">오늘</span><span class="w">뭐</span><span class="w">하기</span><br /><span class="w">좋은</span><span class="w">날이지?</span></h1>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
tl.fromTo("#o1-title .w", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.13, ease: "power4.out", stagger: 0.07 }, 0.05);
|
||||
tl.to("#o1-title", { y: -120, opacity: 0, filter: "blur(10px)", duration: 0.25, ease: "power3.in" }, 2.7);
|
||||
window.__timelines["o1"] = tl;
|
||||
</script>
|
||||
</template>
|
||||
@@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<style>
|
||||
@font-face { font-family: 'Jua'; src: url('assets/fonts/Jua-Regular.ttf'); }
|
||||
@font-face { font-family: 'Pretendard'; src: url('assets/fonts/PretendardVariable.woff2'); font-weight: 100 900; }
|
||||
#root { position: absolute; inset: 0; overflow: hidden; }
|
||||
#o2-shade { position: absolute; left: 0; top: 0; width: 1080px; height: 980px; background: linear-gradient(180deg, rgba(20, 26, 50, 0.5) 0%, rgba(20, 26, 50, 0.25) 55%, rgba(20, 26, 50, 0) 100%); }
|
||||
.o2-chip { position: absolute; padding: 18px 40px; border-radius: 28px; background: #fff; color: #28304a; font: 800 60px/1 'Pretendard', sans-serif; letter-spacing: -1px; box-shadow: 0 10px 30px rgba(40, 48, 74, 0.25); white-space: nowrap; }
|
||||
#o2-c1 { left: 90px; top: 380px; }
|
||||
#o2-c2 { left: 330px; top: 520px; }
|
||||
#o2-c3 { left: 150px; top: 660px; }
|
||||
#o2-ask { position: absolute; left: 90px; top: 960px; width: 900px; margin: 0; font: 400 112px/1.18 'Jua', sans-serif; letter-spacing: -2px; color: #fff; text-shadow: 0 6px 22px rgba(20, 26, 50, 0.6); word-break: keep-all; }
|
||||
#o2-ask .w { display: inline-block; margin-right: 0.22em; }
|
||||
</style>
|
||||
<div id="root" data-composition-id="o2" data-width="1080" data-height="1920">
|
||||
<div id="o2-shade" aria-hidden="true" data-layout-ignore></div>
|
||||
<div id="o2-world" class="clip" data-start="0" data-duration="3">
|
||||
<div id="o2-c1" class="o2-chip">흐림</div>
|
||||
<div id="o2-c2" class="o2-chip">19°</div>
|
||||
<div id="o2-c3" class="o2-chip">습도 70%</div>
|
||||
<h1 id="o2-ask"><span class="w">…그래서</span><br /><span class="w">오늘</span><span class="w">뭐</span><span class="w">하죠?</span></h1>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
tl.fromTo(["#o2-c1", "#o2-c2", "#o2-c3"], { y: -220, scale: 0.6, opacity: 0 }, { y: 0, scale: 1, opacity: 1, duration: 0.45, ease: "back.out(1.6)", stagger: 0.1 }, 0.2);
|
||||
tl.fromTo("#o2-ask .w", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.13, ease: "power4.out", stagger: 0.07 }, 1.1);
|
||||
tl.to(["#o2-c1", "#o2-c2", "#o2-c3", "#o2-ask"], { opacity: 0, filter: "blur(8px)", duration: 0.25, ease: "power3.in" }, 2.7);
|
||||
window.__timelines["o2"] = tl;
|
||||
</script>
|
||||
</template>
|
||||
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<style>
|
||||
@font-face { font-family: 'Jua'; src: url('assets/fonts/Jua-Regular.ttf'); }
|
||||
@font-face { font-family: 'Pretendard'; src: url('assets/fonts/PretendardVariable.woff2'); font-weight: 100 900; }
|
||||
#root { position: absolute; inset: 0; overflow: hidden; }
|
||||
#o3-shade { position: absolute; left: 0; top: 0; width: 1080px; height: 980px; background: linear-gradient(180deg, rgba(20, 26, 50, 0.5) 0%, rgba(20, 26, 50, 0.25) 55%, rgba(20, 26, 50, 0) 100%); }
|
||||
#o3-icon { position: absolute; left: 400px; top: 420px; width: 280px; height: 280px; border-radius: 64px; box-shadow: 0 24px 60px rgba(20, 26, 50, 0.35); transform-origin: 50% 50%; }
|
||||
#o3-name { position: absolute; left: 0; top: 760px; width: 1080px; margin: 0; text-align: center; font: 400 150px/1 'Jua', sans-serif; letter-spacing: -3px; color: #fff; text-shadow: 0 8px 28px rgba(20, 26, 50, 0.55); }
|
||||
#o3-name .l { display: inline-block; }
|
||||
#o3-sub { position: absolute; left: 90px; top: 950px; width: 900px; margin: 0; text-align: center; font: 700 56px/1.3 'Pretendard', sans-serif; letter-spacing: -1px; color: #fff; text-shadow: 0 4px 18px rgba(20, 26, 50, 0.6); word-break: keep-all; }
|
||||
#o3-sub b { color: #ffb48a; font-weight: 800; }
|
||||
</style>
|
||||
<div id="root" data-composition-id="o3" data-width="1080" data-height="1920">
|
||||
<div id="o3-shade" aria-hidden="true" data-layout-ignore></div>
|
||||
<div id="o3-world" class="clip" data-start="0" data-duration="2.5">
|
||||
<img id="o3-icon" src="assets/img/app-icon.png" alt="" />
|
||||
<h1 id="o3-name"><span class="l">날</span><span class="l">씨</span><span class="l">각</span></h1>
|
||||
<p id="o3-sub">날씨를 <b>할 일</b>로 바꿔요</p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
tl.fromTo("#o3-icon", { scale: 0.2, opacity: 0 }, { scale: 1, opacity: 1, duration: 0.5, ease: "back.out(1.7)" }, 0.1);
|
||||
tl.fromTo("#o3-name .l", { opacity: 0, filter: "blur(6px)", y: 14 }, { opacity: 1, filter: "blur(0px)", y: 0, duration: 0.2, ease: "power4.out", stagger: 0.1 }, 0.4);
|
||||
tl.fromTo("#o3-sub", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.2, ease: "power4.out" }, 0.55);
|
||||
tl.to(["#o3-icon", "#o3-name", "#o3-sub"], { opacity: 0, y: -60, filter: "blur(8px)", duration: 0.25, ease: "power3.in" }, 2.3);
|
||||
window.__timelines["o3"] = tl;
|
||||
</script>
|
||||
</template>
|
||||
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<style>
|
||||
@font-face { font-family: 'Jua'; src: url('assets/fonts/Jua-Regular.ttf'); }
|
||||
@font-face { font-family: 'Pretendard'; src: url('assets/fonts/PretendardVariable.woff2'); font-weight: 100 900; }
|
||||
#root { position: absolute; inset: 0; overflow: hidden; }
|
||||
#o4-shade { position: absolute; left: 0; top: 0; width: 1080px; height: 980px; background: linear-gradient(180deg, rgba(20, 26, 50, 0.5) 0%, rgba(20, 26, 50, 0.25) 55%, rgba(20, 26, 50, 0) 100%); }
|
||||
.o4-chip { position: absolute; left: 90px; top: 300px; display: flex; align-items: center; gap: 22px; padding: 22px 40px 22px 24px; border-radius: 32px; background: #fff; color: #28304a; box-shadow: 0 12px 34px rgba(20, 26, 50, 0.3); transform-origin: 0% 50%; }
|
||||
.o4-chip img { width: 110px; height: 110px; }
|
||||
.o4-chip .n { font: 800 54px/1 'Pretendard', sans-serif; letter-spacing: -1px; white-space: nowrap; }
|
||||
.o4-chip .v { font: 800 92px/1 'Pretendard', sans-serif; color: #d4552a; letter-spacing: -2px; min-width: 120px; text-align: right; }
|
||||
.o4-line { position: absolute; left: 90px; top: 500px; width: 900px; margin: 0; font: 400 76px/1.2 'Jua', sans-serif; letter-spacing: -1px; color: #fff; text-shadow: 0 6px 22px rgba(20, 26, 50, 0.6); word-break: keep-all; }
|
||||
#o4-head { position: absolute; left: 90px; top: 210px; margin: 0; font: 700 44px/1 'Pretendard', sans-serif; color: #fff; text-shadow: 0 3px 12px rgba(20, 26, 50, 0.6); }
|
||||
</style>
|
||||
<div id="root" data-composition-id="o4" data-width="1080" data-height="1920">
|
||||
<div id="o4-shade" aria-hidden="true" data-layout-ignore></div>
|
||||
<div id="o4-world" class="clip" data-start="0" data-duration="6">
|
||||
<p id="o4-head">오늘 서울 · 실제 점수</p>
|
||||
<div id="o4-c1" class="o4-chip"><img src="assets/icons/walk.png" alt="" /><span class="n">산책각</span><span class="v" id="o4-v1">0</span></div>
|
||||
<p id="o4-l1" class="o4-line">숲길 산책 딱 좋은 날</p>
|
||||
<div id="o4-c2" class="o4-chip"><img src="assets/icons/camping.png" alt="" /><span class="n">캠핑각</span><span class="v" id="o4-v2">0</span></div>
|
||||
<p id="o4-l2" class="o4-line">텐트 치고 모닥불 딱</p>
|
||||
<div id="o4-c3" class="o4-chip"><img src="assets/icons/hangang.png" alt="" /><span class="n">한강각</span><span class="v" id="o4-v3">0</span></div>
|
||||
<p id="o4-l3" class="o4-line">노을 보며 돗자리 딱</p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
const beat = (chip, line, vid, value, t0) => {
|
||||
tl.fromTo(chip, { scale: 0.5, x: -80, opacity: 0 }, { scale: 1, x: 0, opacity: 1, duration: 0.45, ease: "back.out(1.6)" }, t0);
|
||||
const s = { v: 0 };
|
||||
tl.to(s, { v: value, duration: 0.6, ease: "power2.out", onUpdate: () => { document.getElementById(vid).textContent = Math.round(s.v); } }, t0 + 0.1);
|
||||
tl.fromTo(line, { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.2, ease: "power4.out" }, t0 + 0.25);
|
||||
tl.to([chip, line], { opacity: 0, y: -40, filter: "blur(8px)", duration: 0.2, ease: "power3.in" }, t0 + 1.78);
|
||||
};
|
||||
tl.fromTo("#o4-head", { opacity: 0 }, { opacity: 1, duration: 0.2 }, 0.1);
|
||||
// 2026-10-24 서울 중구 API 점수
|
||||
beat("#o4-c1", "#o4-l1", "o4-v1", 79, 0.3);
|
||||
beat("#o4-c2", "#o4-l2", "o4-v2", 75, 2.3);
|
||||
beat("#o4-c3", "#o4-l3", "o4-v3", 84, 4.3);
|
||||
tl.to("#o4-head", { opacity: 0, duration: 0.2 }, 5.75);
|
||||
window.__timelines["o4"] = tl;
|
||||
</script>
|
||||
</template>
|
||||
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<style>
|
||||
@font-face { font-family: 'Jua'; src: url('assets/fonts/Jua-Regular.ttf'); }
|
||||
@font-face { font-family: 'Pretendard'; src: url('assets/fonts/PretendardVariable.woff2'); font-weight: 100 900; }
|
||||
#root { position: absolute; inset: 0; overflow: hidden; }
|
||||
#o5-title { position: absolute; left: 90px; top: 300px; width: 900px; margin: 0; font: 400 118px/1.18 'Jua', sans-serif; letter-spacing: -2px; color: #fff; text-shadow: 0 6px 22px rgba(10, 14, 40, 0.7); word-break: keep-all; }
|
||||
#o5-title .w { display: inline-block; margin-right: 0.22em; }
|
||||
#o5-chip { position: absolute; left: 0; right: 0; top: 1130px; margin: 0 auto; width: max-content; padding: 22px 44px; border-radius: 32px; background: #d4552a; color: #fff; font: 800 64px/1 'Pretendard', sans-serif; letter-spacing: -1px; box-shadow: 0 12px 34px rgba(212, 85, 42, 0.4); white-space: nowrap; transform-origin: 50% 50%; }
|
||||
#o5-sub { position: absolute; left: 90px; top: 1250px; width: 900px; margin: 0; text-align: center; font: 700 48px/1.3 'Pretendard', sans-serif; letter-spacing: -1px; color: #dfe6ff; text-shadow: 0 4px 18px rgba(10, 14, 40, 0.7); word-break: keep-all; }
|
||||
</style>
|
||||
<div id="root" data-composition-id="o5" data-width="1080" data-height="1920">
|
||||
<div id="o5-world" class="clip" data-start="0" data-duration="3">
|
||||
<h1 id="o5-title"><span class="w">지금</span><span class="w">내</span><span class="w">동네</span><br /><span class="w">1위는?</span></h1>
|
||||
<div id="o5-chip">68가지 각</div>
|
||||
<p id="o5-sub">동네마다 점수가 달라요</p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
tl.fromTo("#o5-title .w", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.13, ease: "power4.out", stagger: 0.07 }, 0.3);
|
||||
tl.fromTo("#o5-chip", { scale: 0.4, opacity: 0 }, { scale: 1, opacity: 1, duration: 0.45, ease: "back.out(1.6)" }, 1.3);
|
||||
tl.fromTo("#o5-sub", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.2, ease: "power4.out" }, 1.6);
|
||||
tl.to(["#o5-title", "#o5-chip", "#o5-sub"], { opacity: 0, filter: "blur(8px)", duration: 0.2, ease: "power3.in" }, 2.75);
|
||||
window.__timelines["o5"] = tl;
|
||||
</script>
|
||||
</template>
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<style>
|
||||
@font-face { font-family: 'Jua'; src: url('assets/fonts/Jua-Regular.ttf'); }
|
||||
@font-face { font-family: 'Pretendard'; src: url('assets/fonts/PretendardVariable.woff2'); font-weight: 100 900; }
|
||||
#root { position: absolute; inset: 0; overflow: hidden; }
|
||||
#o6-icon { position: absolute; left: 410px; top: 520px; width: 260px; height: 260px; border-radius: 60px; box-shadow: 0 24px 60px rgba(10, 14, 40, 0.5); transform-origin: 50% 50%; }
|
||||
#o6-name { position: absolute; left: 0; top: 830px; width: 1080px; margin: 0; text-align: center; font: 400 140px/1 'Jua', sans-serif; letter-spacing: -3px; color: #fff; text-shadow: 0 8px 28px rgba(10, 14, 40, 0.6); }
|
||||
#o6-claim { position: absolute; left: 90px; top: 1010px; width: 900px; margin: 0; text-align: center; font: 800 64px/1.2 'Pretendard', sans-serif; letter-spacing: -1px; color: #fff; text-shadow: 0 4px 18px rgba(10, 14, 40, 0.6); word-break: keep-all; }
|
||||
#o6-claim b { color: #ffb48a; }
|
||||
#o6-url { position: absolute; left: 90px; top: 1125px; width: 900px; margin: 0; text-align: center; font: 700 58px/1.2 'Pretendard', sans-serif; letter-spacing: -1px; color: #9ecbff; text-shadow: 0 4px 18px rgba(10, 14, 40, 0.6); }
|
||||
#o6-toss { position: absolute; left: 90px; top: 1215px; width: 900px; margin: 0; text-align: center; font: 600 50px/1.2 'Pretendard', sans-serif; letter-spacing: -1px; color: #dfe6ff; text-shadow: 0 4px 18px rgba(10, 14, 40, 0.6); word-break: keep-all; }
|
||||
</style>
|
||||
<div id="root" data-composition-id="o6" data-width="1080" data-height="1920">
|
||||
<div id="o6-world" class="clip" data-start="0" data-duration="3.5">
|
||||
<img id="o6-icon" src="assets/img/app-icon.png" alt="" />
|
||||
<h1 id="o6-name">날씨각</h1>
|
||||
<p id="o6-claim">설치 없이 바로, <b>무료</b></p>
|
||||
<p id="o6-url">weather.o2o.kr</p>
|
||||
<p id="o6-toss">토스 앱에서 '날씨각' 검색해도 열려요</p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
tl.fromTo("#o6-icon", { scale: 0.2, opacity: 0 }, { scale: 1, opacity: 1, duration: 0.5, ease: "back.out(1.7)" }, 0.1);
|
||||
tl.fromTo("#o6-name", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.2, ease: "power4.out" }, 0.4);
|
||||
tl.fromTo("#o6-claim", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.2, ease: "power4.out" }, 0.7);
|
||||
tl.fromTo("#o6-url", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.2, ease: "power4.out" }, 1.0);
|
||||
tl.fromTo("#o6-toss", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.2, ease: "power4.out" }, 1.3);
|
||||
tl.to({}, { duration: 0.2 }, 3.3);
|
||||
window.__timelines["o6"] = tl;
|
||||
</script>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"$schema": "https://hyperframes.heygen.com/schema/hyperframes.json",
|
||||
"registry": "https://raw.githubusercontent.com/heygen-com/hyperframes/main/registry",
|
||||
"paths": {
|
||||
"blocks": "compositions",
|
||||
"components": "compositions/components",
|
||||
"assets": "assets"
|
||||
},
|
||||
"media": {
|
||||
"autoProxy": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=1080, height=1920" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
|
||||
<script type="importmap">
|
||||
{ "imports": { "three": "https://cdn.jsdelivr.net/npm/three@0.169.0/build/three.module.js", "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.169.0/examples/jsm/" } }
|
||||
</script>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
html, body { margin: 0; width: 1080px; height: 1920px; overflow: hidden; background: #0f1535; }
|
||||
#root { position: relative; width: 100%; height: 100%; }
|
||||
#world { position: absolute; inset: 0; width: 1080px; height: 1920px; display: block; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 날씨각 소개 릴스(3D). 세상은 Three.js 한 장면(섬·하늘·구름·아이콘, test-design/weather 디오라마를 가져옴), 글·칩·폰은 위에 얹는 sub-composition -->
|
||||
<div id="root" data-composition-id="main" data-start="0" data-duration="21" data-width="1080" data-height="1920">
|
||||
<canvas id="world" width="1080" height="1920"></canvas>
|
||||
<div id="o1" data-composition-id="o1" data-composition-src="compositions/o1.html" data-start="0" data-duration="3" data-track-index="2" data-track-kind="graphics" data-width="1080" data-height="1920"></div>
|
||||
<div id="o2" data-composition-id="o2" data-composition-src="compositions/o2.html" data-start="3" data-duration="3" data-track-index="2" data-track-kind="graphics" data-width="1080" data-height="1920"></div>
|
||||
<div id="o3" data-composition-id="o3" data-composition-src="compositions/o3.html" data-start="6" data-duration="2.5" data-track-index="2" data-track-kind="graphics" data-width="1080" data-height="1920"></div>
|
||||
<div id="o4" data-composition-id="o4" data-composition-src="compositions/o4.html" data-start="8.5" data-duration="6" data-track-index="2" data-track-kind="graphics" data-width="1080" data-height="1920"></div>
|
||||
<div id="o5" data-composition-id="o5" data-composition-src="compositions/o5.html" data-start="14.5" data-duration="3" data-track-index="2" data-track-kind="graphics" data-width="1080" data-height="1920"></div>
|
||||
<div id="o6" data-composition-id="o6" data-composition-src="compositions/o6.html" data-start="17.5" data-duration="3.5" data-track-index="2" data-track-kind="graphics" data-width="1080" data-height="1920"></div>
|
||||
</div>
|
||||
<script type="module">
|
||||
import * as THREE from 'three';
|
||||
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
||||
import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
|
||||
import { makeCloud, makeDrop, JELLY, animate as animateChars } from './assets/characters.js';
|
||||
|
||||
// 결정적 난수: 프레임을 어느 순서로 그려도 같은 별·구름 자리
|
||||
function mulberry32(a) { return () => { a |= 0; a = (a + 0x6d2b79f5) | 0; let t = Math.imul(a ^ (a >>> 15), 1 | a); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; }
|
||||
const rand = mulberry32(20261024);
|
||||
const rnd = (a, b) => a + rand() * (b - a);
|
||||
|
||||
const W = 1080, H = 1920;
|
||||
const canvas = document.getElementById('world');
|
||||
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, preserveDrawingBuffer: true });
|
||||
renderer.setPixelRatio(1);
|
||||
renderer.setSize(W, H, false);
|
||||
renderer.toneMapping = THREE.ACESFilmicToneMapping;
|
||||
renderer.outputColorSpace = THREE.SRGBColorSpace;
|
||||
|
||||
const scene = new THREE.Scene();
|
||||
const camera = new THREE.PerspectiveCamera(62, W / H, 0.1, 3000);
|
||||
|
||||
// 하늘: 브랜드 색 그라데이션 돔 (위 색 → 지평선 색). 분위기(mood) 0 새벽 · 1 낮 · 2 흐림 · 3 노을 · 4 밤 사이를 보간
|
||||
const PAL = [['#ffb7a3', '#ffe6cf'], ['#3f8fe0', '#dff0ff'], ['#8a95ad', '#d3d8e2'], ['#4a3f8f', '#ff8a4a'], ['#0b1230', '#2a3570']].map(([a, b]) => [new THREE.Color(a), new THREE.Color(b)]);
|
||||
const domeMat = new THREE.ShaderMaterial({
|
||||
side: THREE.BackSide, depthWrite: false, toneMapped: false,
|
||||
uniforms: { top: { value: new THREE.Color('#3f8fe0') }, bottom: { value: new THREE.Color('#dff0ff') }, sun: { value: new THREE.Vector3(0, 1, 0) }, glow: { value: 0.0 }, glowColor: { value: new THREE.Color('#ffd27a') } },
|
||||
vertexShader: 'varying vec3 vDir; void main(){ vDir = normalize(position); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }',
|
||||
fragmentShader: 'uniform vec3 top; uniform vec3 bottom; uniform vec3 sun; uniform float glow; uniform vec3 glowColor; varying vec3 vDir; void main(){ float h = clamp(vDir.y * 1.6 + 0.25, 0.0, 1.0); vec3 c = mix(bottom, top, smoothstep(0.0, 1.0, h)); float d = max(dot(normalize(vDir), normalize(sun)), 0.0); c += glowColor * glow * pow(d, 28.0) * 1.4 + glowColor * glow * pow(d, 4.0) * 0.25; gl_FragColor = vec4(c, 1.0); }',
|
||||
});
|
||||
const dome = new THREE.Mesh(new THREE.SphereGeometry(2000, 32, 24), domeMat);
|
||||
scene.add(dome);
|
||||
const sunDir = new THREE.Vector3();
|
||||
|
||||
const hemi = new THREE.HemisphereLight(0xdfefff, 0x6a7aa0, 1.4);
|
||||
const sunLight = new THREE.DirectionalLight(0xffffff, 2.2);
|
||||
const fill = new THREE.DirectionalLight(0xfff4ea, 0);
|
||||
scene.add(hemi, sunLight, sunLight.target, fill, fill.target);
|
||||
|
||||
// 별
|
||||
const starN = 1600, sp = new Float32Array(starN * 3);
|
||||
for (let i = 0; i < starN; i++) {
|
||||
const th = rand() * Math.PI * 2, ph = Math.acos(rand() * 0.92);
|
||||
sp.set([Math.sin(ph) * Math.cos(th) * 900, Math.cos(ph) * 900 - 40, Math.sin(ph) * Math.sin(th) * 900], i * 3);
|
||||
}
|
||||
const starGeo = new THREE.BufferGeometry();
|
||||
starGeo.setAttribute('position', new THREE.BufferAttribute(sp, 3));
|
||||
const starMat = new THREE.PointsMaterial({ color: 0xffffff, size: 2.4, sizeAttenuation: false, transparent: true, opacity: 0, depthWrite: false });
|
||||
scene.add(new THREE.Points(starGeo, starMat));
|
||||
|
||||
// 상태: 타임라인이 이 값을 움직이고, 프레임마다 읽어서 그린다
|
||||
const S = { elev: 9, azim: 168, turb: 3, ray: 2.4, mie: 0.004, g: 0.8, exp: 0.38, camX: 0, camY: 1.4, camZ: 12, lookY: 4.5, lookX: 0, cloud: 1, stars: 0, island: 0, pass: 0, rise: 0, spin: 0, mood: 0, glow: 0.6, nightIcons: 0, chars: 1, charsEnd: 0, iconWalk: 0, iconCamp: 0, iconSunset: 0, rain: 0 };
|
||||
|
||||
const tex = new THREE.TextureLoader();
|
||||
const sprite = (name, s) => {
|
||||
const map = tex.load(`assets/icons/${name}.png`);
|
||||
map.colorSpace = THREE.SRGBColorSpace;
|
||||
const spr = new THREE.Sprite(new THREE.SpriteMaterial({ map, transparent: true, depthWrite: false, toneMapped: false, opacity: 0 }));
|
||||
spr.scale.set(s, s, 1);
|
||||
scene.add(spr);
|
||||
return spr;
|
||||
};
|
||||
// 하늘에 뜬 날씨각 3D 아이콘 (첫 장면), 비 (흐림 장면), 섬 옆 활동 아이콘 (증명 장면)
|
||||
const skyIcons = [['sun', 3.0, 2.6, -9, 2.2], ['umbrella', -3.0, 1.2, -11, 1.8], ['bike', 2.6, -0.4, -5, 1.4], ['laundry', -1.4, -1.2, -15, 1.7]].map(([n, x, y, z, s], i) => { const o = sprite(n, s); o.position.set(x, y, z); o.userData = { x, y, z, phase: i * 1.3, amp: 0.18 + (i % 3) * 0.07 }; return o; });
|
||||
const rainIcon = sprite('rain', 3.2); rainIcon.position.set(-2.4, 6.5, -12);
|
||||
// 날씨각 캐릭터 구름 캐릭터(초록 털뭉치)·물방울 캐릭터(파란 젤리): 카메라 앞 한 벌, 섬 위 한 벌
|
||||
const envTex = new THREE.PMREMGenerator(renderer).fromScene(new RoomEnvironment(), 0.04).texture;
|
||||
const cloudA = makeCloud(), dropA = makeDrop(envTex);
|
||||
const cloudB = makeCloud(22), dropB = makeDrop(envTex);
|
||||
scene.add(cloudA.group, dropA.group);
|
||||
const walkIcon = sprite('walk', 2.2), campIcon = sprite('camping', 2.2), sunsetIcon = sprite('sunset', 2.6);
|
||||
// 밤하늘의 각 무리 (폰 화면 대신): 68가지 중 아홉
|
||||
const NIGHT = [['hangang', -4.2, 2.0, 2.2], ['drive', 3.8, 3.2, 2.0], ['walk', -1.2, 5.2, 1.8], ['camping', 4.6, 7.4, 1.9], ['stars', -4.8, 8.6, 2.0], ['running', 1.4, 0.6, 1.6], ['laundry', -3.4, -1.6, 1.5], ['bike', 5.2, -0.4, 1.6], ['picnic', 0.6, 9.8, 1.7]].map(([n, x, y, sc], i) => { const o = sprite(n, sc * 1.45); o.userData = { x, y, phase: i * 0.9, sc: sc * 1.45 }; return o; });
|
||||
|
||||
// 구름: 날씨각 Fluent 3D 구름
|
||||
const cloudTex = tex.load('assets/icons/cloud.png');
|
||||
cloudTex.colorSpace = THREE.SRGBColorSpace;
|
||||
const cloudMat = new THREE.SpriteMaterial({ map: cloudTex, transparent: true, depthWrite: false, toneMapped: false });
|
||||
const passMat = cloudMat.clone();
|
||||
const clouds = new THREE.Group(), passClouds = new THREE.Group();
|
||||
scene.add(clouds, passClouds);
|
||||
const side = () => (rand() < 0.3 ? -1 : 1);
|
||||
const addCloud = (group, mat, x, y, z, s) => { const c = new THREE.Sprite(mat); c.scale.set(s * (rand() < 0.5 ? -1 : 1), s, 1); c.position.set(x, y, z); c.userData = { drift: rnd(0.15, 0.5), x }; group.add(c); };
|
||||
for (let i = 0; i < 7; i++) addCloud(clouds, cloudMat, side() * rnd(12, 40), rnd(9, 19), rnd(-70, -40), rnd(8, 16));
|
||||
for (let i = 0; i < 18; i++) addCloud(passClouds, passMat, rnd(-8, 8), rnd(-1, 8), rnd(-38, -18), rnd(6, 12));
|
||||
for (let i = 0; i < 12; i++) addCloud(clouds, cloudMat, side() * rnd(30, 130), rnd(16, 40), rnd(-280, -170), rnd(24, 44));
|
||||
|
||||
// 가을 섬 (Kenney Nature Kit, CC0)
|
||||
const loader = new GLTFLoader();
|
||||
const load = (url) => loader.loadAsync(url).then((g) => g.scene);
|
||||
const names = ['cliff_block_rock', 'tree_oak', 'tree_default', 'tree_fat', 'tree_pineRoundA', 'tree_pineRoundC', 'rock_largeA', 'rock_smallC', 'flower_redA', 'flower_yellowB', 'mushroom_redGroup', 'tent_smallOpen', 'campfire_stones', 'grass_large', 'plant_bushLarge'];
|
||||
const island = new THREE.Group();
|
||||
const mats = {
|
||||
leaf: new THREE.MeshStandardMaterial({ color: 0xff7a2e, roughness: 0.9, flatShading: true }),
|
||||
pine: new THREE.MeshStandardMaterial({ color: 0x3a8f6a, roughness: 0.9, flatShading: true }),
|
||||
grass: new THREE.MeshStandardMaterial({ color: 0xc8b25a, roughness: 1, flatShading: true }),
|
||||
dirt: new THREE.MeshStandardMaterial({ color: 0xc77a52, roughness: 1, flatShading: true }),
|
||||
wood: new THREE.MeshStandardMaterial({ color: 0x9a5a3c, roughness: 1, flatShading: true }),
|
||||
};
|
||||
const pick = (mat, model) => { const n = mat.name.toLowerCase(); if (n.startsWith('leafs')) return model.startsWith('tree_pine') ? mats.pine : mats.leaf; if (n === 'grass') return mats.grass; if (n === 'dirt') return mats.dirt; if (n.startsWith('wood')) return mats.wood; return mat; };
|
||||
const build = (async () => {
|
||||
const M = Object.fromEntries(await Promise.all(names.map(async (n) => [n, await load(`assets/models/${n}.glb`)])));
|
||||
const put = (name, x, z, s = 1, ry = 0, y = 1) => { const o = M[name].clone(true); o.traverse((m) => { if (m.isMesh) m.material = pick(m.material, name); }); o.position.set(x, y, z); o.scale.setScalar(s); o.rotation.y = ry; island.add(o); return o; };
|
||||
for (let x = -1; x <= 1; x++) for (let z = -1; z <= 1; z++) put('cliff_block_rock', x, z, 1, 0, 0);
|
||||
put('cliff_block_rock', 0, 0, 0.7, 0.4, -0.7);
|
||||
put('tree_oak', -0.95, -0.85, 1.25, 0.3); put('tree_default', 0.2, -1, 1.05, 1.2); put('tree_fat', -1.1, 0.3, 0.95, 2);
|
||||
put('tree_pineRoundA', 1.05, -0.55, 1.1); put('tree_pineRoundC', 1.15, 0.55, 0.9, 0.8);
|
||||
put('tent_smallOpen', 0.15, 0.45, 0.9, -0.5); put('campfire_stones', -0.35, 0.95, 0.8);
|
||||
put('rock_largeA', 0.95, 1.05, 0.55, 1.1); put('rock_smallC', -0.75, 1.15, 0.8);
|
||||
put('grass_large', 0.55, -0.05, 0.8); put('plant_bushLarge', -0.4, -0.05, 0.7, 1.5);
|
||||
put('flower_redA', -1.15, 1.1); put('flower_yellowB', 0.55, 1.15, 1, 1); put('mushroom_redGroup', -0.05, -0.55, 0.8);
|
||||
// 섬 위에 서 있는 구름·물방울 캐릭터 (섬과 함께 돈다)
|
||||
cloudB.group.position.set(-0.85, 1.42, 1.25); cloudB.group.scale.setScalar(0.36); island.add(cloudB.group);
|
||||
dropB.group.position.set(0.9, 1.5, 1.35); dropB.group.scale.setScalar(0.34); island.add(dropB.group);
|
||||
island.position.set(0, -2.6, -118); island.scale.setScalar(2.0); island.rotation.x = 0.05;
|
||||
scene.add(island);
|
||||
})();
|
||||
window.__hf = window.__hf || {}; window.__hf.buildReady = window.__hf.buildReady || {};
|
||||
window.__hf.buildReady.main = build;
|
||||
|
||||
// 타임라인: 하늘·카메라·아이콘 상태 (절대 초). 위에 얹는 글과 같은 박자
|
||||
const tl = gsap.timeline({ paused: true });
|
||||
const at = (pos, dur, vars, ease = 'sine.inOut') => tl.to(S, { ...vars, duration: Math.max(0.01, dur), ease }, pos);
|
||||
// 0~3 새벽에서 낮으로: 해가 뜨고 카메라가 구름을 뚫고 앞으로
|
||||
at(0, 2.6, { rise: 1 }, 'power2.out');
|
||||
at(0, 2.4, { mood: 1, glow: 0.9 });
|
||||
at(3, 0.8, { mood: 2, glow: 0.1 });
|
||||
at(5.9, 0.9, { mood: 1, glow: 0.8 });
|
||||
at(5.6, 0.5, { chars: 0 }, 'power2.in');
|
||||
at(8.5, 5.5, { mood: 3, glow: 1.2 });
|
||||
at(14.3, 1.2, { mood: 4, glow: 0 });
|
||||
at(0, 3, { camZ: -20, camY: 2.2, lookY: 9, elev: 40, azim: 196, turb: 2.0, ray: 2.6, mie: 0.003, exp: 0.36 });
|
||||
at(0.2, 0.8, { pass: 0.85 }); at(1.3, 0.9, { pass: 0 });
|
||||
// 3~6 흐림: 하늘이 탁해지고 비 아이콘
|
||||
at(3, 0.8, { turb: 14, ray: 0.8, mie: 0.02, g: 0.7, cloud: 0.4, exp: 0.26, elev: 18, pass: 0.45 });
|
||||
at(3.2, 0.5, { rain: 1 }, 'back.out(1.5)');
|
||||
at(3, 3, { camZ: -34, lookY: 5 }, 'none');
|
||||
// 6~8.5 맑게 걷히고 섬으로 하강
|
||||
at(5.9, 0.9, { turb: 2.2, ray: 2.6, mie: 0.004, g: 0.8, cloud: 1, exp: 0.38, rain: 0, pass: 0 });
|
||||
at(6, 2.5, { camZ: -103, camY: 1.4, lookY: 3.2, island: 1 }, 'power2.inOut');
|
||||
// 8.5~14.5 섬 주위: 황금빛으로 기울며 세 아이콘이 차례로 뜬다
|
||||
at(8.5, 6, { spin: 1.6, camX: -1.2, lookX: -0.3, camZ: -106, lookY: 3.0 }, 'none');
|
||||
at(8.5, 6, { elev: 2.4, turb: 4.0, ray: 3.2, mie: 0.008, g: 0.93, exp: 0.5 });
|
||||
at(8.8, 0.5, { iconWalk: 1 }, 'back.out(1.6)');
|
||||
at(10.8, 0.5, { iconCamp: 1 }, 'back.out(1.6)');
|
||||
at(12.8, 0.5, { iconSunset: 1 }, 'back.out(1.6)');
|
||||
// 14.5~21 밤: 해가 지고 별이 켜지고 카메라가 위를 본다
|
||||
at(14.3, 1.2, { elev: -9, exp: 0.26, stars: 1, camY: 5, lookY: 13, camX: 0, lookX: 0, iconWalk: 0, iconCamp: 0, iconSunset: 0 });
|
||||
at(15.5, 5.5, { camY: 7, lookY: 16 }, 'none');
|
||||
at(15.0, 0.9, { nightIcons: 1 }, 'back.out(1.4)');
|
||||
at(17.7, 0.7, { charsEnd: 1 }, 'back.out(1.3)');
|
||||
at(17.3, 0.3, { nightIcons: 0 }, 'power2.in');
|
||||
tl.to({}, { duration: 0.1 }, 20.9);
|
||||
|
||||
const warm = new THREE.Color(0xffa060), noon = new THREE.Color(0xffffff), dusk = new THREE.Color(0xff6a6a);
|
||||
const cloudDay = new THREE.Color(0xffffff), cloudGray = new THREE.Color(0x9aa3b5);
|
||||
const tintDay = new THREE.Color(0xffffff), tintDusk = new THREE.Color(0xffb59a), tintNight = new THREE.Color(0x3a4378), cloudTint = new THREE.Color();
|
||||
const C = THREE.MathUtils;
|
||||
|
||||
function renderAt(t) {
|
||||
tl.seek(t, false);
|
||||
camera.position.set(S.camX, S.camY, S.camZ);
|
||||
camera.lookAt(S.camX + S.lookX, S.lookY, S.camZ - 30);
|
||||
const elev = S.elev - (1 - S.rise) * 12;
|
||||
sunDir.setFromSphericalCoords(1, C.degToRad(90 - elev), C.degToRad(S.azim));
|
||||
{ const m = C.clamp(S.mood, 0, 4), i = Math.min(3, Math.floor(m)), f = m - i; domeMat.uniforms.top.value.copy(PAL[i][0]).lerp(PAL[i + 1][0], f); domeMat.uniforms.bottom.value.copy(PAL[i][1]).lerp(PAL[i + 1][1], f); domeMat.uniforms.sun.value.copy(sunDir); domeMat.uniforms.glow.value = S.glow; domeMat.uniforms.glowColor.value.set(m > 2.5 ? '#ffb070' : '#fff1c2'); }
|
||||
renderer.toneMappingExposure = 0.9;
|
||||
const day = C.clamp(elev / 30, 0, 1), low = C.clamp(1 - elev / 12, 0, 1), night = C.clamp(-elev / 6, 0, 1);
|
||||
sunLight.position.copy(sunDir).multiplyScalar(100).add(camera.position); sunLight.target.position.copy(camera.position);
|
||||
sunLight.color.copy(noon).lerp(warm, low).lerp(dusk, C.clamp(-elev / 3, 0, 1));
|
||||
sunLight.intensity = C.clamp((elev + 4) / 10, 0.05, 1) * 2.4;
|
||||
hemi.intensity = 0.35 + day * 1.1; hemi.color.setHSL(0.6 - low * 0.55, 0.5, 0.75 - low * 0.1);
|
||||
cloudTint.copy(tintDay).lerp(tintDusk, low).lerp(tintNight, night);
|
||||
cloudMat.color.copy(cloudDay).lerp(cloudGray, 1 - S.cloud).multiply(cloudTint);
|
||||
passMat.color.copy(cloudMat.color); passMat.opacity = S.pass; passClouds.visible = S.pass > 0.01;
|
||||
fill.position.copy(camera.position).add(new THREE.Vector3(-4, 6, 6)); fill.target.position.copy(island.position); fill.intensity = S.island * (1.6 - night * 0.8);
|
||||
for (const c of [...clouds.children, ...passClouds.children]) c.position.x = c.userData.x + Math.sin(t * 0.05 + c.userData.drift * 9) * c.userData.drift * 6;
|
||||
skyIcons.forEach((s, i) => { const fall = C.clamp(1 - S.rise, 0, 1); s.position.y = s.userData.y + fall * 14 + Math.sin(t * 1.1 + s.userData.phase) * s.userData.amp; s.material.opacity = S.rise * (1 - C.clamp((t - 2.4) / 0.6, 0, 1)); s.material.rotation = Math.sin(t * 0.8 + s.userData.phase) * 0.06; });
|
||||
rainIcon.material.opacity = S.rain; rainIcon.position.y = 6.5 - (1 - S.rain) * 3 + Math.sin(t * 1.3) * 0.15; rainIcon.position.z = S.camZ - 14;
|
||||
// 섬 옆 활동 아이콘: 섬 기준 자리, 카메라 쪽으로 살짝 띄움
|
||||
const ip = island.position;
|
||||
walkIcon.position.set(ip.x - 4.2, ip.y + 5.2 + Math.sin(t * 1.2) * 0.12, ip.z + 2.2); walkIcon.material.opacity = S.iconWalk; walkIcon.scale.setScalar(2.2 * (0.4 + 0.6 * S.iconWalk));
|
||||
campIcon.position.set(ip.x + 4.0, ip.y + 4.8 + Math.sin(t * 1.1 + 1) * 0.12, ip.z + 2.6); campIcon.material.opacity = S.iconCamp; campIcon.scale.setScalar(2.2 * (0.4 + 0.6 * S.iconCamp));
|
||||
sunsetIcon.position.set(ip.x + 0.4, ip.y + 7.6 + Math.sin(t * 0.9 + 2) * 0.12, ip.z + 1.5); sunsetIcon.material.opacity = S.iconSunset; sunsetIcon.scale.setScalar(2.6 * (0.4 + 0.6 * S.iconSunset));
|
||||
NIGHT.forEach((o, i) => { const k = C.clamp(S.nightIcons - i * 0.06, 0, 1); o.material.opacity = k; o.scale.setScalar(o.userData.sc * (0.3 + 0.7 * k)); o.position.set(S.camX + o.userData.x, S.lookY + o.userData.y - 2 + Math.sin(t * 1.1 + o.userData.phase) * 0.15, S.camZ - 30); });
|
||||
// 카메라 앞 구름·물방울 캐릭터: 첫 장면엔 아래 양쪽, 섬 장면엔 화면 밖(아래), 밤엔 다시 올라온다
|
||||
{ const up = Math.max(S.chars, S.nightIcons, S.charsEnd), drop = (1 - up) * 7;
|
||||
cloudA.group.position.set(S.camX - 1.55, S.camY - 1.25 - drop + Math.sin(t * 1.3) * 0.08, S.camZ - 7.5); cloudA.group.scale.setScalar(0.66);
|
||||
dropA.group.position.set(S.camX + 1.6, S.camY - 1.2 - drop + Math.sin(t * 1.3 + 1.7) * 0.08, S.camZ - 7.5); dropA.group.scale.setScalar(0.64);
|
||||
cloudA.group.lookAt(camera.position); dropA.group.lookAt(camera.position);
|
||||
animateChars(cloudA, dropA, t, 0); animateChars(cloudB, dropB, t, 2.1);
|
||||
const warm = C.clamp(S.mood - 2, 0, 1) * (1 - C.clamp(S.mood - 3, 0, 1)), nightK = C.clamp(S.mood - 3, 0, 1);
|
||||
for (const b of [cloudA, cloudB]) { b.uniforms.uTint.value = warm; b.uniforms.uNight.value = nightK; }
|
||||
for (const m of [dropA, dropB]) { m.front.color.copy(JELLY.blue).lerp(JELLY.warm, warm * 0.75).lerp(JELLY.night, nightK * 0.5); m.back.color.copy(m.front.color); }
|
||||
}
|
||||
starMat.opacity = S.stars;
|
||||
island.visible = S.island > 0.01;
|
||||
island.rotation.y = -0.6 + S.spin * 0.9;
|
||||
renderer.render(scene, camera);
|
||||
}
|
||||
|
||||
window.addEventListener('hf-seek', (e) => { e.detail.waitUntil?.(build); renderAt(e.detail.time); });
|
||||
build.then(() => renderAt(0));
|
||||
window.__timelines["main"] = gsap.timeline({ paused: true });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "intro3d",
|
||||
"name": "intro3d",
|
||||
"createdAt": "2026-10-24T10:57:06.229Z"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "intro3d",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "npx --yes hyperframes@0.8.191 preview",
|
||||
"check": "npx --yes hyperframes@0.8.191 check",
|
||||
"render": "npx --yes hyperframes@0.8.191 render",
|
||||
"publish": "npx --yes hyperframes@0.8.191 publish"
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import { execFileSync } from 'node:child_process'
|
||||
import { existsSync, mkdirSync, readFileSync, rmSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
const SLIDES = { tarot: 5, ootd: 6, intro: 8 }
|
||||
const SLIDES = { tarot: 5, ootd: 4, intro: 8 }
|
||||
// 기본 문구가 서비스 데이터 그대로라 Claude 기획이 꼭 필요한 템플릿 (src/cards/templates.tsx autoPlan)
|
||||
const AUTO_PLAN = ['tarot']
|
||||
// src/cards/themes.ts THEMES 의 id
|
||||
|
||||
@@ -30,22 +30,32 @@ const outDir = resolve(`src/assets/${kind}`)
|
||||
mkdirSync(outDir, { recursive: true })
|
||||
const outPath = (id) => join(outDir, `${id}.webp`)
|
||||
|
||||
// 그림 한 장 = { id, 프롬프트 }. ootd 는 구간 × 스타일 × 사람, tarot 은 주제 꾸밈(skin)마다
|
||||
// 그림 한 장 = { id, 프롬프트 }. ootd 는 구간 × 스타일 × 사람 × (옷 4개 | 겉옷까지 5개, id 끝에 -outer), tarot 은 주제 꾸밈(skin)마다
|
||||
const jobs = spec.bands
|
||||
? spec.bands.flatMap((b) =>
|
||||
Object.entries(b.outfits).flatMap(([style, byPersona]) =>
|
||||
Object.entries(byPersona).map(([persona, outfit]) => ({
|
||||
id: `${b.id}-${persona}-${style}`,
|
||||
Object.entries(byPersona).flatMap(([persona, outfit]) =>
|
||||
[false, true].map((withOuter) => ({
|
||||
id: `${b.id}-${persona}-${style}${withOuter ? '-outer' : ''}`,
|
||||
band: b.id,
|
||||
style,
|
||||
prompt: spec.style
|
||||
.replace('{items}', outfit.items)
|
||||
.replace('{items}', withOuter ? `${outfit.items}, (5) ${spec.outers?.[outfit.outer] ?? outfit.outer} as the outer layer` : outfit.items)
|
||||
.replace('{count}', withOuter ? 'five' : 'four')
|
||||
// 카드 이름표 자리(1 왼쪽 위·2 오른쪽 위·3 왼쪽 아래·4 오른쪽 아래·5 위 가운데)와 그림 위치를 맞춘다
|
||||
.replace(
|
||||
'{layout}',
|
||||
withOuter
|
||||
? 'top row from left to right: (1), then (5) the outer layer in the top center, then (2); bottom row: (3) bottom-left and (4) bottom-right. Five clearly separate spots, nothing else in the top center.'
|
||||
: 'a 2x2 grid: (1) top-left, (2) top-right, (3) bottom-left, (4) bottom-right.',
|
||||
)
|
||||
.replace('{persona}', spec.personas[persona].prompt)
|
||||
.replace('{style}', spec.styles[style].prompt)
|
||||
.replace('{trend}', spec.styles[style].trends?.[persona] ?? '')
|
||||
.replace('{layering}', b.layering ?? ''),
|
||||
})),
|
||||
),
|
||||
),
|
||||
)
|
||||
: spec.items.map((it) => ({
|
||||
id: it.id,
|
||||
|
||||
|
After Width: | Height: | Size: 201 KiB |
|
After Width: | Height: | Size: 214 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 125 KiB |
|
After Width: | Height: | Size: 125 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 66 KiB |
@@ -133,7 +133,7 @@
|
||||
top: 350px;
|
||||
left: 80px;
|
||||
width: 920px;
|
||||
height: 840px;
|
||||
height: 800px;
|
||||
border-radius: 44px;
|
||||
overflow: hidden;
|
||||
background: var(--stage);
|
||||
@@ -156,6 +156,29 @@
|
||||
.ootd-labels span:nth-child(even) {
|
||||
justify-self: end;
|
||||
}
|
||||
/* 그림 아래 옷 목록: 그림 속 위치에 기대지 않고 따로 적는다 */
|
||||
.ootd-items {
|
||||
position: absolute;
|
||||
top: 1168px;
|
||||
left: 80px;
|
||||
right: 80px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.ootd-items li {
|
||||
padding: 8px 18px;
|
||||
border-radius: 99px;
|
||||
background: #fff;
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
box-shadow: 0 6px 16px #28304a1f;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.ootd-labels span {
|
||||
padding: 8px 20px;
|
||||
border-radius: 99px;
|
||||
@@ -454,7 +477,7 @@
|
||||
position: absolute;
|
||||
left: 80px;
|
||||
right: 80px;
|
||||
bottom: 64px;
|
||||
bottom: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 18px;
|
||||
@@ -526,8 +549,8 @@
|
||||
z-index: 2;
|
||||
filter: drop-shadow(0 18px 14px #28304a22);
|
||||
}
|
||||
.intro-cover .rabbit { left: 250px; top: 810px; transform: rotate(-9deg); }
|
||||
.intro-cover .bear { right: 235px; top: 830px; transform: rotate(8deg); }
|
||||
.intro-cover .char-cloud { width: 440px; height: 440px; left: 90px; top: 700px; transform: rotate(-6deg); }
|
||||
.intro-cover .char-drop { width: 420px; height: 420px; right: 90px; top: 730px; transform: rotate(6deg); }
|
||||
.intro .intro-turn {
|
||||
position: absolute;
|
||||
bottom: 90px;
|
||||
@@ -581,22 +604,28 @@
|
||||
.intro-sky .intro-title { top: 205px; }
|
||||
.intro-home .intro-sub,
|
||||
.intro-sky .intro-sub { top: 450px; font-size: 42px; }
|
||||
.intro-phone {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
width: 390px;
|
||||
height: 844px;
|
||||
box-sizing: border-box;
|
||||
padding: 12px;
|
||||
border: 8px solid var(--ink);
|
||||
border-radius: 44px;
|
||||
background: var(--ink);
|
||||
box-shadow: 0 18px 0 var(--soft), 0 30px 58px #28304a28;
|
||||
}
|
||||
/* 스크린샷은 자르지 않고 베젤 안에 통째로 (가장자리 칩이 테두리·둥근 모서리에 먹히지 않게) */
|
||||
.intro-phone img { display: block; width: 100%; height: auto; border-radius: 26px; }
|
||||
.intro-phone.home,
|
||||
.intro-phone.sky { top: 620px; left: 345px; }
|
||||
/* 3D 릴스 스틸 무대: 둥근 모서리, 폰 틀 없음 */
|
||||
.intro-stage { position: absolute; left: 90px; top: 600px; width: 900px; height: 620px; overflow: hidden; border-radius: 48px; box-shadow: 0 24px 60px #28304a2e; }
|
||||
.intro-stage > img:first-child { display: block; width: 100%; height: 100%; object-fit: cover; }
|
||||
/* 낮·노을 스틸은 왼쪽 위 발자국 아이콘이 걸리지 않게 왼쪽 190px를 잘라 낸다 */
|
||||
.intro-stage.home > img:first-child { position: absolute; width: 1092px; max-width: none; height: auto; left: -194px; top: -271px; }
|
||||
.intro-stage.sky > img:first-child { position: absolute; width: 1098px; max-width: none; height: auto; left: -198px; top: -273px; }
|
||||
.intro-stage.cta { top: 640px; height: 560px; }
|
||||
.intro-stage .intro-app { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; margin: -130px 0 0 -130px; border-radius: 60px; box-shadow: 0 24px 60px #0a0e2866; }
|
||||
.intro-rank { position: absolute; left: 36px; right: 36px; bottom: 24px; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
|
||||
.intro-rank li { display: flex; align-items: center; gap: 14px; padding: 8px 22px 8px 14px; border-radius: 22px; background: #ffffffee; color: var(--ink); font: 800 34px/1 'Pretendard Variable', Pretendard, sans-serif; letter-spacing: -1px; }
|
||||
.intro-rank em { font-style: normal; font-size: 30px; color: var(--muted); min-width: 56px; }
|
||||
.intro-rank img { width: 52px; height: 52px; }
|
||||
.intro-rank b { margin-left: auto; font-size: 44px; color: var(--rust); }
|
||||
.intro-chips { position: absolute; left: 36px; top: 36px; display: flex; flex-direction: column; gap: 12px; }
|
||||
.intro-chips span { display: inline-flex; align-items: center; gap: 12px; width: max-content; padding: 14px 26px 14px 16px; border-radius: 24px; background: #ffffffee; color: var(--ink); font: 800 40px/1 'Pretendard Variable', Pretendard, sans-serif; letter-spacing: -1px; }
|
||||
.intro-chips img { width: 56px; height: 56px; }
|
||||
.intro-features { position: absolute; left: 90px; top: 600px; width: 900px; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 22px; }
|
||||
.intro-features li { display: grid; grid-template-columns: 150px 1fr; grid-template-rows: auto auto; column-gap: 24px; align-items: center; padding: 22px 30px; border-radius: 32px; background: #ffffffcc; box-shadow: 0 12px 32px #28304a1a; }
|
||||
.intro-features img { grid-row: 1 / 3; width: 130px; height: 130px; object-fit: contain; }
|
||||
.intro-features b { font: 800 50px/1.15 'Pretendard Variable', Pretendard, sans-serif; letter-spacing: -1px; color: var(--ink); }
|
||||
.intro-features span { font: 600 36px/1.3 'Pretendard Variable', Pretendard, sans-serif; color: var(--muted); }
|
||||
.intro-home .intro-note, .intro-sky .intro-note { left: 240px; right: 240px; top: 1262px; font-size: 32px; text-align: center; color: var(--muted); }
|
||||
.intro-kinds .intro-title { top: 205px; font-size: 88px; }
|
||||
.intro-gak-grid {
|
||||
position: absolute;
|
||||
@@ -624,7 +653,7 @@
|
||||
.intro-more .intro-sub { top: 455px; font-size: 44px; }
|
||||
.intro-more-icons { position: absolute; top: 750px; left: 90px; display: flex; flex-direction: column; gap: 34px; }
|
||||
.intro-more-icons img { width: 105px; height: 105px; object-fit: contain; }
|
||||
.intro-phone.week { top: 705px; left: 510px; width: 275px; height: 595px; border-width: 6px; border-radius: 34px; }
|
||||
.intro-more-icons { display: none; }
|
||||
.intro .intro-note {
|
||||
position: absolute;
|
||||
left: 80px;
|
||||
@@ -633,10 +662,8 @@
|
||||
letter-spacing: -1px;
|
||||
word-break: keep-all;
|
||||
}
|
||||
.intro-more .intro-note { top: 1205px; width: 880px; z-index: 2; padding: 12px 18px; border-radius: 18px; background: var(--paper); }
|
||||
.intro-more .intro-note { top: 1240px; font-size: 34px; color: var(--muted); }
|
||||
.intro-cta .intro-title { top: 220px; font-size: 105px; }
|
||||
.intro-cta .intro-sub { top: 470px; font-size: 48px; color: var(--rust); }
|
||||
.intro-phone.gak { top: 650px; left: 370px; width: 280px; height: 560px; border-width: 6px; border-radius: 34px; }
|
||||
.intro-cta .rabbit { width: 175px; height: 175px; left: 155px; top: 925px; transform: rotate(-8deg); }
|
||||
.intro-cta .bear { width: 175px; height: 175px; right: 160px; top: 950px; transform: rotate(8deg); }
|
||||
.intro-cta .intro-note { left: 240px; right: 240px; text-align: center; }
|
||||
.intro-cta .intro-note { top: 1250px; font-size: 36px; text-align: center; }
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { CardData } from './data'
|
||||
import { gakArt } from './gaks'
|
||||
import { hasTarotBg } from './templates'
|
||||
import { ootdBand, ootdOutfits } from './ootd'
|
||||
import { needsOuter, ootdOutfits } from './ootd'
|
||||
import type { Copy } from './templates'
|
||||
|
||||
export type ImageNeed = { kind: string; ids: string[] }
|
||||
@@ -9,11 +9,9 @@ export type ImageNeed = { kind: string; ids: string[] }
|
||||
/** 이 카드에 필요한 그림 중 아직 없는 것 (all 이면 전부). kind 는 image-prompts/<kind>.json, 그날 필요한 것만 Codex로 만든다. 타로는 그날 뽑힌 각 카드 그림 */
|
||||
export function neededImages(templateId: string, d: CardData, copy: Copy, all = false): ImageNeed[] {
|
||||
if (templateId === 'ootd') {
|
||||
const style = copy.style || 'casual'
|
||||
const band = ootdBand(d.maxC).id
|
||||
const ids = ootdOutfits(d.maxC, style)
|
||||
const ids = ootdOutfits(d.maxC, copy.style, undefined, needsOuter(d.maxC, d.morningC))
|
||||
.filter((o) => all || !o.image)
|
||||
.map((o) => `${band}-${o.persona}-${style}`)
|
||||
.map((o) => o.imageId)
|
||||
return ids.length ? [{ kind: 'ootd', ids }] : []
|
||||
}
|
||||
if (templateId === 'tarot') {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import spec from '../../image-prompts/ootd.json'
|
||||
|
||||
/** 낮 최고기온 구간 × 스타일 × 사람별 옷. 옷 목록·카드 글자는 image-prompts/ootd.json 한 곳에서 정한다.
|
||||
* 그림은 src/assets/ootd/<구간>-<사람>-<스타일>.webp 가 있으면 자동으로 붙는다 (npm run gen-image -- ootd <구간|스타일>) */
|
||||
export type Outfit = { persona: string; label: string; labels: string[]; outer: string; image?: string }
|
||||
* 그림은 src/assets/ootd/<구간>-<사람>-<스타일>.webp 가 있으면 자동으로 붙는다 (npm run gen-image -- ootd <구간|스타일>).
|
||||
* 일교차가 크면(OUTER_GAP_C 이상) 겉옷을 5번째 옷으로 그린 <구간>-<사람>-<스타일>-outer.webp 를 쓰고 이름표에도 겉옷을 더한다 */
|
||||
export type Outfit = { persona: string; label: string; labels: string[]; outer: string; imageId: string; image?: string }
|
||||
export type OotdBand = { id: string; from: number }
|
||||
|
||||
const IMAGES = import.meta.glob<string>('../assets/ootd/*.webp', { eager: true, import: 'default' })
|
||||
@@ -18,17 +19,29 @@ export const styleLabel = (id?: string) => spec.styles[styleOf(id)].label
|
||||
|
||||
export const OOTD_BANDS: OotdBand[] = spec.bands.map((b) => ({ id: b.id, from: b.from }))
|
||||
|
||||
/** 아침·낮 기온 차가 이만큼이면 겉옷까지 보여 준다 (카드 날씨 줄의 '일교차 커요'와 같은 기준) */
|
||||
export const OUTER_GAP_C = 8
|
||||
export const needsOuter = (maxC: number, morningC: number) => maxC - morningC >= OUTER_GAP_C
|
||||
|
||||
export function ootdBand(maxC: number) {
|
||||
return OOTD_BANDS.find((b) => maxC >= b.from) ?? OOTD_BANDS[OOTD_BANDS.length - 1]
|
||||
}
|
||||
|
||||
/** 그 구간·스타일의 6명 옷 */
|
||||
/** 그 구간·스타일의 6명 옷. bandId 를 주면 기온 대신 그 구간 (예시 카드용) */
|
||||
export function ootdOutfits(maxC: number, style?: string, bandId?: string): Outfit[] {
|
||||
/** 그 구간·스타일의 사람별 옷. bandId 를 주면 기온 대신 그 구간 (예시 카드용). withOuter 면 겉옷 포함 그림·이름표 */
|
||||
export function ootdOutfits(maxC: number, style?: string, bandId?: string, withOuter = false): Outfit[] {
|
||||
const band = spec.bands.find((b) => b.id === (bandId || ootdBand(maxC).id))!
|
||||
const st = styleOf(style)
|
||||
return PERSONAS.map((p) => {
|
||||
const o = band.outfits[st][p]
|
||||
return { persona: p, label: spec.personas[p].label, labels: o.labels, outer: o.outer, image: IMAGES[`../assets/ootd/${band.id}-${p}-${st}.webp`] }
|
||||
const imageId = `${band.id}-${p}-${st}${withOuter ? '-outer' : ''}`
|
||||
return {
|
||||
persona: p,
|
||||
label: spec.personas[p].label,
|
||||
// 그림 윗줄 순서(상의 · 겉옷 · 하의)와 같게 겉옷을 두 번째에
|
||||
labels: withOuter ? [o.labels[0], o.outer, ...o.labels.slice(1)] : o.labels,
|
||||
outer: o.outer,
|
||||
imageId,
|
||||
image: IMAGES[`../assets/ootd/${imageId}.webp`],
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import tarotBack from '../assets/tarot-back.webp'
|
||||
import shotHome from '../assets/intro/shot-home.webp'
|
||||
import shotGak from '../assets/intro/shot-gak.webp'
|
||||
import shotSky from '../assets/intro/shot-sky.webp'
|
||||
import shotWeek from '../assets/intro/shot-week.webp'
|
||||
import stillDay from '../assets/intro/still-day.webp'
|
||||
import cloudChar from '../assets/intro/cloud-char.webp'
|
||||
import dropChar from '../assets/intro/drop-char.webp'
|
||||
import stillSunset from '../assets/intro/still-sunset.webp'
|
||||
import stillNight from '../assets/intro/still-night.webp'
|
||||
import type { CardData } from './data'
|
||||
import { Frame, Lines } from './Frame'
|
||||
import { tidy } from './text'
|
||||
import { DEFAULT_STYLE, ootdBand, ootdOutfits, styleLabel } from './ootd'
|
||||
import { DEFAULT_STYLE, needsOuter, ootdBand, ootdOutfits, styleLabel } from './ootd'
|
||||
import { gakArt, gakByCode } from './gaks'
|
||||
|
||||
// 대주제(skin)마다 한 번 만든 배경 그림 (npm run gen-image -- tarot-bg <skin>). 없으면 민무늬 배경
|
||||
@@ -45,11 +46,12 @@ export type Template = {
|
||||
const ootd: Template = {
|
||||
id: 'ootd',
|
||||
name: '오늘의 코디',
|
||||
about: '캐주얼·세미정장·정장·스트릿·꾸안꾸 중 하나 · 20대·30대·40대~ 여자·남자 6장 · 서울 낮 최고기온 구간별',
|
||||
about: '캐주얼·세미정장·정장·스트릿·꾸안꾸 중 하나 · 20-30대·40대~ 여자·남자 4장 · 서울 낮 최고기온 구간별',
|
||||
how: [
|
||||
'서울(중구) 오늘 예보의 아침 6시~밤 9시 중 가장 높은 기온으로 7개 구간(28도 이상 · 23 · 17 · 12 · 9 · 5 · 그 아래) 중 하나를 고른다.',
|
||||
'스타일(캐주얼·세미정장·정장·스트릿·꾸안꾸)을 고르면 바로 그 옷으로 바뀐다. Claude 기획은 쓰지 않는다.',
|
||||
'구간 × 스타일 × 사람(20대·30대·40대~ 여자·남자)마다 옷 4가지가 image-prompts/ootd.json에 정해져 있고, 같은 파일의 문장으로 Codex가 그린 그림(src/assets/ootd/<구간>-<사람>-<스타일>.webp)을 붙인다. 그림이 없으면 옷 이름만 나간다.',
|
||||
'구간 × 스타일 × 사람(20-30대·40대~ 여자·남자)마다 옷 4가지가 image-prompts/ootd.json에 정해져 있고, 같은 파일의 문장으로 Codex가 그린 그림(src/assets/ootd/<구간>-<사람>-<스타일>.webp)을 붙인다. 그림이 없으면 옷 이름만 나간다.',
|
||||
'아침·낮 기온 차가 8도 이상이면 겉옷을 5번째 옷으로 그린 그림(<구간>-<사람>-<스타일>-outer.webp)을 쓰고 이름표에도 겉옷을 더한다.',
|
||||
'카드에 지역 이름은 넣지 않는다.',
|
||||
],
|
||||
fields: [{ key: 'title', label: '제목 (사람·스타일 뒤에 붙음)' }],
|
||||
@@ -63,27 +65,37 @@ const ootd: Template = {
|
||||
hashtags: '#날씨각 #오늘의코디 #OOTD #데일리룩 #옷차림 #코디추천 #날씨 #오늘날씨 #서울날씨 #일상',
|
||||
}),
|
||||
warnings: (d, c) => {
|
||||
const missing = ootdOutfits(d.maxC, c.style).filter((o) => !o.image)
|
||||
const missing = ootdOutfits(d.maxC, c.style, undefined, needsOuter(d.maxC, d.morningC)).filter((o) => !o.image)
|
||||
const id = `${ootdBand(d.maxC).id}`
|
||||
return missing.length
|
||||
? [`낮 최고 ${d.maxC}도 · ${styleLabel(c.style)}에 ${missing.map((o) => o.label).join(', ')} 옷 그림이 아직 없어요. 옷 이름만 나갑니다. (npm run gen-image -- ootd ${id} ${c.style ?? DEFAULT_STYLE})`]
|
||||
: []
|
||||
},
|
||||
slides: (d, c) =>
|
||||
ootdOutfits(d.maxC, c.style, c.band).map((o, i, all) => (
|
||||
ootdOutfits(d.maxC, c.style, c.band, needsOuter(d.maxC, d.morningC)).map((o, i, all) => (
|
||||
<Frame page={i} total={all.length} theme={c.theme} className="ootd" key={o.persona}>
|
||||
<p className="meta">{d.dateLabel} · 오늘의 코디</p>
|
||||
<h1 className="ootd-title">
|
||||
<Lines text={`*${o.label}* ${styleLabel(c.style)}${c.title ? ` ${c.title}` : ''}`} />
|
||||
</h1>
|
||||
<div className="ootd-stage">
|
||||
{o.image ? <img src={o.image} alt="" /> : null}
|
||||
<div className={o.image ? 'ootd-labels' : 'ootd-labels only'}>
|
||||
{o.image ? (
|
||||
<img src={o.image} alt="" />
|
||||
) : (
|
||||
<div className="ootd-labels only">
|
||||
{o.labels.map((l) => (
|
||||
<span key={l}>{l}</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{o.image ? (
|
||||
<ul className="ootd-items">
|
||||
{o.labels.map((l) => (
|
||||
<li key={l}>{l}</li>
|
||||
))}
|
||||
</ul>
|
||||
) : null}
|
||||
<p className="ootd-weather">
|
||||
<img src={iconUrl(d.rainy ? 'rain' : d.maxC - d.morningC >= 8 ? 'sun_cloud' : 'sun')} alt="" />
|
||||
<span>
|
||||
@@ -270,7 +282,8 @@ const intro: Template = {
|
||||
hashtags: '#날씨각 #날씨 #오늘날씨 #날씨앱 #앱인토스 #토스 #오늘뭐하지 #주말뭐하지 #노을 #노을맛집 #한강 #드라이브 #산책 #날씨타로 #오늘의코디 #서울날씨 #주말나들이 #가을 #일상',
|
||||
}),
|
||||
slides: (_d, c) => {
|
||||
const phone = (src: string, name: string) => <div className={`intro-phone ${name}`}><img src={src} alt="" /></div>
|
||||
// 3D 릴스 장면 스틸을 둥근 무대에 (폰 프레임·앱 스크린샷은 쓰지 않는다)
|
||||
const stage = (src: string, name: string, children?: ReactNode) => <div className={`intro-stage ${name}`}><img src={src} alt="" />{children}</div>
|
||||
const head = (text: string, name = '') => <h1 className={`intro-title ${name}`}><Lines text={tidy(text)} /></h1>
|
||||
const sub = (text: string, name = '') => <p className={`intro-sub ${name}`}><Lines text={tidy(text)} /></p>
|
||||
const frame = (page: number, className: string, children: ReactNode) => <Frame page={page} total={8} theme={c.theme || 'sky'} className={`intro intro-${className}`} key={page}>{children}</Frame>
|
||||
@@ -278,8 +291,8 @@ const intro: Template = {
|
||||
frame(0, 'cover', <>
|
||||
{head(c.t1)}{sub(c.s1)}
|
||||
<div className="intro-cover-stage" aria-hidden="true" />
|
||||
<img className="intro-character rabbit" src={iconUrl('rabbit')} alt="" />
|
||||
<img className="intro-character bear" src={iconUrl('bear')} alt="" />
|
||||
<img className="intro-character char-cloud" src={cloudChar} alt="" />
|
||||
<img className="intro-character char-drop" src={dropChar} alt="" />
|
||||
<p className="intro-turn">넘겨 보세요 →</p>
|
||||
</>),
|
||||
frame(1, 'problem', <>
|
||||
@@ -297,7 +310,17 @@ const intro: Template = {
|
||||
</div>
|
||||
{sub(c.s3)}
|
||||
</>),
|
||||
frame(3, 'home', <>{head(c.t4)}{sub(c.s4)}{phone(shotHome, 'home')}</>),
|
||||
frame(3, 'home', <>
|
||||
{head(c.t4)}{sub(c.s4)}
|
||||
{stage(stillDay, 'home', (
|
||||
<ol className="intro-rank">
|
||||
{[['한강각', 84, 'hangang'], ['드라이브각', 82, 'drive'], ['산책각', 79, 'walk']].map(([n, v, ic], i) => (
|
||||
<li key={n}><em>{i + 1}위</em><img src={iconUrl(String(ic))} alt="" /><span>{n}</span><b>{v}</b></li>
|
||||
))}
|
||||
</ol>
|
||||
))}
|
||||
<p className="intro-note">10.24 서울 중구 · 실제 점수</p>
|
||||
</>),
|
||||
frame(4, 'kinds', <>
|
||||
{head(c.t5)}
|
||||
<div className="intro-gak-grid">
|
||||
@@ -308,18 +331,28 @@ const intro: Template = {
|
||||
</div>
|
||||
{sub(c.s5)}
|
||||
</>),
|
||||
frame(5, 'sky', <>{head(c.t6)}{sub(c.s6)}{phone(shotSky, 'sky')}</>),
|
||||
frame(5, 'sky', <>
|
||||
{head(c.t6)}{sub(c.s6)}
|
||||
{stage(stillSunset, 'sky', (
|
||||
<div className="intro-chips">
|
||||
<span><img src={iconUrl('sunset')} alt="" />노을 피크 18:04</span>
|
||||
<span>골든아워 17:08 ~ 17:44</span>
|
||||
</div>
|
||||
))}
|
||||
<p className="intro-note">10.24 서울 마포구 기준</p>
|
||||
</>),
|
||||
frame(6, 'more', <>
|
||||
{head(c.t7)}{sub(c.s7)}
|
||||
<div className="intro-more-icons" aria-hidden="true"><img src={iconUrl('maple')} alt="" /><img src={iconUrl('camping')} alt="" /><img src={iconUrl('walk')} alt="" /></div>
|
||||
{phone(shotWeek, 'week')}
|
||||
<ul className="intro-features">
|
||||
<li><img src={iconUrl('party')} alt="" /><b>주말 행사</b><span>이번 주말 가까운 축제</span></li>
|
||||
<li><img src={iconUrl('maple')} alt="" /><b>단풍·계절</b><span>절정 시기와 계절 상식</span></li>
|
||||
<li><img src={iconUrl('letter')} alt="" /><b>동네 이야기</b><span>우리 동네 날씨 한마디</span></li>
|
||||
</ul>
|
||||
<p className="intro-note"><Lines text={tidy(c.n7)} /></p>
|
||||
</>),
|
||||
frame(7, 'cta', <>
|
||||
{head(c.t8)}{sub(c.s8)}
|
||||
{phone(shotGak, 'gak')}
|
||||
<img className="intro-character rabbit" src={iconUrl('rabbit')} alt="" />
|
||||
<img className="intro-character bear" src={iconUrl('bear')} alt="" />
|
||||
{stage(stillNight, 'cta', <img className="intro-app" src="/apple-touch-icon.png" alt="" />)}
|
||||
<p className="intro-note"><Lines text={tidy(c.n8)} /></p>
|
||||
</>),
|
||||
]
|
||||
|
||||
@@ -360,6 +360,7 @@ class User(Base):
|
||||
color: Mapped[str] = mapped_column(String(20), default="orange")
|
||||
mood: Mapped[Optional[str]] = mapped_column(String(20), nullable=True)
|
||||
status: Mapped[int] = mapped_column(SmallInteger, default=1)
|
||||
terms_agreed_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), nullable=True)
|
||||
token_version: Mapped[int] = mapped_column(SmallInteger, default=1)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
@@ -400,10 +401,29 @@ class Comment(Base):
|
||||
region_name: Mapped[Optional[str]] = mapped_column(String(20), nullable=True)
|
||||
body: Mapped[str] = mapped_column(String(60))
|
||||
like_count: Mapped[int] = mapped_column(Integer, default=0)
|
||||
report_count: Mapped[int] = mapped_column(Integer, default=0)
|
||||
is_hidden: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
deleted: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
|
||||
|
||||
class CommentReport(Base):
|
||||
__tablename__ = "comment_report"
|
||||
|
||||
comment_id: Mapped[int] = mapped_column(BigInteger, primary_key=True)
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True)
|
||||
reason: Mapped[int] = mapped_column(SmallInteger)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
|
||||
class UserBlock(Base):
|
||||
__tablename__ = "user_block"
|
||||
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True)
|
||||
blocked_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
|
||||
class CommentLike(Base):
|
||||
__tablename__ = "comment_like"
|
||||
|
||||
@@ -472,9 +492,3 @@ class TalkReport(Base):
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
|
||||
class UserBlock(Base):
|
||||
__tablename__ = "user_block"
|
||||
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True)
|
||||
blocked_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
@@ -25,6 +25,7 @@ class ErrorType(Enum):
|
||||
AUTH_FAILED = 4002
|
||||
AUTH_DUPLICATE_ID = 4003
|
||||
AUTH_TOKEN_INVALID = 4004
|
||||
TERMS_REQUIRED = 4005
|
||||
|
||||
|
||||
class Sky(CodeEnum):
|
||||
@@ -191,3 +192,10 @@ class CardStatus(CodeEnum):
|
||||
class AuthProvider(CodeEnum):
|
||||
LOCAL = 1
|
||||
GOOGLE = 2
|
||||
|
||||
|
||||
class ReportReason(CodeEnum):
|
||||
ABUSE = 1
|
||||
AD = 2
|
||||
PRIVACY = 3
|
||||
OTHER = 4
|
||||
@@ -2,13 +2,15 @@ import uuid
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from sqlalchemy import delete, func, select, update
|
||||
from sqlalchemy import delete, func, or_, select, update
|
||||
from sqlalchemy.dialects.postgresql import insert
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from common.database.model.models import Comment, CommentLike, CommentLikeAnon, Post, PostLike, PostLikeAnon, PostSave, User
|
||||
from common.database.model.models import Comment, CommentLike, CommentLikeAnon, CommentReport, Post, PostLike, PostLikeAnon, PostSave, User, UserBlock
|
||||
from common.liker import Liker
|
||||
|
||||
HIDE_AT = 3 # 신고가 이만큼 쌓이면 모두에게서 숨긴다
|
||||
|
||||
|
||||
async def toggle_like_row(s: AsyncSession, who: Liker, member: type, anon: type, id_name: str, id_value: int, on: bool) -> bool:
|
||||
"""로그인했으면 member 표에 user_id 로, 아니면 anon 표에 ip_hash 로 넣거나 지운다. 실제로 바뀌었으면 True."""
|
||||
@@ -52,9 +54,16 @@ class ReactionCRUD:
|
||||
stmt = stmt.where(Post.post_id < cursor)
|
||||
return list((await s.execute(stmt.order_by(Post.post_id.desc()).limit(limit))).all())
|
||||
|
||||
async def comments(self, s: AsyncSession, post_id: int, cursor: Optional[int], limit: int) -> list[tuple[Comment, Optional[str], Optional[str], Optional[str], Optional[str]]]:
|
||||
"""로그인 없이 쓴 댓글은 User 칸이 모두 None 이다."""
|
||||
stmt = select(Comment, User.nickname, User.character, User.color, User.mood).outerjoin(User, User.user_id == Comment.user_id).where(Comment.post_id == post_id, Comment.deleted.is_(False))
|
||||
async def comments(self, s: AsyncSession, post_id: int, viewer: Optional[uuid.UUID], cursor: Optional[int], limit: int) -> list[tuple[Comment, Optional[str], Optional[str], Optional[str], Optional[str]]]:
|
||||
"""로그인 없이 쓴 댓글은 User 칸이 모두 None 이다. 숨긴 댓글은 빼고, 보는 사람이 신고한 댓글·차단한 사람의 댓글도 뺀다."""
|
||||
stmt = select(Comment, User.nickname, User.character, User.color, User.mood).outerjoin(User, User.user_id == Comment.user_id).where(
|
||||
Comment.post_id == post_id, Comment.deleted.is_(False), Comment.is_hidden.is_(False)
|
||||
)
|
||||
if viewer is not None:
|
||||
stmt = stmt.where(
|
||||
Comment.comment_id.not_in(select(CommentReport.comment_id).where(CommentReport.user_id == viewer)),
|
||||
or_(Comment.user_id.is_(None), Comment.user_id.not_in(select(UserBlock.blocked_id).where(UserBlock.user_id == viewer))),
|
||||
)
|
||||
if cursor is not None:
|
||||
stmt = stmt.where(Comment.comment_id > cursor)
|
||||
return list((await s.execute(stmt.order_by(Comment.comment_id).limit(limit))).all())
|
||||
@@ -81,18 +90,61 @@ class ReactionCRUD:
|
||||
owner = Comment.user_id == who.user_id if who.user_id is not None else (Comment.user_id.is_(None) & (Comment.ip_hash == who.ip_hash))
|
||||
res = await s.execute(
|
||||
update(Comment).where(Comment.comment_id == comment_id, owner, Comment.deleted.is_(False))
|
||||
.values(deleted=True).returning(Comment.post_id)
|
||||
.values(deleted=True).returning(Comment.post_id, Comment.is_hidden)
|
||||
)
|
||||
post_id = res.scalar()
|
||||
if post_id is None:
|
||||
row = res.first()
|
||||
if row is None:
|
||||
return False
|
||||
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count - 1))
|
||||
# 숨긴 댓글은 이미 댓글 수에서 빠져 있다
|
||||
if not row.is_hidden:
|
||||
await s.execute(update(Post).where(Post.post_id == row.post_id).values(comment_count=Post.comment_count - 1))
|
||||
return True
|
||||
|
||||
async def toggle_comment_like(self, s: AsyncSession, comment_id: int, who: Liker, on: bool) -> Optional[int]:
|
||||
exists = await s.scalar(select(Comment.comment_id).where(Comment.comment_id == comment_id, Comment.deleted.is_(False)))
|
||||
exists = await s.scalar(select(Comment.comment_id).where(Comment.comment_id == comment_id, Comment.deleted.is_(False), Comment.is_hidden.is_(False)))
|
||||
if exists is None:
|
||||
return None
|
||||
if await toggle_like_row(s, who, CommentLike, CommentLikeAnon, "comment_id", comment_id, on):
|
||||
await s.execute(update(Comment).where(Comment.comment_id == comment_id).values(like_count=Comment.like_count + (1 if on else -1)))
|
||||
return await s.scalar(select(Comment.like_count).where(Comment.comment_id == comment_id))
|
||||
|
||||
async def comment_author(self, s: AsyncSession, comment_id: int):
|
||||
"""지금 보이는 댓글이면 (comment_id, user_id) 행, 없으면 None. 로그인 없이 쓴 댓글은 user_id 가 None."""
|
||||
return (await s.execute(select(Comment.comment_id, Comment.user_id).where(Comment.comment_id == comment_id, Comment.deleted.is_(False), Comment.is_hidden.is_(False)))).first()
|
||||
|
||||
async def report_comment(self, s: AsyncSession, comment_id: int, user_id: uuid.UUID, reason: int) -> None:
|
||||
"""같은 사람이 두 번 신고해도 한 번만 센다. HIDE_AT 건이 되면 숨기고 댓글 수에서 뺀다."""
|
||||
res = await s.execute(insert(CommentReport).values(comment_id=comment_id, user_id=user_id, reason=reason).on_conflict_do_nothing().returning(CommentReport.comment_id))
|
||||
if res.first() is None:
|
||||
return
|
||||
await s.execute(update(Comment).where(Comment.comment_id == comment_id).values(report_count=Comment.report_count + 1))
|
||||
res = await s.execute(
|
||||
update(Comment).where(Comment.comment_id == comment_id, Comment.report_count >= HIDE_AT, Comment.is_hidden.is_(False), Comment.deleted.is_(False))
|
||||
.values(is_hidden=True).returning(Comment.post_id)
|
||||
)
|
||||
post_id = res.scalar()
|
||||
if post_id is not None:
|
||||
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count - 1))
|
||||
|
||||
async def set_hidden(self, s: AsyncSession, comment_id: int, hidden: bool) -> bool:
|
||||
"""운영자가 댓글을 숨기거나 되살린다. 실제로 바뀌었을 때만 댓글 수를 고친다."""
|
||||
res = await s.execute(
|
||||
update(Comment).where(Comment.comment_id == comment_id, Comment.is_hidden.is_(not hidden), Comment.deleted.is_(False))
|
||||
.values(is_hidden=hidden).returning(Comment.post_id)
|
||||
)
|
||||
post_id = res.scalar()
|
||||
if post_id is None:
|
||||
return False
|
||||
await s.execute(update(Post).where(Post.post_id == post_id).values(comment_count=Post.comment_count + (-1 if hidden else 1)))
|
||||
return True
|
||||
|
||||
async def block(self, s: AsyncSession, user_id: uuid.UUID, blocked_id: uuid.UUID) -> None:
|
||||
await s.execute(insert(UserBlock).values(user_id=user_id, blocked_id=blocked_id).on_conflict_do_nothing())
|
||||
|
||||
async def unblock(self, s: AsyncSession, user_id: uuid.UUID, blocked_id: uuid.UUID) -> bool:
|
||||
res = await s.execute(delete(UserBlock).where(UserBlock.user_id == user_id, UserBlock.blocked_id == blocked_id).returning(UserBlock.blocked_id))
|
||||
return res.first() is not None
|
||||
|
||||
async def blocked(self, s: AsyncSession, user_id: uuid.UUID) -> list[User]:
|
||||
stmt = select(User).join(UserBlock, UserBlock.blocked_id == User.user_id).where(UserBlock.user_id == user_id).order_by(UserBlock.created_at.desc())
|
||||
return list((await s.scalars(stmt)).all())
|
||||