Skip to content

insightflo/edu-deck-skills / edu-deck

edu-deck

Flagged

Entry skill for education deck requests. Use FIRST when the user wants 교육자료, 강의 자료, 교육용 슬라이드, 직원 교육 덱, or a training series (예: "○○ 교육자료 만들어줘", "사내 교육 시리즈 만들어", "여러 편으로 나눠 교육 자료"). 판별 후 단일 발행(주제 하나, 파일 하나)이면 edu-deck-solo 경로를, 여러 편 시리즈·진도 관리·허브가 필요하면 edu-deck-series 경로를 탄다. 애매하면 사용자에게 한 번 묻는다. 덱 제작 절차는 이 스킬에 없고 각 하위 스킬에 있다.

FileKindSize
SKILL.mdskill md14.1 KB
distribution/NOTICES.mdmarkdown1.5 KB
distribution/README.mdmarkdown3.4 KB
distribution/USAGE.mdmarkdown5.5 KB
shared/assets/css/components.cssother23.2 KB
shared/assets/css/core.cssother15.1 KB
shared/assets/css/pack-runtime.cssother9.4 KB
shared/assets/css/responsive.cssother10.6 KB
shared/assets/css/theme-switch.cssother3.4 KB
shared/assets/css/themes.cssother11.2 KB
shared/assets/css/tokens.cssother2.5 KB
shared/assets/css/viewer.cssother17.5 KB
shared/assets/css/visual-motion.cssother19.3 KB
shared/assets/fonts/GowunBatang-Regular.woff2binary523.3 KB
shared/assets/fonts/GowunDodum-Regular.woff2binary435.5 KB
shared/assets/fonts/OFL-GowunBatang.txtmarkdown4.3 KB
shared/assets/fonts/OFL-GowunDodum.txtmarkdown4.3 KB
shared/assets/fonts/OFL.txtmarkdown4.3 KB
shared/assets/fonts/PretendardVariable.woff2binary2.0 MB
shared/assets/icons/base.svgother9.3 KB
shared/assets/icons/extra.svgother18.4 KB
shared/assets/icons/si.svgother7.6 KB
shared/assets/js/cover-art.jsscript82.9 KB
shared/assets/js/motion.jsscript84.4 KB
shared/assets/js/patterns.jsscript7.2 KB
shared/assets/js/responsive.jsscript21.6 KB
shared/assets/js/sheet.jsscript1.5 KB
shared/assets/js/study.jsscript33.6 KB
shared/assets/js/talk.jsscript9.2 KB
shared/assets/js/themes.jsscript7.8 KB
shared/assets/js/viewer.jsscript29.1 KB
shared/assets/kit/patterns.cssother5.4 KB
shared/assets/kit/stack.jsscript15.8 KB
shared/assets/pack-shell.htmlother2.9 MB
shared/assets/packs/atlas/style.cssother1.7 KB
shared/assets/packs/atlas/template.htmlother2.1 KB
shared/assets/packs/base.cssother2.2 KB
shared/assets/packs/briefing/style.cssother1.4 KB
shared/assets/packs/briefing/template.htmlother1.7 KB
shared/assets/packs/casebook/style.cssother1.4 KB
shared/assets/packs/casebook/template.htmlother1.5 KB
shared/assets/packs/catalog.jsonconfig10.3 KB
shared/assets/packs/editorial/style.cssother1.2 KB
shared/assets/packs/editorial/template.htmlother2.0 KB
shared/assets/packs/field/style.cssother1.5 KB
shared/assets/packs/field/template.htmlother1.6 KB
shared/assets/packs/flows.jsonconfig21.8 KB
shared/assets/packs/lab/style.cssother1.4 KB
shared/assets/packs/lab/template.htmlother1.6 KB
shared/assets/packs/seminar/style.cssother1.4 KB
shared/assets/packs/seminar/template.htmlother1.7 KB
shared/assets/packs/workbook/style.cssother1.6 KB
shared/assets/packs/workbook/template.htmlother1.7 KB
shared/assets/shell.htmlother2.9 MB
shared/assets/snippets/01-cover-bauhaus.htmlother3.3 KB
shared/assets/snippets/01-cover-bento.htmlother6.7 KB
shared/assets/snippets/01-cover-bigstat.htmlother2.3 KB
shared/assets/snippets/01-cover-blueprint.htmlother4.3 KB
shared/assets/snippets/01-cover-bold-poster.htmlother3.4 KB
shared/assets/snippets/01-cover-center.htmlother2.5 KB
shared/assets/snippets/01-cover-diagram.htmlother2.4 KB
shared/assets/snippets/01-cover-editorial-lab.htmlother3.6 KB
shared/assets/snippets/01-cover-future-portal.htmlother3.6 KB
shared/assets/snippets/01-cover-learning-path.htmlother3.7 KB
shared/assets/snippets/01-cover-modular-cards.htmlother3.9 KB
shared/assets/snippets/01-cover-monograph.htmlother3.1 KB
shared/assets/snippets/01-cover-mosaic.htmlother2.4 KB
shared/assets/snippets/01-cover-paper-collage.htmlother3.1 KB
shared/assets/snippets/01-cover-split.htmlother2.8 KB
shared/assets/snippets/01-cover-stripes.htmlother2.4 KB
shared/assets/snippets/01-cover-workbook-notes.htmlother3.8 KB
shared/assets/snippets/02-agenda.htmlother21.2 KB
shared/assets/snippets/03-timeline.htmlother14.2 KB
shared/assets/snippets/04-map.htmlother16.3 KB
shared/assets/snippets/05-mechanism.htmlother14.5 KB
shared/assets/snippets/06-traits-grid.htmlother16.9 KB
shared/assets/snippets/07-meter.htmlother17.1 KB
shared/assets/snippets/08-compare-2.htmlother18.2 KB
shared/assets/snippets/09-compare-table.htmlother16.0 KB
shared/assets/snippets/10-hub.htmlother15.1 KB
shared/assets/snippets/11-levels.htmlother15.1 KB
shared/assets/snippets/12-tile-grid.htmlother12.3 KB
shared/assets/snippets/13-sequence.htmlother15.0 KB
shared/assets/snippets/14-mapping.htmlother13.7 KB
shared/assets/snippets/15-mock-legend.htmlother11.2 KB
shared/assets/snippets/16-mock-options.htmlother10.5 KB
shared/assets/snippets/17-statement.htmlother7.5 KB
shared/assets/snippets/18-build-up.htmlother14.0 KB
shared/assets/snippets/19-frame-form.htmlother9.2 KB
shared/assets/snippets/20-before-after.htmlother13.6 KB
shared/assets/snippets/21-worked-example.htmlother16.5 KB
shared/assets/snippets/22-worked-artifact.htmlother9.2 KB
shared/assets/snippets/23-quiz-ab.htmlother7.1 KB
shared/assets/snippets/24-quiz-sort.htmlother8.0 KB
shared/assets/snippets/25-quiz-ox.htmlother6.9 KB
shared/assets/snippets/26-rules-dark.htmlother13.7 KB
shared/assets/snippets/27-checklist.htmlother8.3 KB
shared/assets/snippets/28-sources.htmlother9.8 KB
shared/assets/snippets/29-closing.htmlother6.0 KB
shared/assets/snippets/30-check.htmlother10.3 KB
shared/assets/snippets/31-stat-strip.htmlother11.4 KB
shared/assets/snippets/32-screen-cite.htmlother14.1 KB
shared/assets/snippets/33-chart-bar.htmlother17.0 KB
shared/assets/snippets/34-chart-line.htmlother17.9 KB
shared/assets/snippets/35-explore.htmlother9.6 KB
shared/assets/snippets/36-detail-sheet.htmlother9.9 KB
shared/assets/snippets/37-arch-flow.htmlother17.2 KB
shared/assets/snippets/38-part-divider.htmlother7.0 KB
shared/assets/snippets/39-quadrant.htmlother10.0 KB
shared/assets/snippets/40-flashcards.htmlother12.4 KB
shared/assets/snippets/41-ops-report.htmlother22.8 KB
shared/assets/snippets/42-sankey-flow.htmlother9.7 KB
shared/assets/snippets/43-decision-tree.htmlother8.7 KB
shared/assets/snippets/44-kanban-board.htmlother9.4 KB
shared/assets/snippets/45-version-graph.htmlother8.9 KB
shared/assets/snippets/46-event-fanout.htmlother8.1 KB
shared/assets/snippets/47-route-tour.htmlother9.3 KB
shared/assets/snippets/48-waterfall.htmlother7.9 KB
shared/assets/snippets/49-mesh-network.htmlother7.8 KB
shared/assets/snippets/50-heatmap-grid.htmlother11.9 KB
shared/assets/snippets/51-swimlane.htmlother8.2 KB
shared/assets/snippets/52-cycle-ring.htmlother7.1 KB
shared/assets/snippets/53-verdict.htmlother6.9 KB
shared/assets/snippets/54-diagnose.htmlother3.0 KB
shared/assets/snippets/55-window-frame.htmlother3.3 KB
shared/assets/snippets/56-gate-chain.htmlother5.6 KB
shared/assets/snippets/patterns/code.htmlother1.2 KB
shared/assets/snippets/patterns/faq.htmlother839 B
shared/assets/snippets/patterns/fx.htmlother2.8 KB
shared/assets/snippets/patterns/pin-shot.htmlother1.5 KB
shared/assets/snippets/patterns/tabs.htmlother1.1 KB
shared/assets/style-sheets/README.mdmarkdown1.7 KB
shared/assets/style-sheets/previews/clean-professional.pngbinary1.4 MB
shared/assets/style-sheets/previews/creative-magazine.pngbinary2.1 MB
shared/assets/style-sheets/previews/data-dashboard.pngbinary1.3 MB
shared/assets/style-sheets/previews/e-ink-magazine.pngbinary2.4 MB
shared/assets/style-sheets/previews/handdrawn-technical.pngbinary2.0 MB
shared/assets/style-sheets/previews/handdrawn-whiteboard.pngbinary1.9 MB
shared/assets/style-sheets/previews/mckinsey-style.pngbinary1.7 MB
shared/assets/style-sheets/previews/party-government-red.pngbinary1.5 MB
shared/assets/style-sheets/previews/retro-flat-illustration.pngbinary2.3 MB
shared/assets/style-sheets/previews/scientific-defense.pngbinary1.4 MB
shared/assets/style-sheets/previews/teaching-courseware.pngbinary1.4 MB
shared/assets/style-sheets/previews/warm-handmade.pngbinary2.3 MB
shared/assets/style-sheets/党政红风格.mdmarkdown8.5 KB
shared/assets/style-sheets/创意杂志风.mdmarkdown3.3 KB
shared/assets/style-sheets/复古扁平插画风.mdmarkdown3.3 KB
shared/assets/style-sheets/手绘技术解释风.mdmarkdown4.7 KB
shared/assets/style-sheets/手绘白板风.mdmarkdown3.3 KB
shared/assets/style-sheets/教学课件风.mdmarkdown9.7 KB
shared/assets/style-sheets/数据仪表盘风.mdmarkdown3.4 KB
shared/assets/style-sheets/清爽专业风.mdmarkdown4.4 KB
shared/assets/style-sheets/温暖手工风.mdmarkdown3.3 KB
shared/assets/style-sheets/电子墨水杂志风.mdmarkdown4.6 KB
shared/assets/style-sheets/科研答辩风.mdmarkdown9.1 KB
shared/assets/style-sheets/麦肯锡风格.mdmarkdown14.8 KB
shared/dev/README.mdmarkdown12.7 KB
shared/dev/crayon-reference.htmlother19.1 KB
shared/dev/defect_test.pyscript5.7 KB
shared/dev/fill_test.pyscript3.4 KB
shared/dev/make_icons.pyscript10.0 KB
shared/dev/make_snippets.pyscript16.0 KB
shared/dev/pack_shell_template.htmlother35.7 KB
shared/dev/port.pyscript1.5 KB
shared/dev/shell_template.htmlother61.0 KB
shared/dev/test_absorb_snippets.pyscript5.5 KB
shared/dev/test_arch_lanes.pyscript12.0 KB
shared/dev/test_arch_si.pyscript17.5 KB
shared/dev/test_arch_trace.pyscript5.6 KB
shared/dev/test_check_talk_est.pyscript4.1 KB
shared/dev/test_chrome_menu.pyscript13.2 KB
shared/dev/test_consult_chart.pyscript35.9 KB
shared/dev/test_consult_regen.pyscript3.5 KB
shared/dev/test_consulting_check.pyscript7.4 KB
shared/dev/test_contrast_backdrop.pyscript8.6 KB
shared/dev/test_contrast_matrix.pyscript9.2 KB
shared/dev/test_cover_art.pyscript10.7 KB
shared/dev/test_cover_custom.pyscript10.8 KB
shared/dev/test_cover_rework.pyscript8.3 KB
shared/dev/test_dblclick_finish.pyscript6.5 KB
shared/dev/test_diagram_variants.pyscript13.8 KB
shared/dev/test_extract_copy.pyscript7.3 KB
shared/dev/test_extract_style.pyscript13.8 KB
shared/dev/test_figslot.pyscript14.0 KB
shared/dev/test_final_gate.pyscript2.5 KB
shared/dev/test_flint_model.pyscript5.5 KB
shared/dev/test_flint_theme.pyscript4.6 KB
shared/dev/test_free_mode.pyscript10.7 KB
shared/dev/test_fx_absorb.pyscript13.8 KB
shared/dev/test_fx_draft.pyscript38.0 KB
shared/dev/test_fx_patterns.pyscript16.8 KB
shared/dev/test_key_motion.pyscript9.3 KB
shared/dev/test_koboyo_icons.pyscript8.6 KB
shared/dev/test_miniflow.pyscript11.7 KB
shared/dev/test_motion_techniques.pyscript11.9 KB
shared/dev/test_ops_report.pyscript11.4 KB
shared/dev/test_pack_browser.pyscript15.7 KB
shared/dev/test_pack_checker.pyscript10.1 KB
shared/dev/test_pack_icons.pyscript6.5 KB
shared/dev/test_pack_router.pyscript5.1 KB

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>
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: 471kUpdated Claude CodeCodexVerifiedInstall
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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 322kUpdated Claude CodeCodexVerifiedInstall