@mayson-org/inject-script 1.0.11 → 1.0.13
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-prompt.d.ts","sourceRoot":"","sources":["../../../../src/plugins/pwa/templates/install-prompt.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,wBAAgB,8BAA8B,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"install-prompt.d.ts","sourceRoot":"","sources":["../../../../src/plugins/pwa/templates/install-prompt.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,wBAAgB,8BAA8B,IAAI,MAAM,CA0MvD"}
|
|
@@ -92,7 +92,7 @@ export function MaysonInstallPrompt() {
|
|
|
92
92
|
alignItems: 'center',
|
|
93
93
|
gap: 8,
|
|
94
94
|
maxWidth: 'calc(100% - 2rem)',
|
|
95
|
-
padding: '
|
|
95
|
+
padding: '6px 12px',
|
|
96
96
|
borderRadius: 6,
|
|
97
97
|
background: '#171718',
|
|
98
98
|
border: '0.6px solid #46454866',
|
|
@@ -110,6 +110,17 @@ export function MaysonInstallPrompt() {
|
|
|
110
110
|
whiteSpace: 'nowrap',
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
const installRingStyle: React.CSSProperties = {
|
|
114
|
+
display: 'inline-flex',
|
|
115
|
+
flexShrink: 0,
|
|
116
|
+
padding: 1,
|
|
117
|
+
borderRadius: 4,
|
|
118
|
+
background:
|
|
119
|
+
'conic-gradient(from var(--mayson-pwa-install-angle, 0deg), #DBD0F8 0%, #A39FF9 16.24%, #8030F8 29.79%, #AE63FF 45.09%, #A828E8 59.87%, #A39FF9 79.85%, #4500A3 99.46%, #DBD0F8 100%)',
|
|
120
|
+
boxShadow: '0 0 3px 0 #ae63ff55',
|
|
121
|
+
animation: 'mayson-pwa-install-border-spin 2s linear infinite',
|
|
122
|
+
};
|
|
123
|
+
|
|
113
124
|
const installBtnStyle: React.CSSProperties = {
|
|
114
125
|
display: 'inline-flex',
|
|
115
126
|
alignItems: 'center',
|
|
@@ -117,17 +128,16 @@ export function MaysonInstallPrompt() {
|
|
|
117
128
|
cursor: 'pointer',
|
|
118
129
|
outline: 'none',
|
|
119
130
|
border: 'none',
|
|
120
|
-
borderRadius:
|
|
121
|
-
background: '#
|
|
122
|
-
color: '#
|
|
123
|
-
padding: '2px
|
|
131
|
+
borderRadius: 3,
|
|
132
|
+
background: '#171718',
|
|
133
|
+
color: '#FFFFFF',
|
|
134
|
+
padding: '2px 6px',
|
|
124
135
|
margin: 0,
|
|
125
136
|
fontFamily: 'inherit',
|
|
126
137
|
fontSize: 12,
|
|
127
138
|
fontWeight: 500,
|
|
128
139
|
lineHeight: '14px',
|
|
129
140
|
whiteSpace: 'nowrap',
|
|
130
|
-
flexShrink: 0,
|
|
131
141
|
};
|
|
132
142
|
|
|
133
143
|
const dismissStyle: React.CSSProperties = {
|
|
@@ -149,6 +159,18 @@ export function MaysonInstallPrompt() {
|
|
|
149
159
|
|
|
150
160
|
return (
|
|
151
161
|
<div role="group" aria-label="Install app" style={shellStyle}>
|
|
162
|
+
<style>{\`
|
|
163
|
+
@property --mayson-pwa-install-angle {
|
|
164
|
+
syntax: '<angle>';
|
|
165
|
+
initial-value: 0deg;
|
|
166
|
+
inherits: false;
|
|
167
|
+
}
|
|
168
|
+
@keyframes mayson-pwa-install-border-spin {
|
|
169
|
+
to {
|
|
170
|
+
--mayson-pwa-install-angle: 360deg;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
\`}</style>
|
|
152
174
|
{showIOSHint ? (
|
|
153
175
|
<p style={{ ...labelStyle, whiteSpace: 'normal', lineHeight: '16px' }}>
|
|
154
176
|
To install: tap Share in Safari, then "Add to Home Screen".
|
|
@@ -160,9 +182,11 @@ export function MaysonInstallPrompt() {
|
|
|
160
182
|
) : (
|
|
161
183
|
<>
|
|
162
184
|
<span style={labelStyle}>Install this app on your device</span>
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
185
|
+
<span style={installRingStyle}>
|
|
186
|
+
<button type="button" onClick={install} style={installBtnStyle}>
|
|
187
|
+
Install
|
|
188
|
+
</button>
|
|
189
|
+
</span>
|
|
166
190
|
</>
|
|
167
191
|
)}
|
|
168
192
|
<button
|
package/package.json
CHANGED