docs(skill): fix reference code examples, contradictions and stale platform facts

Apply 96 verified audit findings plus primary-source research: corrected CSS/JS/three.js examples, cross-doc consistency, webstatus.dev-verified platform status, revert-on-regression and independent-review rules, new antipattern candidates, gallery link status. Interview gate timing unchanged.
This commit is contained in:
Yun Chan 2026-10-09 18:18:58 +09:00
parent eecd3f03ff
commit 48ca43985f
36 changed files with 319 additions and 172 deletions

View file

@ -69,12 +69,17 @@
```
```css
:root { --safe-top: env(safe-area-inset-top, 0px); /* 하·좌·우 동일 */ }
:root {
--safe-top: env(safe-area-inset-top, 0px);
--safe-right: env(safe-area-inset-right, 0px);
--safe-bottom: env(safe-area-inset-bottom, 0px);
--safe-left: env(safe-area-inset-left, 0px);
}
.bottom-nav { padding-bottom: max(8px, var(--safe-bottom)); }
.appbar { padding-top: max(0px, var(--safe-top)); }
```
`env()` 는 `viewport-fit=cover` 없이는 0으로 굳는다. 패딩에 더할 때는 `max(기존값, safe)` — safe가 0인 기기에서 기존 리듬이 살아야 한다. **주의: 토큰 블록(`:root {}`) 안에 넣어야 한다.** 블록 밖에 부착하는 실수가 있었다(무시되고 조용히 죽는다).
`env()` 는 `viewport-fit=cover` 없이는 0으로 굳는다. 패딩에 더할 때는 `max(기존값, safe)` — safe가 0인 기기에서 기존 리듬이 살아야 한다. **주의: 선언은 반드시 규칙 블록(`:root {}` 등) 안에 둔다.** 블록 밖에 부착한 선언은 무시되고 조용히 죽는다(실측 사고).
### 콘텐츠는 bleed, 컨트롤은 float — 2층 모델
@ -162,7 +167,6 @@ unitless `line-height`(위 예의 `1.125`처럼 배수로 쓴 값)는 `scale()`
```js
const DIALOGS = ["stu-dialog", "as-dialog", "more-dialog"];
let suppressPop = false; // close 이벤트가 history.back() 유발 → popstate 무시
let popClosing = false; // popstate가 다이얼로그를 닫는 중 → close의 back() 무시
const openDialog = (dlg) => {
if (dlg.open) return;
@ -173,7 +177,7 @@ const openDialog = (dlg) => {
DIALOGS.forEach((id) => {
const dlg = document.getElementById(id);
dlg.addEventListener("close", () => {
if (popClosing) return;
// popstate로 이미 이전 엔트리에 와 있으면 history.state.d가 달라 back()을 부르지 않는다
if (history.state && history.state.d === dlg.id) { suppressPop = true; history.back(); }
});
});
@ -182,9 +186,7 @@ let pendingMoreSelect = null; // 더보기 시트: 선택은 back() 후 push로
window.addEventListener("popstate", () => {
if (suppressPop) { suppressPop = false; return; }
const s = history.state || {};
popClosing = true;
DIALOGS.forEach((id) => { const d = document.getElementById(id); if (d.open && s.d !== id) d.close(); });
popClosing = false;
if (s.v) setCurrentView(s.v);
if (pendingMoreSelect) { const v = pendingMoreSelect; pendingMoreSelect = null; gotoView(v, true); }
});
@ -230,9 +232,10 @@ function hapticTap(pattern = 10) {
```js
function bindSwipeDismiss(card, onDismiss) {
// CSS: .card { touch-action: pan-y; } — 세로 스크롤은 브라우저에 남기고 가로 드래그만 받는다
let startX = 0, dx = 0, dragging = false;
card.addEventListener('pointerdown', (e) => {
dragging = true; startX = e.clientX; card.setPointerCapture(e.pointerId);
dragging = true; startX = e.clientX; dx = 0; card.setPointerCapture(e.pointerId);
});
card.addEventListener('pointermove', (e) => {
if (!dragging) return;
@ -246,9 +249,15 @@ function bindSwipeDismiss(card, onDismiss) {
else card.style.transform = '';
dx = 0;
});
// 브라우저가 제스처를 가져가면 pointerup 대신 pointercancel이 온다 — 상태와 transform을 되돌린다
card.addEventListener('pointercancel', () => {
dragging = false; dx = 0; card.style.transform = '';
});
}
```
수평 드래그만 쓰는 표면은 `touch-action: none` 대신 `pan-y`(가로 스와이프)·`pan-x`(세로 스와이프)로 스크롤 축을 남긴다. 거리와 속도를 함께 보는 dismiss 판정은 [interaction-feel.md](interaction-feel.md) §5-4를 따른다.
**관찰 후보**: 임계값은 카드 폭의 25~30% 또는 100px을 시작값으로 두고, 프로젝트에서 실측해 조정한다[SKILL-INTERACTION-DESIGN].
### 당겨서 새로고침 — 조건부