insightflo/edu-deck-skills / edu-deck
edu-deck
FlaggedEntry skill for education deck requests. Use FIRST when the user wants 교육자료, 강의 자료, 교육용 슬라이드, 직원 교육 덱, or a training series (예: "○○ 교육자료 만들어줘", "사내 교육 시리즈 만들어", "여러 편으로 나눠 교육 자료"). 판별 후 단일 발행(주제 하나, 파일 하나)이면 edu-deck-solo 경로를, 여러 편 시리즈·진도 관리·허브가 필요하면 edu-deck-series 경로를 탄다. 애매하면 사용자에게 한 번 묻는다. 덱 제작 절차는 이 스킬에 없고 각 하위 스킬에 있다.
shared/dev/crayon-reference.html
View on GitHub<!--
출처: 구글 드라이브 — 사용자 제공 데모 "크레파스 리실 드로잉 모션" (2026-11-02 추가).
용도: 채점 크레파스 모션 엔진(study.js 5절)의 기법 원본 보존. 렌더링 코드(베지어 궤적·손 속도 이징·압력 프로파일·크레파스 입자)를 이 파일에서 가져갔다.
이 파일은 참고 원본이며 덱에 조립되지 않는다. 데모 페이지 의존(버튼 리플레이 UI)은 엔진에 옮기지 않았다.
-->
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>크레파스 리얼 드로잉 모션 (사람 손목 스냅 반영)</title>
<style>
body {
font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
background-color: #f7f4eb;
background-image: radial-gradient(#e6e1d3 1px, transparent 0);
background-size: 16px 16px;
color: #2b2b2b;
padding: 40px 20px;
line-height: 2.4;
font-size: 20px;
}
.paper {
max-width: 760px;
margin: 0 auto;
background: #fffdf8;
padding: 45px 55px;
border-radius: 8px;
box-shadow: 0 8px 25px rgba(0,0,0,0.08);
border: 1px solid #e8e4d9;
}
.header-bar {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 2px dashed #dcd6c8;
padding-bottom: 15px;
margin-bottom: 30px;
flex-wrap: wrap;
gap: 10px;
}
h2 { margin: 0; font-size: 23px; color: #3a352f; }
.btn-group {
display: flex;
gap: 8px;
}
button {
background: #e63946;
color: white;
border: none;
padding: 10px 18px;
font-size: 15px;
font-weight: bold;
border-radius: 6px;
cursor: pointer;
box-shadow: 0 3px 6px rgba(230, 57, 70, 0.3);
transition: transform 0.1s, background 0.2s;
}
button:hover { background: #d62828; }
button:active { transform: scale(0.96); }
.hint {
font-size: 14px;
color: #777;
margin-top: -18px;
margin-bottom: 24px;
}
.item { margin: 34px 0; }
.crayon-wrap {
position: relative;
display: inline-block;
z-index: 1;
cursor: pointer;
user-select: none;
}
.crayon-canvas {
position: absolute;
pointer-events: none;
z-index: -1;
}
.over-text .crayon-canvas {
z-index: 2;
mix-blend-mode: multiply;
}
.circle-showcase {
display: flex;
gap: 38px;
align-items: center;
margin-top: 15px;
padding: 15px 0;
flex-wrap: wrap;
}
.grade-target {
width: 115px;
height: 95px;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 22px;
color: #444;
}
.check-row {
display: flex;
align-items: center;
gap: 14px;
margin: 18px 0;
}
.check-box {
width: 48px;
height: 48px;
position: relative;
display: inline-block;
}
</style>
</head>
<body>
<div class="paper">
<div class="header-bar">
<h2>크레파스 실시간 손그림 모션</h2>
<div class="btn-group">
<button onclick="playAllAnimations()">✏️ 전체 순서대로 채점하기</button>
</div>
</div>
<div class="hint">💡 각 동그라미, 체크, 밑줄, 형광펜을 <strong>클릭</strong>하면 해당 항목만 즉시 다시 그려집니다.</div>
<!-- 1. 채점 동그라미 -->
<div class="item">
<div><strong>1. 채점 동그라미 (돌아 올라갈 때 가속 + 마지막 꼬리 스냅):</strong></div>
<div class="circle-showcase">
<div class="crayon-wrap over-text grade-target" data-type="circle" data-color="red" data-duration="520">
1번 정답
</div>
<div class="crayon-wrap over-text grade-target" data-type="circle" data-color="red" data-duration="480">
100점
</div>
<div class="crayon-wrap over-text grade-target" data-type="circle" data-color="blue" data-duration="550">
참 잘했어요
</div>
</div>
</div>
<!-- 2. 크레파스 체크 표시 -->
<div class="item">
<div><strong>2. 불규칙 크레파스 체크 (찍고 -> 꺾임 멈칫 -> 위로 휙 뻗음):</strong></div>
<div class="check-row">
<span class="crayon-wrap over-text check-box" data-type="check" data-color="red" data-duration="340"></span>
<span>첫 번째 채점 완료 (손목 스냅 속도감 반영)</span>
</div>
<div class="check-row">
<span class="crayon-wrap over-text check-box" data-type="check" data-color="blue" data-duration="360"></span>
<span>두 번째 채점 완료 (파란색 크레파스 질감)</span>
</div>
</div>
<!-- 3. 크레파스 밑줄 -->
<div class="item">
<strong>3. 크레파스 밑줄:</strong> 손으로 꾹 눌러 그은 <span class="crayon-wrap" data-type="underline" data-color="red" data-duration="450">크레파스 불규칙 밑줄과 농담 그라데이션</span>입니다.
</div>
<!-- 4. 크레파스 강조 -->
<div class="item">
<strong>4. 크레파스 강조:</strong> 두 번 쓱싹 문지르는 <span class="crayon-wrap" data-type="highlight" data-color="yellow" data-duration="620">노란색 크레파스 형광펜 질감</span> 효과입니다.
</div>
</div>
<script>
const PALETTES = {
red: { h: [352, 6], s: [78, 96], l: [38, 56] },
yellow: { h: [42, 54], s: [88, 100], l: [48, 64] },
blue: { h: [208, 225], s: [72, 92], l: [36, 56] }
};
const rand = (min, max) => Math.random() * (max - min) + min;
// 3차 베지어 곡선 계산
function getCubicBezierPoint(t, p0, p1, p2, p3) {
const u = 1 - t;
const tt = t * t, uu = u * u;
const uuu = uu * u, ttt = tt * t;
return {
x: uuu * p0.x + 3 * uu * t * p1.x + 3 * u * tt * p2.x + ttt * p3.x,
y: uuu * p0.y + 3 * uu * t * p1.y + 3 * u * tt * p2.y + ttt * p3.y
};
}
function buildBezierPath(segments, stepsPerSegment = 65) {
const pts = [];
segments.forEach(([p0, p1, p2, p3]) => {
for (let i = 0; i <= stepsPerSegment; i++) {
pts.push(getCubicBezierPoint(i / stepsPerSegment, p0, p1, p2, p3));
}
});
return pts;
}
/**
* 사람의 손 움직임 속도 곡선 (Human Hand Velocity Easing)
* 기계적인 등속 운동이 아니라 획의 특성에 따라 시간 진행률(0~1)을 거리 진행률(0~1)로 변환
*/
function applyHandTiming(t, timingType) {
if (timingType === 'circle') {
// 시작할 때 살짝 힘주어 밀고, 윗부분 돌 때 가속, 마지막 꼬리 뻗을 때 휙 빠르게 빠짐
return t < 0.25
? 2.2 * t * t + 0.3 * t
: 1 - Math.pow(1 - t, 2.3) * 0.85;
}
if (timingType === 'fast-snap') {
// 체크 표시의 위로 뻗는 획: 초반에 폭발적으로 치고 나가며 끝에서 날렵하게 빠짐
return 1 - Math.pow(1 - t, 2.8);
}
if (timingType === 'down-tick') {
// 체크 표시의 내려찍는 짧은 획: 점점 빨라지며 바닥에 꽂힘
return Math.pow(t, 1.4);
}
// 기본 밑줄/형광펜: 양끝은 부드럽고 중간에 쓱 빠르게 지나감 (Ease-In-Out 변형)
return t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
}
/**
* 궤적 데이터를 받아 촘촘한 보간 점 배열(densePoints)을 미리 생성
*/
function prepareDensePoints(rawPoints) {
const densePoints = [];
for (let i = 0; i < rawPoints.length - 1; i++) {
const p0 = rawPoints[i];
const p1 = rawPoints[i + 1];
const dist = Math.hypot(p1.x - p0.x, p1.y - p0.y);
const steps = Math.max(Math.ceil(dist * 2.5), 1);
const angle = Math.atan2(p1.y - p0.y, p1.x - p0.x);
for (let s = 0; s < steps; s++) {
const t = s / steps;
densePoints.push({
x: p0.x + (p1.x - p0.x) * t,
y: p0.y + (p1.y - p0.y) * t,
angle
});
}
}
return densePoints;
}
/**
* 특정 구간(startIdx ~ endIdx)의 크레파스 입자를 캔버스에 렌더링
*/
function renderCrayonSegment(ctx, densePoints, startIdx, endIdx, options) {
const {
palette,
baseWidth = 9,
pressureProfile = 'normal',
waxClumpRate = 0.24
} = options;
const total = densePoints.length;
for (let idx = startIdx; idx < endIdx && idx < total; idx++) {
const pt = densePoints[idx];
const progress = idx / total;
let pressure = 1;
if (pressureProfile === 'grading-circle') {
if (progress < 0.06) {
pressure = 0.75 + (progress / 0.06) * 0.25;
} else if (progress > 0.88) {
const tailT = (progress - 0.88) / 0.12;
pressure = Math.max(0.32, 1.0 - tailT * 0.68);
} else {
pressure = 0.9 + 0.2 * Math.sin(progress * Math.PI * 3.5);
}
} else if (pressureProfile === 'taper') {
if (progress < 0.15) pressure = 0.75 + (progress / 0.15) * 0.35;
else if (progress > 0.62) pressure = Math.max(0.08, 1 - ((progress - 0.62) / 0.38) * 0.92);
else pressure = 1.05;
} else if (pressureProfile === 'underline') {
const edge = Math.sin(progress * Math.PI);
pressure = Math.pow(edge, 0.3) * (0.8 + 0.3 * Math.sin(progress * Math.PI * 3));
} else if (pressureProfile === 'highlight') {
pressure = 0.85 + 0.2 * Math.sin(progress * Math.PI * 3);
}
const currentWidth = baseWidth * (0.72 + 0.35 * pressure);
const grainCount = Math.floor(currentWidth * (1.8 + pressure * 1.5));
const hueRange = palette.h;
let hue = hueRange[0] > hueRange[1]
? (hueRange[0] + rand(0, (360 - hueRange[0]) + hueRange[1])) % 360
: rand(hueRange[0], hueRange[1]);
const sat = rand(palette.s[0], palette.s[1]);
const baseLight = rand(palette.l[0], palette.l[1]);
const light = Math.max(24, Math.min(72, baseLight - (pressure - 0.75) * 16));
for (let g = 0; g < grainCount; g++) {
const spread = (Math.random() + Math.random() - 1) * (currentWidth / 2);
const offsetAlong = rand(-1.5, 1.5);
const gx = pt.x + Math.cos(pt.angle + Math.PI / 2) * spread + Math.cos(pt.angle) * offsetAlong;
const gy = pt.y + Math.sin(pt.angle + Math.PI / 2) * spread + Math.sin(pt.angle) * offsetAlong;
const paperTooth = Math.sin(gx * 0.85) * Math.cos(gy * 0.85) + Math.sin((gx - gy) * 0.45);
if (paperTooth > pressure * 0.92) continue;
const distRatio = Math.abs(spread) / (currentWidth / 2);
let alpha = (1 - distRatio * 0.7) * rand(0.22, 0.55) * pressure;
const isClump = Math.random() < waxClumpRate * 0.08 * pressure;
const grainLight = isClump ? light - 11 : light + rand(-5, 5);
if (isClump) alpha = Math.min(0.95, alpha * 2.1);
ctx.fillStyle = `hsla(${hue}, ${sat}%, ${grainLight}%, ${alpha})`;
ctx.beginPath();
const rx = isClump ? rand(1.4, 2.6) : rand(0.7, 1.8);
const ry = isClump ? rand(1.0, 2.0) : rand(0.45, 1.15);
ctx.ellipse(gx, gy, rx, ry, pt.angle + rand(-0.35, 0.35), 0, Math.PI * 2);
ctx.fill();
}
}
}
/**
* 단일 획을 requestAnimationFrame으로 실시간 드로잉하는 비동기 함수
*/
function animateStroke(ctx, rawPoints, options, duration, timingType = 'normal') {
return new Promise(resolve => {
const densePoints = prepareDensePoints(rawPoints);
const total = densePoints.length;
let drawnIdx = 0;
let startTime = null;
function step(timestamp) {
if (!startTime) startTime = timestamp;
const elapsed = timestamp - startTime;
const rawProgress = Math.min(elapsed / duration, 1);
// 사람의 손 가속도 적용
const easedProgress = applyHandTiming(rawProgress, timingType);
const targetIdx = Math.floor(easedProgress * total);
if (targetIdx > drawnIdx) {
renderCrayonSegment(ctx, densePoints, drawnIdx, targetIdx, options);
drawnIdx = targetIdx;
}
if (rawProgress < 1) {
requestAnimationFrame(step);
} else {
// 남은 끝점 마무리
if (drawnIdx < total) {
renderCrayonSegment(ctx, densePoints, drawnIdx, total, options);
}
resolve();
}
}
requestAnimationFrame(step);
});
}
// 잠시 대기하는 유틸리티 (획 사이 멈칫하는 시간 표현)
const wait = ms => new Promise(res => setTimeout(res, ms));
// 첨부 이미지 스타일의 채점 동그라미 궤적 생성
function createGradingCirclePath(w, h) {
const jx = () => rand(-w * 0.025, w * 0.025);
const jy = () => rand(-h * 0.025, h * 0.025);
const p0 = { x: w * 0.76 + jx(), y: h * 0.57 + jy() };
const p1 = { x: w * 0.45 + jx(), y: h * 0.73 + jy() };
const p2 = { x: w * 0.12 + jx(), y: h * 0.73 + jy() };
const p3 = { x: w * 0.14 + jx(), y: h * 0.47 + jy() };
const p4 = { x: w * 0.16 + jx(), y: h * 0.17 + jy() };
const p5 = { x: w * 0.56 + jx(), y: h * 0.07 + jy() };
const p6 = { x: w * 0.82 + jx(), y: h * 0.20 + jy() };
const p7 = { x: w * 0.97 + jx(), y: h * 0.34 + jy() };
const p8 = { x: w * 0.87 + jx(), y: h * 0.65 + jy() };
const p9 = { x: w * 0.47 + jx(), y: h * 0.91 + jy() };
return buildBezierPath([
[p0, p1, p2, p3],
[p3, p4, p5, p6],
[p6, p7, p8, p9]
], 65);
}
/**
* 개별 요소를 사람이 그리듯 애니메이션 실행
*/
async function animateElement(wrap) {
// 중복 실행 방지용 토큰
const animId = Symbol();
wrap._currentAnim = animId;
const oldCanvas = wrap.querySelector('.crayon-canvas');
if (oldCanvas) oldCanvas.remove();
const rect = wrap.getBoundingClientRect();
const type = wrap.dataset.type;
const duration = parseInt(wrap.dataset.duration || '480', 10);
const padX = type === 'circle' ? 28 : 22;
const padY = type === 'circle' ? 32 : 18;
const width = rect.width + padX * 2;
const height = rect.height + padY * 2;
const canvas = document.createElement('canvas');
canvas.className = 'crayon-canvas';
const dpr = window.devicePixelRatio || 1;
canvas.width = width * dpr;
canvas.height = height * dpr;
canvas.style.width = `${width}px`;
canvas.style.height = `${height}px`;
canvas.style.left = `-${padX}px`;
canvas.style.top = `-${padY}px`;
const ctx = canvas.getContext('2d');
ctx.scale(dpr, dpr);
wrap.appendChild(canvas);
const colorKey = wrap.dataset.color || 'red';
const palette = PALETTES[colorKey];
if (type === 'circle') {
const pathPoints = createGradingCirclePath(width, height);
await animateStroke(ctx, pathPoints, {
palette,
baseWidth: 9.5,
pressureProfile: 'grading-circle',
waxClumpRate: 0.26
}, duration, 'circle');
}
else if (type === 'check') {
const startX = padX + rand(4, 10);
const startY = padY + height * rand(0.28, 0.38);
const midX = padX + width * rand(0.25, 0.34);
const midY = padY + height * rand(0.52, 0.62);
const endX = width - padX + rand(2, 12);
const endY = padY - rand(0, 8);
// 1획: 내려찍기 (전체 시간의 32%)
await animateStroke(ctx, [{ x: startX, y: startY }, { x: midX, y: midY }], {
palette, baseWidth: 9.5, pressureProfile: 'underline', waxClumpRate: 0.28
}, duration * 0.32, 'down-tick');
if (wrap._currentAnim !== animId) return;
// 꺾이는 지점에서 손목 방향이 바뀌는 찰나의 멈칫함 (35ms)
await wait(35);
if (wrap._currentAnim !== animId) return;
// 2획: 위로 날렵하게 뻗어 나가기 (전체 시간의 68%)
await animateStroke(ctx, [
{ x: midX - 1, y: midY + 1 },
{ x: (midX + endX) * 0.48, y: (midY + endY) * 0.52 - rand(2, 6) },
{ x: endX, y: endY }
], {
palette, baseWidth: 10, pressureProfile: 'taper', waxClumpRate: 0.25
}, duration * 0.68, 'fast-snap');
}
else if (type === 'underline') {
const yBase = height - padY - 2;
const points = [
{ x: padX - rand(2, 6), y: yBase + rand(-2, 3) },
{ x: width * 0.35, y: yBase + rand(-3, 2) },
{ x: width * 0.7, y: yBase + rand(-2, 3) },
{ x: width - padX + rand(2, 8), y: yBase + rand(-4, 2) }
];
await animateStroke(ctx, points, {
palette, baseWidth: 8, pressureProfile: 'underline', waxClumpRate: 0.25
}, duration, 'normal');
}
else if (type === 'highlight') {
const yMid = height / 2 + 2;
// 첫 번째 쓱 칠하기
const points1 = [
{ x: padX - rand(3, 8), y: yMid - 2.5 + rand(-1.5, 1.5) },
{ x: width * 0.5, y: yMid - 2.5 + rand(-2, 2) },
{ x: width - padX + rand(3, 8), y: yMid - 2.5 + rand(-2, 2) }
];
await animateStroke(ctx, points1, {
palette, baseWidth: 19, pressureProfile: 'highlight', waxClumpRate: 0.12
}, duration * 0.52, 'normal');
if (wrap._currentAnim !== animId) return;
await wait(50);
if (wrap._currentAnim !== animId) return;
// 두 번째 겹쳐서 덧칠하기 (살짝 어긋나게)
const points2 = [
{ x: padX - rand(2, 6), y: yMid + 2.5 + rand(-1.5, 1.5) },
{ x: width * 0.5, y: yMid + 2.5 + rand(-2, 2) },
{ x: width - padX + rand(3, 8), y: yMid + 2.5 + rand(-2, 2) }
];
await animateStroke(ctx, points2, {
palette, baseWidth: 19, pressureProfile: 'highlight', waxClumpRate: 0.12
}, duration * 0.48, 'normal');
}
}
/**
* 전체 항목을 선생님이 위에서부터 순서대로 채점하듯 연속 재생
*/
let playRunToken = 0;
async function playAllAnimations() {
const myToken = ++playRunToken;
const wraps = Array.from(document.querySelectorAll('.crayon-wrap'));
// 일단 모든 캔버스 비우기
wraps.forEach(w => {
const c = w.querySelector('.crayon-canvas');
if (c) c.remove();
});
for (const wrap of wraps) {
if (myToken !== playRunToken) return;
await animateElement(wrap);
// 다음 항목으로 손을 옮기는 자연스러운 시간 간격 (140~220ms)
await wait(rand(140, 220));
}
}
// 개별 요소 클릭 시 해당 요소만 다시 그리기 이벤트 등록
window.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.crayon-wrap').forEach(wrap => {
wrap.addEventListener('click', () => animateElement(wrap));
});
playAllAnimations();
});
</script>
</body>
</html>Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |