dsh-drawai 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4142 -0
- package/README.md +43 -10
- package/lib/audio-media.js +147 -0
- package/lib/audio-service.js +66 -0
- package/lib/canvas-format.js +134 -0
- package/lib/client.js +5075 -181
- package/lib/comfyui-default-workflow.mjs +1825 -0
- package/lib/comfyui-workflow.mjs +426 -0
- package/lib/document-commands.js +12 -0
- package/lib/document-core.js +29 -0
- package/lib/drawing-tasks.js +26 -0
- package/lib/imagegen.mjs +596 -0
- package/lib/index.js +1758 -129
- package/lib/media.js +26 -13
- package/lib/mgstyle-core.js +75 -0
- package/lib/motion/apply.js +180 -0
- package/lib/motion/asset-pack-lock.js +10 -0
- package/lib/motion/asset-pack.js +335 -0
- package/lib/motion/assets.js +290 -0
- package/lib/motion/audio.js +103 -0
- package/lib/motion/audiolevel.js +63 -0
- package/lib/motion/audiomix.js +144 -0
- package/lib/motion/beats.js +337 -0
- package/lib/motion/builtin-assets.js +62 -0
- package/lib/motion/canvas-spec.js +442 -0
- package/lib/motion/capture.js +95 -0
- package/lib/motion/cards.js +80 -0
- package/lib/motion/collect.js +447 -0
- package/lib/motion/delivery.js +112 -0
- package/lib/motion/edge-speech.py +90 -0
- package/lib/motion/entry.jsx +73 -0
- package/lib/motion/export.js +200 -0
- package/lib/motion/ffmpeg.js +42 -0
- package/lib/motion/fonts.js +71 -0
- package/lib/motion/jobs.js +113 -0
- package/lib/motion/json.js +4 -0
- package/lib/motion/media-catalog.js +59 -0
- package/lib/motion/mgstyles/BRIEF-TEMPLATE.md +63 -0
- package/lib/motion/mgstyles/briefs/01-flat-vector.md +104 -0
- package/lib/motion/mgstyles/briefs/02-line-art.md +97 -0
- package/lib/motion/mgstyles/briefs/03-isometric.md +108 -0
- package/lib/motion/mgstyles/briefs/05-cel-boil.md +145 -0
- package/lib/motion/mgstyles/briefs/06-collage.md +149 -0
- package/lib/motion/mgstyles/briefs/07-liquid.md +106 -0
- package/lib/motion/mgstyles/briefs/08-morph.md +111 -0
- package/lib/motion/mgstyles/briefs/09-bauhaus.md +150 -0
- package/lib/motion/mgstyles/briefs/10-synthwave.md +151 -0
- package/lib/motion/mgstyles/briefs/12-aurora-glass.md +147 -0
- package/lib/motion/mgstyles/briefs/18-hanazi.md +140 -0
- package/lib/motion/mgstyles/briefs/19-paperclip.md +156 -0
- package/lib/motion/mgstyles/briefs/20-pixel.md +118 -0
- package/lib/motion/mgstyles/briefs/22-hud.md +118 -0
- package/lib/motion/mgstyles/catalog.d/01-flat-vector.json +34 -0
- package/lib/motion/mgstyles/catalog.d/02-line-art.json +34 -0
- package/lib/motion/mgstyles/catalog.d/03-isometric.json +35 -0
- package/lib/motion/mgstyles/catalog.d/05-cel-boil.json +28 -0
- package/lib/motion/mgstyles/catalog.d/06-collage.json +28 -0
- package/lib/motion/mgstyles/catalog.d/07-liquid.json +28 -0
- package/lib/motion/mgstyles/catalog.d/08-morph.json +28 -0
- package/lib/motion/mgstyles/catalog.d/09-bauhaus.json +28 -0
- package/lib/motion/mgstyles/catalog.d/10-synthwave.json +28 -0
- package/lib/motion/mgstyles/catalog.d/12-aurora-glass.json +28 -0
- package/lib/motion/mgstyles/catalog.d/18-hanazi.json +28 -0
- package/lib/motion/mgstyles/catalog.d/19-paperclip.json +28 -0
- package/lib/motion/mgstyles/catalog.d/20-pixel.json +28 -0
- package/lib/motion/mgstyles/catalog.d/22-hud.json +28 -0
- package/lib/motion/mgstyles/catalog.json +1356 -0
- package/lib/motion/mgstyles/upstream/README.md +147 -0
- package/lib/motion/mgstyles/upstream/README.zh-CN.md +147 -0
- package/lib/motion/mgstyles/upstream/demos/01-flat-vector/cues.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/01-flat-vector/index.html +712 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/cues.json +331 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/film.js +676 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/index.html +18 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/tools/dump_timing.mjs +26 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/cues.json +109 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/index.html +25 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/anim.js +82 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/main.js +219 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/night5.js +180 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/render.js +202 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title.js +167 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title5.js +294 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/ui.js +141 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/world.js +1399 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/cues.json +157 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/index.html +34 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/engine.js +326 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/scene.js +2036 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/assets/gen/layout.json +157 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/cues.json +80 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/index.html +889 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/cues.json +100 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/index.html +108 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/engine.js +153 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/links.js +64 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/lookdev.js +46 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/scene.js +963 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/shaders.js +647 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/textsdf.js +114 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/type.js +50 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/cues.json +131 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/glyphs.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/index.html +901 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/cues.json +270 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/film.js +697 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/index.html +12 -0
- package/lib/motion/mgstyles/upstream/demos/10-synthwave/cues.json +44 -0
- package/lib/motion/mgstyles/upstream/demos/10-synthwave/index.html +1028 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/cues.json +67 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/index.html +16 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/main.js +967 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/shaders.js +468 -0
- package/lib/motion/mgstyles/upstream/demos/18-hanazi/cues.json +117 -0
- package/lib/motion/mgstyles/upstream/demos/18-hanazi/index.html +541 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/countries-110m.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/stickers/meta.json +34 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/cues.json +285 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/index.html +599 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/cues.json +42 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/film.js +914 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/index.html +18 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/cues.json +108 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/index.html +125 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/holo.js +275 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/hud.js +855 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/post.js +150 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/util.js +65 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/v5.js +142 -0
- package/lib/motion/mgstyles/upstream/harness/render.mjs +319 -0
- package/lib/motion/mgstyles/upstream/manifest.json +269 -0
- package/lib/motion/mgstyles/upstream/prompts/01-flat-vector.md +98 -0
- package/lib/motion/mgstyles/upstream/prompts/02-line-art.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/03-isometric.md +97 -0
- package/lib/motion/mgstyles/upstream/prompts/05-cel-boil.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/06-collage.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/07-liquid.md +98 -0
- package/lib/motion/mgstyles/upstream/prompts/08-morph.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/09-bauhaus.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/10-synthwave.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/12-aurora-glass.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/18-hanazi.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/19-paperclip.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/20-pixel.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/22-hud.md +95 -0
- package/lib/motion/mgstyles/upstream/rubric.md +51 -0
- package/lib/motion/mgstyles/upstream/template.md +36 -0
- package/lib/motion/pixelqa.js +198 -0
- package/lib/motion/preview.js +95 -0
- package/lib/motion/project.js +395 -0
- package/lib/motion/qa.js +290 -0
- package/lib/motion/reference-media.jsx +10 -0
- package/lib/motion/render-settings.js +112 -0
- package/lib/motion/render.js +159 -0
- package/lib/motion/scene-kit.js +183 -0
- package/lib/motion/sfx.js +232 -0
- package/lib/motion/shotcraft/ClipCard.tsx +204 -0
- package/lib/motion/shotcraft/catalog.json +2461 -0
- package/lib/motion/shotcraft/upstream/SKILL.md +286 -0
- package/lib/motion/shotcraft/upstream/assets/lib/Caption.tsx +54 -0
- package/lib/motion/shotcraft/upstream/assets/lib/ClipCard.tsx +200 -0
- package/lib/motion/shotcraft/upstream/assets/lib/DigitRoll.tsx +45 -0
- package/lib/motion/shotcraft/upstream/assets/lib/FlashCut.tsx +20 -0
- package/lib/motion/shotcraft/upstream/assets/lib/FlatPanel.tsx +65 -0
- package/lib/motion/shotcraft/upstream/assets/lib/PageCam.tsx +151 -0
- package/lib/motion/shotcraft/upstream/assets/lib/VerticalTicker.tsx +129 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/camera.tsx +75 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/motion.ts +40 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/rand.ts +11 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/shake.ts +10 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/__pycache__/sfx-source.cpython-313.pyc +0 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/build-readme-cover.mjs +49 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/capture-template.mjs +210 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/sfx-source.py +423 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/smoke-render-demos.py +170 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/test_sfx_source.py +157 -0
- package/lib/motion/shotcraft/upstream/demos/README.md +120 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Brand.tsx +112 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Fixtures.tsx +647 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Look.tsx +316 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Motion.tsx +82 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/PageCam2D.tsx +115 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Polish.tsx +243 -0
- package/lib/motion/shotcraft/upstream/demos/_textures/live-layout.json +389 -0
- package/lib/motion/shotcraft/upstream/demos/camera/basic-3d-scene/Basic3DScene.tsx +250 -0
- package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashImpactReal.tsx +305 -0
- package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashZoomReal.tsx +246 -0
- package/lib/motion/shotcraft/upstream/demos/camera/cursor-flyover/CursorFlyover.tsx +390 -0
- package/lib/motion/shotcraft/upstream/demos/camera/depth-layer-moves/MultiplaneReal.tsx +138 -0
- package/lib/motion/shotcraft/upstream/demos/camera/graze-face-tour/GrazeFaceTour.tsx +542 -0
- package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/OverheadTabletopDrop.tsx +315 -0
- package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/TiltReveal.tsx +299 -0
- package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/DroneDiveLanding.tsx +173 -0
- package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/ExplodedView.tsx +348 -0
- package/lib/motion/shotcraft/upstream/demos/camera/steep-tilt-glide/SteepTiltGlide.tsx +366 -0
- package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/BulletTimeFreezeOrbit.tsx +279 -0
- package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/PullBackIsolation.tsx +184 -0
- package/lib/motion/shotcraft/upstream/demos/camera/terminal-3d/Terminal3D.tsx +390 -0
- package/lib/motion/shotcraft/upstream/demos/data/before-after-slider-scrub/BeforeAfterSliderScrub.tsx +155 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/AxisRescaleShockV2.tsx +303 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/OscilloscopeStreamV2.tsx +290 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/UnitDotSwarmRegroupV2.tsx +278 -0
- package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/NeedleSweepSelftest.tsx +307 -0
- package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/TapeScrollFixedPointer.tsx +215 -0
- package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/BrakeReticleLock.tsx +299 -0
- package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/ChangelogScrollBrake.tsx +232 -0
- package/lib/motion/shotcraft/upstream/demos/data/timeline-travel/TimelineTravel.tsx +290 -0
- package/lib/motion/shotcraft/upstream/demos/effects/assemble-then-type-flyin/AssembleThenTypeFlyin.tsx +273 -0
- package/lib/motion/shotcraft/upstream/demos/effects/aurora-bloom-bg-flip/AuroraBloomBgFlip.tsx +167 -0
- package/lib/motion/shotcraft/upstream/demos/effects/brand-frame-snap/BrandFrameSnap.tsx +536 -0
- package/lib/motion/shotcraft/upstream/demos/effects/fui-hud-moves/ReticleLockOn.tsx +164 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/FlylineArc.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/GlowOrbAmbient.tsx +197 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/OrbFlylineRelay.tsx +241 -0
- package/lib/motion/shotcraft/upstream/demos/effects/icon-performance-moves/AttentionBounce.tsx +279 -0
- package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/AnimeImpact.tsx +230 -0
- package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/HitCounter.tsx +345 -0
- package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SheenSweepRetry.tsx +275 -0
- package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SpotlightSweepReveal.tsx +229 -0
- package/lib/motion/shotcraft/upstream/demos/effects/radial-ripple-phone-chips/RadialRipplePhoneChips.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/effects/riso-print-hits/RisoMisregistrationHit.tsx +222 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scan-bracket-sweep/ScanBracketSweep.tsx +295 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scanline-annotate-focus/ScanlineAnnotateFocus.tsx +329 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scanline-assemble-flyin/ScanlineAssembleFlyin.tsx +315 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ImpactBurstKit.tsx +264 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/KanadaPerspectiveSnap.tsx +260 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ScoreSlam.tsx +263 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/CornerSpotlightReveal.tsx +123 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/GlowWakeSleepPanel.tsx +187 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/SlideSpotlightPan.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/autolayout-gap-dial/AutolayoutGapDial.tsx +305 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/DiagramCascadeBuild.tsx +350 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/PanelToCanvasMaterialize.tsx +352 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/chip-grid-single-select-blackout/ChipGridSingleSelectBlackout.tsx +218 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/collab-cursor-moves/CursorCastEnsemble.tsx +297 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/glass-pill-dictation-typing/GlassPillDictationTyping.tsx +157 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/hashtag-to-pill-materialize/HashtagToPillMaterialize.tsx +218 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/picker-carousel-feature-cycle/PickerCarouselFeatureCycle.tsx +202 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/segmented-thumb-hero/SegmentedThumbHero.tsx +265 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/PaletteThemeRipple.tsx +457 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/ThemeSweepToggle.tsx +446 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/type-and-filter/TypeAndFilter.tsx +249 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/voice-waveform-live/VoiceWaveformLive.tsx +278 -0
- package/lib/motion/shotcraft/upstream/demos/opening/crane-rise-reveal/CraneRiseReveal.tsx +332 -0
- package/lib/motion/shotcraft/upstream/demos/opening/dataviz-landscape-open/DatavizLandscapeOpen.tsx +358 -0
- package/lib/motion/shotcraft/upstream/demos/opening/fracture/Fracture.tsx +201 -0
- package/lib/motion/shotcraft/upstream/demos/opening/icon-field-colorize/IconFieldColorize.tsx +200 -0
- package/lib/motion/shotcraft/upstream/demos/opening/letterspace-materialize/LetterspaceMaterialize.tsx +208 -0
- package/lib/motion/shotcraft/upstream/demos/opening/magician-card-flourish/MagicianCardFlourish.tsx +341 -0
- package/lib/motion/shotcraft/upstream/demos/opening/orbit-ring-title-open/OrbitRingTitleOpen.tsx +389 -0
- package/lib/motion/shotcraft/upstream/demos/opening/spotlight-hero-card/SpotlightHeroCard.tsx +293 -0
- package/lib/motion/shotcraft/upstream/demos/opening/stroke-segment-build/StrokeSegmentBuild.tsx +183 -0
- package/lib/motion/shotcraft/upstream/demos/opening/text-as-mask/TextAsMask.tsx +245 -0
- package/lib/motion/shotcraft/upstream/demos/outro/grain-dissolve/GrainDissolve.tsx +222 -0
- package/lib/motion/shotcraft/upstream/demos/outro/logo-shrink-wordmark-lockup/LogoShrinkWordmarkLockup.tsx +223 -0
- package/lib/motion/shotcraft/upstream/demos/outro/neon-triple-marquee/NeonTripleMarquee.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/outro/outro-group-photo-launch/OutroGroupPhotoLaunch.tsx +343 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-strip-away-outro/UiStripAwayOutro.tsx +357 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/IconFlipBloomLogo.tsx +187 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/InputMorphsIntoLogo.tsx +333 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/beat-cut-moves/PaparazziFlash.tsx +274 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/beat-step-list-theme-cycle/BeatStepListThemeCycle.tsx +270 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/panel-grid-moves/ComicPanelSplit.tsx +430 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/quad-split-parallel-scenes/QuadSplitParallelScenes.tsx +252 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/rhythm-interrupt-moves/JumpCutPunchIn.tsx +106 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/sakuga-timing-shift/SakugaTimingShift.tsx +288 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/speed-ramp-freeze/FreezeAnnotateReal.tsx +362 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/trailer-grammar-moves/TrailerBumper.tsx +168 -0
- package/lib/motion/shotcraft/upstream/demos/transition/bottom-push-stack-wipe/BottomPushStackWipe.tsx +310 -0
- package/lib/motion/shotcraft/upstream/demos/transition/card-flip-reveal/CardFlipReveal.tsx +261 -0
- package/lib/motion/shotcraft/upstream/demos/transition/card-flock-tumble/CardFlockTumble.tsx +459 -0
- package/lib/motion/shotcraft/upstream/demos/transition/circle-match-iris/CircleMatchIris.tsx +294 -0
- package/lib/motion/shotcraft/upstream/demos/transition/gradient-transition/GradientTransition.tsx +161 -0
- package/lib/motion/shotcraft/upstream/demos/transition/line-carry-transition/LineCarryTransition.tsx +248 -0
- package/lib/motion/shotcraft/upstream/demos/transition/mosaic-reframe/MosaicReframe.tsx +359 -0
- package/lib/motion/shotcraft/upstream/demos/transition/page-turn-transitions/BarnDoorSplit.tsx +227 -0
- package/lib/motion/shotcraft/upstream/demos/transition/print-texture-transitions/InkBleedReveal.tsx +162 -0
- package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/PortalWipeV2.tsx +248 -0
- package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/WhipBrakeReal.tsx +186 -0
- package/lib/motion/shotcraft/upstream/demos/transition/tear-streak-transitions/GlitchDisplace.tsx +355 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/InvisibleCut.tsx +272 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/LightLeakBurn.tsx +262 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/VersusSlam.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-travel/LetterformZoom.tsx +285 -0
- package/lib/motion/shotcraft/upstream/demos/transition/white-flash-logo-simplify-cut/WhiteFlashLogoSimplifyCut.tsx +205 -0
- package/lib/motion/shotcraft/upstream/demos/transition/wipe-transitions/BlindsSlice.tsx +178 -0
- package/lib/motion/shotcraft/upstream/demos/typography/blur-slide/BlurSlide.tsx +147 -0
- package/lib/motion/shotcraft/upstream/demos/typography/brace-expand/BraceExpand.tsx +143 -0
- package/lib/motion/shotcraft/upstream/demos/typography/brand-ink-open/BrandInkOpen.tsx +134 -0
- package/lib/motion/shotcraft/upstream/demos/typography/countdown-arc-scatter/CountdownArcScatter.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/typography/flying-words/FlyingWords.tsx +198 -0
- package/lib/motion/shotcraft/upstream/demos/typography/glitch-cycle/GlitchCycle.tsx +221 -0
- package/lib/motion/shotcraft/upstream/demos/typography/gradient-word-sweep/GradientWordSweep.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/typography/lead-word-zoom-assemble/LeadWordZoomAssemble.tsx +261 -0
- package/lib/motion/shotcraft/upstream/demos/typography/marker-underline-title/MarkerUnderlineTitle.tsx +121 -0
- package/lib/motion/shotcraft/upstream/demos/typography/outline-word-fill/OutlineWordFill.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/typography/paper-title-card/PaperTitleCard.tsx +179 -0
- package/lib/motion/shotcraft/upstream/demos/typography/pill-chip-slot-cycle-handled/PillChipSlotCycleHandled.tsx +140 -0
- package/lib/motion/shotcraft/upstream/demos/typography/pill-slot-cycle/PillSlotCycle.tsx +309 -0
- package/lib/motion/shotcraft/upstream/demos/typography/text-column-converge/TextColumnConverge.tsx +191 -0
- package/lib/motion/shotcraft/upstream/demos/typography/title-demote-to-label/TitleDemoteToLabel.tsx +292 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/LetterformDriftAssembly.tsx +135 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/SplitTextStagger.tsx +124 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/TextOnPath.tsx +255 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-entrance-moves/LetterDropPhysics.tsx +173 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/FontWeightPump.tsx +225 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/KaraokeFillSync.tsx +141 -0
- package/lib/motion/shotcraft/upstream/demos/typography/typewriter-moves/TypewriterErrorRetype.tsx +137 -0
- package/lib/motion/shotcraft/upstream/demos/typography/vertical-word-roll-blur-cycle/VerticalWordRollBlurCycle.tsx +147 -0
- package/lib/motion/shotcraft/upstream/demos/typography/word-relay-filmstrip/WordRelayFilmstrip.tsx +409 -0
- package/lib/motion/shotcraft/upstream/demos/typography/word-relay-geometry/WordRelayGeometry.tsx +280 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/avatar-bracket-carousel/AvatarBracketCarousel.tsx +271 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/bezier-source-converge-merge/BezierSourceConvergeMerge.tsx +385 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/card-stack/CardStack.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/carousel-3d/Carousel3D.tsx +303 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/clipcard-looping/ClipCardLooping.tsx +77 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/cloner-depth-echo/ClonerDepthEcho.tsx +311 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/deck-deal-flyin/DeckDealFlyin.tsx +307 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/doc-park-left-pill-deal/DocParkLeftPillDeal.tsx +349 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/document-typewriter-reveal/DocumentTypewriterReveal.tsx +255 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/draw-svg-trace/DrawSvgTrace.tsx +244 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/element-body-moves/ContactShadowLift.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/integration-hub-map/IntegrationHubMap.tsx +652 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-reveal/ListReveal.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-stack-press/ListStackPress.tsx +238 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-forerun/NeonFrameForerun.tsx +324 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-orbit-drop/NeonFrameForerunOrbit.tsx +354 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/PageWaterfallWall.tsx +101 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/VerticalTicker.tsx +129 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/product-card-progressive-assemble/ProductCardProgressiveAssemble.tsx +297 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/radial-wave/RadialWave.tsx +57 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/research-card-stack-scroll/ResearchCardStackScroll.tsx +155 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/row-embed/RowEmbed.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/value-stagger-gradient/ValueStaggerGradient.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/BentoLightUp.tsx +146 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/WireframeDrawOn.tsx +226 -0
- package/lib/motion/shotcraft/upstream/gallery/api/library.json +1 -0
- package/lib/motion/shotcraft/upstream/manifest.json +2715 -0
- package/lib/motion/shotcraft/upstream/references/aesthetic-rules.md +193 -0
- package/lib/motion/shotcraft/upstream/references/final-review.md +121 -0
- package/lib/motion/shotcraft/upstream/references/guided-free-creation.md +199 -0
- package/lib/motion/shotcraft/upstream/references/jianying-export.md +183 -0
- package/lib/motion/shotcraft/upstream/references/music-beat-sync.md +257 -0
- package/lib/motion/shotcraft/upstream/references/pipeline.md +382 -0
- package/lib/motion/shotcraft/upstream/references/publish-upload-post.md +111 -0
- package/lib/motion/shotcraft/upstream/references/sequences/promo-energy-arc.md +50 -0
- package/lib/motion/shotcraft/upstream/references/sfx-sourcing.md +95 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/basic-3d-scene.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/crash-zoom-punch.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/cursor-flyover.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/depth-layer-moves.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/graze-face-tour.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/overhead-camera-moves.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/space-camera-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/steep-tilt-glide.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/tension-camera-moves.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/terminal-3d.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/before-after-slider-scrub.md +48 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/chart-live-moves.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/gauge-readout-moves.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/scroll-brake-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/timeline-travel.md +44 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/assemble-then-type-flyin.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/aurora-bloom-bg-flip.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/brand-frame-snap.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/fui-hud-moves.md +35 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/glow-flyline-moves.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/icon-performance-moves.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/impact-feedback.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/light-play-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/radial-ripple-phone-chips.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/riso-print-hits.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scan-bracket-sweep.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-annotate-focus.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-assemble-flyin.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/slam-entrance-moves.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/spotlight-sweep-moves.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/autolayout-gap-dial.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/canvas-materialize-moves.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/chip-grid-single-select-blackout.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/collab-cursor-moves.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/glass-pill-dictation-typing.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/hashtag-to-pill-materialize.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/picker-carousel-feature-cycle.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/segmented-thumb-hero.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/theme-switch-moves.md +47 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/type-and-filter.md +37 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/voice-waveform-live.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/brand-ink-open.md +36 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/crane-rise-reveal.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/dataviz-landscape-open.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/fracture.md +40 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/icon-field-colorize.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/letterspace-materialize.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/magician-card-flourish.md +73 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/orbit-ring-title-open.md +87 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/spotlight-hero-card.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/stroke-segment-build.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/text-as-mask.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/grain-dissolve.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/logo-shrink-wordmark-lockup.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/neon-triple-marquee.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/outro-group-photo-launch.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/ui-strip-away-outro.md +61 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/ui-to-brand-morph.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-cut-moves.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-step-list-theme-cycle.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/panel-grid-moves.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/quad-split-parallel-scenes.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/rhythm-interrupt-moves.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/sakuga-timing-shift.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/speed-ramp-freeze.md +44 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/trailer-grammar-moves.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/bottom-push-stack-wipe.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/card-flip-reveal.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/card-flock-tumble.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/circle-match-iris.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/gradient-transition.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/line-carry-transition.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/mosaic-reframe.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/page-turn-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/print-texture-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/shot-transitions.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/tear-streak-transitions.md +48 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/transition-hidden-cut.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/transition-travel.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/white-flash-logo-simplify-cut.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/wipe-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/blur-slide.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/brace-expand.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/countdown-arc-scatter.md +65 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/document-typewriter-reveal.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/flying-words.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/glitch-cycle.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/gradient-word-sweep.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/lead-word-zoom-assemble.md +91 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/marker-underline-title.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/outline-word-fill.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/paper-title-card.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/pill-chip-slot-cycle-handled.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/pill-slot-cycle.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/text-column-converge.md +61 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/title-demote-to-label.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-assembly-moves.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-entrance-moves.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-rhythm-sync.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/typewriter-moves.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/vertical-word-roll-blur-cycle.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-filmstrip.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-geometry.md +75 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/avatar-bracket-carousel.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/bezier-source-converge-merge.md +67 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/card-stack.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/carousel-3d.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/cloner-depth-echo.md +40 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/deck-deal-flyin.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/doc-park-left-pill-deal.md +62 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/draw-svg-trace.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/element-body-moves.md +37 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/integration-hub-map.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-reveal.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-stack-press.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-forerun.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-orbit-drop.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/page-waterfall-wall.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/product-card-progressive-assemble.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/radial-wave.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/research-card-stack-scroll.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/row-embed.md +36 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/value-stagger-gradient.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/wall-reveal-moves.md +47 -0
- package/lib/motion/shotcraft/upstream/references/sound-design.md +170 -0
- package/lib/motion/shotcraft/upstream/references/workbench.md +157 -0
- package/lib/motion/shotcraft/upstream/template/TEMPLATE.md +103 -0
- package/lib/motion/shotcraft/upstream/template/THEMES.md +44 -0
- package/lib/motion/shotcraft/upstream/template/package.json +20 -0
- package/lib/motion/shotcraft/upstream/template/remotion.config.ts +6 -0
- package/lib/motion/shotcraft/upstream/template/src/Root.tsx +17 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/Caption.tsx +65 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/DigitRoll.tsx +48 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/FlashCut.tsx +24 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/Main.tsx +192 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/PaperTitleCard.tsx +111 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/PageCam.tsx +150 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneDetail.tsx +158 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneFlyIn.tsx +468 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOpen.tsx +552 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOutroLive.tsx +411 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/ScenePapers.tsx +200 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneWbr.tsx +324 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live-layout.json +389 -0
- package/lib/motion/shotcraft/upstream/template/src/index.ts +4 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/ThemedFilm.tsx +7 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/manifest.tsx +68 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.json +1 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.ts +24 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palettes.json +74 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/visual-theme.tsx +91 -0
- package/lib/motion/shotcraft/upstream/template/src/workbench.ts +213 -0
- package/lib/motion/shotcraft/upstream/template/tsconfig.json +15 -0
- package/lib/motion/spec.js +113 -0
- package/lib/motion/style-engine.js +153 -0
- package/lib/motion/style-frames.js +268 -0
- package/lib/motion/sync.js +214 -0
- package/lib/motion/theme.js +121 -0
- package/lib/motion/voice.js +417 -0
- package/lib/motion-agent-files.js +82 -0
- package/lib/motion-agent-protocol.js +66 -0
- package/lib/motion-agent-tools.js +196 -0
- package/lib/motion-agent.js +171 -0
- package/lib/motion-capture.js +92 -0
- package/lib/motion-core.js +238 -0
- package/lib/motion-film-review.js +71 -0
- package/lib/motion-library.js +210 -0
- package/lib/motion-planner.js +254 -0
- package/lib/motion-project.js +80 -0
- package/lib/motion-render-worker.js +145 -0
- package/lib/motion-session.js +32 -0
- package/lib/motion-source.js +49 -0
- package/lib/motion-tasks.js +452 -0
- package/lib/motion-vision.js +43 -0
- package/lib/mxfile.js +27 -7
- package/lib/routing/node-runtime.js +14 -0
- package/lib/routing/router.js +211 -0
- package/lib/routing/vendor/README.md +96 -0
- package/lib/routing/vendor/libavoid-routing.js +753 -0
- package/lib/routing/vendor/libavoid.min.js +59 -0
- package/lib/shotcard-core.js +39 -0
- package/lib/shotcard-reference.js +56 -0
- package/lib/style-kernel.js +37 -3
- package/lib/task-patches.js +26 -2
- package/lib/video-export.js +17 -2
- package/package.json +29 -4
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// 镜头卡 → 时间轴:画布上连到视频节点的 shotcard 就是这条片的镜头顺序。
|
|
2
|
+
//
|
|
3
|
+
// 卡片的 duration 是给人看的自由文本(「约5.6s(168f@30fps)」),
|
|
4
|
+
// 所以优先取其中的绝对帧数(**按卡自己的 fps 换算成本工程 fps**),其次秒数,
|
|
5
|
+
// 都没有才回落 3 秒。168f@30fps 在 15fps 的工程里是 84 帧,不是 168 帧。
|
|
6
|
+
|
|
7
|
+
import { layoutShots } from './spec.js'
|
|
8
|
+
|
|
9
|
+
const FALLBACK_SECONDS = 3
|
|
10
|
+
// 卡片配方默认按 30fps 写;文本里没写帧率时才用它。
|
|
11
|
+
const CARD_FPS = 30
|
|
12
|
+
|
|
13
|
+
/** 把「168f@30fps」「5.6s」「约 5.6 秒」统一读成秒。 */
|
|
14
|
+
export function cardSeconds(duration) {
|
|
15
|
+
const text = String(duration ?? '')
|
|
16
|
+
const frames = /(\d+(?:\.\d+)?)\s*f(?:rames?)?\b/i.exec(text)
|
|
17
|
+
if (frames) {
|
|
18
|
+
const fpsTag = /@\s*(\d+(?:\.\d+)?)\s*fps/i.exec(text) || /(\d+(?:\.\d+)?)\s*fps/i.exec(text)
|
|
19
|
+
const cardFps = fpsTag ? Number(fpsTag[1]) : CARD_FPS
|
|
20
|
+
return Number(frames[1]) / (cardFps > 0 ? cardFps : CARD_FPS)
|
|
21
|
+
}
|
|
22
|
+
const seconds = /(\d+(?:\.\d+)?)\s*(?:s\b|sec|秒)/i.exec(text)
|
|
23
|
+
if (seconds) return Number(seconds[1])
|
|
24
|
+
return FALLBACK_SECONDS
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function cardFrames(duration, fps = 30) {
|
|
28
|
+
return Math.max(1, Math.round(cardSeconds(duration) * (fps || 30)))
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 把各段按比例拉到 target 帧,总和精确等于 target(最大余数法)。
|
|
32
|
+
function fitDurations(durations, target) {
|
|
33
|
+
const total = durations.reduce((sum, value) => sum + value, 0)
|
|
34
|
+
if (!target || !total || target === total) return durations
|
|
35
|
+
const exact = durations.map((value) => (value * target) / total)
|
|
36
|
+
const out = exact.map((value) => Math.max(1, Math.floor(value)))
|
|
37
|
+
let rest = target - out.reduce((sum, value) => sum + value, 0)
|
|
38
|
+
const order = exact
|
|
39
|
+
.map((value, index) => ({ index, frac: value - Math.floor(value) }))
|
|
40
|
+
.sort((a, b) => b.frac - a.frac)
|
|
41
|
+
let cursor = 0
|
|
42
|
+
while (rest > 0) {
|
|
43
|
+
out[order[cursor % order.length].index] += 1
|
|
44
|
+
rest -= 1
|
|
45
|
+
cursor += 1
|
|
46
|
+
}
|
|
47
|
+
while (rest < 0) {
|
|
48
|
+
const biggest = out.indexOf(Math.max(...out))
|
|
49
|
+
if (out[biggest] <= 1) break
|
|
50
|
+
out[biggest] -= 1
|
|
51
|
+
rest += 1
|
|
52
|
+
}
|
|
53
|
+
return out
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// cards: [{ cardId, styleKey, duration, frames, nodeId }],顺序即镜头顺序。
|
|
57
|
+
// options.fitFrames:显式指定总帧数时,按卡片之间的相对时长等比拉伸。
|
|
58
|
+
export function timelineFromCards(spec, cards, options = {}) {
|
|
59
|
+
const list = Array.isArray(cards) ? cards.filter(Boolean) : []
|
|
60
|
+
if (!list.length) throw new Error('没有可排布的镜头卡')
|
|
61
|
+
const raw = list.map((card) => (Number.isFinite(card.frames) && card.frames > 0
|
|
62
|
+
? Math.round(card.frames)
|
|
63
|
+
: cardFrames(card.duration, spec.fps)))
|
|
64
|
+
const fit = Number(options.fitFrames) > 0 ? Math.round(Number(options.fitFrames)) : 0
|
|
65
|
+
const durations = fit ? fitDurations(raw, fit) : raw
|
|
66
|
+
const total = durations.reduce((sum, frames) => sum + frames, 0)
|
|
67
|
+
const shots = layoutShots({ ...spec, totalFrames: total }, durations).map((shot, index) => ({
|
|
68
|
+
id: shot.id,
|
|
69
|
+
file: 'scene-' + index + '.tsx',
|
|
70
|
+
startFrame: shot.startFrame,
|
|
71
|
+
durationFrames: shot.durationFrames,
|
|
72
|
+
card: list[index].cardId,
|
|
73
|
+
style: list[index].styleKey,
|
|
74
|
+
}))
|
|
75
|
+
return { version: 1, width: spec.width, height: spec.height, fps: spec.fps, durationInFrames: total, shots }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function describeCards(cards) {
|
|
79
|
+
return (cards || []).map((card) => card.cardId + (card.styleKey && card.styleKey !== card.cardId ? ' · ' + card.styleKey : ''))
|
|
80
|
+
}
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
// 素材收集:打开页面,把「这张片子里可能要用到的素材」自动扫出来并落地。
|
|
2
|
+
//
|
|
3
|
+
// 为什么不是"让模型自己想需要什么图":真实项目里素材散在页面各处——favicon、og:image、
|
|
4
|
+
// 产品截图、主视觉、品牌色、字体名。逐个猜 URL 又慢又容易 404,截整页又拿不到原图。
|
|
5
|
+
// 这里做的是:一次无头浏览器访问,DOM 里把候选全找出来(带尺寸和位置),
|
|
6
|
+
// 然后把值得要的原图按优先级下载进 assets/,最后补一张 2 倍视口截图当"界面底图"。
|
|
7
|
+
//
|
|
8
|
+
// 两种粒度:
|
|
9
|
+
// collect —— 一个页面,收干净(默认 8 张)。
|
|
10
|
+
// gather —— 一个站点:首页 + 导航里挑出的几个内页,加上品牌 logo 服务(Simple Icons /
|
|
11
|
+
// Clearbit / 高清 favicon),把配色与字体在多个页面间做聚合,一次凑齐一套素材。
|
|
12
|
+
//
|
|
13
|
+
// 抓下来的每一条都带 source URL,交付时能说清"这张图哪来的"。
|
|
14
|
+
|
|
15
|
+
import { openBrowser } from '@remotion/renderer'
|
|
16
|
+
import { createHash } from 'node:crypto'
|
|
17
|
+
import { mkdirSync, writeFileSync } from 'node:fs'
|
|
18
|
+
import { join } from 'node:path'
|
|
19
|
+
import { assetsDirectory, fetchAsset, readAssets, writeAssets } from './assets.js'
|
|
20
|
+
import { browserExecutable, capturePage } from './capture.js'
|
|
21
|
+
|
|
22
|
+
const PAGE_LIMIT = 6
|
|
23
|
+
const NAV_PRIORITY = ['/docs', '/documentation', '/product', '/features', '/platform', '/solutions', '/pricing', '/about', '/developers', '/enterprise']
|
|
24
|
+
|
|
25
|
+
function clamp(value, min, max) {
|
|
26
|
+
const number = Number(value)
|
|
27
|
+
if (!Number.isFinite(number)) return min
|
|
28
|
+
return Math.max(min, Math.min(max, Math.round(number)))
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function pickName(src, fallback) {
|
|
32
|
+
try {
|
|
33
|
+
const path = new URL(src).pathname
|
|
34
|
+
const base = path.split('/').filter(Boolean).pop() || fallback
|
|
35
|
+
return base.replace(/\.[a-z0-9]+$/i, '').slice(0, 40) || fallback
|
|
36
|
+
} catch {
|
|
37
|
+
return fallback
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function slugify(value, fallback) {
|
|
42
|
+
return String(value || '')
|
|
43
|
+
.replace(/\.[a-z0-9]+$/i, '')
|
|
44
|
+
.replace(/[^\w\u4e00-\u9fa5-]+/g, '-')
|
|
45
|
+
.replace(/^-+|-+$/g, '')
|
|
46
|
+
.slice(0, 40) || fallback
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function toHttpUrl(raw) {
|
|
50
|
+
let url
|
|
51
|
+
try {
|
|
52
|
+
url = new URL(String(raw))
|
|
53
|
+
} catch {
|
|
54
|
+
throw new Error('需要一个 http(s) 网址:' + raw)
|
|
55
|
+
}
|
|
56
|
+
if (!['http:', 'https:'].includes(url.protocol)) throw new Error('只接受 http(s) 网址:' + raw)
|
|
57
|
+
return url
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 内联 <svg> 是品牌字标最常见的形态(GitHub 的 octocat 就是这个),页面上没有可下载的
|
|
61
|
+
// URL,只能把 DOM 里的标记原样存下来。带 viewBox 的才要:写死 width/height 的挪走就崩。
|
|
62
|
+
function saveInlineSvg(projectDir, markup, meta) {
|
|
63
|
+
if (!/viewBox\s*=/i.test(markup)) return null
|
|
64
|
+
const dir = assetsDirectory(projectDir)
|
|
65
|
+
mkdirSync(dir, { recursive: true })
|
|
66
|
+
const base = slugify(meta.name, 'inline-logo')
|
|
67
|
+
const taken = new Set(readAssets(projectDir).items.map((item) => item.file))
|
|
68
|
+
let file = base + '.svg'
|
|
69
|
+
let index = 1
|
|
70
|
+
while (taken.has(file)) file = base + '-' + (++index) + '.svg'
|
|
71
|
+
writeFileSync(join(dir, file), markup)
|
|
72
|
+
const manifest = readAssets(projectDir)
|
|
73
|
+
const entry = {
|
|
74
|
+
id: file.replace(/\.svg$/i, ''), file, bytes: Buffer.byteLength(markup),
|
|
75
|
+
sha256: createHash('sha256').update(markup).digest('hex'),
|
|
76
|
+
kind: 'vector', width: meta.width, height: meta.height, source: meta.source,
|
|
77
|
+
...(meta.caption ? { caption: String(meta.caption).slice(0, 400) } : {}),
|
|
78
|
+
at: new Date().toISOString(),
|
|
79
|
+
}
|
|
80
|
+
manifest.items.push(entry)
|
|
81
|
+
writeAssets(projectDir, manifest)
|
|
82
|
+
return entry
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 在页面里跑:一次把图标、社交图、大图、内联 svg、配色、字体、导航链接全扫出来。
|
|
86
|
+
// 注意它是被序列化后丢进浏览器的函数,只能用页面里存在的全局对象。
|
|
87
|
+
function scanDocument({ minWidth }) {
|
|
88
|
+
const abs = (value) => {
|
|
89
|
+
try { return new URL(value, location.href).href } catch { return null }
|
|
90
|
+
}
|
|
91
|
+
const isHttp = (value) => typeof value === 'string' && /^https?:/i.test(value)
|
|
92
|
+
const icons = [...document.querySelectorAll('link[rel]')]
|
|
93
|
+
.filter((link) => /icon/i.test(link.rel))
|
|
94
|
+
.map((link) => abs(link.getAttribute('href')))
|
|
95
|
+
.filter(isHttp)
|
|
96
|
+
const metas = [...document.querySelectorAll('meta[property],meta[name]')]
|
|
97
|
+
.map((meta) => ({ key: String(meta.getAttribute('property') || meta.getAttribute('name') || '').toLowerCase(), value: meta.getAttribute('content') }))
|
|
98
|
+
.filter((meta) => /^(og:image|twitter:image|og:logo|msapplication-tileimage)/.test(meta.key))
|
|
99
|
+
.map((meta) => abs(meta.value))
|
|
100
|
+
.filter(isHttp)
|
|
101
|
+
const images = [...document.images]
|
|
102
|
+
.map((img) => {
|
|
103
|
+
const box = img.getBoundingClientRect()
|
|
104
|
+
return { src: abs(img.currentSrc || img.src), w: Math.round(img.naturalWidth || box.width), h: Math.round(img.naturalHeight || box.height), top: Math.round(box.top + window.scrollY), left: Math.round(box.left + window.scrollX), alt: String(img.alt || '').slice(0, 80) }
|
|
105
|
+
})
|
|
106
|
+
.filter((img) => isHttp(img.src) && img.w >= minWidth && img.h >= 120 && img.top < 6000)
|
|
107
|
+
.sort((a, b) => (b.w * b.h) - (a.w * a.h))
|
|
108
|
+
.slice(0, 24)
|
|
109
|
+
const inlineSvgs = [...document.querySelectorAll('svg')]
|
|
110
|
+
.map((svg) => {
|
|
111
|
+
const box = svg.getBoundingClientRect()
|
|
112
|
+
const link = svg.closest('a,header')
|
|
113
|
+
const title = svg.querySelector('title')
|
|
114
|
+
return {
|
|
115
|
+
w: Math.round(box.width), h: Math.round(box.height),
|
|
116
|
+
top: Math.round(box.top + window.scrollY),
|
|
117
|
+
label: String(svg.getAttribute('aria-label') || (title ? title.textContent : '') || (link && link.getAttribute('aria-label')) || '').slice(0, 40),
|
|
118
|
+
markup: svg.outerHTML.length < 24000 ? svg.outerHTML : '',
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
.filter((svg) => svg.markup && /viewBox/i.test(svg.markup) && svg.w >= 28 && svg.h >= 20 && svg.top < 700)
|
|
122
|
+
.sort((a, b) => (b.w * b.h) - (a.w * a.h))
|
|
123
|
+
// 小尺寸的是字标/图标(真正要复用的),大尺寸的多是首屏装饰插画:分开排,
|
|
124
|
+
// 否则一张 1440×840 的背景图会把 logo 挤到 limit 之外。
|
|
125
|
+
const marks = inlineSvgs.filter((svg) => svg.w <= 420 && svg.h <= 420).slice(0, 3)
|
|
126
|
+
const artwork = inlineSvgs.filter((svg) => svg.w > 420 || svg.h > 420).slice(0, 1)
|
|
127
|
+
const backgrounds = [...document.querySelectorAll('body,header,main,section,div,button,a')]
|
|
128
|
+
.slice(0, 400)
|
|
129
|
+
.map((el) => {
|
|
130
|
+
const style = getComputedStyle(el)
|
|
131
|
+
return { bg: style.backgroundColor, fg: style.color }
|
|
132
|
+
})
|
|
133
|
+
.flatMap((item) => [item.bg, item.fg])
|
|
134
|
+
.filter((value) => value && !/rgba\(0, 0, 0, 0\)|transparent/i.test(value))
|
|
135
|
+
const toHex = (value) => {
|
|
136
|
+
const match = /rgba?\((\d+),\s*(\d+),\s*(\d+)/.exec(value || '')
|
|
137
|
+
if (!match) return null
|
|
138
|
+
return '#' + [1, 2, 3].map((i) => Number(match[i]).toString(16).padStart(2, '0')).join('')
|
|
139
|
+
}
|
|
140
|
+
const counts = new Map()
|
|
141
|
+
for (const color of backgrounds) {
|
|
142
|
+
const hex = toHex(color)
|
|
143
|
+
if (!hex) continue
|
|
144
|
+
counts.set(hex, (counts.get(hex) || 0) + 1)
|
|
145
|
+
}
|
|
146
|
+
const colors = [...counts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 8).map(([hex, count]) => ({ hex, count }))
|
|
147
|
+
const links = [...document.querySelectorAll('header a[href], nav a[href]')]
|
|
148
|
+
.map((anchor) => abs(anchor.getAttribute('href')))
|
|
149
|
+
.filter(isHttp)
|
|
150
|
+
return {
|
|
151
|
+
title: document.title,
|
|
152
|
+
href: location.href,
|
|
153
|
+
pageHeight: Math.round(Math.max(document.documentElement.scrollHeight, innerHeight)),
|
|
154
|
+
icons: [...new Set(icons)].slice(0, 4),
|
|
155
|
+
social: [...new Set(metas)].slice(0, 4),
|
|
156
|
+
images,
|
|
157
|
+
svgs: marks,
|
|
158
|
+
artwork,
|
|
159
|
+
links: [...new Set(links)].slice(0, 40),
|
|
160
|
+
colors,
|
|
161
|
+
fonts: {
|
|
162
|
+
body: getComputedStyle(document.body).fontFamily.slice(0, 160),
|
|
163
|
+
heading: (document.querySelector('h1') ? getComputedStyle(document.querySelector('h1')).fontFamily : '').slice(0, 160),
|
|
164
|
+
},
|
|
165
|
+
inlineSvg: document.querySelectorAll('svg').length,
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async function scanPage(browser, href, { width, minWidth, pageIndex }) {
|
|
170
|
+
const page = await browser.newPage({ context: () => null, logLevel: 'error', indent: false, pageIndex, onBrowserLog: null, onLog: () => {} })
|
|
171
|
+
try {
|
|
172
|
+
await page.setViewport({ width, height: 900, deviceScaleFactor: 1 })
|
|
173
|
+
await page.goto({ url: href, timeout: 30000 })
|
|
174
|
+
await page.evaluate(async () => {
|
|
175
|
+
await Promise.race([document.fonts.ready, new Promise((resolve) => setTimeout(resolve, 4000))])
|
|
176
|
+
await new Promise((resolve) => setTimeout(resolve, 600))
|
|
177
|
+
})
|
|
178
|
+
return await page.evaluate(scanDocument, { minWidth })
|
|
179
|
+
} finally {
|
|
180
|
+
await page.close().catch(() => {})
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// 优先级:品牌 logo 服务 → 内联字标 → 图标 → og/社交图 → 大图(首屏优先)。
|
|
185
|
+
function buildQueue(scans, logos) {
|
|
186
|
+
const queue = []
|
|
187
|
+
const seen = new Set()
|
|
188
|
+
const push = (src, why, meta) => {
|
|
189
|
+
if (!src || seen.has(src) || !/^https?:/i.test(src)) return
|
|
190
|
+
seen.add(src)
|
|
191
|
+
queue.push({ src, why, ...meta })
|
|
192
|
+
}
|
|
193
|
+
for (const logo of logos) push(logo.src, logo.why, { page: 'brand' })
|
|
194
|
+
const iconRank = (src) => {
|
|
195
|
+
if (/fluidicon|apple-touch|icon-192|icon-512|logo/i.test(src)) return 0
|
|
196
|
+
if (/favicon/i.test(src)) return 2
|
|
197
|
+
return 1
|
|
198
|
+
}
|
|
199
|
+
for (const entry of scans) {
|
|
200
|
+
for (const src of [...entry.scan.icons].sort((a, b) => iconRank(a) - iconRank(b))) push(src, 'icon', { page: entry.scan.href })
|
|
201
|
+
for (const src of entry.scan.social) push(src, 'social', { page: entry.scan.href })
|
|
202
|
+
for (const image of entry.scan.images) {
|
|
203
|
+
push(image.src, image.top < 1200 ? 'hero' : 'body', { page: entry.scan.href, width: image.w, height: image.h, alt: image.alt })
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return queue
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function mergeColors(scans) {
|
|
210
|
+
const counts = new Map()
|
|
211
|
+
for (const entry of scans) {
|
|
212
|
+
for (const color of entry.scan.colors || []) counts.set(color.hex, (counts.get(color.hex) || 0) + color.count)
|
|
213
|
+
}
|
|
214
|
+
return [...counts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 8).map(([hex, count]) => ({ hex, count }))
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function mergeFonts(scans) {
|
|
218
|
+
const families = []
|
|
219
|
+
for (const entry of scans) {
|
|
220
|
+
for (const value of [entry.scan.fonts.body, entry.scan.fonts.heading]) {
|
|
221
|
+
const first = String(value || '').split(',')[0].replace(/["']/g, '').trim()
|
|
222
|
+
if (first && !families.includes(first)) families.push(first)
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return families.slice(0, 4)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// 品牌 logo 三条兜底:Simple Icons(单色矢量,最干净)、Clearbit(彩色 512px)、
|
|
229
|
+
// Google favicon 服务(128px,兜底)。目标站自己有官方图时它们会被排在前面优先用。
|
|
230
|
+
function brandLogoSources(brand) {
|
|
231
|
+
const raw = String(brand || '').trim().toLowerCase()
|
|
232
|
+
if (!raw) return []
|
|
233
|
+
const domain = raw.includes('.') ? raw.replace(/^https?:\/\//, '').replace(/\/.*$/, '') : null
|
|
234
|
+
const slug = raw.replace(/\.(com|io|org|net|dev|ai|co)$/i, '').replace(/^https?:\/\//, '').replace(/\/.*$/, '').replace(/[^a-z0-9]+/g, '')
|
|
235
|
+
const sources = []
|
|
236
|
+
if (slug) sources.push({ src: 'https://cdn.simpleicons.org/' + slug, why: 'brand-svg', brand: slug })
|
|
237
|
+
if (domain) {
|
|
238
|
+
sources.push({ src: 'https://logo.clearbit.com/' + domain, why: 'brand-logo', brand: domain })
|
|
239
|
+
sources.push({ src: 'https://www.google.com/s2/favicons?domain=' + domain + '&sz=128', why: 'favicon-128', brand: domain })
|
|
240
|
+
}
|
|
241
|
+
return sources
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// 字体能不能直接拿到:探一下 Google Fonts 有没有同名家族(有就能 fetch 到 ttf/woff2)。
|
|
245
|
+
async function probeFonts(families) {
|
|
246
|
+
const results = []
|
|
247
|
+
for (const family of families.slice(0, 4)) {
|
|
248
|
+
const cssUrl = 'https://fonts.googleapis.com/css2?family=' + encodeURIComponent(family).replace(/%20/g, '+') + '&display=swap'
|
|
249
|
+
try {
|
|
250
|
+
const response = await fetch(cssUrl, { signal: AbortSignal.timeout(6000) })
|
|
251
|
+
results.push({ family, googleFonts: response.ok, cssUrl })
|
|
252
|
+
} catch {
|
|
253
|
+
results.push({ family, googleFonts: null, cssUrl })
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return results
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
async function downloadAll(projectDir, marks, queue, limit, pageLabel) {
|
|
260
|
+
const downloaded = []
|
|
261
|
+
const skipped = []
|
|
262
|
+
const seenFiles = new Set()
|
|
263
|
+
const seenMarks = new Set()
|
|
264
|
+
const note = (entry, why, source) => {
|
|
265
|
+
if (seenFiles.has(entry.file)) return
|
|
266
|
+
seenFiles.add(entry.file)
|
|
267
|
+
// 32px 的 favicon 放进 1080p 画面只会糊:标出来,别当主视觉用。
|
|
268
|
+
const tiny = entry.kind === 'image' && entry.width && entry.height && entry.width < 96 && entry.height < 96
|
|
269
|
+
downloaded.push({ file: entry.file, kind: entry.kind, width: entry.width, height: entry.height, why, source, ...(tiny ? { tiny: true } : {}) })
|
|
270
|
+
}
|
|
271
|
+
for (const mark of marks) {
|
|
272
|
+
// 同一个字标在每页头部都会出现一次:按标记内容去重,别存成 brand.svg / docs.svg 两份。
|
|
273
|
+
const hash = createHash('sha256').update(mark.markup).digest('hex')
|
|
274
|
+
if (seenMarks.has(hash)) continue
|
|
275
|
+
seenMarks.add(hash)
|
|
276
|
+
try {
|
|
277
|
+
const entry = saveInlineSvg(projectDir, mark.markup, {
|
|
278
|
+
name: pickName(mark.page, 'brand') + '-' + (mark.label || 'mark'),
|
|
279
|
+
width: mark.w, height: mark.h, source: mark.page + ' (inline svg)',
|
|
280
|
+
caption: (mark.label ? mark.label + ' · ' : '') + 'inline-svg @ ' + mark.page,
|
|
281
|
+
})
|
|
282
|
+
if (entry) note(entry, mark.why || 'inline-svg', entry.source)
|
|
283
|
+
} catch (error) {
|
|
284
|
+
skipped.push({ src: mark.page + '#inline-svg', why: 'inline-svg', reason: String(error && error.message ? error.message : error).slice(0, 160) })
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
for (const item of queue) {
|
|
288
|
+
if (downloaded.length >= limit) break
|
|
289
|
+
try {
|
|
290
|
+
const entry = await fetchAsset(projectDir, item.src, { name: pickName(item.src, item.why), caption: (item.alt ? item.alt + ' · ' : '') + item.why + ' @ ' + item.page })
|
|
291
|
+
note(entry, item.why, item.src)
|
|
292
|
+
} catch (error) {
|
|
293
|
+
skipped.push({ src: item.src, why: item.why, reason: String(error && error.message ? error.message : error).slice(0, 160) })
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return { downloaded, skipped }
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export async function collectPageAssets(projectDir, rawUrl, options = {}) {
|
|
300
|
+
const url = toHttpUrl(rawUrl)
|
|
301
|
+
const width = clamp(options.width || 1440, 320, 2560)
|
|
302
|
+
const limit = clamp(options.limit || 8, 1, 20)
|
|
303
|
+
const minWidth = clamp(options.minWidth || 240, 40, 2000)
|
|
304
|
+
|
|
305
|
+
mkdirSync(join(projectDir, '.out'), { recursive: true })
|
|
306
|
+
const browser = await openBrowser('chrome', { browserExecutable: browserExecutable(), logLevel: 'error' })
|
|
307
|
+
let scan
|
|
308
|
+
try {
|
|
309
|
+
scan = await scanPage(browser, url.href, { width, minWidth, pageIndex: 0 })
|
|
310
|
+
} finally {
|
|
311
|
+
await browser.close({ silent: true }).catch(() => {})
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const queue = buildQueue([{ scan }], [])
|
|
315
|
+
const marks = [
|
|
316
|
+
...(scan.svgs || []).map((mark) => ({ ...mark, why: 'inline-svg', page: scan.href })),
|
|
317
|
+
...(scan.artwork || []).map((mark) => ({ ...mark, why: 'artwork', page: scan.href })),
|
|
318
|
+
]
|
|
319
|
+
|
|
320
|
+
if (options.dryRun) {
|
|
321
|
+
return {
|
|
322
|
+
dryRun: true, title: scan.title, url: scan.href, pageHeight: scan.pageHeight,
|
|
323
|
+
colors: scan.colors, fonts: scan.fonts, inlineSvg: scan.inlineSvg,
|
|
324
|
+
inlineMarks: marks.map(({ w, h, label, top }) => ({ width: w, height: h, label, top })),
|
|
325
|
+
candidates: queue.map(({ src, why, width: w, height: h, alt }) => ({ src, why, width: w, height: h, alt })),
|
|
326
|
+
next: '这是扫描结果(没有下载)。挑需要的再 collect(去掉 dryRun),或直接 fetch 某一条 src。带 inlineMarks 的会随正式收集一起存成 .svg。要整个站点就换 gather。',
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const { downloaded, skipped } = await downloadAll(projectDir, marks, queue.slice(0, limit), limit, scan.href)
|
|
331
|
+
|
|
332
|
+
// 截图单独走 capturePage:它用 Chrome 的 --screenshot,2 倍图、稳定;
|
|
333
|
+
// 上面的浏览器会话只负责扫 DOM,两条路各做各的事,互不影响。
|
|
334
|
+
let shot = null
|
|
335
|
+
try {
|
|
336
|
+
shot = await capturePage(projectDir, { url: scan.href, width, height: 900, scale: 2, name: pickName(scan.href, 'page') + '-viewport', caption: 'collect 视口截图 @ ' + scan.href })
|
|
337
|
+
} catch (error) {
|
|
338
|
+
skipped.push({ src: scan.href, why: 'screenshot', reason: String(error && error.message ? error.message : error).slice(0, 160) })
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
return {
|
|
342
|
+
title: scan.title, url: scan.href, pageHeight: scan.pageHeight,
|
|
343
|
+
colors: scan.colors, fonts: scan.fonts, inlineSvg: scan.inlineSvg,
|
|
344
|
+
downloaded, skipped, screenshot: shot ? { file: shot.file, width: shot.width, height: shot.height } : null,
|
|
345
|
+
candidates: queue.length,
|
|
346
|
+
next: '下载到的用 staticFile("文件名") 引用;颜色/字体是页面实测值,配色与排版对齐它们最像。缺哪一类(比如产品另一屏的界面)就对这个页面再来一次 collect(换 width,或直接 page 截指定区域);要整站的素材用 gather。',
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// gather:一个站点一次凑齐。首页导航里挑几个内页一起扫,配色与字体跨页聚合,
|
|
351
|
+
// 再补上品牌 logo 服务;重复内容按 SHA-256 去重(fetchAsset 自己会去)。
|
|
352
|
+
export async function gatherAssets(projectDir, options = {}) {
|
|
353
|
+
const rawUrls = [...(Array.isArray(options.urls) ? options.urls : []), options.url].filter(Boolean)
|
|
354
|
+
if (!rawUrls.length && !options.brand) throw new Error('gather 需要 url / urls,或者只给一个 brand(用它去品牌 logo 服务取)')
|
|
355
|
+
const width = clamp(options.width || 1440, 320, 2560)
|
|
356
|
+
const limit = clamp(options.limit || 12, 1, 24)
|
|
357
|
+
const minWidth = clamp(options.minWidth || 240, 40, 2000)
|
|
358
|
+
const pageBudget = clamp(options.pages || 4, 1, PAGE_LIMIT)
|
|
359
|
+
const logos = brandLogoSources(options.brand)
|
|
360
|
+
|
|
361
|
+
const targets = []
|
|
362
|
+
for (const raw of rawUrls) {
|
|
363
|
+
const url = toHttpUrl(raw)
|
|
364
|
+
if (!targets.includes(url.href)) targets.push(url.href)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
mkdirSync(join(projectDir, '.out'), { recursive: true })
|
|
368
|
+
const scans = []
|
|
369
|
+
const failedPages = []
|
|
370
|
+
const browser = await openBrowser('chrome', { browserExecutable: browserExecutable(), logLevel: 'error' })
|
|
371
|
+
try {
|
|
372
|
+
let index = 0
|
|
373
|
+
while (index < targets.length && index < pageBudget) {
|
|
374
|
+
const href = targets[index++]
|
|
375
|
+
try {
|
|
376
|
+
const scan = await scanPage(browser, href, { width, minWidth, pageIndex: index - 1 })
|
|
377
|
+
scans.push({ scan })
|
|
378
|
+
// 首页扫完,把导航里的内页排进来(同源、去重、按常见的产品页优先级)。
|
|
379
|
+
if (index === 1) {
|
|
380
|
+
const origin = new URL(href).origin
|
|
381
|
+
const candidates = scan.links
|
|
382
|
+
.filter((link) => link.startsWith(origin) && !/[?#]/.test(link) && !/\.(png|jpe?g|svg|webp|pdf|zip|mp4)$/i.test(link))
|
|
383
|
+
.map((link) => link.replace(/\/$/, ''))
|
|
384
|
+
.filter((link) => link !== href.replace(/\/$/, ''))
|
|
385
|
+
const ranked = [
|
|
386
|
+
...candidates.filter((link) => NAV_PRIORITY.some((key) => new URL(link).pathname.toLowerCase().startsWith(key))),
|
|
387
|
+
...candidates,
|
|
388
|
+
]
|
|
389
|
+
for (const link of ranked) {
|
|
390
|
+
if (targets.includes(link) || targets.length >= pageBudget) continue
|
|
391
|
+
targets.push(link)
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
} catch (error) {
|
|
395
|
+
failedPages.push({ url: href, reason: String(error && error.message ? error.message : error).slice(0, 160) })
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
} finally {
|
|
399
|
+
await browser.close({ silent: true }).catch(() => {})
|
|
400
|
+
}
|
|
401
|
+
if (!scans.length) throw new Error('gather 一页都没打开成功:' + failedPages.map((item) => item.url + ' (' + item.reason + ')').join(';'))
|
|
402
|
+
|
|
403
|
+
const queue = buildQueue(scans, logos)
|
|
404
|
+
const marks = []
|
|
405
|
+
for (const entry of scans) {
|
|
406
|
+
for (const mark of entry.scan.svgs || []) marks.push({ ...mark, why: 'inline-svg', page: entry.scan.href })
|
|
407
|
+
for (const mark of entry.scan.artwork || []) marks.push({ ...mark, why: 'artwork', page: entry.scan.href })
|
|
408
|
+
}
|
|
409
|
+
const colors = mergeColors(scans)
|
|
410
|
+
const families = mergeFonts(scans)
|
|
411
|
+
|
|
412
|
+
if (options.dryRun) {
|
|
413
|
+
return {
|
|
414
|
+
dryRun: true, pages: scans.map((entry) => entry.scan.href), failedPages,
|
|
415
|
+
colors, fonts: families, inlineMarks: marks.map(({ w, h, label, page }) => ({ width: w, height: h, label, page })),
|
|
416
|
+
candidates: queue.map(({ src, why, width: w, height: h, alt, page }) => ({ src, why, width: w, height: h, alt, page })),
|
|
417
|
+
next: '这是扫描结果(没有下载)。确认清单够用就去掉 dryRun 正式收;缺某类素材就补 urls(另一个页面),或对某个页面单独 collect。',
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
const { downloaded, skipped } = await downloadAll(projectDir, marks, queue.slice(0, limit), limit, scans[0].scan.href)
|
|
422
|
+
const fontSources = await probeFonts(families)
|
|
423
|
+
|
|
424
|
+
// 每个页面一张视口截图,最多两张:首页那张最常用,产品页那张用来做"界面在屏幕上"。
|
|
425
|
+
const screenshots = []
|
|
426
|
+
for (const entry of scans.slice(0, 2)) {
|
|
427
|
+
try {
|
|
428
|
+
const shot = await capturePage(projectDir, { url: entry.scan.href, width, height: 900, scale: 2, name: pickName(entry.scan.href, 'page') + '-viewport', caption: 'gather 视口截图 @ ' + entry.scan.href })
|
|
429
|
+
screenshots.push({ file: shot.file, width: shot.width, height: shot.height, page: entry.scan.href })
|
|
430
|
+
} catch (error) {
|
|
431
|
+
skipped.push({ src: entry.scan.href, why: 'screenshot', reason: String(error && error.message ? error.message : error).slice(0, 160) })
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return {
|
|
436
|
+
pages: scans.map((entry) => entry.scan.href),
|
|
437
|
+
failedPages,
|
|
438
|
+
colors,
|
|
439
|
+
fonts: families,
|
|
440
|
+
fontSources,
|
|
441
|
+
downloaded,
|
|
442
|
+
skipped,
|
|
443
|
+
screenshots,
|
|
444
|
+
candidates: queue.length,
|
|
445
|
+
next: '素材都在 assets/manifest.json 里(带 source URL)。配色用 colors(多页聚合的实测值)对进 theme.ts;字体看 fontSources 里 googleFonts 为 true 的,可以 fetch 它的 cssUrl 拿真字体,其余退回系统字并在 BRIEF 写"字体非官方"。',
|
|
446
|
+
}
|
|
447
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// 交付级派生:把 .out/film.mp4 变成平台要的几种文件。
|
|
2
|
+
//
|
|
3
|
+
// 为什么不属于插件:平台规则一直在变(码率上限、竖版裁切策略、字幕规矩),
|
|
4
|
+
// 这些东西写进插件就等于把一份会过期的知识固化在工具里。放在工程里,
|
|
5
|
+
// 用户想改就改,插件只保证「成片本身是对的」。
|
|
6
|
+
|
|
7
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs'
|
|
8
|
+
import { dirname, join } from 'node:path'
|
|
9
|
+
|
|
10
|
+
const POLISH = `#!/usr/bin/env node
|
|
11
|
+
// 交付级派生:把 .out/film.mp4 变成平台要的几种文件。
|
|
12
|
+
// 默认全跑;也可以单个跑。
|
|
13
|
+
//
|
|
14
|
+
// node tools/polish.mjs 全部(母版 + 平台版 + 竖版 + 响度)
|
|
15
|
+
// node tools/polish.mjs --master ProRes 422 HQ 母版(给后期,给存档)
|
|
16
|
+
// node tools/polish.mjs --web 平台版:1080p / 720p,crf 18,faststart
|
|
17
|
+
// node tools/polish.mjs --vertical 竖版:等比缩放 + 模糊底,抖音/Reels
|
|
18
|
+
// node tools/polish.mjs --loudness 只量响度,不产出文件
|
|
19
|
+
|
|
20
|
+
import { spawnSync } from 'node:child_process'
|
|
21
|
+
import { existsSync, mkdirSync, readFileSync } from 'node:fs'
|
|
22
|
+
import { dirname, join, resolve } from 'node:path'
|
|
23
|
+
import { fileURLToPath } from 'node:url'
|
|
24
|
+
|
|
25
|
+
const here = dirname(fileURLToPath(import.meta.url))
|
|
26
|
+
const project = resolve(here, '..')
|
|
27
|
+
const source = join(project, '.out', 'film.mp4')
|
|
28
|
+
const dist = join(project, 'dist')
|
|
29
|
+
const ffmpeg = process.env.FFMPEG_PATH || 'ffmpeg'
|
|
30
|
+
|
|
31
|
+
if (!existsSync(source)) {
|
|
32
|
+
console.error('找不到成片:' + source + '(先 motion_render start 渲整片)')
|
|
33
|
+
process.exit(1)
|
|
34
|
+
}
|
|
35
|
+
const spec = (() => {
|
|
36
|
+
try { return JSON.parse(readFileSync(join(project, 'timeline.json'), 'utf8').replace(/^\\uFEFF/, '')) } catch { return { width: 1920, height: 1080 } }
|
|
37
|
+
})()
|
|
38
|
+
const width = spec.width || 1920
|
|
39
|
+
const height = spec.height || 1080
|
|
40
|
+
const flags = process.argv.slice(2)
|
|
41
|
+
const want = (name) => flags.length === 0 || flags.includes('--' + name)
|
|
42
|
+
mkdirSync(dist, { recursive: true })
|
|
43
|
+
|
|
44
|
+
function run(args, label) {
|
|
45
|
+
console.log('→ ' + label)
|
|
46
|
+
const result = spawnSync(ffmpeg, ['-y', ...args], { stdio: ['ignore', 'inherit', 'inherit'] })
|
|
47
|
+
if (result.status !== 0) {
|
|
48
|
+
console.error('失败:' + label)
|
|
49
|
+
process.exit(result.status || 1)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// bt709 三标签是硬要求:不打标签的片子换播放器就偏色,这不是「观感问题」。
|
|
54
|
+
const tags = ['-colorspace', 'bt709', '-color_primaries', 'bt709', '-color_trc', 'bt709']
|
|
55
|
+
|
|
56
|
+
if (want('master')) {
|
|
57
|
+
run(['-i', source, '-c:v', 'prores_ks', '-profile:v', '3', '-pix_fmt', 'yuv422p10le',
|
|
58
|
+
'-c:a', 'pcm_s24le', '-ar', '48000', ...tags, join(dist, 'film-master.mov')], 'ProRes 422 HQ 母版')
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (want('web')) {
|
|
62
|
+
for (const target of [1080, 720]) {
|
|
63
|
+
const w = target === 1080 ? width : Math.round(width * target / height / 2) * 2
|
|
64
|
+
const h = target === 1080 ? height : Math.round(height * target / height / 2) * 2
|
|
65
|
+
run(['-i', source, '-vf', 'scale=' + w + ':' + h + ':flags=lanczos+accurate_rnd+full_chroma_int',
|
|
66
|
+
'-c:v', 'libx264', '-crf', '18', '-preset', 'slow', '-profile:v', 'high', '-x264-params', 'aq-mode=3',
|
|
67
|
+
'-pix_fmt', 'yuv420p', '-c:a', 'aac', '-b:a', '192k', '-ar', '48000', '-movflags', '+faststart',
|
|
68
|
+
...tags, join(dist, 'film-' + h + 'p.mp4')], h + 'p 平台版')
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (want('vertical')) {
|
|
73
|
+
// 竖版不是「裁一刀」:等轴画面裁掉两侧就只剩中间一栋楼。等比缩进 9:16 再垫模糊底。
|
|
74
|
+
const vw = 1080
|
|
75
|
+
const vh = 1920
|
|
76
|
+
run(['-i', source, '-filter_complex',
|
|
77
|
+
'[0:v]scale=' + vw + ':' + vh + ':force_original_aspect_ratio=increase,crop=' + vw + ':' + vh + ',gblur=sigma=28[bg];'
|
|
78
|
+
+ '[0:v]scale=' + vw + ':-2:flags=lanczos[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2',
|
|
79
|
+
'-c:v', 'libx264', '-crf', '18', '-preset', 'slow', '-pix_fmt', 'yuv420p',
|
|
80
|
+
'-c:a', 'aac', '-b:a', '192k', '-movflags', '+faststart', ...tags, join(dist, 'film-vertical.mp4')], '竖版 1080×1920')
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (want('loudness')) {
|
|
84
|
+
const result = spawnSync(ffmpeg, ['-hide_banner', '-i', source, '-af', 'loudnorm=print_format=json', '-f', 'null', '-'],
|
|
85
|
+
{ encoding: 'utf8' })
|
|
86
|
+
const text = (result.stderr || '') + (result.stdout || '')
|
|
87
|
+
const match = text.match(/\\{[\\s\\S]*?"input_i"[\\s\\S]*?\\}/)
|
|
88
|
+
if (!match) {
|
|
89
|
+
console.error('量不出响度(片子里没有音轨?)')
|
|
90
|
+
process.exit(1)
|
|
91
|
+
}
|
|
92
|
+
const data = JSON.parse(match[0])
|
|
93
|
+
console.log('响度:' + data.input_i + ' LUFS / 真峰 ' + data.input_tp + ' dBTP / LRA ' + data.input_lra
|
|
94
|
+
+ '(目标 −14 / ≤−1)')
|
|
95
|
+
if (Number(data.input_i) > -13 || Number(data.input_tp) > -0.9) {
|
|
96
|
+
console.error('超出交付范围:检查 timeline.json 的 audioMix,或重跑 motion_render(会自动过 loudnorm + 限幅)')
|
|
97
|
+
process.exit(2)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`
|
|
101
|
+
|
|
102
|
+
export const POLISH_FILE = 'tools/polish.mjs'
|
|
103
|
+
|
|
104
|
+
// 只写缺的文件,和 scene-kit 同一套规矩。
|
|
105
|
+
export function writeDelivery(dir, options = {}) {
|
|
106
|
+
const io = options.io || { join, dirname, existsSync, mkdirSync, writeFileSync }
|
|
107
|
+
const file = io.join(dir, 'tools', 'polish.mjs')
|
|
108
|
+
io.mkdirSync(io.dirname(file), { recursive: true })
|
|
109
|
+
if (io.existsSync(file) && !options.overwrite) return []
|
|
110
|
+
io.writeFileSync(file, POLISH, 'utf8')
|
|
111
|
+
return [POLISH_FILE]
|
|
112
|
+
}
|