@kongyo2/cards-css 0.2.1 → 0.3.1

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/src/types.ts CHANGED
@@ -65,6 +65,93 @@ export interface ShowcaseOptions {
65
65
  spring?: SpringTuning;
66
66
  }
67
67
 
68
+ /** Built-in foil colour schemes for {@link PaletteOptions.preset}. */
69
+ export type PalettePreset = "rainbow" | "gold" | "aurora" | "ruby" | "sapphire" | "mono";
70
+
71
+ /**
72
+ * Foil colour-palette / theming. Every field maps onto the foil CSS custom
73
+ * properties, so a palette can be supplied up front or swapped at runtime with
74
+ * `card.setPalette(...)`. Colours accept any CSS colour string.
75
+ */
76
+ export interface PaletteOptions {
77
+ /** A built-in scheme used as the base; the explicit fields below override it. */
78
+ preset?: PalettePreset;
79
+ /** Holographic spectrum stops (`--sunpillar-1…6`). 1–6 colours; fewer are cycled to fill the ramp. */
80
+ sunpillars?: string[];
81
+ /** Rainbow stops for the `holo` foil sweep (`--red` / `--yellow` / `--green` / `--blue` / `--violet`). 1–5 colours, cycled. */
82
+ spectrum?: string[];
83
+ /** Ramp stops for the `cosmos` foil (`--cosmos-clr-1…6`). 1–6 colours, cycled. */
84
+ cosmos?: string[];
85
+ /** Card edge highlight colour (`--card-edge`). */
86
+ edge?: string;
87
+ /** Card back fill colour (`--card-back`). */
88
+ back?: string;
89
+ /** Card glow colour (`--card-glow`); equivalent to the top-level `glow` option. */
90
+ glow?: string;
91
+ }
92
+
93
+ /**
94
+ * Custom dynamic glare (reflected light). Supply a full `image` for total
95
+ * control, or compose the built-in pointer-tracking radial gradient from
96
+ * `shape` / `extent` / `size` / `stops`. Applies across every effect and can be
97
+ * updated at runtime with `card.setGlare(...)`.
98
+ */
99
+ export interface GlareOptions {
100
+ /**
101
+ * Full `background-image` for the glare layer, overriding the built-in
102
+ * gradient on every effect. `var(--pointer-x)` / `var(--pointer-y)` are
103
+ * available for pointer tracking.
104
+ */
105
+ image?: string;
106
+ /** Radial-gradient shape when composing the gradient (default `circle`). */
107
+ shape?: "circle" | "ellipse";
108
+ /** Radial-gradient extent keyword, e.g. `farthest-corner` / `closest-side` (default `farthest-corner`). */
109
+ extent?: string;
110
+ /** Explicit gradient size — two values imply an ellipse (e.g. `60% 40%`), a single value a circle radius (e.g. `120px`); overrides `extent` when set. */
111
+ size?: string;
112
+ /** Colour stops, e.g. `["hsla(0,0%,100%,.8) 10%", "hsla(0,0%,0%,.5) 90%"]`. */
113
+ stops?: string[];
114
+ /** `mix-blend-mode` for the glare layer. */
115
+ blend?: string;
116
+ /** Glare opacity multiplier (mirrors `visual.glareOpacity`). */
117
+ opacity?: number;
118
+ }
119
+
120
+ /**
121
+ * Physical-behaviour tuning for the device-orientation (gyroscope) response.
122
+ * Passing `true` keeps the defaults; `false` disables gyroscope tilt.
123
+ */
124
+ export interface GyroscopeOptions {
125
+ /** Master switch (default true); `false` matches `gyroscope: false`. */
126
+ enabled?: boolean;
127
+ /** Device tilt (deg) on the X axis (gamma) that reaches the full effect (default 16). Lower is more sensitive. */
128
+ rangeX?: number;
129
+ /** Device tilt (deg) on the Y axis (beta) that reaches the full effect (default 18). */
130
+ rangeY?: number;
131
+ /** Sensitivity multiplier applied to the raw tilt before clamping (default 1). */
132
+ sensitivity?: number;
133
+ /** Flip the horizontal response. */
134
+ invertX?: boolean;
135
+ /** Flip the vertical response. */
136
+ invertY?: boolean;
137
+ }
138
+
139
+ /**
140
+ * Foil 3D depth / extrusion simulation. Lifts the foil stack above the artwork
141
+ * in true 3D so it parallaxes as the card tilts, with a tilt-reactive contact
142
+ * shadow. Passing `true` enables it with the defaults.
143
+ */
144
+ export interface DepthOptions {
145
+ /** Foil extrusion height in px — how far the foil floats above the artwork (default 14). */
146
+ strength?: number;
147
+ /** Perspective in px for the card's 3D space; lower exaggerates the depth (default 600). */
148
+ perspective?: number;
149
+ /** Contact-shadow opacity beneath the lifted card, 0–1 (default 0.35). */
150
+ shadow?: number;
151
+ /** Multiplier turning each extra layer's `parallax` into Z-lift, so stacked layers extrude in depth (default 1). */
152
+ layerScale?: number;
153
+ }
154
+
68
155
  /** Fine-grained visual / effect control. Numeric fields are multipliers (1 = unchanged). */
69
156
  export interface VisualOptions {
70
157
  /** Foil brightness multiplier. */
@@ -133,13 +220,20 @@ export interface HoloCardOptions {
133
220
  effect?: HoloEffect;
134
221
  interactive?: boolean;
135
222
  activateOnClick?: boolean;
136
- gyroscope?: boolean;
223
+ /** Device-orientation tilt: `true`/`false`, or an object for physical-behaviour tuning. */
224
+ gyroscope?: boolean | GyroscopeOptions;
137
225
  showcase?: boolean | ShowcaseOptions;
138
226
  glow?: string;
139
227
  aspectRatio?: number;
140
228
  textureSeed?: number;
141
229
  mask?: string | MaskOptions;
142
230
  foil?: string;
231
+ /** Foil colour palette / theming. */
232
+ palette?: PaletteOptions;
233
+ /** Custom dynamic glare (reflected light). */
234
+ glare?: GlareOptions;
235
+ /** Foil 3D depth / extrusion: `true` for the defaults, or an object to tune it. */
236
+ depth?: boolean | DepthOptions;
143
237
  /** Interaction & physics adjustments. */
144
238
  physics?: PhysicsOptions;
145
239
  /** Fine-grained visual control. */