@rpg-engine/long-bow 0.6.40 → 0.6.42
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/long-bow.cjs.development.js +26 -12
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +26 -12
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/images/farming-plant-seed.png +0 -0
- package/src/components/Image/ZoomableImage.tsx +22 -4
- package/src/components/Tutorial/TutorialStepper.tsx +4 -6
- package/src/stories/TutorialStepper.stories.tsx +2 -1
package/dist/long-bow.esm.js
CHANGED
|
@@ -33226,8 +33226,8 @@ var ZoomableImage = function ZoomableImage(_ref) {
|
|
|
33226
33226
|
var src = _ref.src,
|
|
33227
33227
|
alt = _ref.alt;
|
|
33228
33228
|
var _useState = useState(false),
|
|
33229
|
-
|
|
33230
|
-
|
|
33229
|
+
isZoomed = _useState[0],
|
|
33230
|
+
setIsZoomed = _useState[1];
|
|
33231
33231
|
var _useState2 = useState({
|
|
33232
33232
|
x: 50,
|
|
33233
33233
|
y: 50
|
|
@@ -33247,23 +33247,37 @@ var ZoomableImage = function ZoomableImage(_ref) {
|
|
|
33247
33247
|
y: y
|
|
33248
33248
|
});
|
|
33249
33249
|
};
|
|
33250
|
+
var handleTouchMove = function handleTouchMove(e) {
|
|
33251
|
+
var _e$currentTarget$getB2 = e.currentTarget.getBoundingClientRect(),
|
|
33252
|
+
left = _e$currentTarget$getB2.left,
|
|
33253
|
+
top = _e$currentTarget$getB2.top,
|
|
33254
|
+
width = _e$currentTarget$getB2.width,
|
|
33255
|
+
height = _e$currentTarget$getB2.height;
|
|
33256
|
+
var touch = e.touches[0];
|
|
33257
|
+
var x = (touch.clientX - left) / width * 100;
|
|
33258
|
+
var y = (touch.clientY - top) / height * 100;
|
|
33259
|
+
setZoomPosition({
|
|
33260
|
+
x: x,
|
|
33261
|
+
y: y
|
|
33262
|
+
});
|
|
33263
|
+
};
|
|
33264
|
+
var handleZoomToggle = function handleZoomToggle() {
|
|
33265
|
+
setIsZoomed(!isZoomed);
|
|
33266
|
+
};
|
|
33250
33267
|
return React.createElement("img", {
|
|
33251
33268
|
src: src,
|
|
33252
33269
|
alt: alt,
|
|
33253
33270
|
onMouseMove: handleMouseMove,
|
|
33254
|
-
|
|
33255
|
-
|
|
33256
|
-
},
|
|
33257
|
-
onMouseLeave: function onMouseLeave() {
|
|
33258
|
-
return setIsHovered(false);
|
|
33259
|
-
},
|
|
33271
|
+
onTouchMove: handleTouchMove,
|
|
33272
|
+
onClick: handleZoomToggle,
|
|
33260
33273
|
style: {
|
|
33261
33274
|
width: '100%',
|
|
33262
33275
|
height: '100%',
|
|
33263
33276
|
objectFit: 'cover',
|
|
33264
|
-
transform:
|
|
33277
|
+
transform: isZoomed ? 'scale(1.5)' : 'scale(1)',
|
|
33265
33278
|
transformOrigin: zoomPosition.x + "% " + zoomPosition.y + "%",
|
|
33266
|
-
transition: 'transform 0.3s ease'
|
|
33279
|
+
transition: 'transform 0.3s ease',
|
|
33280
|
+
cursor: 'pointer'
|
|
33267
33281
|
}
|
|
33268
33282
|
});
|
|
33269
33283
|
};
|
|
@@ -33321,7 +33335,7 @@ var TutorialStepper = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
33321
33335
|
var LessonImageWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
33322
33336
|
displayName: "TutorialStepper__LessonImageWrapper",
|
|
33323
33337
|
componentId: "sc-7tgzv2-0"
|
|
33324
|
-
})(["width:100%;max-width:500px;margin:1rem auto;aspect-ratio:
|
|
33338
|
+
})(["width:100%;max-width:500px;margin:1rem auto;aspect-ratio:auto;border-radius:10px;box-shadow:0 4px 6px rgba(0,0,0,0.1);"]);
|
|
33325
33339
|
var LessonBody = /*#__PURE__*/styled.div.withConfig({
|
|
33326
33340
|
displayName: "TutorialStepper__LessonBody",
|
|
33327
33341
|
componentId: "sc-7tgzv2-1"
|
|
@@ -33337,7 +33351,7 @@ var LessonFooter = /*#__PURE__*/styled.div.withConfig({
|
|
|
33337
33351
|
var LessonImage = /*#__PURE__*/styled.div.withConfig({
|
|
33338
33352
|
displayName: "TutorialStepper__LessonImage",
|
|
33339
33353
|
componentId: "sc-7tgzv2-4"
|
|
33340
|
-
})(["display:flex;justify-content:center;align-items:center;width:100%;
|
|
33354
|
+
})(["display:flex;justify-content:center;align-items:center;width:100%;max-width:500px;margin:auto;img{width:100%;height:auto;object-fit:contain;border-radius:10px;}"]);
|
|
33341
33355
|
var LessonTitle = /*#__PURE__*/styled.h1.withConfig({
|
|
33342
33356
|
displayName: "TutorialStepper__LessonTitle",
|
|
33343
33357
|
componentId: "sc-7tgzv2-5"
|