Repository navigation
[DONE] Pattern Lab 텍스트 레이어에 노브로 움직이는 흐르기 · 반짝임 · 색 램프 효과가 생긴다 - #187
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PzCQEsRTRtmM7tcthcCUnQ
… in the Lab and both exports Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PzCQEsRTRtmM7tcthcCUnQ
…ed JS and the compiled header Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PzCQEsRTRtmM7tcthcCUnQ
…uns through it, and ARCHITECTURE names text effects Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PzCQEsRTRtmM7tcthcCUnQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PzCQEsRTRtmM7tcthcCUnQ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PzCQEsRTRtmM7tcthcCUnQ
patternflow-bot
marked this pull request as ready for review
October 23, 2026 22:28
This was referenced Oct 23, 2026
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 25, 2026
engmung
pushed a commit
to engmung/Patternflow
that referenced
this pull request
Oct 25, 2026
Patternflow-lab#183 Patternflow-lab#184 Patternflow-lab#186 Patternflow-lab#187 Patternflow-lab#189 Patternflow-lab#191 Patternflow-lab#192 Patternflow-lab#193 Patternflow-lab#194 Patternflow-lab#196 Patternflow-lab#197 Patternflow-lab#198 Patternflow-lab#199 Patternflow-lab#200 Patternflow-lab#202 Patternflow-lab#203 Patternflow-lab#204 Patternflow-lab#205 Patternflow-lab#206 Patternflow-lab#208 Patternflow-lab#209 Patternflow-lab#210 Patternflow-lab#214 Patternflow-lab#217 Patternflow-lab#218 Patternflow-lab#221 Patternflow-lab#222 Patternflow-lab#223 Patternflow-lab#227 Patternflow-lab#237 Patternflow-lab#238 Patternflow-lab#239 Patternflow-lab#240
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dev / https://claude.ai/code/session_01PzCQEsRTRtmM7tcthcCUnQ
Pattern Lab 의 텍스트 레이어에 Effect 칸이 생겼어요. 흐르기 · 반짝임 · 색 램프 따라 바뀌기 가운데 하나를 고르면, 고른 노브가 그 빠르기를 정하고 끝까지 내리면 멈춰요. 흐르기는 판보다 긴 문장도 통째로 지나가요. 머지하면 내보낸 JS 와 To hardware 헤더도 미리보기와 같은 LED 를 같은 걸음으로 켜서, 협업 문구를 움직이는 채로 기기에 올릴 수 있어요.
좋아지는 것: 글자가 노브 빠르기로 흐르고 반짝이고 색이 바뀐다 — 협업 문구를 움직이는 채로 기기에 올린다
체크리스트
textEffects.ts), 미리보기 엔진, 내보낸 JS(flatten.ts), 기기 헤더(hExport.ts)source: 그리기, 저장, 판 크기 바꾸기, Graphic Export한 일
web/src/lib/lab/textEffects.ts(새 파일): 효과 셋의 셈이에요. 위상(phase)은 매 프레임dt × (노브 몫 × 빠르기)를 더하고 주기로 나눈 나머지만 남겨요. 픽셀마다는 정수 셈뿐이라 미리보기 · JS · C++ 가 같은 LED 를 켜요.types.ts:TextSpec에effect·effectKnob,TextLayer에source. 흐르기와 램프는 판 밖까지 줄 전체를source로 그려 둬요(가장 큰 판 한 장 분량, 128×64 판에서 4096칸까지).text.ts,textRaster.ts: 줄이 닿는 칸을 재고(textReach) 그 폭의 캔버스에 같은 정수 자리로 그려요. 판과 겹치는 칸은 판에 그린 것과 바이트까지 같아요(아래 증거).engine.ts: 효과가 있는 텍스트 레이어마다 위상과 프레임을 들고, 마스크로 쓰여도 같이 움직여요. Graphic Export 가 다른 격자로 그릴 땐 그 프레임을 늘려요(stretch.ts로 옮긴stretchNearest).flatten.ts,hExport.ts: 효과 레이어는 움직일 것(source나 비트맵, RLE)과 위상, 램프면 LUT 를 싣고textEffects.ts와 같은 걸음을 JS · C++ 로 적어요. 효과가 없는 스택의 출력은 전과 한 글자도 같아요. 헤더의rleDecode는 칸 수를 받는 인자가 기본값과 함께 생겼어요.serialize.ts,store/shared.ts:source를 저장하고 열어요(맞지 않으면 버리고 그 레이어는 멈춘 글자로 보여요). 판 크기를 바꾸면source도 글자와 같이 옮겨요. 램프를 따르는 한 색 텍스트는 램프를 고치면 다시 그려요.TextPanel.tsx: Effect 칸(None · Scroll · Twinkle · Run the ramp)과 Speed knob 칸(Knobs 패널의 이름 그대로). 그 노브가 지금 몇 % 인지, 0% 면 「아직 안 움직이니 Knobs 에서 올리라」고 말해요. 램프를 따를 땐 Color 칸을 감춰요.RampPanel.tsx: 램프를 따르는 한 색 텍스트를 「This text is one colour」라 하지 않아요.HardwareModal.tsx: 움직이는 텍스트가 있으면 「Text that moves moves there too, on the same knob.」을 더해요.pixelToCode.ts: 흐르는 텍스트의 Copy as code 는 판 밖까지 줄 전체를 실어요. 효과는 싣지 않고 멈춘 글자예요(Text 패널이 그렇다고 말해요).web/ARCHITECTURE.md의 Text 줄에 효과와source를 적었어요.textEffects.test.ts(새 파일, 22개),textExport.test.ts에 움직이는 스택 19개 × 여러 프레임,TextPanel.test.tsx5개,HardwareModal.test.tsx1개.증거
web/에서, 이 브랜치 마지막 코드 커밋(9044e80)으로:같은 픽셀 시험(
npx vitest run src/lib/lab/textExport.test.ts, 157개 통과). 움직이는 스택마다 미리보기, 내보낸 JS, g++ 로 컴파일한 헤더를 1 · 23 · 77 프레임처럼 여러 때에 비교해요. 흐르기가 한 바퀴 돌아 제자리에 오는 85 프레임, 램프가 끝에 닿는 128 프레임과 돌아오는 256 프레임, 반짝임 박자가 끝나는 64 프레임을 넣었어요. 헤더 쪽은 dt 를 1/64 초, 노브를 1/4 단위로 둬서 float 와 double 의 위상 합이 비트까지 같아요. JS 쪽은 노브 0.3 · 0.37 · 0.81 같은 값과 1/60 초로도 비교해요.시험이 틀린 걸 잡는지 일부러 고장 내 봤어요(돌려 놓은 뒤 다시 초록).
실제 브라우저(빌드한 사이트, 컨테이너 Chromium, Silkscreen 실제 글꼴)에서 128×64 미리보기 캔버스를 읽었어요. 「PATTERNFLOW SEOUL 2026」은 판보다 길어요.
다른 판에선 Freq 로 바꾸기 전 Speed 노브로 한 칸 흘러가 있었고, 그때도 「1 columns on, to the byte」였어요. 사진 맨 위 둘은 흐르기 중간이라 판 밖에 있던 「SEOUL 2026」이 들어와 있어요.
실행법
+ Text를 눌러요. Text 패널이 열려요.Scroll로 둬요. Speed knob 은 처음 프로젝트에서 「Speed」(39%)예요. Knobs 패널에서 그 노브를 돌리면 빨라지고 끝까지 내리면 멈춰요.Twinkle,Run the ramp도 같아요.Run the ramp는 Color Ramp 패널의 색을 따라가요.Copy .h헤더와 Export 의 JS 도 같은 노브로 같이 움직여요.가정
TEXT_EFFECTS와 세 렌더러(textEffects.ts,flatten.ts,hExport.ts)에 한 갈래씩 더하면 돼요.source는 가장 큰 판 한 장(512×512×4 바이트)까지예요. 128×64 판에선 4096칸이라 Silkscreen 16px 로 200자 넘게 들어가요. 넘는 글자는 빠져요..pfm을 보드에서 돌려 보지는 못했어요. 이 컨테이너엔 보드가 없어요. 증거는 헤더를 호스트 g++ 로 돌린 데까지예요. 기기의 실제 dt 는 1/64 가 아니라서 위상이 미리보기와 아주 조금 다르게 쌓이지만, 같은 위상에선 같은 LED 를 켜요.fmodf와 32비트 곱셈이 들어가요. 효과가 없는 스택의 헤더 · JS 는 전과 같아요.loader.js를 막아서 나는 것이고, 효과를 고르기 전 빈 페이지에서도 나요.stretchNearest는capture/core.ts에서stretch.ts로 옮겼고,core.ts가 다시 내보내서 부르는 곳은 그대로예요.Changelog
Web
경험
언제: 바퀴에서 vitest 시험의
beforeEach로 목(mock)을 비울 때교훈:
beforeEach(() => vi.mocked(fn).mockClear())처럼 화살표가 값을 돌려주게 쓰지 않고 중괄호로 감싼다.mockClear()가 목 자신을 돌려주면 vitest 가 그것을 정리 함수로 알고 인자 없이 불러서, 목 안에서 엉뚱한 TypeError 가 난다근거: #187 의
textEffects.test.ts가 「Cannot read properties of undefined (reading 'align')」로 7개 빨갰고, 스택이 vitest 의callCleanupHooks에서 목을 부르고 있었어요. 중괄호로 감싸자 사라졌어요바퀴
바퀴 64 · 지시 4 「텍스트 효과 첫 셋」
다음 바퀴
https://claude.ai/code/session_01PzCQEsRTRtmM7tcthcCUnQ
Generated by Claude Code