@mkbabb/glass-ui 3.10.1 → 3.11.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/dist/{CardAction-DrAcAV4d.js → CardAction-DuArVky-.js} +2 -2
- package/dist/{CommandShortcut-mV2e1aG6.js → CommandShortcut-CefCj5mt.js} +2 -2
- package/dist/{DataTable-C3E6jZ5B.js → DataTable-CUHMukiQ.js} +2 -2
- package/dist/DeckProgress-Dmk4_AKN.js +23 -0
- package/dist/{DialogContent-BxaaafFi.js → DialogContent-BRkT1cjP.js} +1 -1
- package/dist/{HoverPopover-CDA_SaCe.js → HoverPopover-2LOIW34a.js} +1 -1
- package/dist/InstrumentRail-CUJ05YVG.js +44 -0
- package/dist/{MetricBadge-idgrkqoP.js → MetricBadge-BZVWIxNy.js} +7 -5
- package/dist/{Notification-Cu0nN17_.js → Notification-DLMhblXR.js} +1 -1
- package/dist/{NumberFieldContent-CHEWghnY.js → NumberFieldContent-BbLOh8RU.js} +2 -2
- package/dist/{PopoverContent-DpUvdYY-.js → PopoverContent-BId6ggf_.js} +1 -1
- package/dist/{Progress-BW-StFw2.js → Progress-iEuD9pxG.js} +1 -1
- package/dist/{ScrollingText-DruYCni_.js → ScrollingText-BPP84wKo.js} +1 -1
- package/dist/{SelectScrollDownButton-pirzjm--.js → SelectScrollDownButton-T32cVFeM.js} +3 -3
- package/dist/{Switch-DeAqg6pi.js → Switch-Ch-k3Rv-.js} +1 -1
- package/dist/{TabsList-BAVzOZpg.js → TabsList-B8CVOQPC.js} +2 -2
- package/dist/{Toaster-CvuuW_y9.js → Toaster-1rYWrmAm.js} +46 -49
- package/dist/{ToggleGroupItem-DtD37b4G.js → ToggleGroupItem-COu_4IW4.js} +21 -17
- package/dist/animated-digit.js +2 -2
- package/dist/api/index.d.ts +5 -4
- package/dist/api.js +2 -2
- package/dist/aurora.js +70 -70
- package/dist/{badge-NdCQMvvB.js → badge-CaoFJzRb.js} +1 -1
- package/dist/badge.js +1 -1
- package/dist/{button-DyiWFAOE.js → button-DN39cGqL.js} +12 -12
- package/dist/button.js +1 -1
- package/dist/canvas.js +2 -2
- package/dist/card.js +1 -1
- package/dist/carousel.js +5 -5
- package/dist/collapsible.js +1 -1
- package/dist/{color-B65wWyQz.js → color-C5ls_QF7.js} +7 -9
- package/dist/color.js +1 -1
- package/dist/command.js +1 -1
- package/dist/components/custom/aurora/constants/presets.d.ts +62 -5
- package/dist/components/custom/aurora/constants/shaders/mediums.glsl.d.ts +1 -1
- package/dist/components/custom/aurora/index.d.ts +1 -1
- package/dist/components/custom/constellation/Constellation.vue.d.ts +0 -12
- package/dist/components/custom/constellation/constellationField.d.ts +151 -10
- package/dist/components/custom/constellation/index.d.ts +1 -3
- package/dist/components/custom/controls/DarkModeToggle.vue.d.ts +0 -11
- package/dist/components/custom/deck-progress/DeckProgress.vue.d.ts +27 -0
- package/dist/components/custom/deck-progress/index.d.ts +2 -0
- package/dist/components/custom/dialog-native/GlassDialogNative.vue.d.ts +57 -0
- package/dist/components/custom/dialog-native/index.d.ts +1 -0
- package/dist/components/custom/dock/DockTabButton.vue.d.ts +4 -3
- package/dist/components/custom/dock/GlassDock.vue.d.ts +115 -3
- package/dist/components/custom/dock/composables/dockMorphContext.d.ts +0 -36
- package/dist/components/custom/dock/composables/useLayerTransition.d.ts +0 -44
- package/dist/components/custom/expandable-container/ExpandableContainer.vue.d.ts +37 -5
- package/dist/components/custom/fourier-field/index.d.ts +1 -1
- package/dist/components/custom/fourier-field/math.d.ts +0 -17
- package/dist/components/custom/glass-panel/GlassPanel.vue.d.ts +41 -0
- package/dist/components/custom/glass-panel/index.d.ts +2 -0
- package/dist/components/custom/goo-blob/composables/useBlobPointer.d.ts +3 -4
- package/dist/components/custom/goo-blob/composables/useMetaballRenderer.d.ts +8 -11
- package/dist/components/custom/handmark/HandMark.vue.d.ts +29 -0
- package/dist/components/custom/handmark/brush.d.ts +242 -0
- package/dist/components/custom/handmark/freehand.d.ts +69 -0
- package/dist/components/custom/handmark/geometry.d.ts +50 -0
- package/dist/components/custom/handmark/index.d.ts +21 -0
- package/dist/components/custom/handmark/ink.d.ts +11 -0
- package/dist/components/custom/handmark/texture.d.ts +39 -0
- package/dist/components/custom/handmark/types.d.ts +53 -0
- package/dist/components/custom/handmark/useHandMark.d.ts +87 -0
- package/dist/components/custom/header-ribbon/HeaderRibbon.vue.d.ts +31 -0
- package/dist/components/custom/header-ribbon/index.d.ts +2 -0
- package/dist/components/custom/header-ribbon/types.d.ts +7 -0
- package/dist/components/custom/instrument-chassis/InstrumentChassis.vue.d.ts +2 -2
- package/dist/components/custom/instrument-rail/InstrumentRail.vue.d.ts +91 -0
- package/dist/components/custom/instrument-rail/index.d.ts +2 -0
- package/dist/components/custom/metric-badge/MetricBadge.vue.d.ts +8 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +0 -1
- package/dist/components/ui/dropdown-menu/DropdownMenuSubContent.vue.d.ts +2 -2
- package/dist/components/ui/slider/index.d.ts +19 -22
- package/dist/components/ui/toast/use-toast.d.ts +2 -2
- package/dist/components/ui/toggle/Toggle.vue.d.ts +1 -1
- package/dist/components/ui/toggle/index.d.ts +1 -1
- package/dist/components/ui/toggle-group/ToggleGroup.vue.d.ts +7 -1
- package/dist/components/ui/toggle-group/ToggleGroupItem.vue.d.ts +3 -1
- package/dist/components/ui/toggle-group/toggleGroupContext.d.ts +13 -0
- package/dist/composables/color/index.d.ts +0 -12
- package/dist/composables/dark/index.d.ts +1 -1
- package/dist/composables/dark/useGlobalDark.d.ts +21 -1
- package/dist/composables/glass/useSpecularTracking.d.ts +3 -12
- package/dist/composables/motion/core/index.d.ts +1 -0
- package/dist/composables/motion/index.d.ts +0 -2
- package/dist/composables/motion/useRouteTransition.d.ts +42 -0
- package/dist/composables/motion/useSpringMount.d.ts +1 -1
- package/dist/configurator.js +1 -1
- package/dist/confirm-dialog.js +2 -2
- package/dist/constellation.js +225 -260
- package/dist/controls.js +14 -48
- package/dist/dark.d.ts +1 -1
- package/dist/dark.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/deck-progress.d.ts +1 -0
- package/dist/deck-progress.js +2 -0
- package/dist/dialog.js +2 -2
- package/dist/dock.js +345 -340
- package/dist/dockContext-BKeIMmNk.js +9 -0
- package/dist/{dropdown-menu-DVnQcA0E.js → dropdown-menu-D77jX6Df.js} +4 -7
- package/dist/dropdown-menu.js +1 -1
- package/dist/expandable-container.js +79 -38
- package/dist/forms.js +2 -2
- package/dist/fourier-field.js +102 -137
- package/dist/fourier-math.js +2 -2
- package/dist/glass-panel.d.ts +1 -0
- package/dist/glass-panel.js +44 -0
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +209 -287
- package/dist/goo-blob.js +212 -243
- package/dist/handmark.d.ts +1 -0
- package/dist/handmark.js +662 -0
- package/dist/header-ribbon.d.ts +1 -0
- package/dist/header-ribbon.js +63 -0
- package/dist/hover-popover.js +1 -1
- package/dist/icon-tooltip.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/instrument-rail.d.ts +1 -0
- package/dist/instrument-rail.js +2 -0
- package/dist/keyboard.js +1 -1
- package/dist/labeled-field.js +5 -5
- package/dist/{math-BUU9hHID.js → math-DTpRVC0e.js} +2 -18
- package/dist/metric-badge.js +1 -1
- package/dist/metric-stack.js +1 -1
- package/dist/motion-core.js +70 -69
- package/dist/motion.js +37 -38
- package/dist/notification.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/{presets-1OhFpaIC.js → presets-BP_ALM0m.js} +14 -1
- package/dist/progress.js +1 -1
- package/dist/pulse.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/scrolling-text.js +1 -1
- package/dist/search.js +6 -6
- package/dist/select.js +1 -1
- package/dist/{sheet-ChSXcJpU.js → sheet-VZEtNFvO.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-sfl8gFDD.js → slider-ClgpP7EB.js} +4 -4
- package/dist/slider.js +1 -1
- package/dist/sortable-list.js +2 -2
- package/dist/stacked-icons.js +6 -6
- package/dist/styles/animations.css +111 -15
- package/dist/styles/components.css +1 -1
- package/dist/styles/dock/layer-group.css +0 -22
- package/dist/styles/dock/layers.css +1 -11
- package/dist/styles/dock/morph.css +19 -95
- package/dist/styles/dock/shell.css +0 -12
- package/dist/styles/dock-controls.css +31 -28
- package/dist/styles/drawer.css +0 -2
- package/dist/styles/floating-panel.css +0 -2
- package/dist/styles/glass-refract.css +0 -2
- package/dist/styles/glass.css +1188 -31
- package/dist/styles/hover-popover.css +0 -2
- package/dist/styles/index.css +6 -24
- package/dist/styles/instrument-chassis.css +0 -4
- package/dist/styles/paper.css +68 -2
- package/dist/styles/theme.css +20 -13
- package/dist/styles/tokens.css +2360 -22
- package/dist/styles/typography.css +6 -18
- package/dist/styles/utilities.css +1291 -19
- package/dist/styles/view-transition.css +51 -0
- package/dist/switch.js +1 -1
- package/dist/tabs.js +98 -98
- package/dist/timeline.js +2 -2
- package/dist/toast.js +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/typewriter.js +1 -1
- package/dist/{useAnimatedNumber-DfVgP4te.js → useAnimatedNumber-Bcpy5Etf.js} +1 -1
- package/dist/{useConfiguratorState-BdQXh9ie.js → useConfiguratorState-DxAqksK6.js} +1 -1
- package/dist/useGlassRenderer-D7YGOYiM.js +69 -0
- package/dist/{useGlobalDark-D7R9OypB.js → useGlobalDark-D1wgEqfW.js} +21 -2
- package/dist/useSpecularTracking-BVRZsRHA.js +26 -0
- package/dist/useSpringMount-BJSHcLl3.js +113 -0
- package/dist/useViewTransition-DaN5Zrox.js +21 -0
- package/dist/vReveal-zUIQk-rJ.js +53 -0
- package/dist/watercolor-dot.js +2 -2
- package/package.json +57 -33
- package/src/styles/animations.css +111 -15
- package/src/styles/dock/layer-group.css +0 -22
- package/src/styles/dock/layers.css +1 -11
- package/src/styles/dock/morph.css +19 -95
- package/src/styles/dock/shell.css +0 -12
- package/src/styles/dock-controls.css +31 -28
- package/src/styles/glass.css +1188 -31
- package/src/styles/index.css +6 -24
- package/src/styles/paper.css +68 -2
- package/src/styles/theme.css +20 -13
- package/src/styles/tokens.css +2360 -22
- package/src/styles/typography.css +6 -18
- package/src/styles/utilities.css +1291 -19
- package/src/styles/view-transition.css +51 -0
- package/dist/components/custom/aurora/constants/shaders/vangogh-medium.glsl.d.ts +0 -1
- package/dist/components/custom/constellation/composables/createConstellationField.d.ts +0 -35
- package/dist/components/custom/constellation/composables/useConstellationPointer.d.ts +0 -35
- package/dist/components/custom/constellation/constants.d.ts +0 -36
- package/dist/components/custom/constellation/constellationDraw.d.ts +0 -18
- package/dist/components/custom/constellation/constellationInteraction.d.ts +0 -102
- package/dist/components/custom/dock/composables/useDockMorphWindow.d.ts +0 -15
- package/dist/components/custom/dock/composables/useDockShellProps.d.ts +0 -131
- package/dist/components/custom/dock/constants.d.ts +0 -23
- package/dist/components/custom/fourier-field/presets.d.ts +0 -54
- package/dist/components/custom/goo-blob/composables/buildMetaballProgram.d.ts +0 -18
- package/dist/components/custom/goo-blob/composables/uploadBlobUniforms.d.ts +0 -41
- package/dist/components/custom/goo-blob/constants.d.ts +0 -52
- package/dist/components/custom/goo-blob/shaders/metaball-uniforms.glsl.d.ts +0 -1
- package/dist/components/custom/tabs/constants.d.ts +0 -12
- package/dist/components/custom/underline/GlassUnderline.vue.d.ts +0 -84
- package/dist/components/custom/underline/index.d.ts +0 -2
- package/dist/components/custom/underline/types.d.ts +0 -56
- package/dist/composables/motion/curves.d.ts +0 -48
- package/dist/composables/motion/springPresets.d.ts +0 -33
- package/dist/composables/motion/suite.d.ts +0 -2
- package/dist/dockContext-bho8B1A4.js +0 -17
- package/dist/motion-curves.d.ts +0 -1
- package/dist/motion-curves.js +0 -130
- package/dist/springPresets-aRSm-4_k.js +0 -40
- package/dist/styles/glass/a11y-fallback.css +0 -245
- package/dist/styles/glass/ladder.css +0 -304
- package/dist/styles/glass/material.css +0 -238
- package/dist/styles/glass/progress-rail.css +0 -78
- package/dist/styles/glass/squircle.css +0 -66
- package/dist/styles/glass/surfaces.css +0 -306
- package/dist/styles/tokens/color-radius.css +0 -250
- package/dist/styles/tokens/dark-arm.css +0 -194
- package/dist/styles/tokens/glass.css +0 -413
- package/dist/styles/tokens/light-dark.css +0 -158
- package/dist/styles/tokens/offsets-sizing.css +0 -406
- package/dist/styles/tokens/property-regs.css +0 -169
- package/dist/styles/tokens/scale-paper.css +0 -361
- package/dist/styles/tokens/scheme-motion.css +0 -334
- package/dist/styles/tokens/shadow.css +0 -132
- package/dist/styles/utilities/a11y-overrides.css +0 -140
- package/dist/styles/utilities/animate.css +0 -26
- package/dist/styles/utilities/base.css +0 -365
- package/dist/styles/utilities/btn.css +0 -399
- package/dist/styles/utilities/components.css +0 -317
- package/dist/underline.d.ts +0 -1
- package/dist/underline.js +0 -85
- package/dist/useSpecularTracking-DFK_fhpG.js +0 -32
- package/dist/useSpringMount-DXUzxBjV.js +0 -108
- package/dist/vReveal-CqaCz_mC.js +0 -44
- package/src/styles/glass/a11y-fallback.css +0 -245
- package/src/styles/glass/ladder.css +0 -304
- package/src/styles/glass/material.css +0 -238
- package/src/styles/glass/progress-rail.css +0 -78
- package/src/styles/glass/squircle.css +0 -66
- package/src/styles/glass/surfaces.css +0 -306
- package/src/styles/tokens/color-radius.css +0 -250
- package/src/styles/tokens/dark-arm.css +0 -194
- package/src/styles/tokens/glass.css +0 -413
- package/src/styles/tokens/light-dark.css +0 -158
- package/src/styles/tokens/offsets-sizing.css +0 -406
- package/src/styles/tokens/property-regs.css +0 -169
- package/src/styles/tokens/scale-paper.css +0 -361
- package/src/styles/tokens/scheme-motion.css +0 -334
- package/src/styles/tokens/shadow.css +0 -132
- package/src/styles/utilities/a11y-overrides.css +0 -140
- package/src/styles/utilities/animate.css +0 -26
- package/src/styles/utilities/base.css +0 -365
- package/src/styles/utilities/btn.css +0 -399
- package/src/styles/utilities/components.css +0 -317
- /package/dist/{CollapsibleContent-Drow5WkV.js → CollapsibleContent-CP9qF1v4.js} +0 -0
- /package/dist/{DialogFooter-DufLHi0y.js → DialogFooter-Gprw8H_A.js} +0 -0
- /package/dist/{IconTooltip-BrQ5p181.js → IconTooltip-Cus0fvK0.js} +0 -0
- /package/dist/{Input-B-F818RU.js → Input-xuDwALQR.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-DWghtRt7.js → _plugin-vue_export-helper-ok8pgSl5.js} +0 -0
- /package/dist/{compile-Ce_V55zi.js → compile-BOXjLUxu.js} +0 -0
- /package/dist/{constants-C8NMonuo.js → constants-yKeKnE84.js} +0 -0
- /package/dist/{prng-CjVgzjQT.js → prng-D27-B3tK.js} +0 -0
- /package/dist/{resolveCanvasColor-CRvVzOvP.js → resolveCanvasColor-BBiYfp8g.js} +0 -0
- /package/dist/{useCanvas2D-CSeH8h16.js → useCanvas2D-ClrQuZtp.js} +0 -0
- /package/dist/{useIntersectionPause-DAdVPVp4.js → useIntersectionPause-Cck5Uxk8.js} +0 -0
- /package/dist/{useInterval-D3USn0yc.js → useInterval-Dsmqwi03.js} +0 -0
- /package/dist/{useKeyboardShortcuts-i8tHd5WO.js → useKeyboardShortcuts-CyIYrndH.js} +0 -0
- /package/dist/{useScrollProgress-CcgmgMQt.js → useScrollProgress-CffFGLa5.js} +0 -0
- /package/dist/{useSortable-DnyGXKKY.js → useSortable-C8ReQ50P.js} +0 -0
- /package/dist/{useTextHighlight-B3b10W6r.js → useTextHighlight-CWEi25hf.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components/custom/handmark";
|
package/dist/handmark.js
ADDED
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-ok8pgSl5.js";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, onBeforeUnmount as c, onMounted as l, openBlock as u, ref as d, renderList as f, renderSlot as p, unref as m, useId as h, watch as g } from "vue";
|
|
3
|
+
import { catmullRomToBezier as _, ellipsePoints as v, mulberry32 as y, perturbPoints as b, perturbPointsClosed as x, pointsToLinear as S, useLineBoil as C, wobbleLinePoints as w } from "@mkbabb/pencil-boil";
|
|
4
|
+
//#region src/components/custom/handmark/brush.ts
|
|
5
|
+
var T = {
|
|
6
|
+
pen: {
|
|
7
|
+
weight: 6,
|
|
8
|
+
weightJitter: .1,
|
|
9
|
+
thinning: .15,
|
|
10
|
+
taper: {
|
|
11
|
+
start: 14,
|
|
12
|
+
end: 14,
|
|
13
|
+
ease: "out-cubic"
|
|
14
|
+
},
|
|
15
|
+
ribbon: "stroke",
|
|
16
|
+
opacity: 1,
|
|
17
|
+
blend: "source-over",
|
|
18
|
+
passes: 1,
|
|
19
|
+
passOpacity: 0,
|
|
20
|
+
grain: 0,
|
|
21
|
+
grainFreq: .1,
|
|
22
|
+
grainScale: 0,
|
|
23
|
+
octaves: 2,
|
|
24
|
+
roughness: .7,
|
|
25
|
+
wobble: 1.2,
|
|
26
|
+
segments: 9,
|
|
27
|
+
cap: "round"
|
|
28
|
+
},
|
|
29
|
+
pencil: {
|
|
30
|
+
weight: 3,
|
|
31
|
+
weightJitter: .3,
|
|
32
|
+
thinning: .4,
|
|
33
|
+
taper: {
|
|
34
|
+
start: 8,
|
|
35
|
+
end: 18,
|
|
36
|
+
ease: "out-cubic"
|
|
37
|
+
},
|
|
38
|
+
ribbon: "stroke",
|
|
39
|
+
opacity: .6,
|
|
40
|
+
blend: "source-over",
|
|
41
|
+
passes: 1,
|
|
42
|
+
passOpacity: 0,
|
|
43
|
+
grain: .5,
|
|
44
|
+
grainFreq: .42,
|
|
45
|
+
grainScale: 1.5,
|
|
46
|
+
octaves: 3,
|
|
47
|
+
roughness: 1,
|
|
48
|
+
wobble: 1.6,
|
|
49
|
+
segments: 11,
|
|
50
|
+
cap: "round"
|
|
51
|
+
},
|
|
52
|
+
crayon: {
|
|
53
|
+
weight: 16,
|
|
54
|
+
weightJitter: 1,
|
|
55
|
+
thinning: .25,
|
|
56
|
+
taper: {
|
|
57
|
+
start: 6,
|
|
58
|
+
end: 6,
|
|
59
|
+
ease: "linear"
|
|
60
|
+
},
|
|
61
|
+
ribbon: "stroke",
|
|
62
|
+
opacity: .8,
|
|
63
|
+
blend: "source-over",
|
|
64
|
+
passes: 2,
|
|
65
|
+
passOpacity: .18,
|
|
66
|
+
grain: .85,
|
|
67
|
+
grainFreq: .16,
|
|
68
|
+
grainScale: 2.6,
|
|
69
|
+
octaves: 4,
|
|
70
|
+
roughness: 1.5,
|
|
71
|
+
wobble: 3,
|
|
72
|
+
segments: 13,
|
|
73
|
+
cap: "round"
|
|
74
|
+
},
|
|
75
|
+
ring: {
|
|
76
|
+
weight: 5,
|
|
77
|
+
weightJitter: .6,
|
|
78
|
+
thinning: .3,
|
|
79
|
+
taper: {
|
|
80
|
+
start: 8,
|
|
81
|
+
end: 12,
|
|
82
|
+
ease: "out-cubic"
|
|
83
|
+
},
|
|
84
|
+
ribbon: "stroke",
|
|
85
|
+
opacity: .55,
|
|
86
|
+
blend: "source-over",
|
|
87
|
+
passes: 1,
|
|
88
|
+
passOpacity: 0,
|
|
89
|
+
grain: .7,
|
|
90
|
+
grainFreq: .18,
|
|
91
|
+
grainScale: 1.8,
|
|
92
|
+
octaves: 4,
|
|
93
|
+
roughness: 1.4,
|
|
94
|
+
wobble: 2.6,
|
|
95
|
+
segments: 13,
|
|
96
|
+
cap: "round"
|
|
97
|
+
},
|
|
98
|
+
marker: {
|
|
99
|
+
weight: 12,
|
|
100
|
+
weightJitter: .2,
|
|
101
|
+
thinning: .1,
|
|
102
|
+
taper: {
|
|
103
|
+
start: 4,
|
|
104
|
+
end: 10,
|
|
105
|
+
ease: "out-cubic"
|
|
106
|
+
},
|
|
107
|
+
ribbon: "stroke",
|
|
108
|
+
opacity: .92,
|
|
109
|
+
blend: "source-over",
|
|
110
|
+
passes: 1,
|
|
111
|
+
passOpacity: 0,
|
|
112
|
+
grain: .22,
|
|
113
|
+
grainFreq: .09,
|
|
114
|
+
grainScale: 1,
|
|
115
|
+
octaves: 3,
|
|
116
|
+
roughness: 1,
|
|
117
|
+
wobble: 2.2,
|
|
118
|
+
segments: 9,
|
|
119
|
+
cap: "square"
|
|
120
|
+
},
|
|
121
|
+
highlighter: {
|
|
122
|
+
weight: 26,
|
|
123
|
+
weightJitter: .05,
|
|
124
|
+
thinning: 0,
|
|
125
|
+
taper: {
|
|
126
|
+
start: 0,
|
|
127
|
+
end: 0,
|
|
128
|
+
ease: "linear"
|
|
129
|
+
},
|
|
130
|
+
ribbon: "stroke",
|
|
131
|
+
opacity: .38,
|
|
132
|
+
blend: "multiply",
|
|
133
|
+
passes: 1,
|
|
134
|
+
passOpacity: 0,
|
|
135
|
+
grain: .12,
|
|
136
|
+
grainFreq: .2,
|
|
137
|
+
grainScale: 1.5,
|
|
138
|
+
octaves: 2,
|
|
139
|
+
roughness: .5,
|
|
140
|
+
wobble: 1.4,
|
|
141
|
+
segments: 9,
|
|
142
|
+
cap: "square"
|
|
143
|
+
}
|
|
144
|
+
}, E = (e, t) => ({
|
|
145
|
+
...T[typeof e == "string" ? e : "pen"],
|
|
146
|
+
...typeof e == "object" ? e : {},
|
|
147
|
+
...t
|
|
148
|
+
}), D = (e, t, n) => {
|
|
149
|
+
let r = (e, t) => e + (t - e) * n, i = (e, t) => n < .5 ? e : t;
|
|
150
|
+
return {
|
|
151
|
+
weight: r(e.weight, t.weight),
|
|
152
|
+
weightJitter: r(e.weightJitter, t.weightJitter),
|
|
153
|
+
thinning: r(e.thinning, t.thinning),
|
|
154
|
+
taper: {
|
|
155
|
+
start: r(e.taper.start, t.taper.start),
|
|
156
|
+
end: r(e.taper.end, t.taper.end),
|
|
157
|
+
ease: i(e.taper.ease, t.taper.ease)
|
|
158
|
+
},
|
|
159
|
+
ribbon: i(e.ribbon, t.ribbon),
|
|
160
|
+
opacity: r(e.opacity, t.opacity),
|
|
161
|
+
blend: i(e.blend, t.blend),
|
|
162
|
+
passes: Math.max(1, Math.round(r(e.passes, t.passes))),
|
|
163
|
+
passOpacity: r(e.passOpacity, t.passOpacity),
|
|
164
|
+
grain: r(e.grain, t.grain),
|
|
165
|
+
grainFreq: r(e.grainFreq, t.grainFreq),
|
|
166
|
+
grainScale: r(e.grainScale, t.grainScale),
|
|
167
|
+
octaves: Math.max(1, Math.round(r(e.octaves, t.octaves))),
|
|
168
|
+
roughness: r(e.roughness, t.roughness),
|
|
169
|
+
wobble: r(e.wobble, t.wobble),
|
|
170
|
+
segments: Math.max(2, Math.round(r(e.segments, t.segments))),
|
|
171
|
+
cap: i(e.cap, t.cap)
|
|
172
|
+
};
|
|
173
|
+
}, O = 100, k = 40, A = .06;
|
|
174
|
+
function j(e, t, n = null, r = null) {
|
|
175
|
+
let i = n ? n.x : 4, a = n ? n.x + n.w : 96, o = n ? n.y + n.h / 2 : 40 / 2, s = n ? n.y + n.h * .92 : r == null ? 32 : 40 * (r + A), c = t.seed ?? 1, l = (e, n, r, i, a = 0) => w(e, n, r, i, {
|
|
176
|
+
...t,
|
|
177
|
+
seed: c + a
|
|
178
|
+
});
|
|
179
|
+
switch (e) {
|
|
180
|
+
case "underline": return {
|
|
181
|
+
lines: [l(i, s, a, s)],
|
|
182
|
+
closed: !1
|
|
183
|
+
};
|
|
184
|
+
case "strikethrough": return {
|
|
185
|
+
lines: [l(i, o, a, o)],
|
|
186
|
+
closed: !1
|
|
187
|
+
};
|
|
188
|
+
case "highlight": return {
|
|
189
|
+
lines: [l(i, o, a, o)],
|
|
190
|
+
closed: !1
|
|
191
|
+
};
|
|
192
|
+
case "box": {
|
|
193
|
+
let e = n ? n.y : 4, t = n ? n.y + n.h : 36;
|
|
194
|
+
return {
|
|
195
|
+
lines: [
|
|
196
|
+
l(i, e, a, e, 0),
|
|
197
|
+
l(a, e, a, t, 1),
|
|
198
|
+
l(a, t, i, t, 2),
|
|
199
|
+
l(i, t, i, e, 3)
|
|
200
|
+
],
|
|
201
|
+
closed: !1
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
case "bracket": {
|
|
205
|
+
let e = n ? n.y : 4, t = n ? n.y + n.h : 36, r = (a - i) * .22;
|
|
206
|
+
return {
|
|
207
|
+
lines: [
|
|
208
|
+
l(i + r, e, i, e, 0),
|
|
209
|
+
l(i, e, i, t, 1),
|
|
210
|
+
l(i, t, i + r, t, 2)
|
|
211
|
+
],
|
|
212
|
+
closed: !1
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
case "circle": return {
|
|
216
|
+
lines: [v(n ? n.x + n.w / 2 : 100 / 2, n ? n.y + n.h / 2 : 40 / 2, (n ? n.w / 2 : 100 / 2) - 3, (n ? n.h / 2 : 40 / 2) - 3, t)],
|
|
217
|
+
closed: !0
|
|
218
|
+
};
|
|
219
|
+
case "path": return {
|
|
220
|
+
lines: [],
|
|
221
|
+
closed: !1
|
|
222
|
+
};
|
|
223
|
+
default: return {
|
|
224
|
+
lines: [l(i, s, a, s)],
|
|
225
|
+
closed: !1
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function M({ lines: e, closed: t }, n, r) {
|
|
230
|
+
return e.map((e, i) => {
|
|
231
|
+
if (t) return x(e, n, r + i);
|
|
232
|
+
let a = e[0], o = e[e.length - 1];
|
|
233
|
+
return b(e, a[0], a[1], o[0], o[1], n, r + i);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function N(e, t = !1) {
|
|
237
|
+
return e.map((e) => t ? S(e) : _(e)).join(" ");
|
|
238
|
+
}
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/components/custom/handmark/freehand.ts
|
|
241
|
+
var P = (e, t) => [e[0] + t[0], e[1] + t[1]], F = (e, t) => [e[0] - t[0], e[1] - t[1]], I = (e, t) => [e[0] * t, e[1] * t], L = (e) => [-e[0], -e[1]], R = (e) => [e[1], -e[0]], z = (e, t) => e[0] * t[0] + e[1] * t[1], B = (e) => e[0] * e[0] + e[1] * e[1], V = (e, t) => B(F(e, t)), H = (e, t) => Math.hypot(e[1] - t[1], e[0] - t[0]), U = (e) => I(e, 1 / (Math.hypot(e[0], e[1]) || 1)), W = (e, t, n) => P(e, I(F(t, e), n)), G = (e, t) => I(P(e, t), .5), K = (e, t, n) => {
|
|
242
|
+
let r = Math.sin(n), i = Math.cos(n), a = e[0] - t[0], o = e[1] - t[1];
|
|
243
|
+
return [a * i - o * r + t[0], a * r + o * i + t[1]];
|
|
244
|
+
}, { min: q, PI: ee } = Math, J = ee + 1e-4, Y = (e) => e;
|
|
245
|
+
function X(e, t = {}) {
|
|
246
|
+
let { streamline: n = .5, size: r = 16, last: i = !1 } = t;
|
|
247
|
+
if (e.length === 0) return [];
|
|
248
|
+
let a = .15 + (1 - n) * .85, o = e.map((e) => [
|
|
249
|
+
e[0],
|
|
250
|
+
e[1],
|
|
251
|
+
e[2] ?? .5
|
|
252
|
+
]);
|
|
253
|
+
if (o.length === 2) {
|
|
254
|
+
let e = o[1];
|
|
255
|
+
o[1] = W(o[0], e, .5), o.push(e);
|
|
256
|
+
}
|
|
257
|
+
o.length === 1 && o.push([...P(o[0], [1, 1]), ...o[0].slice(2)]);
|
|
258
|
+
let s = [{
|
|
259
|
+
point: [o[0][0], o[0][1]],
|
|
260
|
+
pressure: o[0][2] >= 0 ? o[0][2] : .25,
|
|
261
|
+
vector: [1, 1],
|
|
262
|
+
distance: 0,
|
|
263
|
+
runningLength: 0
|
|
264
|
+
}], c = !1, l = 0, u = s[0], d = o.length - 1;
|
|
265
|
+
for (let e = 1; e < o.length; e++) {
|
|
266
|
+
let t = i && e === d ? [o[e][0], o[e][1]] : W(u.point, [o[e][0], o[e][1]], a);
|
|
267
|
+
if (V(u.point, t) < 1e-4) continue;
|
|
268
|
+
let n = H(t, u.point);
|
|
269
|
+
if (l += n, e < d && !c) {
|
|
270
|
+
if (l < r) continue;
|
|
271
|
+
c = !0;
|
|
272
|
+
}
|
|
273
|
+
u = {
|
|
274
|
+
point: t,
|
|
275
|
+
pressure: o[e][2] >= 0 ? o[e][2] : .5,
|
|
276
|
+
vector: U(F(u.point, t)),
|
|
277
|
+
distance: n,
|
|
278
|
+
runningLength: l
|
|
279
|
+
}, s.push(u);
|
|
280
|
+
}
|
|
281
|
+
return s.length > 0 && (s[0].vector = s[1]?.vector ?? [0, 0]), s;
|
|
282
|
+
}
|
|
283
|
+
function te(e, t = {}) {
|
|
284
|
+
let { size: n = 16, smoothing: r = .5, thinning: i = .5, simulatePressure: a = !0, easing: o = Y, start: s = {}, end: c = {}, last: l = !1 } = t, { cap: u = !0, easing: d = (e) => e * (2 - e) } = s, { cap: f = !0, easing: p = (e) => --e * e * e + 1 } = c;
|
|
285
|
+
if (e.length === 0 || n <= 0) return [];
|
|
286
|
+
let m = e[e.length - 1].runningLength, h = s.taper === !1 ? 0 : s.taper === !0 ? Math.max(n, m) : s.taper ?? 0, g = c.taper === !1 ? 0 : c.taper === !0 ? Math.max(n, m) : c.taper ?? 0, _ = (n * r) ** 2, v = [], y = [], b = [], x = e.slice(0, 10).reduce((e, t) => {
|
|
287
|
+
let r = t.pressure;
|
|
288
|
+
if (a) {
|
|
289
|
+
let i = q(1, t.distance / n);
|
|
290
|
+
r = q(1, e + (q(1, 1 - i) - e) * (i * .275));
|
|
291
|
+
}
|
|
292
|
+
return (e + r) / 2;
|
|
293
|
+
}, e[0].pressure), S = Z(n, i, e[e.length - 1].pressure, o), C, w = e[0].vector, T = e[0].point, E = T, D = T, O = E, k = !1;
|
|
294
|
+
for (let t = 0; t < e.length; t++) {
|
|
295
|
+
let { pressure: r } = e[t], { point: s, vector: c, distance: l, runningLength: u } = e[t];
|
|
296
|
+
if (t < e.length - 1 && m - u < 3) continue;
|
|
297
|
+
if (i) {
|
|
298
|
+
if (a) {
|
|
299
|
+
let e = q(1, l / n), t = q(1, 1 - e);
|
|
300
|
+
r = q(1, x + (t - x) * (e * .275));
|
|
301
|
+
}
|
|
302
|
+
S = Z(n, i, r, o);
|
|
303
|
+
} else S = n / 2;
|
|
304
|
+
C === void 0 && (C = S);
|
|
305
|
+
let f = u < h ? d(u / h) : 1, A = m - u < g ? p((m - u) / g) : 1;
|
|
306
|
+
S = Math.max(.01, S * Math.min(f, A));
|
|
307
|
+
let j = (t < e.length - 1 ? e[t + 1] : e[t]).vector, M = t < e.length - 1 ? z(c, j) : 1, N = z(c, w) < 0 && !k, L = M !== null && M < .2;
|
|
308
|
+
if (N || L) {
|
|
309
|
+
let e = I(R(w), S);
|
|
310
|
+
for (let t = 0; t <= 1; t += .07692307692307693) D = K(F(s, e), s, J * t), v.push(D), O = K(P(s, e), s, J * -t), y.push(O);
|
|
311
|
+
T = D, E = O, L && (k = !0);
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
if (k = !1, t === e.length - 1) {
|
|
315
|
+
let e = I(R(c), S);
|
|
316
|
+
v.push(F(s, e)), y.push(P(s, e));
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
let B = I(R(W(j, c, M)), S);
|
|
320
|
+
D = F(s, B), (t <= 1 || V(T, D) > _) && (v.push(D), T = D), O = P(s, B), (t <= 1 || V(E, O) > _) && (y.push(O), E = O), x = r, w = c, b.push(S);
|
|
321
|
+
}
|
|
322
|
+
let A = e[0].point.slice(0, 2), j = e.length > 1 ? e[e.length - 1].point.slice(0, 2) : P(e[0].point, [1, 1]), M = [], N = [];
|
|
323
|
+
if (e.length === 1) {
|
|
324
|
+
if (!(h || g) || l) {
|
|
325
|
+
let e = P(A, I(U(R(F(A, j))), -(C ?? S))), t = [];
|
|
326
|
+
for (let n = 1 / 13, r = n; r <= 1; r += n) t.push(K(e, A, J * 2 * r));
|
|
327
|
+
return t;
|
|
328
|
+
}
|
|
329
|
+
} else {
|
|
330
|
+
if (!(h || g && e.length === 1)) if (u) for (let e = 1 / 13, t = e; t <= 1; t += e) {
|
|
331
|
+
let e = K(y[0], A, J * t);
|
|
332
|
+
M.push(e);
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
let e = F(v[0], y[0]), t = I(e, .5), n = I(e, .51);
|
|
336
|
+
M.push(F(A, t), F(A, n), P(A, n), P(A, t));
|
|
337
|
+
}
|
|
338
|
+
let t = R(L(e[e.length - 1].vector));
|
|
339
|
+
if (g || h && e.length === 1) N.push(j);
|
|
340
|
+
else if (f) {
|
|
341
|
+
let e = P(j, I(t, S));
|
|
342
|
+
for (let t = 1 / 29, n = t; n < 1; n += t) N.push(K(e, j, J * 3 * n));
|
|
343
|
+
} else N.push(P(j, I(t, S)), P(j, I(t, S * .99)), F(j, I(t, S * .99)), F(j, I(t, S)));
|
|
344
|
+
}
|
|
345
|
+
return v.concat(N, y.reverse(), M);
|
|
346
|
+
}
|
|
347
|
+
function Z(e, t, n, r = Y) {
|
|
348
|
+
if (!t) return e / 2;
|
|
349
|
+
let i = n;
|
|
350
|
+
return i < 0 && (i = 0), i > 1 && (i = 1), e * r(.5 - t * (.5 - i)) * .5 + e / 2 * (1 - Math.abs(t));
|
|
351
|
+
}
|
|
352
|
+
function Q(e, t = {}) {
|
|
353
|
+
return te(X(e, t), t);
|
|
354
|
+
}
|
|
355
|
+
function ne(e, t = !0) {
|
|
356
|
+
if (e.length < 4) return "";
|
|
357
|
+
let n = e[0], r = e[1], i = e[2], a = `M${n[0].toFixed(2)},${n[1].toFixed(2)} Q${r[0].toFixed(2)},${r[1].toFixed(2)} ${G(r, i)[0].toFixed(2)},${G(r, i)[1].toFixed(2)} T`;
|
|
358
|
+
for (let t = 2, i = e.length - 1; t < i; t++) n = e[t], r = e[t + 1], a += `${G(n, r)[0].toFixed(2)},${G(n, r)[1].toFixed(2)} `;
|
|
359
|
+
return t && (a += "Z"), a;
|
|
360
|
+
}
|
|
361
|
+
//#endregion
|
|
362
|
+
//#region src/components/custom/handmark/texture.ts
|
|
363
|
+
function re(e, t, n) {
|
|
364
|
+
if (t.grain <= 0 && t.grainScale <= 0) return "";
|
|
365
|
+
let r = (n ^ 34283) & 65535, i = (.55 - t.grain * .42).toFixed(3), a = t.grain > 0 ? "in" : "over";
|
|
366
|
+
return `
|
|
367
|
+
<filter id="${e}" x="-40%" y="-60%" width="180%" height="220%" color-interpolation-filters="sRGB">
|
|
368
|
+
<feTurbulence type="fractalNoise" baseFrequency="${(.012 * t.roughness).toFixed(4)}" numOctaves="2" seed="${r}" result="warp"/>
|
|
369
|
+
<feDisplacementMap in="SourceGraphic" in2="warp" scale="${(t.grainScale * 1.4).toFixed(2)}" xChannelSelector="R" yChannelSelector="G" result="wob"/>
|
|
370
|
+
<feTurbulence type="fractalNoise" baseFrequency="${t.grainFreq}" numOctaves="${t.octaves}" seed="${r + 17}" result="grain"/>
|
|
371
|
+
<feColorMatrix in="grain" type="matrix" result="grainA"
|
|
372
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${(6 + t.grain * 10).toFixed(2)} ${i}"/>
|
|
373
|
+
<feComposite in="wob" in2="grainA" operator="${a}" result="grained"/>
|
|
374
|
+
<feDisplacementMap in="grained" in2="grain" scale="${(t.grainScale * 2).toFixed(2)}" xChannelSelector="R" yChannelSelector="G"/>
|
|
375
|
+
</filter>`;
|
|
376
|
+
}
|
|
377
|
+
function $(e) {
|
|
378
|
+
return e.grain > 0 || e.grainScale > 0;
|
|
379
|
+
}
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/components/custom/handmark/ink.ts
|
|
382
|
+
function ie(e) {
|
|
383
|
+
let t = 0;
|
|
384
|
+
for (let n = 1; n < e.length; n++) t += Math.hypot(e[n][0] - e[n - 1][0], e[n][1] - e[n - 1][1]);
|
|
385
|
+
return t;
|
|
386
|
+
}
|
|
387
|
+
function ae(e, t, n) {
|
|
388
|
+
let r = y(n);
|
|
389
|
+
return e.map((n, i) => {
|
|
390
|
+
let a = i / Math.max(1, e.length - 1), o = .5 + .35 * Math.sin(Math.PI * a) + (r() - .5) * t.weightJitter * .4;
|
|
391
|
+
return [
|
|
392
|
+
n[0],
|
|
393
|
+
n[1],
|
|
394
|
+
Math.max(.05, Math.min(1, o))
|
|
395
|
+
];
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
function oe(e) {
|
|
399
|
+
return e === "out-cubic" ? (e) => 1 - (1 - e) ** 3 : (e) => e;
|
|
400
|
+
}
|
|
401
|
+
function se(e, t, n, r, i, a = !1) {
|
|
402
|
+
if (t.stamp) {
|
|
403
|
+
let i = y(n), a = t.stamp({
|
|
404
|
+
centerline: e,
|
|
405
|
+
brush: t,
|
|
406
|
+
rng: i,
|
|
407
|
+
seed: n,
|
|
408
|
+
length: ie(e),
|
|
409
|
+
color: r
|
|
410
|
+
});
|
|
411
|
+
return {
|
|
412
|
+
paths: a.paths,
|
|
413
|
+
filterId: a.filterId ?? null,
|
|
414
|
+
defs: a.defs ?? []
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
let o = [], s = (e) => a ? S(e) : _(e);
|
|
418
|
+
for (let i = 0; i < t.passes; i++) {
|
|
419
|
+
let a = e[0], c = e[e.length - 1], l = b(e, a[0], a[1], c[0], c[1], t.weight * .06, n + 991 * i), u = t.opacity * (1 - t.passOpacity * i);
|
|
420
|
+
if (t.ribbon === "hull") {
|
|
421
|
+
let e = Q(ae(l, t, n + 7 * i), {
|
|
422
|
+
size: t.weight,
|
|
423
|
+
thinning: t.thinning,
|
|
424
|
+
streamline: Math.max(.1, .55 - t.roughness * .1),
|
|
425
|
+
last: !0,
|
|
426
|
+
start: {
|
|
427
|
+
taper: t.taper.start,
|
|
428
|
+
easing: oe(t.taper.ease)
|
|
429
|
+
},
|
|
430
|
+
end: {
|
|
431
|
+
taper: t.taper.end,
|
|
432
|
+
easing: oe(t.taper.ease)
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
o.push({
|
|
436
|
+
d: ne(e),
|
|
437
|
+
fill: r,
|
|
438
|
+
opacity: u,
|
|
439
|
+
blend: t.blend
|
|
440
|
+
});
|
|
441
|
+
} else o.push({
|
|
442
|
+
d: s(l),
|
|
443
|
+
stroke: r,
|
|
444
|
+
opacity: u,
|
|
445
|
+
blend: t.blend
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
let c = $(t) ? re(i, t, n) : "";
|
|
449
|
+
return {
|
|
450
|
+
paths: o,
|
|
451
|
+
filterId: c ? i : null,
|
|
452
|
+
defs: c ? [c] : []
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/components/custom/handmark/useHandMark.ts
|
|
457
|
+
var ce = {
|
|
458
|
+
currentFrame: d(0),
|
|
459
|
+
start: () => {},
|
|
460
|
+
stop: () => {}
|
|
461
|
+
};
|
|
462
|
+
function le(e, t, n = null) {
|
|
463
|
+
return {
|
|
464
|
+
brush: e.brush ?? "pen",
|
|
465
|
+
shape: e.shape ?? "underline",
|
|
466
|
+
color: e.color ?? "currentColor",
|
|
467
|
+
seed: e.seed ?? 1,
|
|
468
|
+
overrides: e.overrides,
|
|
469
|
+
animation: e.animation ?? "none",
|
|
470
|
+
boilFps: e.boilFps ?? 8,
|
|
471
|
+
boilFrames: e.boilFrames ?? 3,
|
|
472
|
+
roughness: e.roughness ?? null,
|
|
473
|
+
segments: e.segments ?? null,
|
|
474
|
+
jagged: e.jagged ?? !1,
|
|
475
|
+
box: e.box ?? null,
|
|
476
|
+
path: e.path ?? null,
|
|
477
|
+
filterId: t,
|
|
478
|
+
baselineFrac: n
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
function ue(e) {
|
|
482
|
+
let t = n(() => {
|
|
483
|
+
let t = { ...e.value.overrides ?? {} };
|
|
484
|
+
return e.value.roughness != null && (t.roughness = e.value.roughness), e.value.segments != null && (t.segments = e.value.segments), E(e.value.brush, t);
|
|
485
|
+
}), r = n(() => $(t.value)), i = n(() => j(e.value.shape, {
|
|
486
|
+
roughness: t.value.roughness,
|
|
487
|
+
segments: t.value.segments,
|
|
488
|
+
seed: e.value.seed,
|
|
489
|
+
jagged: e.value.jagged
|
|
490
|
+
}, e.value.box, e.value.baselineFrac)), a = n(() => e.value.animation === "boil" || e.value.animation === "draw-then-boil"), o = n(() => e.value.animation === "draw-on" || e.value.animation === "draw-then-boil"), s = n(() => r.value ? "clip" : "dashoffset"), c = d(!1), l = e.value.animation === "boil" || e.value.animation === "draw-then-boil" ? C(() => a.value && c.value ? e.value.boilFrames : 1, () => Math.max(16, 1e3 / e.value.boilFps)) : ce, u = n(() => {
|
|
491
|
+
if (e.value.path) return e.value.path;
|
|
492
|
+
let n = i.value.lines;
|
|
493
|
+
if (a.value && c.value) {
|
|
494
|
+
let r = t.value.wobble * .4 + .4, a = l.currentFrame.value;
|
|
495
|
+
n = M(i.value, r, e.value.seed + a * 31);
|
|
496
|
+
}
|
|
497
|
+
return N(n, e.value.jagged);
|
|
498
|
+
}), f = n(() => e.value.path ? [] : a.value && c.value ? M(i.value, t.value.wobble * .4 + .4, e.value.seed + l.currentFrame.value * 31) : i.value.lines);
|
|
499
|
+
return {
|
|
500
|
+
brush: t,
|
|
501
|
+
baseGeom: i,
|
|
502
|
+
fragment: n(() => {
|
|
503
|
+
let n = {
|
|
504
|
+
paths: [],
|
|
505
|
+
filterId: null,
|
|
506
|
+
defs: []
|
|
507
|
+
}, r = f.value.length ? f.value : [[]];
|
|
508
|
+
for (let i of r) {
|
|
509
|
+
let r = se(i, t.value, e.value.seed, e.value.color, e.value.filterId, e.value.jagged);
|
|
510
|
+
n.paths.push(...r.paths), r.filterId && !n.filterId && (n.filterId = r.filterId, n.defs = r.defs);
|
|
511
|
+
}
|
|
512
|
+
return n;
|
|
513
|
+
}),
|
|
514
|
+
pathD: u,
|
|
515
|
+
grained: r,
|
|
516
|
+
drawKind: s,
|
|
517
|
+
draws: o,
|
|
518
|
+
boils: a,
|
|
519
|
+
boil: l,
|
|
520
|
+
boilArmed: c
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/components/custom/handmark/HandMark.vue?vue&type=script&setup=true&lang.ts
|
|
525
|
+
var de = [
|
|
526
|
+
"data-shape",
|
|
527
|
+
"data-behind",
|
|
528
|
+
"data-grained"
|
|
529
|
+
], fe = ["viewBox"], pe = ["innerHTML"], me = [
|
|
530
|
+
"d",
|
|
531
|
+
"stroke",
|
|
532
|
+
"fill",
|
|
533
|
+
"stroke-width",
|
|
534
|
+
"stroke-opacity",
|
|
535
|
+
"fill-opacity",
|
|
536
|
+
"filter"
|
|
537
|
+
], he = 100, ge = 40, _e = /* @__PURE__ */ e(/* @__PURE__ */ a({
|
|
538
|
+
__name: "HandMark",
|
|
539
|
+
props: {
|
|
540
|
+
brush: { default: "pen" },
|
|
541
|
+
shape: { default: "underline" },
|
|
542
|
+
color: { default: "currentColor" },
|
|
543
|
+
seed: { default: 1 },
|
|
544
|
+
overrides: {},
|
|
545
|
+
animation: { default: "none" },
|
|
546
|
+
drawMs: { default: 800 },
|
|
547
|
+
drawDelayMs: { default: 0 },
|
|
548
|
+
appear: { default: "visible" },
|
|
549
|
+
boilFps: { default: 8 },
|
|
550
|
+
boilFrames: { default: 3 },
|
|
551
|
+
roughness: {},
|
|
552
|
+
segments: {},
|
|
553
|
+
jagged: {
|
|
554
|
+
type: Boolean,
|
|
555
|
+
default: !1
|
|
556
|
+
},
|
|
557
|
+
box: {},
|
|
558
|
+
path: {},
|
|
559
|
+
points: {}
|
|
560
|
+
},
|
|
561
|
+
setup(e, { expose: a }) {
|
|
562
|
+
let _ = e, v = `hm-${h().replace(/[^a-zA-Z0-9_-]/g, "")}`, y = d(null), { brush: b, fragment: x, grained: S, drawKind: C, draws: w, boils: T, boil: E, boilArmed: D } = ue(n(() => le(_, v, y.value))), O = n(() => _.shape === "highlight"), k = n(() => _.path ?? null), A = d(!1), j = d(null), M = n(() => w.value ? `${C.value === "clip" ? "clip-path" : "stroke-dashoffset"} ${_.drawMs}ms cubic-bezier(.16,1,.3,1) ${_.drawDelayMs}ms` : "none");
|
|
563
|
+
function N() {
|
|
564
|
+
T.value && (D.value = !0, E.start());
|
|
565
|
+
}
|
|
566
|
+
function P() {
|
|
567
|
+
if (!w.value) {
|
|
568
|
+
N();
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
A.value = !1, j.value && j.value.offsetWidth, requestAnimationFrame(() => {
|
|
572
|
+
A.value = !0;
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
function F() {
|
|
576
|
+
_.animation === "draw-then-boil" && N();
|
|
577
|
+
}
|
|
578
|
+
a({ play: P });
|
|
579
|
+
let I = n(() => _.box == null && (_.shape === "underline" || _.shape === "strikethrough"));
|
|
580
|
+
function L(e) {
|
|
581
|
+
if (typeof document > "u" || typeof Range > "u") return null;
|
|
582
|
+
let t = document.createRange(), n = !1;
|
|
583
|
+
for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE && r.tagName === "svg" || (t.selectNode(r), n = !0);
|
|
584
|
+
if (!n) return null;
|
|
585
|
+
let r = t.getBoundingClientRect();
|
|
586
|
+
return t.detach?.(), r.height > 0 ? r : null;
|
|
587
|
+
}
|
|
588
|
+
function R() {
|
|
589
|
+
if (!I.value) return;
|
|
590
|
+
let e = j.value;
|
|
591
|
+
if (!e) return;
|
|
592
|
+
let t = L(e);
|
|
593
|
+
if (!t) return;
|
|
594
|
+
let n = e.getBoundingClientRect();
|
|
595
|
+
if (n.height <= 0) return;
|
|
596
|
+
let r = (t.bottom - n.top) / n.height;
|
|
597
|
+
y.value = Math.min(1, Math.max(0, r));
|
|
598
|
+
}
|
|
599
|
+
let z = null;
|
|
600
|
+
function B() {
|
|
601
|
+
!I.value || !j.value || (R(), typeof document < "u" && document.fonts?.ready && document.fonts.ready.then(() => R()), typeof ResizeObserver < "u" && (z = new ResizeObserver(() => R()), z.observe(j.value)));
|
|
602
|
+
}
|
|
603
|
+
let V = null;
|
|
604
|
+
l(() => {
|
|
605
|
+
B(), _.animation === "boil" && N(), _.appear === "mount" ? P() : _.appear === "visible" && typeof IntersectionObserver < "u" ? (V = new IntersectionObserver((e) => {
|
|
606
|
+
e.some((e) => e.isIntersecting) && (P(), V?.disconnect());
|
|
607
|
+
}, { threshold: .35 }), j.value && V.observe(j.value)) : _.appear === "visible" && P();
|
|
608
|
+
}), c(() => {
|
|
609
|
+
V?.disconnect(), z?.disconnect(), E.stop();
|
|
610
|
+
}), g(() => _.animation, () => {
|
|
611
|
+
A.value = !1, D.value = !1;
|
|
612
|
+
});
|
|
613
|
+
let H = {
|
|
614
|
+
"source-over": "normal",
|
|
615
|
+
multiply: "multiply",
|
|
616
|
+
darken: "darken",
|
|
617
|
+
screen: "screen"
|
|
618
|
+
};
|
|
619
|
+
function U(e) {
|
|
620
|
+
return {
|
|
621
|
+
mixBlendMode: H[e],
|
|
622
|
+
transition: M.value
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
return (n, a) => (u(), i("span", {
|
|
626
|
+
class: "hm",
|
|
627
|
+
ref_key: "root",
|
|
628
|
+
ref: j,
|
|
629
|
+
"data-shape": e.shape,
|
|
630
|
+
"data-behind": O.value,
|
|
631
|
+
"data-grained": m(S)
|
|
632
|
+
}, [p(n.$slots, "default", {}, void 0, !0), (u(), i("svg", {
|
|
633
|
+
class: "hm__svg",
|
|
634
|
+
viewBox: `0 0 ${he} ${ge}`,
|
|
635
|
+
preserveAspectRatio: "none",
|
|
636
|
+
"aria-hidden": "true",
|
|
637
|
+
focusable: "false"
|
|
638
|
+
}, [m(x).filterId ? (u(), i("defs", {
|
|
639
|
+
key: 0,
|
|
640
|
+
innerHTML: m(x).defs[0]
|
|
641
|
+
}, null, 8, pe)) : r("", !0), (u(!0), i(t, null, f(m(x).paths, (e, t) => (u(), i("path", {
|
|
642
|
+
key: t,
|
|
643
|
+
class: o(["hm__path", {
|
|
644
|
+
drawn: A.value,
|
|
645
|
+
[`hm__path--${m(C)}`]: m(w)
|
|
646
|
+
}]),
|
|
647
|
+
d: k.value ?? e.d,
|
|
648
|
+
pathLength: "1",
|
|
649
|
+
"vector-effect": "non-scaling-stroke",
|
|
650
|
+
stroke: e.stroke ?? "none",
|
|
651
|
+
fill: e.fill ?? "none",
|
|
652
|
+
"stroke-width": e.stroke ? m(b).weight : 0,
|
|
653
|
+
"stroke-opacity": e.stroke ? e.opacity : void 0,
|
|
654
|
+
"fill-opacity": e.fill ? e.opacity : void 0,
|
|
655
|
+
filter: m(x).filterId ? `url(#${m(x).filterId})` : void 0,
|
|
656
|
+
style: s(U(e.blend)),
|
|
657
|
+
onTransitionend: F
|
|
658
|
+
}, null, 46, me))), 128))], 8, fe))], 8, de));
|
|
659
|
+
}
|
|
660
|
+
}), [["__scopeId", "data-v-581c26dd"]]);
|
|
661
|
+
//#endregion
|
|
662
|
+
export { T as BRUSHES, _e as HandMark, _e as InkMark, A as UNDERLINE_GAP, k as VB_H, O as VB_W, M as boilLines, Q as getStroke, X as getStrokePoints, ne as getSvgPathFromStroke, re as grainFilter, $ as hasGrain, se as ink, D as lerpBrush, le as normalizeProps, E as resolveBrush, N as serialize, j as shapeGeom, ue as useHandMark };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components/custom/header-ribbon";
|