create-catalyst-app 1.2.0-canary.2 → 1.2.0-canary.3
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/package.json +1 -1
- package/templates/common/public/splashscreen.html +16 -5
- package/templates/common/server/index.js +2 -1
- package/templates/common/src/js/containers/Home/Home.js +3 -2
- package/templates/none-js/package.json +1 -1
- package/templates/none-ts/package.json +1 -1
- package/templates/redux-js/package.json +1 -1
- package/templates/redux-ts/package.json +1 -1
- package/templates/rtk-js/package.json +1 -1
- package/templates/rtk-ts/package.json +1 -1
package/package.json
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
6
6
|
<title>Catalyst</title>
|
|
7
7
|
<style>
|
|
8
|
-
/* Must equal
|
|
8
|
+
/* Must equal the native splash colour so the native layer and this page are one surface. The native build
|
|
9
|
+
injects WEBVIEW_CONFIG.splashScreen.backgroundColor as window.__CATALYST_SPLASH__ and the script sets --ink
|
|
10
|
+
from it; this value is the fallback for a page opened on its own. */
|
|
9
11
|
:root {
|
|
10
12
|
--ink: #0b0a14;
|
|
11
13
|
--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
|
|
@@ -162,8 +164,12 @@ const RAYS=[{"g":[0,89.75,85.3,89.75,0,1,0],"p":[0,1794,3,1754,14,1716,30,1680,5
|
|
|
162
164
|
(function () {
|
|
163
165
|
var still = /still/.test(location.hash);
|
|
164
166
|
if (still) document.documentElement.className = 'still';
|
|
167
|
+
var cfg = window.__CATALYST_SPLASH__;
|
|
168
|
+
if (cfg && cfg.backgroundColor) document.documentElement.style.setProperty('--ink', cfg.backgroundColor);
|
|
165
169
|
|
|
166
170
|
var DPR = window.devicePixelRatio || 1;
|
|
171
|
+
/* The composition is tuned for a 144px mark: keep WEBVIEW_CONFIG.splashScreen.imageHeight (and imageWidth)
|
|
172
|
+
at 144 so the native image and frame 0 of this page line up */
|
|
167
173
|
var S = 0.8; /* css px per logo unit: 180 units -> 144px, the native imageHeight */
|
|
168
174
|
var K = S * DPR; /* device px per unit */
|
|
169
175
|
var CX = 79, CY = 90; /* logo centre in units */
|
|
@@ -172,6 +178,11 @@ const RAYS=[{"g":[0,89.75,85.3,89.75,0,1,0],"p":[0,1794,3,1754,14,1716,30,1680,5
|
|
|
172
178
|
var SLICES = 26;
|
|
173
179
|
var HERO = 1.7; /* the mark ends at this scale, so 3D layers are drawn this sharp */
|
|
174
180
|
var WALL_RES = 1.3;
|
|
181
|
+
/* The silhouette, the 26 wall slices and the shade hold most of the canvas memory (~34 MB of ~51 MB on a
|
|
182
|
+
3x phone), so cap them at 2.6 backing px per css px: unchanged up to 2x, 0.87x device px on 3x screens.
|
|
183
|
+
They share one resolution because the slices and shade copy the silhouette 1:1.
|
|
184
|
+
If memory is still tight, SLICES is the next lever. */
|
|
185
|
+
var wallRes = Math.min(WALL_RES, 2.6 / DPR);
|
|
175
186
|
var PURPLE = '#7171ff';
|
|
176
187
|
var Q = function (v) { return v.toFixed(2); };
|
|
177
188
|
|
|
@@ -230,7 +241,7 @@ const RAYS=[{"g":[0,89.75,85.3,89.75,0,1,0],"p":[0,1794,3,1754,14,1716,30,1680,5
|
|
|
230
241
|
base.appendChild(depth); ray.appendChild(base);
|
|
231
242
|
|
|
232
243
|
/* Silhouette eroded by 1.6 device px so the side walls never fringe the front face's anti-aliased edge */
|
|
233
|
-
var sil = layer(0,
|
|
244
|
+
var sil = layer(0, wallRes), sc = sil.ctx;
|
|
234
245
|
trace(sc, pts, dx, dy); sc.fillStyle = '#fff'; sc.fill();
|
|
235
246
|
sc.globalCompositeOperation = 'destination-out'; sc.lineWidth = 3.2; sc.stroke();
|
|
236
247
|
|
|
@@ -240,8 +251,8 @@ const RAYS=[{"g":[0,89.75,85.3,89.75,0,1,0],"p":[0,1794,3,1754,14,1716,30,1680,5
|
|
|
240
251
|
for (var k = 0; k < SLICES; k++) {
|
|
241
252
|
var f = k / (SLICES - 1);
|
|
242
253
|
var z = -HD + 2 * HD * f * (SLICES - 1) / SLICES;
|
|
243
|
-
var L = layer(z,
|
|
244
|
-
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.drawImage(sil.c, 0, 0); ctx.setTransform(
|
|
254
|
+
var L = layer(z, wallRes), ctx = L.ctx;
|
|
255
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.drawImage(sil.c, 0, 0); ctx.setTransform(wallRes, 0, 0, wallRes, 0, 0);
|
|
245
256
|
ctx.globalCompositeOperation = 'source-in';
|
|
246
257
|
if (k === 0) {
|
|
247
258
|
ctx.fillStyle = brand(ctx, r, dx, dy, 0.55);
|
|
@@ -288,7 +299,7 @@ const RAYS=[{"g":[0,89.75,85.3,89.75,0,1,0],"p":[0,1794,3,1754,14,1716,30,1680,5
|
|
|
288
299
|
depth.appendChild(lit);
|
|
289
300
|
|
|
290
301
|
/* Depth shade: darkens the ray while it is on the far side of the turbine */
|
|
291
|
-
var sd = layer(HD + 0.3,
|
|
302
|
+
var sd = layer(HD + 0.3, wallRes);
|
|
292
303
|
sd.ctx.setTransform(1, 0, 0, 1, 0, 0); sd.ctx.drawImage(sil.c, 0, 0);
|
|
293
304
|
sd.ctx.globalCompositeOperation = 'source-in'; sd.ctx.fillStyle = '#05040c'; sd.ctx.fillRect(0, 0, sd.c.width, sd.c.height);
|
|
294
305
|
sd.c.className = 'shade s' + i;
|
|
@@ -22,7 +22,8 @@ export const onRouteMatch = () => {}
|
|
|
22
22
|
export const onAppServerSideSuccess = () => {}
|
|
23
23
|
export const onAppServerSideError = () => {}
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// onFetcherSuccess runs after the matched route's data has loaded. onFetcherError
|
|
26
|
+
// runs when loading that data or preparing the page (metadata, assets) fails; the
|
|
26
27
|
// page still renders, with the error's status_code (404 by default).
|
|
27
28
|
// Receive { req, res, store }, plus `error` on failure.
|
|
28
29
|
export const onFetcherSuccess = () => {}
|
|
@@ -49,8 +49,6 @@ function Home() {
|
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<div className={css.page} data-hydrated={hydratedIn !== null}>
|
|
52
|
-
<title>Your app is running | Catalyst</title>
|
|
53
|
-
|
|
54
52
|
<nav className={css.nav}>
|
|
55
53
|
<span className={css.brand}>Catalyst</span>
|
|
56
54
|
<span className={css.navLinks}>
|
|
@@ -125,4 +123,7 @@ function Home() {
|
|
|
125
123
|
)
|
|
126
124
|
}
|
|
127
125
|
|
|
126
|
+
// Tags returned here go into the page's <head>, on the server and after navigation.
|
|
127
|
+
Home.setMetaData = () => [<title key="title">Your app is running | Catalyst</title>]
|
|
128
|
+
|
|
128
129
|
export default Home
|