@orangecheck/design 0.28.8 → 0.28.10
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/index.js +111 -45
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +111 -45
- package/dist/index.mjs.map +1 -1
- package/dist/primitives.js +4 -1
- package/dist/primitives.js.map +1 -1
- package/dist/primitives.mjs +4 -1
- package/dist/primitives.mjs.map +1 -1
- package/dist/styles/sigil.css +113 -24
- package/dist/tokens.d.mts +2 -1
- package/dist/tokens.d.ts +2 -1
- package/dist/tokens.js +104 -41
- package/dist/tokens.js.map +1 -1
- package/dist/tokens.mjs +104 -41
- package/dist/tokens.mjs.map +1 -1
- package/package.json +3 -2
package/dist/styles/sigil.css
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* oc-sigil — the brand mark as a translucent 3D watermark (aurora depth R3).
|
|
3
3
|
*
|
|
4
|
-
* A large, see-through extruded relief of the verb's
|
|
5
|
-
* hero and bleeding off a corner. Many thin <use> layers under perspective
|
|
6
|
-
* translateZ give real depth (a lit front face
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* A large, see-through extruded relief of the verb's pictogram, sitting behind
|
|
5
|
+
* the hero and bleeding off a corner. Many thin <use> layers under perspective
|
|
6
|
+
* + eased translateZ give real depth (a lit front face via the specular leaf,
|
|
7
|
+
* chromatically-shaded walls, a back that dissolves to TRANSPARENT so the
|
|
8
|
+
* aurora composites through it); the whole object is composited at a low
|
|
9
|
+
* `--oc-sigil-opacity` so the field reads through it — present, dimensional,
|
|
9
10
|
* but muted. The drift carries `.oc-ambient` (family oc_motion pause) and
|
|
10
11
|
* freezes under prefers-reduced-motion.
|
|
11
12
|
*
|
|
13
|
+
* Two registers, switched by `data-oc-theme` on the endpoint custom properties
|
|
14
|
+
* (--oc-sigil-lift / --oc-sigil-shade / --oc-sigil-ink-base): ember = lit
|
|
15
|
+
* letterpress relief; cypherpunk skins = unlit crisp echo stack. No hue is
|
|
16
|
+
* hardcoded — everything is a color-mix() off the skin's own tokens.
|
|
17
|
+
*
|
|
12
18
|
* Responsive by default: size is a clamp() so it scales with the viewport, and
|
|
13
|
-
* it stays visible (smaller, quieter) on phones.
|
|
14
|
-
* per-site via
|
|
19
|
+
* it stays visible (smaller, quieter, re-anchored top-right) on phones.
|
|
20
|
+
* Position/size/opacity are tunable per-site via the --oc-sigil-* vars.
|
|
15
21
|
*
|
|
16
22
|
* PRESERVE-3D FOOTGUN: opacity/mask/filter/overflow live on the OUTER wrapper
|
|
17
23
|
* ONLY — never on .oc-sigil__drift / .oc-sigil__par, or the 3D stack flattens.
|
|
24
|
+
* (The specular leaf's own mask is safe: it is a LEAF svg with no 3D children.)
|
|
18
25
|
*/
|
|
19
26
|
|
|
20
27
|
.oc-sigil {
|
|
21
28
|
position: absolute;
|
|
22
29
|
pointer-events: none;
|
|
23
30
|
contain: layout paint;
|
|
24
|
-
perspective:
|
|
31
|
+
perspective: 1600px;
|
|
25
32
|
/* responsive footprint — scales with the smaller viewport axis, clamped */
|
|
26
33
|
width: var(--oc-sigil-size, clamp(240px, 52vmin, 600px));
|
|
27
34
|
height: var(--oc-sigil-size, clamp(240px, 52vmin, 600px));
|
|
@@ -30,39 +37,101 @@
|
|
|
30
37
|
rides quieter — a mid-tone terracotta reads with less alpha over a
|
|
31
38
|
near-white page than the same mark does over a dark one. */
|
|
32
39
|
opacity: var(--oc-sigil-opacity, 0.4);
|
|
33
|
-
/* soft edge fade
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
/* soft edge fade — the mark dissolves into the field rather than ending in a
|
|
41
|
+
hard box. The solid core is aimed (per corner) at the hero-interior
|
|
42
|
+
quadrant that is actually on screen, since corner-bleed pushes the mark's
|
|
43
|
+
own center off-canvas. On the wrapper, which is safe for preserve-3d. */
|
|
44
|
+
-webkit-mask-image: radial-gradient(
|
|
45
|
+
120% 120% at var(--oc-sigil-mask-at, 55% 45%),
|
|
46
|
+
#000 48%,
|
|
47
|
+
transparent 90%
|
|
48
|
+
);
|
|
49
|
+
mask-image: radial-gradient(
|
|
50
|
+
120% 120% at var(--oc-sigil-mask-at, 55% 45%),
|
|
51
|
+
#000 48%,
|
|
52
|
+
transparent 90%
|
|
53
|
+
);
|
|
37
54
|
}
|
|
38
55
|
:root.dark .oc-sigil {
|
|
39
56
|
opacity: var(--oc-sigil-opacity, 0.52);
|
|
40
57
|
}
|
|
41
58
|
|
|
59
|
+
/* Light grounds: form-from-shadow. A warm ink-tinted highlight (never chalk
|
|
60
|
+
white) so the lit face stays in the mark's hue family. Dark keeps pure white
|
|
61
|
+
(form-from-light). */
|
|
62
|
+
:root:not(.dark) .oc-sigil {
|
|
63
|
+
--oc-sigil-lift: color-mix(in oklab, white, var(--oc-sigil-ink, var(--primary)) 30%);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ember dark rides the brighter --brand (0.645) instead of --primary (0.55) —
|
|
67
|
+
ember-scoped only, and via --oc-sigil-ink-base so the www band's explicit
|
|
68
|
+
--oc-sigil-ink still wins. Bare .dark == ember default; the cypherpunk skins
|
|
69
|
+
set their own data-oc-theme and must NOT inherit this slot. */
|
|
70
|
+
:root.dark:not([data-oc-theme]) .oc-sigil,
|
|
71
|
+
:root.dark[data-oc-theme='ember'] .oc-sigil {
|
|
72
|
+
--oc-sigil-ink-base: var(--brand);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Cypherpunk register — unlit crisp echo stack. lift = ink (flat front face,
|
|
76
|
+
auto-neutralizes the specular leaf); shade = transparent (walls FADE rather
|
|
77
|
+
than darken, so they only ever carry the skin's own ink — no olive, no gray,
|
|
78
|
+
alpha-correct over the aurora and over gold's cream page). Placed AFTER the
|
|
79
|
+
light-lift rule at equal specificity so it wins on source order. */
|
|
80
|
+
:root[data-oc-theme='orangecheck'] .oc-sigil,
|
|
81
|
+
:root[data-oc-theme='phosphor'] .oc-sigil,
|
|
82
|
+
:root[data-oc-theme='lightning'] .oc-sigil,
|
|
83
|
+
:root[data-oc-theme='gold'] .oc-sigil {
|
|
84
|
+
--oc-sigil-lift: var(--oc-sigil-ink, var(--primary));
|
|
85
|
+
--oc-sigil-shade: transparent;
|
|
86
|
+
}
|
|
87
|
+
|
|
42
88
|
/* corner anchors — the bleed crops against the hero's overflow-hidden. Offsets
|
|
43
|
-
are a share of the mark's own size so the crop is consistent at every width
|
|
89
|
+
are a share of the mark's own size so the crop is consistent at every width;
|
|
90
|
+
the mask core is aimed at the on-screen interior quadrant per corner. */
|
|
44
91
|
.oc-sigil--bottom-left {
|
|
45
92
|
left: -14%;
|
|
46
93
|
bottom: -18%;
|
|
94
|
+
--oc-sigil-mask-at: 70% 30%;
|
|
47
95
|
}
|
|
48
96
|
.oc-sigil--bottom-right {
|
|
49
97
|
right: -14%;
|
|
50
98
|
bottom: -18%;
|
|
99
|
+
--oc-sigil-mask-at: 30% 30%;
|
|
51
100
|
}
|
|
52
101
|
.oc-sigil--top-left {
|
|
53
102
|
left: -14%;
|
|
54
103
|
top: -16%;
|
|
104
|
+
--oc-sigil-mask-at: 70% 68%;
|
|
55
105
|
}
|
|
56
106
|
.oc-sigil--top-right {
|
|
57
107
|
right: -14%;
|
|
58
108
|
top: -16%;
|
|
109
|
+
--oc-sigil-mask-at: 30% 68%;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Band deboss preset — emboss the § into a full-bleed brand band. A taller,
|
|
113
|
+
right-weighted mask keeps the full glyph spine top-to-bottom; walls sink into
|
|
114
|
+
the band's own --brand (tone-on-tone deboss, no gray fringe). The consumer
|
|
115
|
+
supplies --oc-sigil-ink (e.g. --brand-foreground). Ships in the package so
|
|
116
|
+
band consumers don't rediscover it. Under a cypherpunk skin the register
|
|
117
|
+
block above wins --oc-sigil-shade (transparent) — the band then follows that
|
|
118
|
+
skin's echo look, which is intentional. */
|
|
119
|
+
.oc-sigil--band {
|
|
120
|
+
--oc-sigil-mask-at: 62% 50%;
|
|
121
|
+
--oc-sigil-shade: var(--brand);
|
|
122
|
+
-webkit-mask-image: radial-gradient(
|
|
123
|
+
150% 185% at var(--oc-sigil-mask-at),
|
|
124
|
+
#000 55%,
|
|
125
|
+
transparent 95%
|
|
126
|
+
);
|
|
127
|
+
mask-image: radial-gradient(150% 185% at var(--oc-sigil-mask-at), #000 55%, transparent 95%);
|
|
59
128
|
}
|
|
60
129
|
|
|
61
130
|
.oc-sigil__drift {
|
|
62
131
|
width: 100%;
|
|
63
132
|
height: 100%;
|
|
64
133
|
transform-style: preserve-3d;
|
|
65
|
-
animation: oc-sigil-drift
|
|
134
|
+
animation: oc-sigil-drift 48s ease-in-out infinite;
|
|
66
135
|
}
|
|
67
136
|
|
|
68
137
|
.oc-sigil__par {
|
|
@@ -72,19 +141,28 @@
|
|
|
72
141
|
transform: rotateX(var(--oc-sigil-rx, 0deg)) rotateY(var(--oc-sigil-ry, 0deg));
|
|
73
142
|
}
|
|
74
143
|
|
|
144
|
+
/* Shallow, art-directed rest (the 0% frame is what reduced-motion freezes at):
|
|
145
|
+
a ~5° breathing arc that never revisits the old steep -24° wall-dominant
|
|
146
|
+
extreme. Reads the per-slug seed on both axes. */
|
|
75
147
|
@keyframes oc-sigil-drift {
|
|
76
148
|
0%,
|
|
77
149
|
100% {
|
|
78
|
-
transform: rotateX(
|
|
150
|
+
transform: rotateX(calc(14deg + var(--oc-sigil-seed-x, 0deg)))
|
|
151
|
+
rotateY(calc(-17deg + var(--oc-sigil-seed, 0deg)));
|
|
79
152
|
}
|
|
80
|
-
|
|
81
|
-
transform: rotateX(
|
|
153
|
+
38% {
|
|
154
|
+
transform: rotateX(calc(17deg + var(--oc-sigil-seed-x, 0deg)))
|
|
155
|
+
rotateY(calc(-12deg + var(--oc-sigil-seed, 0deg)));
|
|
156
|
+
}
|
|
157
|
+
72% {
|
|
158
|
+
transform: rotateX(calc(15deg + var(--oc-sigil-seed-x, 0deg)))
|
|
159
|
+
rotateY(calc(-21deg + var(--oc-sigil-seed, 0deg)));
|
|
82
160
|
}
|
|
83
161
|
}
|
|
84
162
|
|
|
85
|
-
/* Layers are absolutely stacked; their translateZ + color ramp (the 3D
|
|
86
|
-
are computed per-layer in the component so depth is tunable in one
|
|
87
|
-
mark is
|
|
163
|
+
/* Layers are absolutely stacked; their eased translateZ + color ramp (the 3D
|
|
164
|
+
relief) are computed per-layer in the component so depth is tunable in one
|
|
165
|
+
place. The mark is the pictogram (tile frame stripped), extruded into a slab
|
|
88
166
|
that recolors per skin via currentColor. */
|
|
89
167
|
.oc-sigil__layer {
|
|
90
168
|
position: absolute;
|
|
@@ -94,15 +172,26 @@
|
|
|
94
172
|
backface-visibility: hidden;
|
|
95
173
|
}
|
|
96
174
|
|
|
175
|
+
/* Directional key light: a single upper-left catch on the front plane,
|
|
176
|
+
consistent with the negative resting yaw. One stated light across all corners
|
|
177
|
+
(do not flip per corner). Mask on this LEAF only — preserve-3d safe. */
|
|
178
|
+
.oc-sigil__spec {
|
|
179
|
+
-webkit-mask-image: linear-gradient(135deg, #000 10%, transparent 55%);
|
|
180
|
+
mask-image: linear-gradient(135deg, #000 10%, transparent 55%);
|
|
181
|
+
}
|
|
182
|
+
|
|
97
183
|
/* Phones: single-column heroes stack tall, so a bottom anchor buries the mark
|
|
98
184
|
below the fold. Re-anchor to the TOP-RIGHT corner (clear of a left-aligned
|
|
99
|
-
headline) so it lands in the first viewport,
|
|
100
|
-
|
|
185
|
+
headline) so it lands in the first viewport, aim the mask core at the visible
|
|
186
|
+
quadrant, and hold a presence floor (light was sitting at the rejected
|
|
187
|
+
"barely visible" edge). Wins on specificity + source order over the desktop
|
|
188
|
+
corner classes above. */
|
|
101
189
|
@media (max-width: 640px) {
|
|
102
190
|
.oc-sigil {
|
|
103
191
|
width: var(--oc-sigil-size-sm, clamp(170px, 56vw, 300px));
|
|
104
192
|
height: var(--oc-sigil-size-sm, clamp(170px, 56vw, 300px));
|
|
105
|
-
opacity: var(--oc-sigil-opacity-sm, 0.
|
|
193
|
+
opacity: var(--oc-sigil-opacity-sm, 0.34);
|
|
194
|
+
--oc-sigil-mask-at: 32% 66%;
|
|
106
195
|
}
|
|
107
196
|
:root.dark .oc-sigil {
|
|
108
197
|
opacity: var(--oc-sigil-opacity-sm, 0.42);
|
|
@@ -111,7 +200,7 @@
|
|
|
111
200
|
.oc-sigil--bottom-right,
|
|
112
201
|
.oc-sigil--top-left,
|
|
113
202
|
.oc-sigil--top-right {
|
|
114
|
-
inset: -
|
|
203
|
+
inset: -4% -18% auto auto; /* top-right, gentler crop keeps the mark's identity */
|
|
115
204
|
}
|
|
116
205
|
}
|
|
117
206
|
|
package/dist/tokens.d.mts
CHANGED
|
@@ -98,8 +98,9 @@ interface OcSigilProps {
|
|
|
98
98
|
glyph: OcGlyphSlug;
|
|
99
99
|
corner?: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
100
100
|
parallax?: boolean;
|
|
101
|
+
band?: boolean;
|
|
101
102
|
className?: string;
|
|
102
103
|
}
|
|
103
|
-
declare function OcSigil({ glyph, corner, parallax, className }: OcSigilProps): react_jsx_runtime.JSX.Element;
|
|
104
|
+
declare function OcSigil({ glyph, corner, parallax, band, className, }: OcSigilProps): react_jsx_runtime.JSX.Element;
|
|
104
105
|
|
|
105
106
|
export { AppearanceControls, DEFAULT_OC_THEME, OC_DEFAULT_ACCENT, OC_GLYPHS, OC_GLYPH_CANVAS, OC_MOTION_COOKIE, OC_SKIN_COOKIE, OC_THEMES, OcAppearanceMenu, type OcAppearanceMenuProps, OcAurora, type OcAuroraProps, type OcGlyphSlug, type OcMotion, type OcSceneRGB, type OcSceneTokens, OcSigil, type OcSigilProps, type OcTheme, OcThemeBridge, type OcThemeId, OcThemePicker, type OcThemePickerProps, OcThemeProvider, type OcThemeProviderProps, accentFor, cn, getOcThemeInitScript, isKnownTheme, normalizeHue, readOcSceneTokens, resolveTheme, subscribeOcTheme, useOcMotion, useOcSkin };
|
package/dist/tokens.d.ts
CHANGED
|
@@ -98,8 +98,9 @@ interface OcSigilProps {
|
|
|
98
98
|
glyph: OcGlyphSlug;
|
|
99
99
|
corner?: 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
100
100
|
parallax?: boolean;
|
|
101
|
+
band?: boolean;
|
|
101
102
|
className?: string;
|
|
102
103
|
}
|
|
103
|
-
declare function OcSigil({ glyph, corner, parallax, className }: OcSigilProps): react_jsx_runtime.JSX.Element;
|
|
104
|
+
declare function OcSigil({ glyph, corner, parallax, band, className, }: OcSigilProps): react_jsx_runtime.JSX.Element;
|
|
104
105
|
|
|
105
106
|
export { AppearanceControls, DEFAULT_OC_THEME, OC_DEFAULT_ACCENT, OC_GLYPHS, OC_GLYPH_CANVAS, OC_MOTION_COOKIE, OC_SKIN_COOKIE, OC_THEMES, OcAppearanceMenu, type OcAppearanceMenuProps, OcAurora, type OcAuroraProps, type OcGlyphSlug, type OcMotion, type OcSceneRGB, type OcSceneTokens, OcSigil, type OcSigilProps, type OcTheme, OcThemeBridge, type OcThemeId, OcThemePicker, type OcThemePickerProps, OcThemeProvider, type OcThemeProviderProps, accentFor, cn, getOcThemeInitScript, isKnownTheme, normalizeHue, readOcSceneTokens, resolveTheme, subscribeOcTheme, useOcMotion, useOcSkin };
|
package/dist/tokens.js
CHANGED
|
@@ -956,40 +956,86 @@ var OC_GLYPHS = {
|
|
|
956
956
|
btc: `<path d="M373 1414V1676H531V1414ZM670 1414V1676H829V1414ZM373 -186V76H531V-186ZM670 -186V76H829V-186ZM129 0V1490H705Q863 1490 972.50 1441Q1082 1392 1139 1305.50Q1196 1219 1196 1103Q1196 1016 1164 951Q1132 886 1074 843Q1016 800 937 779V774Q1024 765 1095.50 721Q1167 677 1210 600.50Q1253 524 1253 416Q1253 293 1194.50 199Q1136 105 1020 52.50Q904 0 731 0ZM391 217H700Q838 217 910.50 272.50Q983 328 983 428Q983 497 950 547.50Q917 598 855.50 626Q794 654 707 654H391ZM391 858H688Q762 858 817 883.50Q872 909 902 956Q932 1003 932 1068Q932 1161 868 1217.50Q804 1274 689 1274H391Z" fill="__INK__" transform="translate(238.3907 806.9912) scale(0.395961 -0.395961)"/>`
|
|
957
957
|
};
|
|
958
958
|
var DEPTH = 22;
|
|
959
|
-
var Z_STEP = 3;
|
|
960
959
|
var LAYERS = Array.from({ length: DEPTH }, (_, i) => i);
|
|
961
|
-
|
|
960
|
+
var FILL = /* @__PURE__ */ new Set(["orangecheck", "btc", "vote"]);
|
|
961
|
+
var INK = "var(--oc-sigil-ink, var(--oc-sigil-ink-base, var(--primary)))";
|
|
962
|
+
var LIFT = "var(--oc-sigil-lift, white)";
|
|
963
|
+
var SHADE = `var(--oc-sigil-shade, color-mix(in oklab, black, ${INK} 30%))`;
|
|
964
|
+
function layerStyle(i, relief) {
|
|
962
965
|
const t = i / (DEPTH - 1);
|
|
963
|
-
const ink = "var(--oc-sigil-ink, var(--primary))";
|
|
964
|
-
const bg = "var(--oc-sigil-bg, var(--background))";
|
|
965
966
|
let color;
|
|
966
967
|
if (t < 0.14) {
|
|
967
|
-
color = `color-mix(in oklab, ${
|
|
968
|
-
} else if (t < 0.
|
|
969
|
-
const k = (t - 0.14) / 0.
|
|
970
|
-
color = `color-mix(in oklab, ${
|
|
968
|
+
color = `color-mix(in oklab, ${INK}, ${LIFT} ${Math.round((0.14 - t) / 0.14 * 18)}%)`;
|
|
969
|
+
} else if (t < 0.55) {
|
|
970
|
+
const k = (t - 0.14) / 0.41;
|
|
971
|
+
color = `color-mix(in oklab, ${INK}, ${SHADE} ${Math.round(k * 45)}%)`;
|
|
971
972
|
} else {
|
|
972
|
-
const k = (t - 0.
|
|
973
|
-
color = `color-mix(in oklab, color-mix(in oklab, ${
|
|
973
|
+
const k = (t - 0.55) / 0.45;
|
|
974
|
+
color = `color-mix(in oklab, color-mix(in oklab, ${INK}, ${SHADE} 45%), transparent ${Math.round(Math.pow(k, 1.3) * 100)}%)`;
|
|
974
975
|
}
|
|
975
|
-
return {
|
|
976
|
-
transform: `translateZ(${-i * Z_STEP}px)`,
|
|
977
|
-
color
|
|
978
|
-
};
|
|
976
|
+
return { transform: `translateZ(${(-Math.pow(t, 1.4) * relief).toFixed(1)}px)`, color };
|
|
979
977
|
}
|
|
980
|
-
|
|
981
|
-
|
|
978
|
+
var TILE = /* @__PURE__ */ new Set(["stamp", "pledge", "cosign", "me", "fleet", "docs"]);
|
|
979
|
+
var FOCUS = {
|
|
980
|
+
stamp: "translate(512 512) scale(1.5) translate(-512 -512)",
|
|
981
|
+
// anchor-cross
|
|
982
|
+
pledge: "translate(512 512) scale(1.7) translate(-491 -512)",
|
|
983
|
+
// ₱ mark, recentered
|
|
984
|
+
cosign: "translate(512 512) scale(1.35) translate(-512 -512)",
|
|
985
|
+
// two figures
|
|
986
|
+
me: "translate(512 512) scale(1.45) translate(-512 -544)",
|
|
987
|
+
// bust, recentered down
|
|
988
|
+
fleet: "translate(512 512) scale(1.5) translate(-512 -512)",
|
|
989
|
+
// play + bar
|
|
990
|
+
docs: "translate(512 512) scale(1.4) translate(-512 -512)",
|
|
991
|
+
// text lines
|
|
992
|
+
vote: "translate(512 512) scale(0.92) translate(-512 -542)",
|
|
993
|
+
// tall bars, nudged down
|
|
994
|
+
btc: "translate(512 512) scale(1.25) translate(-512 -512)"
|
|
995
|
+
// ₿
|
|
996
|
+
};
|
|
997
|
+
function normSw(w) {
|
|
998
|
+
return w < 1.3 ? 1.3 : w > 1.8 ? 1.7 : w;
|
|
982
999
|
}
|
|
983
|
-
function
|
|
1000
|
+
function prepare(glyph, markup) {
|
|
1001
|
+
let m = markup.split("__INK__").join("currentColor").split("__BG__").join("none").split("__FG__").join("none");
|
|
1002
|
+
if (TILE.has(glyph)) {
|
|
1003
|
+
m = m.replace(/<rect x="6" y="6" width="12" height="12"[^>]*\/>/, "");
|
|
1004
|
+
}
|
|
1005
|
+
m = m.replace(/stroke-width="([\d.]+)"/g, (_, w) => `stroke-width="${normSw(parseFloat(w))}"`);
|
|
1006
|
+
const focus = FOCUS[glyph];
|
|
1007
|
+
return focus ? `<g transform="${focus}">${m}</g>` : m;
|
|
1008
|
+
}
|
|
1009
|
+
var SEED = {
|
|
1010
|
+
attest: [-7, 2],
|
|
1011
|
+
lock: [-4, -2],
|
|
1012
|
+
vote: [6, 0],
|
|
1013
|
+
stamp: [2, -2],
|
|
1014
|
+
agent: [-2, 3],
|
|
1015
|
+
pledge: [5, 2],
|
|
1016
|
+
chat: [-6, -1],
|
|
1017
|
+
cosign: [1, -3],
|
|
1018
|
+
vault: [4, 1],
|
|
1019
|
+
me: [-3, 2],
|
|
1020
|
+
fleet: [7, -2],
|
|
1021
|
+
docs: [0, 0],
|
|
1022
|
+
analytics: [-5, 1],
|
|
1023
|
+
btc: [4, 3],
|
|
1024
|
+
orangecheck: [0, 0]
|
|
1025
|
+
};
|
|
1026
|
+
function OcSigil({
|
|
1027
|
+
glyph,
|
|
1028
|
+
corner = "bottom-left",
|
|
1029
|
+
parallax = true,
|
|
1030
|
+
band = false,
|
|
1031
|
+
className
|
|
1032
|
+
}) {
|
|
984
1033
|
const rawId = react.useId();
|
|
985
1034
|
const id = react.useMemo(() => `oc-sigil-${rawId.replace(/[^a-zA-Z0-9_-]/g, "")}`, [rawId]);
|
|
986
1035
|
const parRef = react.useRef(null);
|
|
987
|
-
const
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
return (h % 7 - 3) * 1.5;
|
|
991
|
-
}, [glyph]);
|
|
992
|
-
const mark = react.useMemo(() => sub(OC_GLYPHS[glyph]), [glyph]);
|
|
1036
|
+
const mark = react.useMemo(() => prepare(glyph, OC_GLYPHS[glyph]), [glyph]);
|
|
1037
|
+
const relief = FILL.has(glyph) ? 30 : 48;
|
|
1038
|
+
const [seedY, seedX] = SEED[glyph];
|
|
993
1039
|
react.useEffect(() => {
|
|
994
1040
|
if (!parallax) return;
|
|
995
1041
|
const el = parRef.current;
|
|
@@ -1004,16 +1050,16 @@ function OcSigil({ glyph, corner = "bottom-left", parallax = true, className })
|
|
|
1004
1050
|
const allowed = () => !prm.matches && document.documentElement.getAttribute("data-oc-motion") !== "off";
|
|
1005
1051
|
const onMove = (e) => {
|
|
1006
1052
|
if (!allowed()) return;
|
|
1007
|
-
tx = (e.clientX / innerWidth - 0.5) *
|
|
1008
|
-
ty = (e.clientY / innerHeight - 0.5) * -
|
|
1053
|
+
tx = Math.tanh((e.clientX / innerWidth - 0.5) * 2 * 1.2) * 5;
|
|
1054
|
+
ty = Math.tanh((e.clientY / innerHeight - 0.5) * 2 * 1.2) * -5;
|
|
1009
1055
|
if (!raf) raf = requestAnimationFrame(step);
|
|
1010
1056
|
};
|
|
1011
1057
|
const step = () => {
|
|
1012
1058
|
raf = 0;
|
|
1013
|
-
cx += (tx - cx) * 0.
|
|
1014
|
-
cy += (ty - cy) * 0.
|
|
1015
|
-
el.style.setProperty("--oc-sigil-ry", `${
|
|
1016
|
-
el.style.setProperty("--oc-sigil-rx", `${
|
|
1059
|
+
cx += (tx - cx) * 0.045;
|
|
1060
|
+
cy += (ty - cy) * 0.045;
|
|
1061
|
+
el.style.setProperty("--oc-sigil-ry", `${cx.toFixed(2)}deg`);
|
|
1062
|
+
el.style.setProperty("--oc-sigil-rx", `${cy.toFixed(2)}deg`);
|
|
1017
1063
|
if (Math.abs(tx - cx) + Math.abs(ty - cy) > 0.05) raf = requestAnimationFrame(step);
|
|
1018
1064
|
};
|
|
1019
1065
|
const onPrm = () => {
|
|
@@ -1034,20 +1080,37 @@ function OcSigil({ glyph, corner = "bottom-left", parallax = true, className })
|
|
|
1034
1080
|
"div",
|
|
1035
1081
|
{
|
|
1036
1082
|
"aria-hidden": "true",
|
|
1037
|
-
className: cn("oc-sigil", `oc-sigil--${corner}`, className),
|
|
1038
|
-
style: {
|
|
1083
|
+
className: cn("oc-sigil", `oc-sigil--${corner}`, band && "oc-sigil--band", className),
|
|
1084
|
+
style: {
|
|
1085
|
+
"--oc-sigil-seed": `${seedY}deg`,
|
|
1086
|
+
"--oc-sigil-seed-x": `${seedX}deg`
|
|
1087
|
+
},
|
|
1039
1088
|
children: [
|
|
1040
1089
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: "0", height: "0", style: { position: "absolute" }, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("g", { id: `${id}-mark`, dangerouslySetInnerHTML: { __html: mark } }) }) }),
|
|
1041
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "oc-sigil__drift oc-ambient", children: /* @__PURE__ */ jsxRuntime.
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1090
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "oc-sigil__drift oc-ambient", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: parRef, className: "oc-sigil__par", children: [
|
|
1091
|
+
LAYERS.map((n) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1092
|
+
"svg",
|
|
1093
|
+
{
|
|
1094
|
+
viewBox: "0 0 1024 1024",
|
|
1095
|
+
className: "oc-sigil__layer",
|
|
1096
|
+
style: layerStyle(n, relief),
|
|
1097
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: `#${id}-mark` })
|
|
1098
|
+
},
|
|
1099
|
+
n
|
|
1100
|
+
)),
|
|
1101
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1102
|
+
"svg",
|
|
1103
|
+
{
|
|
1104
|
+
viewBox: "0 0 1024 1024",
|
|
1105
|
+
className: "oc-sigil__layer oc-sigil__spec",
|
|
1106
|
+
style: {
|
|
1107
|
+
transform: "translateZ(1.5px)",
|
|
1108
|
+
color: `color-mix(in oklab, ${INK}, ${LIFT} 45%)`
|
|
1109
|
+
},
|
|
1110
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("use", { href: `#${id}-mark` })
|
|
1111
|
+
}
|
|
1112
|
+
)
|
|
1113
|
+
] }) })
|
|
1051
1114
|
]
|
|
1052
1115
|
}
|
|
1053
1116
|
);
|