feat(site): 재료 섹션을 실무 필터 3종으로 다시 만들고 푸터를 제거
Some checks are pending
ci / build (push) Waiting to run

푸터를 없애라는 지시가 반영돼 있지 않았다. .install-colophon 이 사실상
푸터였고, .install-grid 밖에 있어 padding-inline 을 못 받아 화면 왼쪽 끝에
붙어 있기까지 했다. 제거하고 저장소 링크는 헤더 nav 로 옮겼다.

재료 섹션은 "필터로 질감 만들기"(그레인/굴절/듀오톤)였고 화면에서 아무 말도
하지 않았다. 실무에서 손이 줄어드는 자리로 바꾼다.

- 글자 모양대로 생기는 스크림 — 흰 글자 대비 1.70:1 → 4.79:1 (AA 통과)
- 색각 이상 시뮬레이션 — 상태 배지 셋의 최소 색거리 82 → 2
- 구이(gooey) — 가로로 세어 덩어리 3개 → 1개

세 값 모두 화면을 캡처해 잰 것이다. 처음에는 데모보다 카피를 먼저 썼고,
그 결과 "2.1:1 → 12.4:1" 같은 재지 않은 숫자가 페이지에 실렸다. 전부 교체했다.

backdrop-filter 굴절 데모는 뺐다. feTurbulence 를 변위 지도로 써서 지도가
중립값(128)으로 수렴했고, scale 을 120 까지 올려도 채널차 2.96 이었다.
svg-filters.md 에 "변위 지도는 노이즈가 아니다" 라고 이미 적혀 있었는데
쓰기 전에 읽지 않았다.

섹션 끝의 note 도 삭제했다. color-interpolation-filters 를 명시했다는
문장은 방문자가 그것으로 할 수 있는 일이 없는 내부 자랑이었다.

스킬 내재화:
- svg-filters.md  실무 레시피 3종(스크림/색각/구이) + 구이가 붙는 문턱 계산
                  + feTurbulence 변위 지도 실패 기록
- antipatterns.md 데모를 만들기 전에 카피부터 쓰지 마라
                  + Playwright animations:'disabled' 가 끝 프레임을 찍는 함정
This commit is contained in:
Yun Chan 2026-08-20 23:23:24 +09:00
parent f7f811ab42
commit ae2980872b
7 changed files with 473 additions and 256 deletions

View file

