@wise/art 0.0.0-experimental-1d6d788
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 +155 -0
- package/dist/CheckMark-C7SPkQjr.esm.js +38 -0
- package/dist/CheckMark-C7SPkQjr.esm.js.map +1 -0
- package/dist/CheckMark-DbWrBNtH.js +40 -0
- package/dist/CheckMark-DbWrBNtH.js.map +1 -0
- package/dist/Confetti-BbPKLCpN.js +37 -0
- package/dist/Confetti-BbPKLCpN.js.map +1 -0
- package/dist/Confetti-DPMBG56o.esm.js +35 -0
- package/dist/Confetti-DPMBG56o.esm.js.map +1 -0
- package/dist/Flower-Dhjb1Y6Z.esm.js +28 -0
- package/dist/Flower-Dhjb1Y6Z.esm.js.map +1 -0
- package/dist/Flower-I053ey4H.js +30 -0
- package/dist/Flower-I053ey4H.js.map +1 -0
- package/dist/Globe-CJDK9wR6.esm.js +44 -0
- package/dist/Globe-CJDK9wR6.esm.js.map +1 -0
- package/dist/Globe-DD_Ybugr.js +46 -0
- package/dist/Globe-DD_Ybugr.js.map +1 -0
- package/dist/Graph-D1M4JGez.esm.js +32 -0
- package/dist/Graph-D1M4JGez.esm.js.map +1 -0
- package/dist/Graph-DrtwCTeB.js +34 -0
- package/dist/Graph-DrtwCTeB.js.map +1 -0
- package/dist/Illustration.css +1 -0
- package/dist/Interest-5AzhwfRZ.js +53 -0
- package/dist/Interest-5AzhwfRZ.js.map +1 -0
- package/dist/Interest-d9YRzYsQ.esm.js +51 -0
- package/dist/Interest-d9YRzYsQ.esm.js.map +1 -0
- package/dist/Jars-Bj5zryIy.esm.js +51 -0
- package/dist/Jars-Bj5zryIy.esm.js.map +1 -0
- package/dist/Jars-DTpuM002.js +53 -0
- package/dist/Jars-DTpuM002.js.map +1 -0
- package/dist/Lock-Ca-LEge7.js +44 -0
- package/dist/Lock-Ca-LEge7.js.map +1 -0
- package/dist/Lock-xy_KoW2g.esm.js +42 -0
- package/dist/Lock-xy_KoW2g.esm.js.map +1 -0
- package/dist/MagnifyingGlass-CR0nvKTo.esm.js +31 -0
- package/dist/MagnifyingGlass-CR0nvKTo.esm.js.map +1 -0
- package/dist/MagnifyingGlass-DFASWsdn.js +33 -0
- package/dist/MagnifyingGlass-DFASWsdn.js.map +1 -0
- package/dist/Marble-BZIHD9uw.js +45 -0
- package/dist/Marble-BZIHD9uw.js.map +1 -0
- package/dist/Marble-Dn1NhVNa.esm.js +43 -0
- package/dist/Marble-Dn1NhVNa.esm.js.map +1 -0
- package/dist/MarbleCard-CLq_nDBM.esm.js +46 -0
- package/dist/MarbleCard-CLq_nDBM.esm.js.map +1 -0
- package/dist/MarbleCard-CtjGjEPp.js +48 -0
- package/dist/MarbleCard-CtjGjEPp.js.map +1 -0
- package/dist/MultiCurrency-B5HtZfTG.esm.js +62 -0
- package/dist/MultiCurrency-B5HtZfTG.esm.js.map +1 -0
- package/dist/MultiCurrency-Bh-7t3nH.js +64 -0
- package/dist/MultiCurrency-Bh-7t3nH.js.map +1 -0
- package/dist/Plane-D-NW6i-O.js +40 -0
- package/dist/Plane-D-NW6i-O.js.map +1 -0
- package/dist/Plane-aYcLKAhf.esm.js +38 -0
- package/dist/Plane-aYcLKAhf.esm.js.map +1 -0
- package/dist/Scene-ClmxQ_BP.esm.js +54 -0
- package/dist/Scene-ClmxQ_BP.esm.js.map +1 -0
- package/dist/Scene-DNB5gL2m.js +56 -0
- package/dist/Scene-DNB5gL2m.js.map +1 -0
- package/dist/common-DBpCdW70.esm.js +14 -0
- package/dist/common-DBpCdW70.esm.js.map +1 -0
- package/dist/common-H4L6Hbbh.js +16 -0
- package/dist/common-H4L6Hbbh.js.map +1 -0
- package/dist/common.d.ts +15 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/flags/Flag.d.ts +14 -0
- package/dist/flags/Flag.d.ts.map +1 -0
- package/dist/flags/Flag.spec.d.ts +2 -0
- package/dist/flags/Flag.spec.d.ts.map +1 -0
- package/dist/flags/index.d.ts +3 -0
- package/dist/flags/index.d.ts.map +1 -0
- package/dist/flags/metadata.d.ts +2 -0
- package/dist/flags/metadata.d.ts.map +1 -0
- package/dist/illustrations/Illustration.d.ts +20 -0
- package/dist/illustrations/Illustration.d.ts.map +1 -0
- package/dist/illustrations/Illustration.spec.d.ts +2 -0
- package/dist/illustrations/Illustration.spec.d.ts.map +1 -0
- package/dist/illustrations/index.d.ts +5 -0
- package/dist/illustrations/index.d.ts.map +1 -0
- package/dist/illustrations/metadata.d.ts +113 -0
- package/dist/illustrations/metadata.d.ts.map +1 -0
- package/dist/illustrations3d/Illustration3D.d.ts +10 -0
- package/dist/illustrations3d/Illustration3D.d.ts.map +1 -0
- package/dist/illustrations3d/Scene.d.ts +10 -0
- package/dist/illustrations3d/Scene.d.ts.map +1 -0
- package/dist/illustrations3d/index.d.ts +5 -0
- package/dist/illustrations3d/index.d.ts.map +1 -0
- package/dist/illustrations3d/models/CheckMark.d.ts +3 -0
- package/dist/illustrations3d/models/CheckMark.d.ts.map +1 -0
- package/dist/illustrations3d/models/Confetti.d.ts +3 -0
- package/dist/illustrations3d/models/Confetti.d.ts.map +1 -0
- package/dist/illustrations3d/models/Flower.d.ts +3 -0
- package/dist/illustrations3d/models/Flower.d.ts.map +1 -0
- package/dist/illustrations3d/models/Globe.d.ts +3 -0
- package/dist/illustrations3d/models/Globe.d.ts.map +1 -0
- package/dist/illustrations3d/models/Graph.d.ts +3 -0
- package/dist/illustrations3d/models/Graph.d.ts.map +1 -0
- package/dist/illustrations3d/models/Interest.d.ts +3 -0
- package/dist/illustrations3d/models/Interest.d.ts.map +1 -0
- package/dist/illustrations3d/models/Jars.d.ts +3 -0
- package/dist/illustrations3d/models/Jars.d.ts.map +1 -0
- package/dist/illustrations3d/models/Lock.d.ts +3 -0
- package/dist/illustrations3d/models/Lock.d.ts.map +1 -0
- package/dist/illustrations3d/models/MagnifyingGlass.d.ts +3 -0
- package/dist/illustrations3d/models/MagnifyingGlass.d.ts.map +1 -0
- package/dist/illustrations3d/models/Marble.d.ts +3 -0
- package/dist/illustrations3d/models/Marble.d.ts.map +1 -0
- package/dist/illustrations3d/models/MarbleCard.d.ts +3 -0
- package/dist/illustrations3d/models/MarbleCard.d.ts.map +1 -0
- package/dist/illustrations3d/models/MultiCurrency.d.ts +3 -0
- package/dist/illustrations3d/models/MultiCurrency.d.ts.map +1 -0
- package/dist/illustrations3d/models/Plane.d.ts +3 -0
- package/dist/illustrations3d/models/Plane.d.ts.map +1 -0
- package/dist/illustrations3d/utils.d.ts +9 -0
- package/dist/illustrations3d/utils.d.ts.map +1 -0
- package/dist/illustrations3d/utils.spec.d.ts +2 -0
- package/dist/illustrations3d/utils.spec.d.ts.map +1 -0
- package/dist/index-ApMK-TMV.esm.js +377 -0
- package/dist/index-ApMK-TMV.esm.js.map +1 -0
- package/dist/index-CeTVmx_6.js +383 -0
- package/dist/index-CeTVmx_6.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +6 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/rive/RiveIllustration.d.ts +13 -0
- package/dist/rive/RiveIllustration.d.ts.map +1 -0
- package/dist/rive/index.d.ts +3 -0
- package/dist/rive/index.d.ts.map +1 -0
- package/dist/rive/index.esm.js +47 -0
- package/dist/rive/index.esm.js.map +1 -0
- package/dist/rive/index.js +53 -0
- package/dist/rive/index.js.map +1 -0
- package/package.json +125 -0
- package/src/common.ts +17 -0
- package/src/flags/AllFlagsAndSizes.stories.tsx +131 -0
- package/src/flags/Flag.css +4 -0
- package/src/flags/Flag.spec.tsx +31 -0
- package/src/flags/Flag.stories.tsx +20 -0
- package/src/flags/Flag.tsx +65 -0
- package/src/flags/index.ts +2 -0
- package/src/flags/metadata.ts +9 -0
- package/src/illustrations/Illustration.css +27 -0
- package/src/illustrations/Illustration.spec.tsx +20 -0
- package/src/illustrations/Illustration.stories.tsx +58 -0
- package/src/illustrations/Illustration.tsx +95 -0
- package/src/illustrations/index.ts +5 -0
- package/src/illustrations/metadata.ts +13 -0
- package/src/illustrations3d/Illustration3D.stories.tsx +101 -0
- package/src/illustrations3d/Illustration3D.tsx +139 -0
- package/src/illustrations3d/Scene.tsx +62 -0
- package/src/illustrations3d/index.ts +6 -0
- package/src/illustrations3d/models/CheckMark.tsx +30 -0
- package/src/illustrations3d/models/Confetti.tsx +29 -0
- package/src/illustrations3d/models/Flower.tsx +24 -0
- package/src/illustrations3d/models/Globe.tsx +41 -0
- package/src/illustrations3d/models/Graph.tsx +26 -0
- package/src/illustrations3d/models/Interest.tsx +42 -0
- package/src/illustrations3d/models/Jars.tsx +47 -0
- package/src/illustrations3d/models/Lock.tsx +38 -0
- package/src/illustrations3d/models/MagnifyingGlass.tsx +30 -0
- package/src/illustrations3d/models/Marble.tsx +47 -0
- package/src/illustrations3d/models/MarbleCard.tsx +50 -0
- package/src/illustrations3d/models/MultiCurrency.tsx +58 -0
- package/src/illustrations3d/models/Plane.tsx +33 -0
- package/src/illustrations3d/utils.spec.tsx +36 -0
- package/src/illustrations3d/utils.ts +73 -0
- package/src/index.css +3 -0
- package/src/index.ts +12 -0
- package/src/rive/RiveIllustration.css +18 -0
- package/src/rive/RiveIllustration.stories.tsx +20 -0
- package/src/rive/RiveIllustration.tsx +54 -0
- package/src/rive/index.ts +2 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* DON'T MODIFY THIS FILE IT'S AUTO GENERATED
|
|
4
|
+
* See: `scripts/generate-i10s-metadata.mjs`
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export enum Assets {
|
|
10
|
+
WALLET = 'wallet',TWO_INVITE_LETTERS_OPENED = 'two-invite-letters-opened',TOOL = 'tool',TARGET_PLATFORM = 'target-platform',STOPWATCH_PLATFORM = 'stopwatch-platform',SPEECH_BUBBLE = 'speech-bubble',SKIP_AUTHENTICATION = 'skip-authentication',SHOPPING_BAG = 'shopping-bag',SATELLITE_PLATFORM = 'satellite-platform',SAND_TIMER_BUSINESS = 'sand-timer-business',SAND_TIMER = 'sand-timer',REMINDER_LETTER = 'reminder-letter',RECEIVE_BUSINESS = 'receive-business',RECEIVE = 'receive',QUESTION_MARK_BUSINESS = 'question-mark-business',QUESTION_MARK = 'question-mark',PUZZLE_PIECES_BUSINESS = 'puzzle-pieces-business',PUZZLE_PIECES = 'puzzle-pieces',PLANE_BUSINESS = 'plane-business',PLANE_2 = 'plane-2',PLANE = 'plane',PIE_CHART_BUSINESS = 'pie-chart-business',PIE_CHART = 'pie-chart',PHONES = 'phones',PERSONAL_CARD = 'personal-card',PERCENTAGE_BUSINESS = 'percentage-business',PERCENTAGE = 'percentage',PALM_TREE = 'palm-tree',ONE_INVITE_LETTER_OPENED = 'one-invite-letter-opened',MULTI_CURRENCY_BUSINESS = 'multi-currency-business',MULTI_CURRENCY = 'multi-currency',MEGAPHONE = 'megaphone',MARBLE_CARD_FLAG_ONLY_BUSINESS = 'marble-card-flag-only-business',MARBLE_CARD_FLAG_ONLY = 'marble-card-flag-only',MARBLE_CARD_BUSINESS_FLAG_ONLY = 'marble-card-business-flag-only',MARBLE_CARD_BUSINESS = 'marble-card-business',MARBLE_CARD = 'marble-card',MARBLE_BUSINESS = 'marble-business',MARBLE = 'marble',MAP = 'map',MAGNIFYING_GLASS_BUSINESS = 'magnifying-glass-business',MAGNIFYING_GLASS = 'magnifying-glass',LOCK_PLATFORM = 'lock-platform',LOCK_BUSINESS = 'lock-business',LOCK = 'lock',LIGHT_BULB_BUSINESS = 'light-bulb-business',LIGHT_BULB = 'light-bulb',KEY_BUSINESS = 'key-business',KEY = 'key',JARS = 'jars',INVITE_LETTER = 'invite-letter',INTEREST = 'interest',INFINITE = 'infinite',ID_CARD = 'id-card',HOUSE = 'house',HEART_5 = 'heart-5',HEART_4 = 'heart-4',HEART_3 = 'heart-3',HEART_2 = 'heart-2',HEART = 'heart',HEADSET_BUSINESS = 'headset-business',HEADSET = 'headset',GRAPH_BUSINESS = 'graph-business',GRAPH = 'graph',GLOBE = 'globe',GET_PAID_WITH_CARD_BUSINESS = 'get-paid-with-card-business',GEAR_BUSINESS = 'gear-business',GEAR = 'gear',FLOWER = 'flower',FLAG = 'flag',EXCLAMATION_MARK_BUSINESS = 'exclamation-mark-business',EXCLAMATION_MARK = 'exclamation-mark',EMAIL_SUCCESS_BUSINESS = 'email-success-business',EMAIL_SUCCESS = 'email-success',EMAIL = 'email',ELECTRIC_PLUG = 'electric-plug',ECO_CARD = 'eco-card',DOOR = 'door',DOCUMENTS_FOLDER_BUSINESS = 'documents-folder-business',DOCUMENTS = 'documents',DIGITAL_CARD_BUSINESS = 'digital-card-business',DIGITAL_CARD_2 = 'digital-card-2',DIGITAL_CARD = 'digital-card',COOKIE = 'cookie',CONVERT_BUSINESS = 'convert-business',CONVERT = 'convert',CONSTRUCTION_FENCE = 'construction-fence',CONFETTI_BUSINESS = 'confetti-business',CONFETTI = 'confetti',COIN_PILE_UP_BUSINESS = 'coin-pile-up-business',COIN_PILE_UP = 'coin-pile-up',COIN_PILE_DOWN_BUSINESS = 'coin-pile-down-business',COIN_PILE_DOWN = 'coin-pile-down',CLOSED_WINDOW = 'closed-window',CHECK_MARK_BUSINESS = 'check-mark-business',CHECK_MARK = 'check-mark',CALENDAR_BUSINESS = 'calendar-business',CALENDAR = 'calendar',CALCULATOR_BUSINESS = 'calculator-business',BUSINESS_CARD_BUSINESS = 'business-card-business',BUSINESS_CARD = 'business-card',BRIEFCASE_BUSINESS = 'briefcase-business',BRIEFCASE = 'briefcase',BELL_BUSINESS = 'bell-business',BELL = 'bell',BATCH_PAYMENTS_BUSINESS = 'batch-payments-business',BACKPACK = 'backpack',APP_MARKETPLACE_BUSINESS = 'app-marketplace-business',API_INTEGRATIONS_BUSINESS = 'api-integrations-business'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type IllustrationNames = 'wallet' | 'two-invite-letters-opened' | 'tool' | 'target-platform' | 'stopwatch-platform' | 'speech-bubble' | 'skip-authentication' | 'shopping-bag' | 'satellite-platform' | 'sand-timer-business' | 'sand-timer' | 'reminder-letter' | 'receive-business' | 'receive' | 'question-mark-business' | 'question-mark' | 'puzzle-pieces-business' | 'puzzle-pieces' | 'plane-business' | 'plane-2' | 'plane' | 'pie-chart-business' | 'pie-chart' | 'phones' | 'personal-card' | 'percentage-business' | 'percentage' | 'palm-tree' | 'one-invite-letter-opened' | 'multi-currency-business' | 'multi-currency' | 'megaphone' | 'marble-card-flag-only-business' | 'marble-card-flag-only' | 'marble-card-business-flag-only' | 'marble-card-business' | 'marble-card' | 'marble-business' | 'marble' | 'map' | 'magnifying-glass-business' | 'magnifying-glass' | 'lock-platform' | 'lock-business' | 'lock' | 'light-bulb-business' | 'light-bulb' | 'key-business' | 'key' | 'jars' | 'invite-letter' | 'interest' | 'infinite' | 'id-card' | 'house' | 'heart-5' | 'heart-4' | 'heart-3' | 'heart-2' | 'heart' | 'headset-business' | 'headset' | 'graph-business' | 'graph' | 'globe' | 'get-paid-with-card-business' | 'gear-business' | 'gear' | 'flower' | 'flag' | 'exclamation-mark-business' | 'exclamation-mark' | 'email-success-business' | 'email-success' | 'email' | 'electric-plug' | 'eco-card' | 'door' | 'documents-folder-business' | 'documents' | 'digital-card-business' | 'digital-card-2' | 'digital-card' | 'cookie' | 'convert-business' | 'convert' | 'construction-fence' | 'confetti-business' | 'confetti' | 'coin-pile-up-business' | 'coin-pile-up' | 'coin-pile-down-business' | 'coin-pile-down' | 'closed-window' | 'check-mark-business' | 'check-mark' | 'calendar-business' | 'calendar' | 'calculator-business' | 'business-card-business' | 'business-card' | 'briefcase-business' | 'briefcase' | 'bell-business' | 'bell' | 'batch-payments-business' | 'backpack' | 'app-marketplace-business' | 'api-integrations-business'
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Sizes } from '../common';
|
|
5
|
+
import { Assets } from '../illustrations/metadata';
|
|
6
|
+
|
|
7
|
+
import Illustration3D from './Illustration3D';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: '3D Illustrations',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Confetti = () => {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<Illustration3D name={Assets.CONFETTI} size={Sizes.LARGE} />
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const Globe = () => {
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<Illustration3D name={Assets.GLOBE} size={Sizes.LARGE} />
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Lock = () => {
|
|
30
|
+
return <Illustration3D name={Assets.LOCK} size={Sizes.LARGE} />;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const CheckMark = () => {
|
|
34
|
+
return <Illustration3D name={Assets.CHECK_MARK} size={Sizes.LARGE} />;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const Flower = () => {
|
|
38
|
+
return <Illustration3D name={Assets.FLOWER} size={Sizes.LARGE} />;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Plane = () => {
|
|
42
|
+
return <Illustration3D name={Assets.PLANE} size={Sizes.LARGE} />;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Graph = () => {
|
|
46
|
+
return <Illustration3D name={Assets.GRAPH} size={Sizes.LARGE} />;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Marble = () => {
|
|
50
|
+
return <Illustration3D name={Assets.MARBLE} size={Sizes.LARGE} />;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const MarbleCard = () => {
|
|
54
|
+
return <Illustration3D name={Assets.MARBLE_CARD} size={Sizes.LARGE} />;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const MagnifyingGlass = () => {
|
|
58
|
+
return <Illustration3D name={Assets.MAGNIFYING_GLASS} size={Sizes.LARGE} />;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const Jars = () => {
|
|
62
|
+
return <Illustration3D name={Assets.JARS} size={Sizes.LARGE} />;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const MultiCurrency = () => {
|
|
66
|
+
return <Illustration3D name={Assets.MULTI_CURRENCY} size={Sizes.LARGE} />;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const Interest = () => {
|
|
70
|
+
return <Illustration3D name={Assets.INTEREST} />;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
interface NetworkInformation extends EventTarget {
|
|
74
|
+
effectiveType: 'slow-2g' | '2g' | '3g' | '4g';
|
|
75
|
+
}
|
|
76
|
+
export const Fallback = () => {
|
|
77
|
+
// @ts-expect-error navigator has connection property
|
|
78
|
+
const originalConnection = window.navigator.connection as NetworkInformation;
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
const setConnection = (value?: NetworkInformation['effectiveType']) => {
|
|
82
|
+
Object.defineProperty(window.navigator, 'connection', {
|
|
83
|
+
value: value ? { effectiveType: value } : originalConnection,
|
|
84
|
+
configurable: true,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
setConnection('slow-2g');
|
|
89
|
+
|
|
90
|
+
return () => {
|
|
91
|
+
setConnection();
|
|
92
|
+
};
|
|
93
|
+
}, [originalConnection]);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<>
|
|
97
|
+
<Illustration3D name={Assets.LOCK} />
|
|
98
|
+
<p>Mock slow internet connection so it fallback to static illustration</p>
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/* eslint-disable fp/no-mutation */
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { lazy, Suspense, useEffect, useState, LazyExoticComponent } from 'react';
|
|
4
|
+
|
|
5
|
+
import { LargeSize, MediumSize, SmallSize, Sizes } from '../common';
|
|
6
|
+
import Illustration, { Assets } from '../illustrations';
|
|
7
|
+
|
|
8
|
+
import { useBattery, isConnectionSlow, isBatteryLow } from './utils';
|
|
9
|
+
|
|
10
|
+
export type Illustration3DNames =
|
|
11
|
+
| 'lock'
|
|
12
|
+
| 'globe'
|
|
13
|
+
| 'confetti'
|
|
14
|
+
| 'check-mark'
|
|
15
|
+
| 'flower'
|
|
16
|
+
| 'graph'
|
|
17
|
+
| 'jars'
|
|
18
|
+
| 'magnifying-glass'
|
|
19
|
+
| 'marble'
|
|
20
|
+
| 'marble-card'
|
|
21
|
+
| 'multi-currency'
|
|
22
|
+
| 'plane'
|
|
23
|
+
| 'interest';
|
|
24
|
+
|
|
25
|
+
export type Props = {
|
|
26
|
+
name: Illustration3DNames;
|
|
27
|
+
size?: SmallSize | MediumSize | LargeSize;
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
enum RenderMode {
|
|
32
|
+
INIT,
|
|
33
|
+
FALLBACK,
|
|
34
|
+
ASSET_3D,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const Illustration3D = ({ name, size = Sizes.MEDIUM, className }: Props) => {
|
|
38
|
+
const [renderMode, setRenderMode] = useState<RenderMode>(RenderMode.INIT);
|
|
39
|
+
const [inintrinsicSize, setInintrinsicSize] = useState<Props['size']>(size);
|
|
40
|
+
const batteryData = useBattery();
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setRenderMode(
|
|
44
|
+
isConnectionSlow() || isBatteryLow(batteryData.level)
|
|
45
|
+
? RenderMode.FALLBACK
|
|
46
|
+
: RenderMode.ASSET_3D,
|
|
47
|
+
);
|
|
48
|
+
const isMobile: boolean =
|
|
49
|
+
(typeof window !== undefined && window?.matchMedia('(max-width: 575px)')?.matches) ?? false;
|
|
50
|
+
if (isMobile) {
|
|
51
|
+
setInintrinsicSize(Sizes.SMALL);
|
|
52
|
+
}
|
|
53
|
+
}, [batteryData]);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div
|
|
57
|
+
className={clsx(
|
|
58
|
+
'wds-illustration-3d',
|
|
59
|
+
`wds-illustration-3d-${name}`,
|
|
60
|
+
`wds-illustration-3d-${inintrinsicSize as string}`,
|
|
61
|
+
className,
|
|
62
|
+
)}
|
|
63
|
+
aria-hidden
|
|
64
|
+
>
|
|
65
|
+
{renderMode === RenderMode.INIT ? null : renderMode === RenderMode.ASSET_3D ? (
|
|
66
|
+
<Suspense fallback={null}>{getModel({ name, size: inintrinsicSize })}</Suspense>
|
|
67
|
+
) : (
|
|
68
|
+
<Illustration name={name} size={size} alt="" />
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
function getModel({ name, size }: Props) {
|
|
75
|
+
// @ts-expect-error unknown generic
|
|
76
|
+
let Model: LazyExoticComponent = <></>;
|
|
77
|
+
const Scene = lazy(async () => import('./Scene'));
|
|
78
|
+
switch (name) {
|
|
79
|
+
case Assets.LOCK: {
|
|
80
|
+
Model = lazy(async () => import('./models/Lock'));
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case Assets.GLOBE: {
|
|
84
|
+
Model = lazy(async () => import('./models/Globe'));
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
case Assets.CONFETTI: {
|
|
88
|
+
Model = lazy(async () => import('./models/Confetti'));
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case Assets.CHECK_MARK: {
|
|
92
|
+
Model = lazy(async () => import('./models/CheckMark'));
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case Assets.FLOWER: {
|
|
96
|
+
Model = lazy(async () => import('./models/Flower'));
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case Assets.PLANE: {
|
|
100
|
+
Model = lazy(async () => import('./models/Plane'));
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case Assets.GRAPH: {
|
|
104
|
+
Model = lazy(async () => import('./models/Graph'));
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case Assets.MARBLE: {
|
|
108
|
+
Model = lazy(async () => import('./models/Marble'));
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case Assets.MARBLE_CARD: {
|
|
112
|
+
Model = lazy(async () => import('./models/MarbleCard'));
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
case Assets.MAGNIFYING_GLASS: {
|
|
116
|
+
Model = lazy(async () => import('./models/MagnifyingGlass'));
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
case Assets.JARS: {
|
|
120
|
+
Model = lazy(async () => import('./models/Jars'));
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
case Assets.MULTI_CURRENCY: {
|
|
124
|
+
Model = lazy(async () => import('./models/MultiCurrency'));
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
case Assets.INTEREST: {
|
|
128
|
+
Model = lazy(async () => import('./models/Interest'));
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return (
|
|
133
|
+
<Scene assetName={name} size={size}>
|
|
134
|
+
<Model />
|
|
135
|
+
</Scene>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export default Illustration3D;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PerspectiveCamera } from '@react-three/drei';
|
|
2
|
+
import { Canvas } from '@react-three/fiber';
|
|
3
|
+
import type { PropsWithChildren } from 'react';
|
|
4
|
+
import { ACESFilmicToneMapping, LinearSRGBColorSpace, LinearToneMapping, PCFShadowMap, SRGBColorSpace } from 'three';
|
|
5
|
+
|
|
6
|
+
import { ImageSizes, LargeSize, MediumSize, Sizes, SmallSize } from '../common';
|
|
7
|
+
import { Assets } from '../illustrations/metadata';
|
|
8
|
+
|
|
9
|
+
import type { Illustration3DNames } from './Illustration3D';
|
|
10
|
+
|
|
11
|
+
export type Props = PropsWithChildren<{
|
|
12
|
+
assetName: Illustration3DNames;
|
|
13
|
+
size?: SmallSize | MediumSize | LargeSize;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
const Scene = ({ children, assetName, size = Sizes.MEDIUM }: Props) => {
|
|
17
|
+
const castShadows: boolean = [
|
|
18
|
+
Assets.LOCK as string,
|
|
19
|
+
Assets.MULTI_CURRENCY as string,
|
|
20
|
+
Assets.MAGNIFYING_GLASS as string,
|
|
21
|
+
Assets.INTEREST as string,
|
|
22
|
+
].includes(assetName);
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated this is a temporary variable until we migrate all models to v2 (DS-6879)
|
|
25
|
+
*/
|
|
26
|
+
const isV2 = [Assets.INTEREST as string].includes(assetName);
|
|
27
|
+
return (
|
|
28
|
+
<Canvas
|
|
29
|
+
onCreated={({ gl }) => {
|
|
30
|
+
gl.setClearColor(0x000000, 0);
|
|
31
|
+
gl.setSize(ImageSizes[size], ImageSizes[size]);
|
|
32
|
+
gl.clearDepth();
|
|
33
|
+
// eslint-disable-next-line functional/immutable-data, no-param-reassign
|
|
34
|
+
gl.useLegacyLights = !isV2;
|
|
35
|
+
}}
|
|
36
|
+
gl={{
|
|
37
|
+
alpha: true,
|
|
38
|
+
antialias: !isV2,
|
|
39
|
+
pixelRatio: window.devicePixelRatio * 1,
|
|
40
|
+
toneMapping: isV2 ? ACESFilmicToneMapping : LinearToneMapping,
|
|
41
|
+
outputColorSpace: isV2 ? LinearSRGBColorSpace : SRGBColorSpace,
|
|
42
|
+
toneMappingExposure: 1.1,
|
|
43
|
+
}}
|
|
44
|
+
shadows={{
|
|
45
|
+
type: PCFShadowMap,
|
|
46
|
+
enabled: castShadows,
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<PerspectiveCamera
|
|
50
|
+
makeDefault
|
|
51
|
+
far={1000000000000}
|
|
52
|
+
near={0.1}
|
|
53
|
+
fov={10.29}
|
|
54
|
+
aspect={window.innerWidth / window.innerHeight}
|
|
55
|
+
position={[0, 0, 100]}
|
|
56
|
+
/>
|
|
57
|
+
{children}
|
|
58
|
+
</Canvas>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default Scene;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useGLTF, useAnimations } from '@react-three/drei';
|
|
2
|
+
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { ObjectLoader, LoopOnce } from 'three';
|
|
5
|
+
|
|
6
|
+
import { defineSrc } from '../utils';
|
|
7
|
+
|
|
8
|
+
const CheckMark = () => {
|
|
9
|
+
const modelRef = useRef();
|
|
10
|
+
const model = useGLTF(defineSrc('check-mark.glb'));
|
|
11
|
+
const { animations, scene } = model;
|
|
12
|
+
|
|
13
|
+
const lights = useLoader(ObjectLoader, defineSrc('check-mark-light.json'));
|
|
14
|
+
|
|
15
|
+
const { mixer, clips } = useAnimations(animations, modelRef);
|
|
16
|
+
useFrame(() => {
|
|
17
|
+
model.materials['Standard'].map.offset.x += -0.0025;
|
|
18
|
+
|
|
19
|
+
mixer.clipAction(clips[0]).play().setLoop(LoopOnce, 1);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<primitive ref={modelRef} scale={1.4} object={scene} />
|
|
25
|
+
<primitive object={lights} />
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default CheckMark;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useGLTF, useAnimations } from '@react-three/drei';
|
|
2
|
+
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { ObjectLoader, LoopOnce } from 'three';
|
|
5
|
+
|
|
6
|
+
import { defineSrc } from '../utils';
|
|
7
|
+
|
|
8
|
+
const Confetti = () => {
|
|
9
|
+
const ref = useRef();
|
|
10
|
+
const model = useGLTF(defineSrc('confetti.glb'));
|
|
11
|
+
|
|
12
|
+
const lights = useLoader(ObjectLoader, defineSrc('confetti-light.json'));
|
|
13
|
+
|
|
14
|
+
const { mixer, clips } = useAnimations(model.animations, ref);
|
|
15
|
+
useFrame(() => {
|
|
16
|
+
model.materials['Tapestry WebGL'].map.offset.x += -0.0015;
|
|
17
|
+
|
|
18
|
+
mixer.clipAction(clips[0]).play().setLoop(LoopOnce, 1);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<primitive ref={ref} scale={1.5} position={[0, 1.5, 0]} object={model.scene} />
|
|
24
|
+
<primitive object={lights} />
|
|
25
|
+
</>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default Confetti;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useGLTF } from '@react-three/drei';
|
|
2
|
+
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
+
import { ObjectLoader } from 'three';
|
|
4
|
+
|
|
5
|
+
import { defineSrc } from '../utils';
|
|
6
|
+
|
|
7
|
+
const Flower = () => {
|
|
8
|
+
const model = useGLTF(defineSrc('flower.glb'));
|
|
9
|
+
|
|
10
|
+
const lights = useLoader(ObjectLoader, defineSrc('flower-light.json'));
|
|
11
|
+
|
|
12
|
+
useFrame(() => {
|
|
13
|
+
model.materials['Tapestry WebGL'].map.offset.x += -0.001;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<primitive scale={1.3} position={[0, -9, 0]} object={model.scene} />
|
|
19
|
+
<primitive object={lights} />
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default Flower;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useGLTF } from '@react-three/drei';
|
|
2
|
+
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
+
import { TextureLoader, ObjectLoader } from 'three';
|
|
4
|
+
|
|
5
|
+
import { defineSrc } from '../utils';
|
|
6
|
+
|
|
7
|
+
const Globe = () => {
|
|
8
|
+
const { scene } = useGLTF(defineSrc('globe.glb'));
|
|
9
|
+
|
|
10
|
+
const lights = useLoader(ObjectLoader, defineSrc('globe-light.json'));
|
|
11
|
+
const wiseLogo = useLoader(TextureLoader, defineSrc('wise-flag-map-bump.jpg'));
|
|
12
|
+
const planet = scene.getObjectByName('Globe');
|
|
13
|
+
const orbit = scene.getObjectByName('Coins_Axis_Rotation_Animate');
|
|
14
|
+
|
|
15
|
+
scene.traverse((child) => {
|
|
16
|
+
if (child.name.startsWith('Coin_')) {
|
|
17
|
+
const mesh = child;
|
|
18
|
+
|
|
19
|
+
const material = mesh.material;
|
|
20
|
+
material.bumpMap = wiseLogo;
|
|
21
|
+
material.bumpMap.flipY = false;
|
|
22
|
+
mesh.castShadow = false;
|
|
23
|
+
mesh.receiveShadow = false;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
useFrame(() => {
|
|
28
|
+
orbit.rotation.y += 0.002;
|
|
29
|
+
|
|
30
|
+
planet.material.map.offset.x += -0.0002;
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<primitive position={[0, -10, 0]} scale={1.3} object={scene} />
|
|
36
|
+
<primitive object={lights} />
|
|
37
|
+
</>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default Globe;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useGLTF } from '@react-three/drei';
|
|
2
|
+
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
+
import { ObjectLoader } from 'three';
|
|
4
|
+
|
|
5
|
+
import { defineSrc } from '../utils';
|
|
6
|
+
|
|
7
|
+
const Graph = () => {
|
|
8
|
+
const model = useGLTF(defineSrc('graph.glb'));
|
|
9
|
+
|
|
10
|
+
const lights = useLoader(ObjectLoader, defineSrc('graph-light.json'));
|
|
11
|
+
|
|
12
|
+
useFrame(() => {
|
|
13
|
+
const { offset } = model.materials['Standard '].map;
|
|
14
|
+
offset.x += -0.0015;
|
|
15
|
+
offset.y += 0.0015;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<primitive scale={1.3} position={[0, -10, 0]} object={model.scene} />
|
|
21
|
+
<primitive object={lights} />
|
|
22
|
+
</>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default Graph;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useAnimations,useGLTF } from '@react-three/drei';
|
|
2
|
+
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { LoopRepeat, MeshStandardMaterial, ObjectLoader, TextureLoader, Vector2 } from 'three';
|
|
5
|
+
|
|
6
|
+
import { defineSrc } from '../utils';
|
|
7
|
+
|
|
8
|
+
const Interest = () => {
|
|
9
|
+
const ref = useRef();
|
|
10
|
+
const { scene, animations } = useGLTF(defineSrc('interest.glb'));
|
|
11
|
+
|
|
12
|
+
const lights = useLoader(ObjectLoader, defineSrc('interest-light.json'));
|
|
13
|
+
const wiseLogo = useLoader(TextureLoader, defineSrc('file-interest-2.webp'));
|
|
14
|
+
|
|
15
|
+
scene.traverse((child) => {
|
|
16
|
+
if (child.name.startsWith('coin') && child.isMesh) {
|
|
17
|
+
child.material.map.flipY = true;
|
|
18
|
+
child.material.map.repeat.set(0.25, 0.25);
|
|
19
|
+
child.material.map.offset.set(0.85, -0.03);
|
|
20
|
+
child.material.map.needsUpdate = true;
|
|
21
|
+
child.material = new MeshStandardMaterial({
|
|
22
|
+
map: child.material.map,
|
|
23
|
+
normalMap: wiseLogo,
|
|
24
|
+
normalScale: new Vector2(1.3, 1.3)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const { mixer, clips } = useAnimations(animations, ref);
|
|
30
|
+
useFrame(() => {
|
|
31
|
+
mixer.clipAction(clips[0]).play().setLoop(LoopRepeat, Infinity);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<primitive ref={ref} position={[0, -1, 0]} scale={1.45} object={scene} />
|
|
37
|
+
<primitive object={lights} />
|
|
38
|
+
</>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default Interest;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useGLTF, useAnimations } from '@react-three/drei';
|
|
2
|
+
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { TextureLoader, ObjectLoader } from 'three';
|
|
5
|
+
|
|
6
|
+
import { defineSrc } from '../utils';
|
|
7
|
+
|
|
8
|
+
const Jars = () => {
|
|
9
|
+
const ref = useRef();
|
|
10
|
+
const model = useGLTF(defineSrc('jars.glb'));
|
|
11
|
+
const lights = useLoader(ObjectLoader, defineSrc('jars-light.json'));
|
|
12
|
+
const wiseLogo = useLoader(TextureLoader, defineSrc('wise-flag-map-bump.jpg'));
|
|
13
|
+
const jars = [];
|
|
14
|
+
|
|
15
|
+
model.scene.traverse((child) => {
|
|
16
|
+
if (child.name.startsWith('Coin_')) {
|
|
17
|
+
child.material.bumpMap = wiseLogo;
|
|
18
|
+
|
|
19
|
+
child.material.bumpMap.flipY = false;
|
|
20
|
+
child.castShadow = false;
|
|
21
|
+
child.receiveShadow = false;
|
|
22
|
+
}
|
|
23
|
+
if (child.name.startsWith('Jar_')) {
|
|
24
|
+
jars.push(child);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const { mixer, clips } = useAnimations(model.animations, ref);
|
|
29
|
+
|
|
30
|
+
useFrame(() => {
|
|
31
|
+
mixer.clipAction(clips[0]).play();
|
|
32
|
+
|
|
33
|
+
jars.forEach((jar) => {
|
|
34
|
+
jar.material.map.offset.x += 0.001;
|
|
35
|
+
jar.material.map.offset.y += 0.0;
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<primitive ref={ref} scale={1.3} position={[0, -10, 0]} object={model.scene} />
|
|
42
|
+
<primitive object={lights} />
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default Jars;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useGLTF, useAnimations } from '@react-three/drei';
|
|
2
|
+
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
import { LoopOnce, ObjectLoader } from 'three';
|
|
5
|
+
|
|
6
|
+
import { defineSrc } from '../utils';
|
|
7
|
+
|
|
8
|
+
const Lock = () => {
|
|
9
|
+
const ref = useRef();
|
|
10
|
+
const model = useGLTF(defineSrc('lock.glb'));
|
|
11
|
+
|
|
12
|
+
const lights = useLoader(ObjectLoader, defineSrc('lock-light.json'));
|
|
13
|
+
|
|
14
|
+
model.scene.traverse((node) => {
|
|
15
|
+
if (node.isMesh) {
|
|
16
|
+
node.castShadow = true;
|
|
17
|
+
node.receiveShadow = true;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const { clips, mixer } = useAnimations(model.animations, ref);
|
|
22
|
+
let frame = 0;
|
|
23
|
+
useFrame(() => {
|
|
24
|
+
mixer.clipAction(clips[0]).play().setLoop(LoopOnce, 1);
|
|
25
|
+
model.scene.position.y = Math.sin(frame++ * 0.04) * 0.2;
|
|
26
|
+
|
|
27
|
+
model.materials.Standard.map.offset.x += -0.001;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<primitive ref={ref} scale={1.4} object={model.scene} />
|
|
33
|
+
<primitive object={lights} />
|
|
34
|
+
</>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default Lock;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useGLTF } from '@react-three/drei';
|
|
2
|
+
import { useFrame, useLoader } from '@react-three/fiber';
|
|
3
|
+
import { ObjectLoader } from 'three';
|
|
4
|
+
|
|
5
|
+
import { defineSrc } from '../utils';
|
|
6
|
+
|
|
7
|
+
const MagnifyingGlass = () => {
|
|
8
|
+
const model = useGLTF(defineSrc('magnifying-glass.glb'));
|
|
9
|
+
|
|
10
|
+
const lights = useLoader(ObjectLoader, defineSrc('magnifying-glass-light.json'));
|
|
11
|
+
|
|
12
|
+
const lens = model.scene.getObjectByName('Optimised_lens');
|
|
13
|
+
|
|
14
|
+
useFrame(() => {
|
|
15
|
+
lens.material.transparent = true;
|
|
16
|
+
|
|
17
|
+
lens.material.opacity = 0.8;
|
|
18
|
+
|
|
19
|
+
model.materials['Tapestry WebGL'].map.offset.x += -0.0006;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<primitive scale={1.5} position={[0, -12, 0]} object={model.scene} />
|
|
25
|
+
<primitive object={lights} />
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default MagnifyingGlass;
|