@wise/art 2.7.0-beta.1 → 2.7.0
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/dist/Illustration.css +0 -19
- package/dist/common.d.ts +0 -5
- package/dist/common.d.ts.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +158 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +155 -15
- package/dist/index.js.map +1 -1
- package/package.json +5 -11
- package/src/common.ts +0 -6
- package/src/illustrations/Illustration.css +0 -19
- package/src/index.ts +0 -5
- package/dist/CheckMark-365a1dc6.js +0 -39
- package/dist/CheckMark-365a1dc6.js.map +0 -1
- package/dist/CheckMark-5b996187.esm.js +0 -37
- package/dist/CheckMark-5b996187.esm.js.map +0 -1
- package/dist/Confetti-b6bfa95b.js +0 -36
- package/dist/Confetti-b6bfa95b.js.map +0 -1
- package/dist/Confetti-c865d663.esm.js +0 -34
- package/dist/Confetti-c865d663.esm.js.map +0 -1
- package/dist/Flower-1987844c.esm.js +0 -27
- package/dist/Flower-1987844c.esm.js.map +0 -1
- package/dist/Flower-385aa337.js +0 -29
- package/dist/Flower-385aa337.js.map +0 -1
- package/dist/Globe-b5acfedf.js +0 -45
- package/dist/Globe-b5acfedf.js.map +0 -1
- package/dist/Globe-df8b4bbd.esm.js +0 -43
- package/dist/Globe-df8b4bbd.esm.js.map +0 -1
- package/dist/Graph-bc618890.js +0 -33
- package/dist/Graph-bc618890.js.map +0 -1
- package/dist/Graph-e48b9d55.esm.js +0 -31
- package/dist/Graph-e48b9d55.esm.js.map +0 -1
- package/dist/Jars-b371f7ec.esm.js +0 -50
- package/dist/Jars-b371f7ec.esm.js.map +0 -1
- package/dist/Jars-b80056b7.js +0 -52
- package/dist/Jars-b80056b7.js.map +0 -1
- package/dist/Lock-0d8008b7.esm.js +0 -41
- package/dist/Lock-0d8008b7.esm.js.map +0 -1
- package/dist/Lock-841864c6.js +0 -43
- package/dist/Lock-841864c6.js.map +0 -1
- package/dist/MagnifyingGlass-7b6dda3b.esm.js +0 -30
- package/dist/MagnifyingGlass-7b6dda3b.esm.js.map +0 -1
- package/dist/MagnifyingGlass-de98441e.js +0 -32
- package/dist/MagnifyingGlass-de98441e.js.map +0 -1
- package/dist/Marble-5a115e95.esm.js +0 -42
- package/dist/Marble-5a115e95.esm.js.map +0 -1
- package/dist/Marble-c42785f3.js +0 -44
- package/dist/Marble-c42785f3.js.map +0 -1
- package/dist/MarbleCard-1792cf0c.esm.js +0 -45
- package/dist/MarbleCard-1792cf0c.esm.js.map +0 -1
- package/dist/MarbleCard-50b56966.js +0 -47
- package/dist/MarbleCard-50b56966.js.map +0 -1
- package/dist/MultiCurrency-4735dbb2.esm.js +0 -61
- package/dist/MultiCurrency-4735dbb2.esm.js.map +0 -1
- package/dist/MultiCurrency-fcf4b9a2.js +0 -63
- package/dist/MultiCurrency-fcf4b9a2.js.map +0 -1
- package/dist/Plane-1e15b49c.esm.js +0 -37
- package/dist/Plane-1e15b49c.esm.js.map +0 -1
- package/dist/Plane-91b11234.js +0 -39
- package/dist/Plane-91b11234.js.map +0 -1
- package/dist/Scene-3830de67.esm.js +0 -48
- package/dist/Scene-3830de67.esm.js.map +0 -1
- package/dist/Scene-fa187d3a.js +0 -50
- package/dist/Scene-fa187d3a.js.map +0 -1
- package/dist/illustrations3d/Illustration3d.d.ts +0 -11
- package/dist/illustrations3d/Illustration3d.d.ts.map +0 -1
- package/dist/illustrations3d/Scene.d.ts +0 -9
- package/dist/illustrations3d/Scene.d.ts.map +0 -1
- package/dist/illustrations3d/index.d.ts +0 -5
- package/dist/illustrations3d/index.d.ts.map +0 -1
- package/dist/illustrations3d/models/CheckMark.d.ts +0 -4
- package/dist/illustrations3d/models/CheckMark.d.ts.map +0 -1
- package/dist/illustrations3d/models/Confetti.d.ts +0 -4
- package/dist/illustrations3d/models/Confetti.d.ts.map +0 -1
- package/dist/illustrations3d/models/Flower.d.ts +0 -4
- package/dist/illustrations3d/models/Flower.d.ts.map +0 -1
- package/dist/illustrations3d/models/Globe.d.ts +0 -4
- package/dist/illustrations3d/models/Globe.d.ts.map +0 -1
- package/dist/illustrations3d/models/Graph.d.ts +0 -4
- package/dist/illustrations3d/models/Graph.d.ts.map +0 -1
- package/dist/illustrations3d/models/Jars.d.ts +0 -4
- package/dist/illustrations3d/models/Jars.d.ts.map +0 -1
- package/dist/illustrations3d/models/Lock.d.ts +0 -4
- package/dist/illustrations3d/models/Lock.d.ts.map +0 -1
- package/dist/illustrations3d/models/MagnifyingGlass.d.ts +0 -4
- package/dist/illustrations3d/models/MagnifyingGlass.d.ts.map +0 -1
- package/dist/illustrations3d/models/Marble.d.ts +0 -4
- package/dist/illustrations3d/models/Marble.d.ts.map +0 -1
- package/dist/illustrations3d/models/MarbleCard.d.ts +0 -4
- package/dist/illustrations3d/models/MarbleCard.d.ts.map +0 -1
- package/dist/illustrations3d/models/MultiCurrency.d.ts +0 -4
- package/dist/illustrations3d/models/MultiCurrency.d.ts.map +0 -1
- package/dist/illustrations3d/models/Plane.d.ts +0 -4
- package/dist/illustrations3d/models/Plane.d.ts.map +0 -1
- package/dist/illustrations3d/utils.d.ts +0 -9
- package/dist/illustrations3d/utils.d.ts.map +0 -1
- package/dist/index-36ff762e.js +0 -332
- package/dist/index-36ff762e.js.map +0 -1
- package/dist/index-76341731.esm.js +0 -325
- package/dist/index-76341731.esm.js.map +0 -1
- package/src/illustrations3d/Illustration3d.stories.tsx +0 -89
- package/src/illustrations3d/Illustration3d.tsx +0 -133
- package/src/illustrations3d/Scene.tsx +0 -54
- package/src/illustrations3d/index.ts +0 -6
- package/src/illustrations3d/models/CheckMark.tsx +0 -30
- package/src/illustrations3d/models/Confetti.tsx +0 -29
- package/src/illustrations3d/models/Flower.tsx +0 -24
- package/src/illustrations3d/models/Globe.tsx +0 -41
- package/src/illustrations3d/models/Graph.tsx +0 -26
- package/src/illustrations3d/models/Jars.tsx +0 -47
- package/src/illustrations3d/models/Lock.tsx +0 -38
- package/src/illustrations3d/models/MagnifyingGlass.tsx +0 -30
- package/src/illustrations3d/models/Marble.tsx +0 -47
- package/src/illustrations3d/models/MarbleCard.tsx +0 -50
- package/src/illustrations3d/models/MultiCurrency.tsx +0 -58
- package/src/illustrations3d/models/Plane.tsx +0 -33
- package/src/illustrations3d/utils.ts +0 -68
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { useGLTF, useAnimations } from '@react-three/drei';
|
|
2
|
-
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import { ObjectLoader, TextureLoader, Color } from 'three';
|
|
5
|
-
|
|
6
|
-
import { defineSrc } from '../utils';
|
|
7
|
-
|
|
8
|
-
const MultiCurrency = () => {
|
|
9
|
-
const ref = useRef();
|
|
10
|
-
const model = useGLTF(defineSrc(`multi-currency.gltf`));
|
|
11
|
-
|
|
12
|
-
const lights = useLoader(ObjectLoader, defineSrc('multi-currency-light.json'));
|
|
13
|
-
const wiseLogo = useLoader(TextureLoader, defineSrc('wise-flag-map-bump.jpg'));
|
|
14
|
-
|
|
15
|
-
const animatedMaps = [];
|
|
16
|
-
|
|
17
|
-
model.scene.traverse((child) => {
|
|
18
|
-
if (child.name.includes('Note')) {
|
|
19
|
-
child.castShadow = true;
|
|
20
|
-
child.receiveShadow = true;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (child.name.startsWith('Coin_') && child.isMesh) {
|
|
24
|
-
const { material } = child;
|
|
25
|
-
material.bumpMap = wiseLogo;
|
|
26
|
-
material.bumpMap.flipY = false;
|
|
27
|
-
material.bumpScale = 1;
|
|
28
|
-
material.color = new Color(0.49, 0.49, 0.49);
|
|
29
|
-
child.castShadow = false;
|
|
30
|
-
child.receiveShadow = false;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (child.name.startsWith('NoteBase_') && child.isMesh) {
|
|
34
|
-
animatedMaps.push(child.material.map);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (child.name.includes('Wise') && child.isMesh) {
|
|
38
|
-
animatedMaps.push(child.material.map);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const { mixer, clips } = useAnimations(model.animations, ref);
|
|
43
|
-
useFrame(() => {
|
|
44
|
-
animatedMaps.forEach((animatedMap) => {
|
|
45
|
-
animatedMap.offset.x += 0.001;
|
|
46
|
-
});
|
|
47
|
-
mixer.clipAction(clips[0]).play();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<>
|
|
52
|
-
<primitive ref={ref} position={[-0.5, -10, 0]} scale={1.3} object={model.scene} />
|
|
53
|
-
<primitive object={lights} />
|
|
54
|
-
</>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default MultiCurrency;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { useGLTF, useAnimations } from '@react-three/drei';
|
|
2
|
-
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import { ObjectLoader } from 'three';
|
|
5
|
-
|
|
6
|
-
import { defineSrc } from '../utils';
|
|
7
|
-
|
|
8
|
-
const Plane = () => {
|
|
9
|
-
const ref = useRef();
|
|
10
|
-
const model = useGLTF(defineSrc('plane.gltf'));
|
|
11
|
-
|
|
12
|
-
const lights = useLoader(ObjectLoader, defineSrc('plane-light.json'));
|
|
13
|
-
const plane = model.scene.getObjectByName('Plane_6_update');
|
|
14
|
-
|
|
15
|
-
const { mixer, clips } = useAnimations(model.animations, ref);
|
|
16
|
-
useFrame(() => {
|
|
17
|
-
model.materials['Tapestry WebGL'].map.offset.y += 0.018;
|
|
18
|
-
|
|
19
|
-
plane.position.x = 0.45;
|
|
20
|
-
|
|
21
|
-
plane.position.y = 7.5;
|
|
22
|
-
mixer.clipAction(clips[0]).play();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<>
|
|
27
|
-
<primitive ref={ref} scale={1.3} position={[0, -7, 0]} object={model.scene} />
|
|
28
|
-
<primitive object={lights} />
|
|
29
|
-
</>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default Plane;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { IllustrationNames } from '../illustrations/metadata';
|
|
4
|
-
|
|
5
|
-
export function useBattery() {
|
|
6
|
-
const [batteryData, setBatteryData] = useState<{ level: number }>({ level: 1.0 });
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const getBatteryData = async () => {
|
|
10
|
-
// @ts-expect-error .getBattery exists in Navigator interface
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
12
|
-
const battery = await navigator.getBattery();
|
|
13
|
-
|
|
14
|
-
setBatteryData({
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
16
|
-
level: battery?.level,
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
// Check if the browser supports the Battery API
|
|
20
|
-
if ('getBattery' in navigator) {
|
|
21
|
-
void getBatteryData();
|
|
22
|
-
}
|
|
23
|
-
}, []);
|
|
24
|
-
|
|
25
|
-
return batteryData;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function isBatteryLow(batteryLevel: number): boolean {
|
|
29
|
-
return batteryLevel < 0.2;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function isConnectionSlow(): boolean {
|
|
33
|
-
// @ts-expect-error .connection prop exists in Navigator interface
|
|
34
|
-
const { connection } = window.navigator;
|
|
35
|
-
if (connection === undefined) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
return (
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
40
|
-
['slow-2g', '2g'].includes(connection?.effectiveType as string) ||
|
|
41
|
-
// @ts-expect-error Property 'connection' does exist on type 'Navigator'
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
43
|
-
navigator?.connection?.saveData === true
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function defineSrc(asset: string): string {
|
|
48
|
-
return `https://wise.com/web-art/assets/illustrations3d/${asset}`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const illustration3dNames = [
|
|
52
|
-
'lock',
|
|
53
|
-
'globe',
|
|
54
|
-
'confetti',
|
|
55
|
-
'check-mark',
|
|
56
|
-
'flower',
|
|
57
|
-
'graph',
|
|
58
|
-
'jars',
|
|
59
|
-
'magnifying-glass',
|
|
60
|
-
'marble',
|
|
61
|
-
'marble-card',
|
|
62
|
-
'multi-currency',
|
|
63
|
-
'plane',
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
export function is3dIllustrationSupported(asset: IllustrationNames): boolean {
|
|
67
|
-
return illustration3dNames.includes(asset);
|
|
68
|
-
}
|