diff --git a/package-lock.json b/package-lock.json index 271b030c..00c96b1a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1", + "react-lottie-player": "^2.1.0", "zustand": "^4.5.4" }, "devDependencies": { @@ -2776,7 +2777,6 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, "license": "MIT" }, "node_modules/fast-glob": { @@ -3899,6 +3899,12 @@ "loose-envify": "cli.js" } }, + "node_modules/lottie-web": { + "version": "5.12.2", + "resolved": "https://registry.npmjs.org/lottie-web/-/lottie-web-5.12.2.tgz", + "integrity": "sha512-uvhvYPC8kGPjXT3MyKMrL3JitEAmDMp30lVkuq/590Mw9ok6pWcFCwXJveo0t5uqYw1UREQHofD+jVpdjBv8wg==", + "license": "MIT" + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -4615,6 +4621,23 @@ "dev": true, "license": "MIT" }, + "node_modules/react-lottie-player": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/react-lottie-player/-/react-lottie-player-2.1.0.tgz", + "integrity": "sha512-rxSNIVVLWYnwzsIow377vZsh7GDbReu70V7IDD9TbbcdcJWons4pSh3nyuEa4QWIZw0ZBIieoZRTsiqnb6MZ3g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "lottie-web": "^5.12.2", + "rfdc": "^1.3.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/react-refresh": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", @@ -4728,6 +4751,12 @@ "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT" + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", diff --git a/package.json b/package.json index 3f08221e..aec14275 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1", + "react-lottie-player": "^2.1.0", "zustand": "^4.5.4" }, "devDependencies": { diff --git a/src/assets/property1.svg b/public/icons/property1.svg similarity index 100% rename from src/assets/property1.svg rename to public/icons/property1.svg diff --git a/src/assets/property2.svg b/public/icons/property2.svg similarity index 100% rename from src/assets/property2.svg rename to public/icons/property2.svg diff --git a/src/assets/property3.svg b/public/icons/property3.svg similarity index 100% rename from src/assets/property3.svg rename to public/icons/property3.svg diff --git a/src/assets/property4.svg b/public/icons/property4.svg similarity index 100% rename from src/assets/property4.svg rename to public/icons/property4.svg diff --git a/src/assets/property5.svg b/public/icons/property5.svg similarity index 100% rename from src/assets/property5.svg rename to public/icons/property5.svg diff --git a/src/interactions/InteractionDescription.jsx b/src/interactions/InteractionDescription.jsx new file mode 100644 index 00000000..626038e1 --- /dev/null +++ b/src/interactions/InteractionDescription.jsx @@ -0,0 +1,16 @@ +function InteractionDescription({ order, title, description, directive }) { + return ( +
+ {order} +
+

+ {title} +

+

{description}

+

{directive}

