@superwall/studio 1.6.0 → 1.6.2
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/README.md +27 -10
- package/dist/assets/index-BMe9fPdZ.css +1 -0
- package/dist/assets/index-Czsb6jZs.js +11 -0
- package/dist/index.html +3 -3
- package/dist/lib/components/Dialog.d.ts +7 -0
- package/dist/lib/components/EmptyState.d.ts +9 -0
- package/dist/lib/components/InlineCode.d.ts +2 -0
- package/dist/lib/components/PaywallToasts.d.ts +8 -0
- package/dist/lib/components/SuperwallLogo.d.ts +9 -0
- package/dist/lib/components/Tooltip.d.ts +3 -1
- package/dist/lib/components/chrome/TopBar.d.ts +2 -3
- package/dist/lib/components/controls.d.ts +10 -1
- package/dist/lib/components/icons.d.ts +30 -17
- package/dist/lib/components/menus/ActionMenu.d.ts +4 -1
- package/dist/lib/components/menus/Menu.d.ts +19 -0
- package/dist/lib/index.d.ts +3 -1
- package/dist/lib/index.js +2590 -2064
- package/dist/lib/lib/actions.d.ts +3 -2
- package/dist/lib/lib/contract.d.ts +4 -0
- package/dist/lib/lib/notify.d.ts +4 -1
- package/dist/lib/lib/promotion.d.ts +17 -0
- package/dist/lib/lib/steps.d.ts +2 -1
- package/dist/lib/lib/surfaces.d.ts +10 -4
- package/dist/lib/studio.css +1 -1
- package/package.json +2 -2
- package/src/StudioApp.tsx +3 -2
- package/src/components/Dialog.tsx +74 -0
- package/src/components/DownloadScreenshot.tsx +13 -20
- package/src/components/EmptyState.tsx +32 -0
- package/src/components/InlineCode.tsx +7 -0
- package/src/components/OpenInApp.tsx +15 -14
- package/src/components/PaywallToasts.tsx +44 -37
- package/src/components/PreviewOnDevice.tsx +61 -43
- package/src/components/SuperwallLogo.tsx +72 -0
- package/src/components/SurfaceCard.tsx +34 -18
- package/src/components/Tooltip.tsx +25 -2
- package/src/components/chrome/StudioShell.tsx +1 -1
- package/src/components/chrome/Toolbar.tsx +10 -8
- package/src/components/chrome/TopBar.tsx +21 -22
- package/src/components/controls.tsx +116 -31
- package/src/components/icons.tsx +140 -59
- package/src/components/menus/ActionMenu.tsx +221 -97
- package/src/components/menus/CompareMenu.tsx +48 -67
- package/src/components/menus/Menu.tsx +144 -0
- package/src/components/panels/MissingProducts.tsx +27 -34
- package/src/components/panels/SidePanel.tsx +9 -9
- package/src/components/panels/VariablesPanel.tsx +57 -49
- package/src/components/preview/Canvas.tsx +9 -13
- package/src/components/preview/DeviceFrame.tsx +4 -6
- package/src/index.ts +9 -0
- package/src/lib/actions.ts +13 -4
- package/src/lib/contract.ts +2 -0
- package/src/lib/notify.tsx +15 -18
- package/src/lib/project.ts +1 -0
- package/src/lib/promotion.ts +47 -0
- package/src/lib/steps.ts +9 -1
- package/src/lib/surfaces.ts +22 -2
- package/src/main.tsx +22 -10
- package/src/screens/SurfaceEditor.tsx +101 -63
- package/src/screens/SurfaceList.tsx +112 -69
- package/src/scroll-fade.css +425 -0
- package/src/styles.css +380 -182
- package/dist/assets/index-CljhSsYl.js +0 -11
- package/dist/assets/index-DrsTCwot.css +0 -1
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { EmptyState } from "../components/EmptyState";
|
|
3
|
+
import { AlertTriangleIcon, AppWindowIcon, SearchIcon } from "../components/icons";
|
|
4
|
+
import { InlineCode } from "../components/InlineCode";
|
|
2
5
|
import { OpenInApp } from "../components/OpenInApp";
|
|
3
6
|
import { SurfaceCard } from "../components/SurfaceCard";
|
|
4
7
|
import { TopBar } from "../components/chrome/TopBar";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
hasActions,
|
|
8
|
-
type StudioSource,
|
|
9
|
-
type StudioStatus,
|
|
10
|
-
type StudioSurface,
|
|
11
|
-
} from "../lib/surfaces";
|
|
8
|
+
import { type StudioSource, type StudioStatus, type StudioSurface } from "../lib/surfaces";
|
|
12
9
|
import { hostStateFor, studioDefaults } from "../lib/host";
|
|
13
10
|
import { surfacePath } from "../lib/preview";
|
|
14
11
|
import { useStudioMode } from "../lib/studio-host";
|
|
@@ -23,7 +20,7 @@ export const SurfaceList = ({
|
|
|
23
20
|
onOpen: (surface: StudioSurface) => void;
|
|
24
21
|
}) => {
|
|
25
22
|
const device = useStudioMode() === "device";
|
|
26
|
-
const actions =
|
|
23
|
+
const actions = source.actions;
|
|
27
24
|
const [statuses, setStatuses] = React.useState<Record<string, StudioStatus>>({});
|
|
28
25
|
const defaults = React.useMemo(studioDefaults, [source]);
|
|
29
26
|
|
|
@@ -31,7 +28,7 @@ export const SurfaceList = ({
|
|
|
31
28
|
if (!actions) return;
|
|
32
29
|
let cancelled = false;
|
|
33
30
|
for (const surface of source.surfaces) {
|
|
34
|
-
void
|
|
31
|
+
void actions.status(surface).then((status) => {
|
|
35
32
|
if (cancelled) return;
|
|
36
33
|
setStatuses((current) => ({ ...current, [surfacePath(surface)]: status }));
|
|
37
34
|
});
|
|
@@ -75,97 +72,143 @@ export const SurfaceList = ({
|
|
|
75
72
|
surfaces: all.filter(
|
|
76
73
|
(surface) =>
|
|
77
74
|
needle === "" ||
|
|
78
|
-
`${surface.project ?? ""} ${surface.id}
|
|
75
|
+
`${surface.project ?? ""} ${surface.id} ${surface.label ?? ""}`
|
|
76
|
+
.toLowerCase()
|
|
77
|
+
.includes(needle),
|
|
79
78
|
),
|
|
80
79
|
};
|
|
81
80
|
})
|
|
82
81
|
.filter((section) => section.all.length > 0);
|
|
83
82
|
|
|
83
|
+
const clear = (kind: string) => setQueries((current) => ({ ...current, [kind]: "" }));
|
|
84
|
+
|
|
84
85
|
return (
|
|
85
86
|
<>
|
|
86
87
|
<TopBar
|
|
87
|
-
title={source.title}
|
|
88
|
-
inset
|
|
89
88
|
label={device ? "Preview" : undefined}
|
|
90
89
|
actions={
|
|
91
90
|
device ? <OpenInApp origin={window.location.origin} scheme={source.scheme} /> : undefined
|
|
92
91
|
}
|
|
93
92
|
/>
|
|
94
93
|
|
|
95
|
-
<div className="flex-1 overflow-y-auto
|
|
96
|
-
<div className="mx-auto max-w-[
|
|
94
|
+
<div className="flex-1 overflow-y-auto" ref={scroller}>
|
|
95
|
+
<div className="mx-auto flex w-full max-w-[1440px] flex-col gap-6 p-3 sm:p-6 lg:p-10">
|
|
96
|
+
<header className="flex flex-col gap-0.5">
|
|
97
|
+
<h1 className="m-0 text-2xl font-medium">{source.title}</h1>
|
|
98
|
+
{!device && (
|
|
99
|
+
<p className="m-0 text-base text-fg-secondary">
|
|
100
|
+
Previews run against a real SDK host, and you choose the outcomes. Edit files under{" "}
|
|
101
|
+
<InlineCode>superwall/</InlineCode> and they update live.
|
|
102
|
+
</p>
|
|
103
|
+
)}
|
|
104
|
+
</header>
|
|
105
|
+
|
|
97
106
|
{source.diagnostics && source.diagnostics.length > 0 && (
|
|
98
|
-
<div
|
|
99
|
-
|
|
107
|
+
<div
|
|
108
|
+
className="flex gap-2 rounded-sm border border-destructive/32 bg-destructive/8 py-3 ps-[calc(--spacing(3)-1px)] pe-3 text-sm text-destructive-foreground"
|
|
109
|
+
role="alert"
|
|
110
|
+
>
|
|
111
|
+
<span className="flex h-5 flex-none items-center">
|
|
112
|
+
<AlertTriangleIcon />
|
|
113
|
+
</span>
|
|
114
|
+
<span className="min-w-0 whitespace-pre-wrap text-destructive-foreground/80">
|
|
115
|
+
{source.diagnostics.join("\n")}
|
|
116
|
+
</span>
|
|
100
117
|
</div>
|
|
101
118
|
)}
|
|
102
119
|
|
|
103
120
|
{sections.map((section) => (
|
|
104
|
-
<section
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
121
|
+
<section
|
|
122
|
+
key={section.kind}
|
|
123
|
+
className="overflow-hidden rounded-sm border border-border bg-card"
|
|
124
|
+
aria-label={section.label}
|
|
125
|
+
>
|
|
126
|
+
<div className="flex min-h-12 flex-wrap items-center gap-x-4 gap-y-2 border-b border-border py-2.5 ps-4 pe-2.5">
|
|
127
|
+
<h2 className="m-0 flex flex-1 items-center gap-1.5 text-sm font-medium tracking-normal whitespace-nowrap">
|
|
128
|
+
{section.label}
|
|
129
|
+
<span className="font-normal text-fg-tertiary tabular-nums">
|
|
130
|
+
{section.surfaces.length}
|
|
131
|
+
</span>
|
|
132
|
+
</h2>
|
|
110
133
|
{section.all.length > 1 && (
|
|
111
|
-
<
|
|
112
|
-
className="
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
134
|
+
<label className="relative flex w-full items-center sm:w-56">
|
|
135
|
+
<SearchIcon className="icon-tertiary pointer-events-none absolute left-[calc(--spacing(2.5)-1px)]" />
|
|
136
|
+
<input
|
|
137
|
+
className="sw-input sw-input--sm ps-8"
|
|
138
|
+
type="search"
|
|
139
|
+
value={queries[section.kind] ?? ""}
|
|
140
|
+
placeholder={`Search ${section.label.toLowerCase()}`}
|
|
141
|
+
aria-label={`Search ${section.label.toLowerCase()}`}
|
|
142
|
+
onChange={(event) =>
|
|
143
|
+
setQueries((current) => ({
|
|
144
|
+
...current,
|
|
145
|
+
[section.kind]: event.target.value,
|
|
146
|
+
}))
|
|
147
|
+
}
|
|
148
|
+
/>
|
|
149
|
+
</label>
|
|
121
150
|
)}
|
|
122
151
|
</div>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
{section.surfaces.length > 0 ? (
|
|
153
|
+
<div className="-me-px -mb-px grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 2xl:grid-cols-5">
|
|
154
|
+
{section.surfaces.map((surface) => {
|
|
155
|
+
const preview = device ? source.standaloneUrl?.(surface) : undefined;
|
|
156
|
+
return (
|
|
157
|
+
<SurfaceCard
|
|
158
|
+
key={surfacePath(surface)}
|
|
159
|
+
surface={surface}
|
|
160
|
+
status={statuses[surfacePath(surface)]}
|
|
161
|
+
previewSrc={source.previewUrl(surface)}
|
|
162
|
+
hostState={hostStateFor({
|
|
163
|
+
surface,
|
|
164
|
+
defaults,
|
|
165
|
+
sourceSamples: source.samples,
|
|
166
|
+
samples: {},
|
|
167
|
+
theme: "light",
|
|
168
|
+
edited: {},
|
|
169
|
+
})}
|
|
170
|
+
onOpen={() =>
|
|
171
|
+
preview === undefined ? onOpen(surface) : window.location.assign(preview)
|
|
172
|
+
}
|
|
173
|
+
href={preview ?? (device ? surfacePath(surface) : undefined)}
|
|
174
|
+
/>
|
|
175
|
+
);
|
|
176
|
+
})}
|
|
177
|
+
</div>
|
|
178
|
+
) : (
|
|
179
|
+
<EmptyState
|
|
180
|
+
icon={<SearchIcon />}
|
|
181
|
+
title={`No ${section.label.toLowerCase()} match “${(queries[section.kind] ?? "").trim()}”`}
|
|
182
|
+
actions={
|
|
183
|
+
<button
|
|
184
|
+
type="button"
|
|
185
|
+
className="sw-btn sw-btn--sm"
|
|
186
|
+
onClick={() => clear(section.kind)}
|
|
187
|
+
>
|
|
188
|
+
Clear search
|
|
189
|
+
</button>
|
|
190
|
+
}
|
|
191
|
+
/>
|
|
147
192
|
)}
|
|
148
193
|
</section>
|
|
149
194
|
))}
|
|
150
195
|
|
|
151
196
|
{source.surfaces.length === 0 && (
|
|
152
|
-
<div className="rounded border border-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
197
|
+
<div className="rounded-sm border border-border bg-card">
|
|
198
|
+
<EmptyState
|
|
199
|
+
icon={<AppWindowIcon />}
|
|
200
|
+
title="No paywalls yet"
|
|
201
|
+
description={
|
|
202
|
+
<>
|
|
203
|
+
Create <InlineCode>superwall/paywalls/<id>/app/page.tsx</InlineCode> and
|
|
204
|
+
it appears here.
|
|
205
|
+
</>
|
|
206
|
+
}
|
|
207
|
+
/>
|
|
158
208
|
</div>
|
|
159
209
|
)}
|
|
160
210
|
</div>
|
|
161
211
|
</div>
|
|
162
|
-
|
|
163
|
-
{!device && (
|
|
164
|
-
<footer className="bg-bar flex h-11 flex-none items-center justify-center border-t border-cream/10 text-xs text-cream/55">
|
|
165
|
-
Previews run against a real SDK host — you choose the outcomes. Edit files under
|
|
166
|
-
superwall/ and they update live.
|
|
167
|
-
</footer>
|
|
168
|
-
)}
|
|
169
212
|
</>
|
|
170
213
|
);
|
|
171
214
|
};
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
@property --scroll-fade-t {
|
|
2
|
+
syntax: "<length-percentage>";
|
|
3
|
+
inherits: false;
|
|
4
|
+
initial-value: 0px;
|
|
5
|
+
}
|
|
6
|
+
@property --scroll-fade-b {
|
|
7
|
+
syntax: "<length-percentage>";
|
|
8
|
+
inherits: false;
|
|
9
|
+
initial-value: 0px;
|
|
10
|
+
}
|
|
11
|
+
@property --scroll-fade-s {
|
|
12
|
+
syntax: "<length-percentage>";
|
|
13
|
+
inherits: false;
|
|
14
|
+
initial-value: 0px;
|
|
15
|
+
}
|
|
16
|
+
@property --scroll-fade-e {
|
|
17
|
+
syntax: "<length-percentage>";
|
|
18
|
+
inherits: false;
|
|
19
|
+
initial-value: 0px;
|
|
20
|
+
}
|
|
21
|
+
@property --scroll-fade-mask {
|
|
22
|
+
syntax: "*";
|
|
23
|
+
inherits: false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@theme inline {
|
|
27
|
+
@keyframes scroll-fade-reveal-t {
|
|
28
|
+
from {
|
|
29
|
+
--scroll-fade-t: 0px;
|
|
30
|
+
}
|
|
31
|
+
to {
|
|
32
|
+
--scroll-fade-t: var(
|
|
33
|
+
--_scroll-fade-size-t,
|
|
34
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
@keyframes scroll-fade-reveal-b {
|
|
39
|
+
from {
|
|
40
|
+
--scroll-fade-b: var(
|
|
41
|
+
--_scroll-fade-size-b,
|
|
42
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
to {
|
|
46
|
+
--scroll-fade-b: 0px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
@keyframes scroll-fade-reveal-s {
|
|
50
|
+
from {
|
|
51
|
+
--scroll-fade-s: 0px;
|
|
52
|
+
}
|
|
53
|
+
to {
|
|
54
|
+
--scroll-fade-s: var(
|
|
55
|
+
--_scroll-fade-size-s,
|
|
56
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
@keyframes scroll-fade-reveal-e {
|
|
61
|
+
from {
|
|
62
|
+
--scroll-fade-e: var(
|
|
63
|
+
--_scroll-fade-size-e,
|
|
64
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
to {
|
|
68
|
+
--scroll-fade-e: 0px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@utility scroll-fade {
|
|
74
|
+
--_scroll-fade-size-t: var(
|
|
75
|
+
--scroll-fade-t-size,
|
|
76
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
77
|
+
);
|
|
78
|
+
--_scroll-fade-size-b: var(
|
|
79
|
+
--scroll-fade-b-size,
|
|
80
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
81
|
+
);
|
|
82
|
+
--scroll-fade-block: linear-gradient(
|
|
83
|
+
to bottom,
|
|
84
|
+
transparent 0,
|
|
85
|
+
#000 var(--scroll-fade-t, 0px),
|
|
86
|
+
#000 calc(100% - var(--scroll-fade-b, 0px)),
|
|
87
|
+
transparent 100%
|
|
88
|
+
);
|
|
89
|
+
-webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
|
|
90
|
+
mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
|
|
91
|
+
-webkit-mask-composite: source-in;
|
|
92
|
+
mask-composite: intersect;
|
|
93
|
+
-webkit-mask-repeat: no-repeat;
|
|
94
|
+
mask-repeat: no-repeat;
|
|
95
|
+
|
|
96
|
+
@supports (animation-timeline: scroll()) {
|
|
97
|
+
animation:
|
|
98
|
+
scroll-fade-reveal-t 1ms ease-in-out,
|
|
99
|
+
scroll-fade-reveal-b 1ms ease-in-out;
|
|
100
|
+
animation-timeline: scroll(self y), scroll(self y);
|
|
101
|
+
animation-range:
|
|
102
|
+
0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
|
|
103
|
+
calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
104
|
+
animation-fill-mode: both;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@supports not (animation-timeline: scroll()) {
|
|
108
|
+
--scroll-fade-t: var(--_scroll-fade-size-t);
|
|
109
|
+
--scroll-fade-b: var(--_scroll-fade-size-b);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@utility scroll-fade-y {
|
|
114
|
+
--_scroll-fade-size-t: var(
|
|
115
|
+
--scroll-fade-t-size,
|
|
116
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
117
|
+
);
|
|
118
|
+
--_scroll-fade-size-b: var(
|
|
119
|
+
--scroll-fade-b-size,
|
|
120
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
121
|
+
);
|
|
122
|
+
--scroll-fade-block: linear-gradient(
|
|
123
|
+
to bottom,
|
|
124
|
+
transparent 0,
|
|
125
|
+
#000 var(--scroll-fade-t, 0px),
|
|
126
|
+
#000 calc(100% - var(--scroll-fade-b, 0px)),
|
|
127
|
+
transparent 100%
|
|
128
|
+
);
|
|
129
|
+
-webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
|
|
130
|
+
mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
|
|
131
|
+
-webkit-mask-composite: source-in;
|
|
132
|
+
mask-composite: intersect;
|
|
133
|
+
-webkit-mask-repeat: no-repeat;
|
|
134
|
+
mask-repeat: no-repeat;
|
|
135
|
+
|
|
136
|
+
@supports (animation-timeline: scroll()) {
|
|
137
|
+
animation:
|
|
138
|
+
scroll-fade-reveal-t 1ms ease-in-out,
|
|
139
|
+
scroll-fade-reveal-b 1ms ease-in-out;
|
|
140
|
+
animation-timeline: scroll(self y), scroll(self y);
|
|
141
|
+
animation-range:
|
|
142
|
+
0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
|
|
143
|
+
calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
144
|
+
animation-fill-mode: both;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@supports not (animation-timeline: scroll()) {
|
|
148
|
+
--scroll-fade-t: var(--_scroll-fade-size-t);
|
|
149
|
+
--scroll-fade-b: var(--_scroll-fade-size-b);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@utility scroll-fade-x {
|
|
154
|
+
--_scroll-fade-size-s: var(
|
|
155
|
+
--scroll-fade-s-size,
|
|
156
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
157
|
+
);
|
|
158
|
+
--_scroll-fade-size-e: var(
|
|
159
|
+
--scroll-fade-e-size,
|
|
160
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
161
|
+
);
|
|
162
|
+
--scroll-fade-inline: linear-gradient(
|
|
163
|
+
to right,
|
|
164
|
+
transparent 0,
|
|
165
|
+
#000 var(--scroll-fade-s, 0px),
|
|
166
|
+
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
167
|
+
transparent 100%
|
|
168
|
+
);
|
|
169
|
+
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
170
|
+
--scroll-fade-inline: linear-gradient(
|
|
171
|
+
to left,
|
|
172
|
+
transparent 0,
|
|
173
|
+
#000 var(--scroll-fade-s, 0px),
|
|
174
|
+
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
175
|
+
transparent 100%
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
-webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
|
|
179
|
+
mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
|
|
180
|
+
-webkit-mask-composite: source-in;
|
|
181
|
+
mask-composite: intersect;
|
|
182
|
+
-webkit-mask-repeat: no-repeat;
|
|
183
|
+
mask-repeat: no-repeat;
|
|
184
|
+
|
|
185
|
+
@supports (animation-timeline: scroll()) {
|
|
186
|
+
animation:
|
|
187
|
+
scroll-fade-reveal-s 1ms ease-in-out,
|
|
188
|
+
scroll-fade-reveal-e 1ms ease-in-out;
|
|
189
|
+
animation-timeline: scroll(self inline), scroll(self inline);
|
|
190
|
+
animation-range:
|
|
191
|
+
0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
|
|
192
|
+
calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
193
|
+
animation-fill-mode: both;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@supports not (animation-timeline: scroll()) {
|
|
197
|
+
--scroll-fade-s: var(--_scroll-fade-size-s);
|
|
198
|
+
--scroll-fade-e: var(--_scroll-fade-size-e);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@utility scroll-fade-t {
|
|
203
|
+
--_scroll-fade-size-t: var(
|
|
204
|
+
--scroll-fade-t-size,
|
|
205
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
206
|
+
);
|
|
207
|
+
--scroll-fade-mask: linear-gradient(
|
|
208
|
+
to bottom,
|
|
209
|
+
transparent 0,
|
|
210
|
+
#000 var(--scroll-fade-t, 0px),
|
|
211
|
+
#000 100%
|
|
212
|
+
);
|
|
213
|
+
-webkit-mask-image: var(--scroll-fade-mask);
|
|
214
|
+
mask-image: var(--scroll-fade-mask);
|
|
215
|
+
-webkit-mask-composite: source-in;
|
|
216
|
+
mask-composite: intersect;
|
|
217
|
+
-webkit-mask-repeat: no-repeat;
|
|
218
|
+
mask-repeat: no-repeat;
|
|
219
|
+
|
|
220
|
+
@supports (animation-timeline: scroll()) {
|
|
221
|
+
animation: scroll-fade-reveal-t 1ms ease-in-out;
|
|
222
|
+
animation-timeline: scroll(self y);
|
|
223
|
+
animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
|
|
224
|
+
animation-fill-mode: both;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@supports not (animation-timeline: scroll()) {
|
|
228
|
+
--scroll-fade-t: var(--_scroll-fade-size-t);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@utility scroll-fade-b {
|
|
233
|
+
--_scroll-fade-size-b: var(
|
|
234
|
+
--scroll-fade-b-size,
|
|
235
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
236
|
+
);
|
|
237
|
+
--scroll-fade-mask: linear-gradient(
|
|
238
|
+
to bottom,
|
|
239
|
+
#000 0,
|
|
240
|
+
#000 calc(100% - var(--scroll-fade-b, 0px)),
|
|
241
|
+
transparent 100%
|
|
242
|
+
);
|
|
243
|
+
-webkit-mask-image: var(--scroll-fade-mask);
|
|
244
|
+
mask-image: var(--scroll-fade-mask);
|
|
245
|
+
-webkit-mask-composite: source-in;
|
|
246
|
+
mask-composite: intersect;
|
|
247
|
+
-webkit-mask-repeat: no-repeat;
|
|
248
|
+
mask-repeat: no-repeat;
|
|
249
|
+
|
|
250
|
+
@supports (animation-timeline: scroll()) {
|
|
251
|
+
animation: scroll-fade-reveal-b 1ms ease-in-out;
|
|
252
|
+
animation-timeline: scroll(self y);
|
|
253
|
+
animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
254
|
+
animation-fill-mode: both;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@supports not (animation-timeline: scroll()) {
|
|
258
|
+
--scroll-fade-b: var(--_scroll-fade-size-b);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@utility scroll-fade-l {
|
|
263
|
+
--_scroll-fade-size-s: var(
|
|
264
|
+
--scroll-fade-s-size,
|
|
265
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
266
|
+
);
|
|
267
|
+
--scroll-fade-mask: linear-gradient(
|
|
268
|
+
to right,
|
|
269
|
+
transparent 0,
|
|
270
|
+
#000 var(--scroll-fade-s, 0px),
|
|
271
|
+
#000 100%
|
|
272
|
+
);
|
|
273
|
+
-webkit-mask-image: var(--scroll-fade-mask);
|
|
274
|
+
mask-image: var(--scroll-fade-mask);
|
|
275
|
+
-webkit-mask-composite: source-in;
|
|
276
|
+
mask-composite: intersect;
|
|
277
|
+
-webkit-mask-repeat: no-repeat;
|
|
278
|
+
mask-repeat: no-repeat;
|
|
279
|
+
|
|
280
|
+
@supports (animation-timeline: scroll()) {
|
|
281
|
+
animation: scroll-fade-reveal-s 1ms ease-in-out;
|
|
282
|
+
animation-timeline: scroll(self x);
|
|
283
|
+
animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
|
|
284
|
+
animation-fill-mode: both;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@supports not (animation-timeline: scroll()) {
|
|
288
|
+
--scroll-fade-s: var(--_scroll-fade-size-s);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
@utility scroll-fade-r {
|
|
293
|
+
--_scroll-fade-size-e: var(
|
|
294
|
+
--scroll-fade-e-size,
|
|
295
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
296
|
+
);
|
|
297
|
+
--scroll-fade-mask: linear-gradient(
|
|
298
|
+
to right,
|
|
299
|
+
#000 0,
|
|
300
|
+
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
301
|
+
transparent 100%
|
|
302
|
+
);
|
|
303
|
+
-webkit-mask-image: var(--scroll-fade-mask);
|
|
304
|
+
mask-image: var(--scroll-fade-mask);
|
|
305
|
+
-webkit-mask-composite: source-in;
|
|
306
|
+
mask-composite: intersect;
|
|
307
|
+
-webkit-mask-repeat: no-repeat;
|
|
308
|
+
mask-repeat: no-repeat;
|
|
309
|
+
|
|
310
|
+
@supports (animation-timeline: scroll()) {
|
|
311
|
+
animation: scroll-fade-reveal-e 1ms ease-in-out;
|
|
312
|
+
animation-timeline: scroll(self x);
|
|
313
|
+
animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
314
|
+
animation-fill-mode: both;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
@supports not (animation-timeline: scroll()) {
|
|
318
|
+
--scroll-fade-e: var(--_scroll-fade-size-e);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@utility scroll-fade-s {
|
|
323
|
+
--_scroll-fade-size-s: var(
|
|
324
|
+
--scroll-fade-s-size,
|
|
325
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
326
|
+
);
|
|
327
|
+
--scroll-fade-mask: linear-gradient(
|
|
328
|
+
to right,
|
|
329
|
+
transparent 0,
|
|
330
|
+
#000 var(--scroll-fade-s, 0px),
|
|
331
|
+
#000 100%
|
|
332
|
+
);
|
|
333
|
+
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
334
|
+
--scroll-fade-mask: linear-gradient(
|
|
335
|
+
to left,
|
|
336
|
+
transparent 0,
|
|
337
|
+
#000 var(--scroll-fade-s, 0px),
|
|
338
|
+
#000 100%
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
-webkit-mask-image: var(--scroll-fade-mask);
|
|
342
|
+
mask-image: var(--scroll-fade-mask);
|
|
343
|
+
-webkit-mask-composite: source-in;
|
|
344
|
+
mask-composite: intersect;
|
|
345
|
+
-webkit-mask-repeat: no-repeat;
|
|
346
|
+
mask-repeat: no-repeat;
|
|
347
|
+
|
|
348
|
+
@supports (animation-timeline: scroll()) {
|
|
349
|
+
animation: scroll-fade-reveal-s 1ms ease-in-out;
|
|
350
|
+
animation-timeline: scroll(self inline);
|
|
351
|
+
animation-range: 0 var(--scroll-fade-reveal, calc(var(--spacing) * 24));
|
|
352
|
+
animation-fill-mode: both;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
@supports not (animation-timeline: scroll()) {
|
|
356
|
+
--scroll-fade-s: var(--_scroll-fade-size-s);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
@utility scroll-fade-e {
|
|
361
|
+
--_scroll-fade-size-e: var(
|
|
362
|
+
--scroll-fade-e-size,
|
|
363
|
+
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
|
|
364
|
+
);
|
|
365
|
+
--scroll-fade-mask: linear-gradient(
|
|
366
|
+
to right,
|
|
367
|
+
#000 0,
|
|
368
|
+
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
369
|
+
transparent 100%
|
|
370
|
+
);
|
|
371
|
+
&:where([dir="rtl"], [dir="rtl"] *) {
|
|
372
|
+
--scroll-fade-mask: linear-gradient(
|
|
373
|
+
to left,
|
|
374
|
+
#000 0,
|
|
375
|
+
#000 calc(100% - var(--scroll-fade-e, 0px)),
|
|
376
|
+
transparent 100%
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
-webkit-mask-image: var(--scroll-fade-mask);
|
|
380
|
+
mask-image: var(--scroll-fade-mask);
|
|
381
|
+
-webkit-mask-composite: source-in;
|
|
382
|
+
mask-composite: intersect;
|
|
383
|
+
-webkit-mask-repeat: no-repeat;
|
|
384
|
+
mask-repeat: no-repeat;
|
|
385
|
+
|
|
386
|
+
@supports (animation-timeline: scroll()) {
|
|
387
|
+
animation: scroll-fade-reveal-e 1ms ease-in-out;
|
|
388
|
+
animation-timeline: scroll(self inline);
|
|
389
|
+
animation-range: calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
|
|
390
|
+
animation-fill-mode: both;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
@supports not (animation-timeline: scroll()) {
|
|
394
|
+
--scroll-fade-e: var(--_scroll-fade-size-e);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
@utility scroll-fade-* {
|
|
399
|
+
--scroll-fade-size: calc(var(--spacing) * --value(integer));
|
|
400
|
+
--scroll-fade-size: --value([length], [percentage]);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
@utility scroll-fade-t-* {
|
|
404
|
+
--scroll-fade-t-size: calc(var(--spacing) * --value(integer));
|
|
405
|
+
--scroll-fade-t-size: --value([length], [percentage]);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
@utility scroll-fade-b-* {
|
|
409
|
+
--scroll-fade-b-size: calc(var(--spacing) * --value(integer));
|
|
410
|
+
--scroll-fade-b-size: --value([length], [percentage]);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
@utility scroll-fade-s-* {
|
|
414
|
+
--scroll-fade-s-size: calc(var(--spacing) * --value(integer));
|
|
415
|
+
--scroll-fade-s-size: --value([length], [percentage]);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
@utility scroll-fade-e-* {
|
|
419
|
+
--scroll-fade-e-size: calc(var(--spacing) * --value(integer));
|
|
420
|
+
--scroll-fade-e-size: --value([length], [percentage]);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
@utility scroll-fade-none {
|
|
424
|
+
--scroll-fade-mask: none;
|
|
425
|
+
}
|