@mayson-org/inject-script 1.0.10 → 1.0.12

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,CA6KvD"}
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,CAqMvD"}
@@ -84,15 +84,15 @@ export function MaysonInstallPrompt() {
84
84
 
85
85
  const shellStyle: React.CSSProperties = {
86
86
  position: 'fixed',
87
+ top: 16,
87
88
  left: '50%',
88
- bottom: 16,
89
89
  zIndex: 2147483646,
90
90
  transform: 'translateX(-50%)',
91
91
  display: 'inline-flex',
92
- alignItems: 'flex-end',
92
+ alignItems: 'center',
93
93
  gap: 8,
94
94
  maxWidth: 'calc(100% - 2rem)',
95
- padding: '4px 8px',
95
+ padding: '6px 12px',
96
96
  borderRadius: 6,
97
97
  background: '#171718',
98
98
  border: '0.6px solid #46454866',
@@ -107,25 +107,32 @@ export function MaysonInstallPrompt() {
107
107
  fontWeight: 500,
108
108
  lineHeight: '14px',
109
109
  margin: 0,
110
+ whiteSpace: 'nowrap',
110
111
  };
111
112
 
112
- const actionStyle: React.CSSProperties = {
113
+ const installGradient =
114
+ 'radial-gradient(100% 100% at 0% 0%, #DBD0F8 0%, #A39FF9 16.24%, #8030F8 29.79%, #AE63FF 45.09%, #A828E8 59.87%, #A39FF9 79.85%, #4500A3 99.46%)';
115
+
116
+ const installBtnStyle: React.CSSProperties = {
113
117
  display: 'inline-flex',
114
118
  alignItems: 'center',
115
- gap: 4,
116
- color: '#9D9DA2',
117
- textDecoration: 'none',
119
+ justifyContent: 'center',
118
120
  cursor: 'pointer',
119
121
  outline: 'none',
120
- border: 'none',
122
+ border: '2px solid transparent',
123
+ borderImageSource: installGradient,
124
+ borderImageSlice: 1,
121
125
  background: 'transparent',
122
- padding: 0,
126
+ color: '#FFFFFF',
127
+ padding: '4px 8px',
123
128
  margin: 0,
124
129
  fontFamily: 'inherit',
125
130
  fontSize: 12,
126
131
  fontWeight: 500,
127
132
  lineHeight: '14px',
128
133
  whiteSpace: 'nowrap',
134
+ flexShrink: 0,
135
+ animation: 'mayson-pwa-install-glow 2.4s ease-in-out infinite',
129
136
  };
130
137
 
131
138
  const dismissStyle: React.CSSProperties = {
@@ -147,18 +154,35 @@ export function MaysonInstallPrompt() {
147
154
 
148
155
  return (
149
156
  <div role="group" aria-label="Install app" style={shellStyle}>
157
+ <style>{\`
158
+ @keyframes mayson-pwa-install-glow {
159
+ 0%, 100% {
160
+ box-shadow:
161
+ 0 0 4px 0 #ae63ff66,
162
+ 0 0 8px 0 #8030f844;
163
+ }
164
+ 50% {
165
+ box-shadow:
166
+ 0 0 8px 2px #a828e8aa,
167
+ 0 0 16px 2px #a39ff988;
168
+ }
169
+ }
170
+ \`}</style>
150
171
  {showIOSHint ? (
151
- <p style={{ ...labelStyle, lineHeight: '16px', whiteSpace: 'normal' }}>
172
+ <p style={{ ...labelStyle, whiteSpace: 'normal', lineHeight: '16px' }}>
152
173
  To install: tap Share in Safari, then &quot;Add to Home Screen&quot;.
153
174
  </p>
154
175
  ) : showBrowserHint ? (
155
- <p style={{ ...labelStyle, lineHeight: '16px', whiteSpace: 'normal' }}>
176
+ <p style={{ ...labelStyle, whiteSpace: 'normal', lineHeight: '16px' }}>
156
177
  To install: open your browser menu (⋮) and choose &quot;Install app&quot;.
157
178
  </p>
158
179
  ) : (
159
- <button type="button" onClick={install} style={actionStyle}>
160
- Install app
161
- </button>
180
+ <>
181
+ <span style={labelStyle}>Install this app on your device</span>
182
+ <button type="button" onClick={install} style={installBtnStyle}>
183
+ Install
184
+ </button>
185
+ </>
162
186
  )}
163
187
  <button
164
188
  type="button"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mayson-org/inject-script",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "CLI and library to inject Mayson watermark, ascii, and PWA into Next.js App Router layouts.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",