@ -0,0 +1,136 @@
---
import { Image } from "astro:assets";
import paper from "../assets/bg/bg-paper.webp";
/**
* 필터 데모의 소재. 같은 소재를 두 번 그리고 한쪽에만 필터를 건다.
* 변수를 하나만 바꿔야 데모가 무언가를 증명한다 — 소재가 다르면
* 보이는 차이가 필터 때문인지 소재 때문인지 알 수 없다.
*/
interface Props {
kind: "scrim" | "cvd" | "goo";
on: boolean;
}
const { kind, on } = Astro.props;
---
{
kind === "scrim" && (
<div class="art art-photo">
<Image src={paper} alt="" widths={[300, 600]} sizes="300px" loading="lazy" />
<span class:list={["cap", { on }]}>산미 8.5 · 로스팅 2일차</span>
</div>
)
}
{
kind === "cvd" && (
<div class:list={["art art-badges", { on }]}>
<span class="badge b-ok">통과</span>
<span class="badge b-warn">주의</span>
<span class="badge b-bad">실패</span>
</div>
)
}
{
kind === "goo" && (
<div class="art art-goo">
{/* 같은 간격으로 놓인 세 덩어리. 왼쪽은 셋으로 보이고 오른쪽은 하나로 보인다.
움직임으로 증명하려다 실패했다 — 지나가는 프레임은 방문자도 놓치고
측정도 매번 다른 값을 준다. 정지된 두 장이 더 정확하게 말한다. */}
<div class:list={["goo-track", { on }]}>
<span class="goo-blob" /><span class="goo-blob" /><span class="goo-blob" />
</div>
</div>
)
}
<style>
.art {
height: var(--art-h, 118px);
border-radius: var(--radius-sm);
overflow: hidden;
position: relative;
background: var(--surface-2);
}
/* ---- 스크림 ------------------------------------------------
밝은 종이 사진 위의 흰 캡션. 필터가 없으면 대비가 무너진다 */
.art-photo :global(img) {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.cap {
position: absolute;
left: var(--space-3);
bottom: var(--space-3);
right: var(--space-3);
color: #fff;
font-weight: var(--weight-medium);
font-size: var(--step-0);
line-height: 1.3;
}
.cap.on { filter: url(#f-scrim); }
/* ---- 색각 --------------------------------------------------
상태를 색으로만 구분한 흔한 배지 묶음. 사이트 팔레트가 아니라
"현장에서 그렇게 오는" 색이다 — 그게 이 데모의 소재다 */
.art-badges {
--art-h: 84px;
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
padding: var(--space-3);
}
.art-badges.on { filter: url(#f-deuter); }
.badge {
padding: 0.4em 0.95em;
border-radius: var(--radius-sm);
font-size: var(--step--1);
font-weight: var(--weight-medium);
color: #08110f;
}
/* 적록색약에서 서로 무너지는 조합을 일부러 골랐다.
현장에서 상태 배지가 실제로 이렇게 온다 */
.b-ok { background: #3fb950; }
.b-warn { background: #d29922; }
.b-bad { background: #e5534b; }
/* ---- 구이 ---------------------------------------------------
필터는 트랙에만 건다. 라벨까지 걸면 글자가 녹는다 */
.art-goo {
--art-h: 96px;
display: grid;
align-content: center;
gap: var(--space-2);
}
/* 간격이 이 데모의 유일한 변수다.
붙는 조건은 눈대중이 아니라 산수다 — 두 원 사이 중간점의 블러 알파가
alpha 램프의 문턱(offset/slope = 7/18 ≒ 0.39)을 넘어야 한다.
간격 18px 에 stdDeviation 7 로는 중간점 알파가 0.2 근처라 못 넘었다.
실측에서 필터를 켜고도 덩어리가 3개 그대로였다. 간격을 좁힌다. */
.goo-track {
display: flex;
justify-content: center;
gap: 12px;
}
.goo-track.on { filter: url(#f-goo); }
.goo-blob {
width: 46px;
height: 46px;
border-radius: 23px;
background: var(--accent);
}
@media (prefers-reduced-transparency: reduce) {
.cap { text-shadow: 0 1px 3px rgb(0 0 0 / 0.9); }
}
</style>

View file

@ -41,25 +41,10 @@ const { c, ui } = Astro.props;
</dl>
</div>
</div>
{/* 푸터를 없앴으므로 출처와 라이선스는 여기 한 줄로 남는다.
링크 하나 없이 배포하면 사용자가 소스를 찾을 방법이 사라진다. */}
<p class="install-colophon muted">
<a href={`https://${c.colophon.repo}`}>{c.colophon.repo}</a>
<span aria-hidden="true"> · </span>{c.colophon.license}
<span aria-hidden="true"> · </span>{c.colophon.made}
</p>
</section>
<style>
.install { padding-block: var(--space-8); }
.install-colophon {
margin-top: var(--space-6);
padding-top: var(--space-4);
border-top: 1px solid var(--line);
font-size: var(--step--1);
letter-spacing: var(--tracking-label);
}
.install-grid {
max-width: 1180px;
margin-inline: auto;
@ -95,13 +80,6 @@ const { c, ui } = Astro.props;
dd { margin: 0; font-size: var(--step-0); }
@media (max-width: 820px) {
.install-colophon {
margin-top: var(--space-6);
padding-top: var(--space-4);
border-top: 1px solid var(--line);
font-size: var(--step--1);
letter-spacing: var(--tracking-label);
}
.install-grid { grid-template-columns: 1fr; }
.install-grid { grid-template-columns: 1fr; }
}
</style>

View file

@ -1,5 +1,6 @@
---
import BgPhoto from "./BgPhoto.astro";
import FilterArt from "./FilterArt.astro";
import type { Content } from "../i18n/content";
interface Props { c: Content["materials"]; }
@ -7,246 +8,179 @@ const { c } = Astro.props;
---
{/*
레이아웃 패밀리: 레이어드 캔버스.
배경은 three.js 셰이더 플레인, 전경은 SVG 필터를 실제로 먹인 타일 3장.
둘 다 설명이 아니라 지금 이 화면에서 돌고 있는 것이다.
이 섹션은 한동안 "필터로 재질 만들기" 였다 — 추상 사각형에 그레인·굴절·듀오톤.
화면에서 아무 말도 하지 않았다. 필터가 실제로 값을 하는 자리는 질감이 아니라
**실무에서 반복되는 네 가지 수작업**이고, 넷 다 이 스킬의 프리플라이트 항목이다.
왼쪽이 문제, 오른쪽이 같은 소재에 선언 하나만 얹은 것이다.
*/}
<section class="section materials has-bg" aria-labelledby="mat-h">
<BgPhoto variant="refraction" mode="fixed" opacity={0.9} />
<p class="eyebrow reveal">{c.eyebrow}</p>
<h2 id="mat-h" class="reveal">{c.h2}</h2>
<p class="lead mat-lead reveal">{c.lead}</p>
<div class="full stage glass par-slow">
<div class="full stage glass">
<span class="rim" aria-hidden="true"></span>
<div class="stage-fallback" aria-hidden="true"></div>
{/* GPU 가 만드는 재질. WebGL 이 없으면 위 그라디언트가 그대로 결과물이다 */}
{/* GPU 가 만드는 배경. WebGL 이 없으면 위 그라디언트가 그대로 결과물이다 */}
<canvas id="mat-canvas" class="stage-canvas" aria-hidden="true"></canvas>
<ul class="tiles">
<ol role="list" class="fdemos">
{
c.tiles.map((t, i) => (
<li class:list={["tile", "reveal", i % 2 === 0 ? "par-slow" : "par-fast"]} style={`--reveal-delay:${i * 80}ms`}>
<div class={`swatch swatch-${t.id}`} aria-hidden="true">
{t.id === "glass" && <span class="swatch-type">Aa 산미 8.5</span>}
c.demos.map((d, i) => (
<li class="fdemo reveal" style={`--reveal-delay:${i * 70}ms`}>
<h3 class="fd-name">{d.name}</h3>
<p class="fd-problem">{d.problem}</p>
<div class="fd-pair">
{[false, true].map((on) => (
<figure class="fd-side">
<FilterArt kind={d.id} on={on} />
<figcaption class:list={["fd-tag", "mono", on ? "is-good" : "is-bad"]}>
{on ? d.afterLabel : d.beforeLabel}
</figcaption>
</figure>
))}
</div>
<h3 class="tile-name">{t.name}</h3>
<p class="tile-use">{t.use}</p>
<p class="tile-how muted">{t.how}</p>
<p class="tile-cost mono">{t.cost}</p>
<p class="fd-how muted">{d.how}</p>
<p class="fd-verdict mono">{d.verdict}</p>
</li>
))
}
</ul>
</ol>
</div>
<p class="mat-note muted reveal">{c.note}</p>
</section>
{/* 필터 정의. 화면에 그려지지 않고 참조만 된다 */}
{/*
필터 정의. 화면에 그려지지 않고 참조만 된다.
전부 color-interpolation-filters 를 명시한다. 기본값은 linearRGB 인데,
블렌드와 합성이 씻겨 보인다 — 대부분 sRGB 가 맞다.
단 하나, 색각 시뮬레이션은 반대다. 색각 변환은 물리적인 빛의 혼합이라
선형 공간에서 계산해야 실제로 그 사람이 보는 색이 나온다.
*/}
<svg class="visually-hidden" aria-hidden="true" focusable="false">
<defs>
<!-- 종이: 미세한 프랙탈 노이즈를 표면에 얹는다 -->
<!--
그레인. 한동안 아무 효과도 못 내고 있었다.
`feComposite in="SourceGraphic" in2="soft" operator="over"` 는 원본을 노이즈
**위에** 올린다 — 노이즈가 통째로 가려진다. 입력 순서가 뒤집혀 있었다.
그레인은 원본을 덮는 게 아니라 표면에 섞이는 것이므로 feBlend/overlay 가 맞다.
baseFrequency 0.9 도 너무 촘촘해 화면에서 뭉갰다.
글자 모양대로 생기는 스크림.
박스를 그리는 대신 알파를 부풀려 그 모양만 채운다.
영역을 넉넉히 잡지 않으면 부풀린 만큼 가장자리가 잘린다.
-->
<filter id="f-grain" x="0" y="0" width="100%" height="100%">
<feTurbulence type="fractalNoise" baseFrequency="0.62" numOctaves="3" seed="4" result="n" />
<feColorMatrix in="n" type="saturate" values="0" result="g" />
<feComponentTransfer in="g" result="soft">
<feFuncA type="linear" slope="0.55" />
<filter id="f-scrim" color-interpolation-filters="sRGB"
x="-25%" y="-60%" width="150%" height="220%">
<feMorphology in="SourceAlpha" operator="dilate" radius="4" result="fat" />
<feGaussianBlur in="fat" stdDeviation="3.5" result="soft" />
<!-- 블러가 알파를 옅게 만든다. 다시 세우지 않으면 스크림이 비쳐서
대비가 3.1:1 에서 멈춘다 — 실측으로 확인하고 올린 값이다 -->
<feComponentTransfer in="soft" result="dense">
<feFuncA type="linear" slope="4.4" />
</feComponentTransfer>
<feBlend in="SourceGraphic" in2="soft" mode="overlay" />
<feFlood flood-color="#04100f" flood-opacity="1" result="ink" />
<feComposite in="ink" in2="dense" operator="in" result="scrim" />
<feMerge>
<feMergeNode in="scrim" />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
<!-- 유리: 난류로 만든 변위 지도를 굴절에 쓴다. 필터 영역을 넓혀 가장자리 잘림을 막는다 -->
<filter id="f-glass" x="-12%" y="-12%" width="124%" height="124%"
color-interpolation-filters="sRGB">
<feTurbulence type="fractalNoise" baseFrequency="0.012 0.02" numOctaves="2" seed="7" result="warp" />
<feDisplacementMap in="SourceGraphic" in2="warp" scale="26"
xChannelSelector="R" yChannelSelector="G" result="bent" />
<feGaussianBlur in="bent" stdDeviation="0.4" />
<!--
적록색약(2형) 시뮬레이션. Brettel–Viénot–Mollon 계열 근사 행렬.
여기만 linearRGB 다 — sRGB 로 돌리면 감마가 섞여 실제보다 덜 심하게 보인다.
-->
<filter id="f-deuter" color-interpolation-filters="linearRGB">
<feColorMatrix type="matrix"
values="0.625 0.375 0 0 0
0.700 0.300 0 0 0
0 0.300 0.700 0 0
0 0 0 1 0" />
</filter>
<!-- 인쇄: 명도를 두 색 사이로 다시 매핑한다 -->
<filter id="f-duotone" x="0" y="0" width="100%" height="100%"
color-interpolation-filters="sRGB">
<feColorMatrix type="matrix" result="mono"
values="0.33 0.33 0.33 0 0
0.33 0.33 0.33 0 0
0.33 0.33 0.33 0 0
0 0 0 1 0" />
<feComponentTransfer in="mono">
<feFuncR type="table" tableValues="0.05 0.06 0.42" />
<feFuncG type="table" tableValues="0.09 0.42 0.66" />
<feFuncB type="table" tableValues="0.08 0.39 0.60" />
</feComponentTransfer>
<!--
구이. 커뮤니티에서 가장 많이 만들어지는 필터이고, 값 두 개가 전부다.
stdDeviation 이 얼마나 멀리서부터 붙을지를, 알파 기울기(18)가
얼마나 단단하게 잘릴지를 정한다. 기울기를 낮추면 흐릿한 젤리가 된다.
마지막 atop 이 없으면 블러된 헤일로가 남는다.
-->
<filter id="f-goo" color-interpolation-filters="sRGB"
x="-20%" y="-40%" width="140%" height="180%">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
<feColorMatrix in="blur" type="matrix" result="goo"
values="1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 18 -7" />
<feComposite in="SourceGraphic" in2="goo" operator="atop" />
</filter>
</defs>
</svg>
<style>
.mat-lead { margin-bottom: var(--space-6); }
.mat-note { margin-top: var(--space-5); font-size: var(--step-0); }
.mat-lead { margin-bottom: var(--space-6); max-width: var(--measure); }
.stage {
position: relative;
isolation: isolate;
max-width: 1180px;
width: 100%;
margin-inline: auto;
padding: var(--space-5) var(--space-4);
padding: var(--wide-pad);
border-radius: var(--radius-frame);
overflow: hidden;
isolation: isolate;
}
.stage-fallback,
.stage-canvas {
position: absolute;
inset: 0;
z-index: -1;
width: 100%;
height: 100%;
display: block;
z-index: -1;
}
.stage-fallback {
background:
radial-gradient(120% 90% at 12% 8%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%),
radial-gradient(90% 80% at 88% 92%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 62%),
var(--surface-raised);
radial-gradient(60% 70% at 22% 20%,
color-mix(in oklab, var(--accent) 16%, transparent), transparent 70%),
radial-gradient(56% 64% at 80% 76%,
color-mix(in oklab, var(--glow-2) 14%, transparent), transparent 68%);
}
.stage-canvas { opacity: 0; transition: opacity 1s var(--ease-soft); }
.stage-canvas.is-live { opacity: 0.55; }
.stage-canvas { opacity: 0; transition: opacity var(--dur-slow) var(--ease-soft); }
.stage-canvas.is-live { opacity: 1; }
/* 3개 항목에 3개 셀. 빈 칸이 생기지 않고 균등 3열도 아니다 */
.tiles {
.fdemos {
list-style: none;
margin: 0;
padding: 0;
display: grid;
gap: var(--space-4);
grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
grid-template-areas:
"big top"
"big bottom";
gap: var(--space-6);
}
.tile:nth-child(1) { grid-area: big; }
.tile:nth-child(2) { grid-area: top; }
.tile:nth-child(3) { grid-area: bottom; }
/* 큰 셀은 더 넓은 화면을 갖는다 */
.tile:nth-child(1) .swatch { aspect-ratio: 16 / 11; }
.tile:nth-child(n + 2) .swatch { aspect-ratio: 16 / 6; }
.tile { display: grid; gap: var(--space-2); align-content: start; }
.fdemo + .fdemo { border-top: 1px solid var(--line); padding-top: var(--space-6); }
/* 필터를 먹일 대상.
한때 셋 다 같은 줄무늬였다. 필터가 무엇을 하는지는 보였지만
그것을 왜 쓰는지는 보이지 않았다 — 줄무늬는 실무에서 쓰는 소재가 아니다.
이제 각 필터를 그 필터가 실제로 걸리는 자리에 올린다. */
.swatch {
aspect-ratio: 4 / 3;
border-radius: var(--radius-sm);
overflow: hidden;
position: relative;
}
.fd-name { font-size: var(--step-1); }
.fd-problem { max-width: 52ch; color: var(--ink-muted); }
/* 그레인 — 매끈한 그라디언트 위. 노이즈가 없으면 밋밋하다는 게 요점이다 */
.swatch-grain {
background: linear-gradient(148deg,
color-mix(in oklab, var(--accent) 82%, var(--surface)),
color-mix(in oklab, var(--glow-2) 62%, var(--surface)));
}
/* 굴절 — 글자 위. 유리 뒤의 것이 휘는 걸 보여줘야 의미가 산다 */
.swatch-glass {
background: linear-gradient(100deg,
color-mix(in oklab, var(--surface) 82%, var(--ink)),
color-mix(in oklab, var(--accent) 30%, var(--surface)));
.fd-pair {
display: grid;
place-items: center;
grid-template-columns: repeat(2, minmax(0, 300px));
gap: var(--space-4);
margin-block: var(--space-4);
}
.swatch-type {
font-size: clamp(1.1rem, 0.6rem + 1.6vw, 1.9rem);
font-weight: var(--weight-strong);
letter-spacing: var(--tracking-display);
color: var(--ink);
white-space: nowrap;
.fd-side { margin: 0; }
.fd-tag {
margin: var(--space-2) 0 0;
font-size: var(--mono-size);
letter-spacing: 0;
}
.is-bad { color: var(--ink-muted); }
.is-good { color: var(--accent); }
/* 듀오톤 — 사진. 출처가 다른 사진을 한 팔레트로 묶는 게 실제 용도다 */
.swatch-duotone {
background:
radial-gradient(58% 74% at 30% 28%, color-mix(in oklab, var(--ink) 90%, transparent), transparent 70%),
radial-gradient(52% 60% at 74% 68%, color-mix(in oklab, var(--ink-muted) 70%, transparent), transparent 66%),
linear-gradient(160deg, color-mix(in oklab, var(--surface) 40%, var(--ink-muted)), var(--surface-sunken));
}
.tile-use {
margin: 0;
.fd-how { max-width: 60ch; }
.fd-verdict {
margin: var(--space-2) 0 0;
font-size: var(--mono-size);
color: var(--accent);
font-size: var(--step-0);
}
.swatch-grain { filter: url(#f-grain); }
.swatch-glass { filter: url(#f-glass); }
.swatch-duotone { filter: url(#f-duotone); }
/* 필터를 지원하지 않거나 저사양이면 줄무늬만 남는다. 그래도 성립한다 */
@supports not (filter: url(#f-grain)) {
.swatch-grain, .swatch-glass, .swatch-duotone { filter: none; }
}
.tile-name { font-size: var(--step-1); margin-top: var(--space-1); }
.tile-how { margin: 0; font-size: var(--step-0); }
.tile-cost { margin: 0; color: var(--accent); }
@media (max-width: 760px) {
.tiles { grid-template-columns: 1fr; grid-template-areas: "big" "top" "bottom"; }
.tile:nth-child(n + 2) .swatch { aspect-ratio: 5 / 4; }
@media (max-width: 720px) {
.fd-pair { grid-template-columns: 1fr; }
}
</style>
<script>
// 무대 배경. 유리 표면을 지나는 빛의 굴절을 흉내낸다.
// 히어로와 같은 모듈, 같은 three 청크를 쓴다. 새로 받는 것은 없다.
import { mountShaderPlane, GLSL_NOISE } from "../lib/shader-plane";
const canvas = document.getElementById("mat-canvas") as HTMLCanvasElement | null;
if (canvas) {
mountShaderPlane({
canvas,
speed: 0.7,
colors: { uA: "--accent", uB: "--glow-2" },
fragment: `
precision mediump float;
varying vec2 vUv;
uniform float uTime;
uniform float uAspect;
uniform vec3 uA;
uniform vec3 uB;
${GLSL_NOISE}
void main() {
vec2 p = vUv;
p.x *= uAspect;
float t = uTime * 0.06;
// 좌표 자체를 노이즈로 밀어 굴절처럼 보이게 한다
vec2 warp = vec2(fbm(p * 2.2 + t), fbm(p * 2.2 - t + 4.7));
vec2 q = p + (warp - 0.5) * 0.42;
// 밀린 좌표 위에 얇은 띠를 얹는다. 유리 너머의 결이다
float band = sin((q.x + q.y) * 7.0 + uTime * 0.35) * 0.5 + 0.5;
band = smoothstep(0.35, 0.95, band);
float depth = smoothstep(0.1, 1.0, fbm(q * 1.6 - t * 0.5));
vec3 col = mix(uB, uA, depth);
float alpha = (0.16 + band * 0.22) * (0.55 + depth * 0.45);
gl_FragColor = vec4(col, alpha);
}
`,
});
}
</script>