+
+
+ ); +} + +export default InteractionDescription; diff --git a/src/interactions/distanceDriven/index.jsx b/src/interactions/distanceDriven/index.jsx new file mode 100644 index 00000000..369bdc78 --- /dev/null +++ b/src/interactions/distanceDriven/index.jsx @@ -0,0 +1,72 @@ +import { useImperativeHandle } from "react"; +import InteractionDescription from "../InteractionDescription.jsx"; +import usePointDrag from "./usePointDrag.js"; + +function DistanceDrivenInteraction({ interactCallback, $ref }) { + const { x, y, reset, onPointerDown } = usePointDrag(); + + const circleStyle = { + transform: `translate(${x}px, ${y}px)`, + }; + + function pulseAnimation(e) { + e.currentTarget.animate( + [ + { transform: "scale(1)", opacity: 0.5 }, + { transform: "scale(16)", opacity: 0 }, + ], + { + duration: 300, + iteractions: 1, + easing: "ease-out", + pseudoElement: "::before", + }, + ); + } + + useImperativeHandle($ref, () => ({ reset }), [reset]); + + return ( +
+ +
+
{ + onPointerDown(e); + pulseAnimation(e); + interactCallback?.(); + }} + style={circleStyle} + /> + + + +
+

+ + {Math.round(Math.hypot(x, y) / 3)} + + km +

+
+ ); +} + +export default DistanceDrivenInteraction; diff --git a/src/interactions/distanceDriven/usePointDrag.js b/src/interactions/distanceDriven/usePointDrag.js new file mode 100644 index 00000000..c341271f --- /dev/null +++ b/src/interactions/distanceDriven/usePointDrag.js @@ -0,0 +1,40 @@ +import { useState, useRef, useCallback } from "react"; +import useMountDragEvent from "@/common/useMountDragEvent.js"; + +function usePointDrag() { + const isDragging = useRef(false); + const prevState = useRef({ x: 0, y: 0, mouseX: 0, mouseY: 0 }); + const [x, setX] = useState(0); + const [y, setY] = useState(0); + + function onDragStart(e) { + isDragging.current = true; + prevState.current.mouseX = e.clientX; + prevState.current.mouseY = e.clientY; + prevState.current.x = x; + prevState.current.y = y; + } + const onDrag = useCallback(function (mouse) { + if (!isDragging.current) return; + setX(prevState.current.x + mouse.x - prevState.current.mouseX); + setY(prevState.current.y + mouse.y - prevState.current.mouseY); + }, []); + const onDragEnd = useCallback(function () { + if (!isDragging.current) return; + isDragging.current = false; + }, []); + + useMountDragEvent(onDrag, onDragEnd); + + return { + x, + y, + reset() { + setX(0); + setY(0); + }, + onPointerDown: onDragStart, + }; +} + +export default usePointDrag; diff --git a/src/interactions/fastCharge/timer.svg b/src/interactions/fastCharge/assets/timer.svg similarity index 100% rename from src/interactions/fastCharge/timer.svg rename to src/interactions/fastCharge/assets/timer.svg diff --git a/src/interactions/fastCharge/FastChargeInteraction.jsx b/src/interactions/fastCharge/index.jsx similarity index 71% rename from src/interactions/fastCharge/FastChargeInteraction.jsx rename to src/interactions/fastCharge/index.jsx index d125b6fe..049a4dc8 100644 --- a/src/interactions/fastCharge/FastChargeInteraction.jsx +++ b/src/interactions/fastCharge/index.jsx @@ -1,7 +1,7 @@ import { useImperativeHandle } from "react"; +import InteractionDescription from "../InteractionDescription.jsx"; import BatteryProgressBar from "./BatteryProgressBar.jsx"; -import orderIcon from "@/assets/property2.svg"; -import dialSvg from "./timer.svg"; +import dialSvg from "./assets/timer.svg"; import useDialDrag from "./useDialDrag.js"; const MAX_MINUTE = 30; @@ -35,20 +35,12 @@ function FastChargeInteraction({ interactCallback, $ref }) { return (
-
- 2 -
-

- 불편함 없이, 더 빠르게 -

-

- The new IONIQ 5의 배터리를 충전하는 데 얼마만큼의 시간이 걸릴까요? -

-

- 다이얼을 돌려 충전에 필요한 시간을 확인해보세요! -

-
-
+
diff --git a/src/interactions/fastCharge/useDialDrag.js b/src/interactions/fastCharge/useDialDrag.js index 388cfac8..17f74c82 100644 --- a/src/interactions/fastCharge/useDialDrag.js +++ b/src/interactions/fastCharge/useDialDrag.js @@ -56,7 +56,11 @@ function useDialDrag() { setIsDrag(true); } - const resetAngle = useCallback(() => setAngle(0), []); + const resetAngle = useCallback(() => { + setAngle(0); + angleCache.current = 0; + prevAngle.current = 0; + }, []); const style = { transform: `rotate(${angle}rad)`, diff --git a/src/interactions/subsidy/assets/coin.json b/src/interactions/subsidy/assets/coin.json new file mode 100644 index 00000000..c322582a --- /dev/null +++ b/src/interactions/subsidy/assets/coin.json @@ -0,0 +1,1035 @@ +{ + "v": "4.8.0", + "meta": { "g": "LottieFiles AE 3.5.8", "a": "", "k": "", "d": "", "tc": "" }, + "fr": 30, + "ip": 0, + "op": 30, + "w": 500, + "h": 500, + "nm": "Comp 2", + "ddd": 0, + "assets": [], + "layers": [ + { + "ddd": 0, + "ind": 1, + "ty": 4, + "nm": "Shape Layer 6", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 19, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 23, + "s": [1] + }, + { "t": 25, "s": [1] } + ], + "ix": 11 + }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.123], "y": [0.335] }, + "o": { "x": [0], "y": [0] }, + "t": 5, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [0.7] }, + "o": { "x": [0.496], "y": [0.424] }, + "t": 13, + "s": [-24] + }, + { "t": 25, "s": [-56] } + ], + "ix": 10 + }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0, "y": 0.296 }, + "o": { "x": 0, "y": 0 }, + "t": 5, + "s": [250, 250, 0], + "to": [-40.667, -47.5, 0], + "ti": [57.284, -10.284, 0] + }, + { + "i": { "x": 0.778, "y": 0.451 }, + "o": { "x": 0.21, "y": 0.14 }, + "t": 13, + "s": [126, 200, 0], + "to": [-71.118, 12.767, 0], + "ti": [5, -36, 0] + }, + { "t": 25, "s": [-12, 368, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [-151.707, -94.707, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.234, 0.833], "y": [1, 0.487, 1] }, + "o": { "x": [0, 0, 0.333], "y": [0, 0, 0] }, + "t": 5, + "s": [100, 100, 100] + }, + { + "i": { "x": [0.833, 0.613, 0.833], "y": [1, 0.513, 1] }, + "o": { "x": [0.167, 0.41, 0.167], "y": [0, 0.118, 0] }, + "t": 13, + "s": [100, 40, 100] + }, + { "t": 21, "s": [100, -100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [30, 30], "ix": 2 }, + "p": { "a": 0, "k": [0, 0], "ix": 3 }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.33662701775, 0.33662701775, 0.33662701775, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 0, "ix": 5 }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 5, + "s": [0.149019607843, 0.898039215686, 1, 1] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 13, + "s": [0.58659620098, 0.950467756683, 1, 1] + }, + { "t": 25, "s": [0.84753370098, 0.981732117896, 1, 1] } + ], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [-151.707, -94.707], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 5, + "op": 2705, + "st": 5, + "bm": 0 + }, + { + "ddd": 0, + "ind": 2, + "ty": 4, + "nm": "Shape Layer 5", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 22, + "s": [100] + }, + { "t": 26, "s": [0] } + ], + "ix": 11 + }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.123], "y": [1.425] }, + "o": { "x": [0], "y": [0] }, + "t": 3, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1.193] }, + "o": { "x": [0.496], "y": [-0.272] }, + "t": 13, + "s": [47] + }, + { "t": 26, "s": [101] } + ], + "ix": 10 + }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0, "y": 0.163 }, + "o": { "x": 0, "y": 0 }, + "t": 3, + "s": [250, 250, 0], + "to": [8.333, -36.5, 0], + "ti": [-44.659, -3.543, 0] + }, + { + "i": { "x": 0.778, "y": 0.425 }, + "o": { "x": 0.21, "y": 0.146 }, + "t": 13, + "s": [359, 160, 0], + "to": [58.396, 4.633, 0], + "ti": [-5.5, -86.833, 0] + }, + { "t": 26, "s": [464, 353, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [-151.707, -94.707, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.167, 0.41, 0.167], "y": [0, -0.343, 0] }, + "t": 3, + "s": [100, 40, 100] + }, + { + "i": { "x": [0.833, 0.613, 0.833], "y": [1, 0.446, 1] }, + "o": { "x": [0, 0, 0.333], "y": [0, 0, 0] }, + "t": 13, + "s": [100, 100, 100] + }, + { "t": 26, "s": [100, -100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [30, 30], "ix": 2 }, + "p": { "a": 0, "k": [0, 0], "ix": 3 }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.33662701775, 0.33662701775, 0.33662701775, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 0, "ix": 5 }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 3, + "s": [0.58659620098, 0.950467756683, 1, 1] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 13, + "s": [0.149019607843, 0.898039215686, 1, 1] + }, + { "t": 26, "s": [0.84753370098, 0.981732117896, 1, 1] } + ], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [-151.707, -94.707], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 3, + "op": 2703, + "st": 3, + "bm": 0 + }, + { + "ddd": 0, + "ind": 3, + "ty": 4, + "nm": "Shape Layer 4", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 23, + "s": [100] + }, + { "t": 27, "s": [0] } + ], + "ix": 11 + }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.123], "y": [2.497] }, + "o": { "x": [0], "y": [0] }, + "t": 4, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1.22] }, + "o": { "x": [0.496], "y": [-0.31] }, + "t": 13, + "s": [12] + }, + { "t": 27, "s": [63] } + ], + "ix": 10 + }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0, "y": 0.375 }, + "o": { "x": 0, "y": 0 }, + "t": 4, + "s": [250, 250, 0], + "to": [-1.667, -56.5, 0], + "ti": [45.583, -0.146, 0] + }, + { + "i": { "x": 0.823, "y": 0.638 }, + "o": { "x": 0.21, "y": 0.125 }, + "t": 13, + "s": [164.5, 148, 0], + "to": [-72.093, 0.23, 0], + "ti": [-4.5, -60.833, 0] + }, + { "t": 27, "s": [63, 345, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [-151.707, -94.707, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0, 0.312, 0.833], "y": [0.247, -20.657, 1] }, + "o": { "x": [0, 0, 0.167], "y": [0, -0.005, 0] }, + "t": 4, + "s": [100, 100, 100] + }, + { + "i": { "x": [0.936, 0.837, 0.833], "y": [0.869, 30.541, 1] }, + "o": { "x": [0.693, 0.563, 0.167], "y": [0.348, 27.567, 0] }, + "t": 13, + "s": [52, 100, 100] + }, + { "t": 27, "s": [-60, 100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [30, 30], "ix": 2 }, + "p": { "a": 0, "k": [0, 0], "ix": 3 }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.33662701775, 0.33662701775, 0.33662701775, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 0, "ix": 5 }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 4, + "s": [0.58659620098, 0.950467756683, 1, 1] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 13, + "s": [0.149019607843, 0.898039215686, 1, 1] + }, + { "t": 27, "s": [0.84753370098, 0.981732117896, 1, 1] } + ], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [-151.707, -94.707], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 4, + "op": 2704, + "st": 4, + "bm": 0 + }, + { + "ddd": 0, + "ind": 4, + "ty": 4, + "nm": "Shape Layer 3", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 20, + "s": [100] + }, + { "t": 24, "s": [0] } + ], + "ix": 11 + }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.123], "y": [2.497] }, + "o": { "x": [0], "y": [0] }, + "t": 1, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1.22] }, + "o": { "x": [0.496], "y": [-0.31] }, + "t": 10, + "s": [12] + }, + { "t": 24, "s": [63] } + ], + "ix": 10 + }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0, "y": 0.28 }, + "o": { "x": 0, "y": 0 }, + "t": 1, + "s": [250, 250, 0], + "to": [33.333, -39.5, 0], + "ti": [-45.383, -4.275, 0] + }, + { + "i": { "x": 0.823, "y": 0.559 }, + "o": { "x": 0.21, "y": 0.152 }, + "t": 10, + "s": [362, 203, 0], + "to": [44.907, 4.23, 0], + "ti": [-26.5, -61.833, 0] + }, + { "t": 24, "s": [510, 323, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [-151.707, -94.707, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0, 0.312, 0.833], "y": [0.247, -20.657, 1] }, + "o": { "x": [0, 0, 0.167], "y": [0, -0.005, 0] }, + "t": 1, + "s": [100, 100, 100] + }, + { + "i": { "x": [0.936, 0.837, 0.833], "y": [0.869, 30.541, 1] }, + "o": { "x": [0.693, 0.563, 0.167], "y": [0.348, 27.567, 0] }, + "t": 10, + "s": [52, 100, 100] + }, + { "t": 24, "s": [-60, 100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [30, 30], "ix": 2 }, + "p": { "a": 0, "k": [0, 0], "ix": 3 }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.33662701775, 0.33662701775, 0.33662701775, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 0, "ix": 5 }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 1, + "s": [0.58659620098, 0.950467756683, 1, 1] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 10, + "s": [0.149019607843, 0.898039215686, 1, 1] + }, + { "t": 24, "s": [0.84753370098, 0.981732117896, 1, 1] } + ], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [-151.707, -94.707], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 1, + "op": 2701, + "st": 1, + "bm": 0 + }, + { + "ddd": 0, + "ind": 5, + "ty": 4, + "nm": "Shape Layer 2", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 23, + "s": [100] + }, + { "t": 27, "s": [0] } + ], + "ix": 11 + }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.123], "y": [1.425] }, + "o": { "x": [0], "y": [0] }, + "t": 4, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1.193] }, + "o": { "x": [0.496], "y": [-0.272] }, + "t": 14, + "s": [47] + }, + { "t": 27, "s": [101] } + ], + "ix": 10 + }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0, "y": 0.117 }, + "o": { "x": 0, "y": 0 }, + "t": 4, + "s": [250, 250, 0], + "to": [8.333, -36.5, 0], + "ti": [-42.806, -13.216, 0] + }, + { + "i": { "x": 0.778, "y": 0.437 }, + "o": { "x": 0.21, "y": 0.143 }, + "t": 14, + "s": [343, 159, 0], + "to": [47.396, 14.633, 0], + "ti": [-15.5, -82.833, 0] + }, + { "t": 27, "s": [456, 362, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [-151.707, -94.707, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.167, 0.41, 0.167], "y": [0, -0.343, 0] }, + "t": 4, + "s": [100, 40, 100] + }, + { + "i": { "x": [0.833, 0.613, 0.833], "y": [1, 0.446, 1] }, + "o": { "x": [0, 0, 0.333], "y": [0, 0, 0] }, + "t": 14, + "s": [100, 100, 100] + }, + { "t": 27, "s": [100, -100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [30, 30], "ix": 2 }, + "p": { "a": 0, "k": [0, 0], "ix": 3 }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.33662701775, 0.33662701775, 0.33662701775, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 0, "ix": 5 }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 4, + "s": [0.58659620098, 0.950467756683, 1, 1] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 14, + "s": [0.149019607843, 0.898039215686, 1, 1] + }, + { "t": 27, "s": [0.84753370098, 0.981732117896, 1, 1] } + ], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [-151.707, -94.707], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 4, + "op": 2704, + "st": 4, + "bm": 0 + }, + { + "ddd": 0, + "ind": 6, + "ty": 4, + "nm": "Shape Layer 1", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 14, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 18, + "s": [1] + }, + { "t": 20, "s": [1] } + ], + "ix": 11 + }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.123], "y": [0.335] }, + "o": { "x": [0], "y": [0] }, + "t": 0, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [0.7] }, + "o": { "x": [0.496], "y": [0.424] }, + "t": 8, + "s": [-24] + }, + { "t": 20, "s": [-56] } + ], + "ix": 10 + }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0, "y": 0.296 }, + "o": { "x": 0, "y": 0 }, + "t": 0, + "s": [250, 250, 0], + "to": [-40.667, -47.5, 0], + "ti": [57.284, -10.284, 0] + }, + { + "i": { "x": 0.778, "y": 0.451 }, + "o": { "x": 0.21, "y": 0.14 }, + "t": 8, + "s": [126, 200, 0], + "to": [-71.118, 12.767, 0], + "ti": [5, -36, 0] + }, + { "t": 20, "s": [-12, 368, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [-151.707, -94.707, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.833, 0.234, 0.833], "y": [1, 0.487, 1] }, + "o": { "x": [0, 0, 0.333], "y": [0, 0, 0] }, + "t": 0, + "s": [100, 100, 100] + }, + { + "i": { "x": [0.833, 0.613, 0.833], "y": [1, 0.513, 1] }, + "o": { "x": [0.167, 0.41, 0.167], "y": [0, 0.118, 0] }, + "t": 8, + "s": [100, 40, 100] + }, + { "t": 16, "s": [100, -100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "d": 1, + "ty": "el", + "s": { "a": 0, "k": [30, 30], "ix": 2 }, + "p": { "a": 0, "k": [0, 0], "ix": 3 }, + "nm": "Ellipse Path 1", + "mn": "ADBE Vector Shape - Ellipse", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.33662701775, 0.33662701775, 0.33662701775, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 0, "ix": 5 }, + "lc": 1, + "lj": 1, + "ml": 4, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 0, + "s": [0.149019607843, 0.898039215686, 1, 1] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 8, + "s": [0.58659620098, 0.950467756683, 1, 1] + }, + { "t": 20, "s": [0.84753370098, 0.981732117896, 1, 1] } + ], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [-151.707, -94.707], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Ellipse 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 2700, + "st": 0, + "bm": 0 + } + ], + "markers": [] +} diff --git a/src/interactions/subsidy/assets/dollor.svg b/src/interactions/subsidy/assets/dollor.svg new file mode 100644 index 00000000..55578184 --- /dev/null +++ b/src/interactions/subsidy/assets/dollor.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/interactions/subsidy/index.jsx b/src/interactions/subsidy/index.jsx new file mode 100644 index 00000000..8e1cc5b7 --- /dev/null +++ b/src/interactions/subsidy/index.jsx @@ -0,0 +1,73 @@ +import { useState, useRef, useImperativeHandle } from "react"; +import Lottie from "react-lottie-player/dist/LottiePlayerLight"; +import coinRottie from "./assets/coin.json"; +import dollor from "./assets/dollor.svg"; +import InteractionDescription from "../InteractionDescription.jsx"; + +function SubsidyInteraction({ interactCallback, $ref }) { + const [count, setCount] = useState(0); + const rottieRef = useRef(null); + + function onClick(e) { + setCount((count) => count + 1); + e.currentTarget.animate( + [{ transform: "rotateY(0)" }, { transform: "rotateY(360deg)" }], + { + duration: 500, + iteractions: 1, + easing: "cubic-bezier(0.215, 0.610, 0.355, 1.000)", // ease-out-cubic + }, + ); + rottieRef.current.goToAndPlay(0); + interactCallback?.(); + } + + useImperativeHandle( + $ref, + () => ({ + reset() { + setCount(0); + }, + }), + [], + ); + + return ( +
+ +
+
+ $ +
+ +
+

+ + {count * 10} + + 만원 +

+
+ ); +} + +export default SubsidyInteraction; diff --git a/src/interactions/univasalIsland/UnivasalIslandInteraction.jsx b/src/interactions/univasalIsland/index.jsx similarity index 77% rename from src/interactions/univasalIsland/UnivasalIslandInteraction.jsx rename to src/interactions/univasalIsland/index.jsx index 1e68d81c..03ceaa77 100644 --- a/src/interactions/univasalIsland/UnivasalIslandInteraction.jsx +++ b/src/interactions/univasalIsland/index.jsx @@ -1,8 +1,8 @@ import { useImperativeHandle } from "react"; +import InteractionDescription from "../InteractionDescription.jsx"; import Phone from "./Phone.jsx"; import useIslandDrag from "./useIslandDrag.js"; -import orderIcon from "@/assets/property3.svg"; import seat from "./assets/seat.png"; import univasalIsland1x from "./assets/univasalIsland@1x.png"; import univasalIsland2x from "./assets/univasalIsland@2x.png"; @@ -44,20 +44,12 @@ function UnivasalIslandInteraction({ interactCallback, $ref }) { return (
-
- 3 -
-

- 나에게 맞게, 자유자재로 -

-

- 새로워진 The new IONIQ 5의 유니버설 아일랜드는 어떤 모습일까요? -

-

- 유니버설 아일랜드를 드래그하여 이동시키고 스마트폰을 충전해보세요! -

-
-
+