@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
|
@@ -33228,8 +33228,8 @@ var ZoomableImage = function ZoomableImage(_ref) {
|
|
|
33228
33228
|
var src = _ref.src,
|
|
33229
33229
|
alt = _ref.alt;
|
|
33230
33230
|
var _useState = React.useState(false),
|
|
33231
|
-
|
|
33232
|
-
|
|
33231
|
+
isZoomed = _useState[0],
|
|
33232
|
+
setIsZoomed = _useState[1];
|
|
33233
33233
|
var _useState2 = React.useState({
|
|
33234
33234
|
x: 50,
|
|
33235
33235
|
y: 50
|
|
@@ -33249,23 +33249,37 @@ var ZoomableImage = function ZoomableImage(_ref) {
|
|
|
33249
33249
|
y: y
|
|
33250
33250
|
});
|
|
33251
33251
|
};
|
|
33252
|
+
var handleTouchMove = function handleTouchMove(e) {
|
|
33253
|
+
var _e$currentTarget$getB2 = e.currentTarget.getBoundingClientRect(),
|
|
33254
|
+
left = _e$currentTarget$getB2.left,
|
|
33255
|
+
top = _e$currentTarget$getB2.top,
|
|
33256
|
+
width = _e$currentTarget$getB2.width,
|
|
33257
|
+
height = _e$currentTarget$getB2.height;
|
|
33258
|
+
var touch = e.touches[0];
|
|
33259
|
+
var x = (touch.clientX - left) / width * 100;
|
|
33260
|
+
var y = (touch.clientY - top) / height * 100;
|
|
33261
|
+
setZoomPosition({
|
|
33262
|
+
x: x,
|
|
33263
|
+
y: y
|
|
33264
|
+
});
|
|
33265
|
+
};
|
|
33266
|
+
var handleZoomToggle = function handleZoomToggle() {
|
|
33267
|
+
setIsZoomed(!isZoomed);
|
|
33268
|
+
};
|
|
33252
33269
|
return React__default.createElement("img", {
|
|
33253
33270
|
src: src,
|
|
33254
33271
|
alt: alt,
|
|
33255
33272
|
onMouseMove: handleMouseMove,
|
|
33256
|
-
|
|
33257
|
-
|
|
33258
|
-
},
|
|
33259
|
-
onMouseLeave: function onMouseLeave() {
|
|
33260
|
-
return setIsHovered(false);
|
|
33261
|
-
},
|
|
33273
|
+
onTouchMove: handleTouchMove,
|
|
33274
|
+
onClick: handleZoomToggle,
|
|
33262
33275
|
style: {
|
|
33263
33276
|
width: '100%',
|
|
33264
33277
|
height: '100%',
|
|
33265
33278
|
objectFit: 'cover',
|
|
33266
|
-
transform:
|
|
33279
|
+
transform: isZoomed ? 'scale(1.5)' : 'scale(1)',
|
|
33267
33280
|
transformOrigin: zoomPosition.x + "% " + zoomPosition.y + "%",
|
|
33268
|
-
transition: 'transform 0.3s ease'
|
|
33281
|
+
transition: 'transform 0.3s ease',
|
|
33282
|
+
cursor: 'pointer'
|
|
33269
33283
|
}
|
|
33270
33284
|
});
|
|
33271
33285
|
};
|
|
@@ -33323,7 +33337,7 @@ var TutorialStepper = /*#__PURE__*/React__default.memo(function (_ref) {
|
|
|
33323
33337
|
var LessonImageWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
33324
33338
|
displayName: "TutorialStepper__LessonImageWrapper",
|
|
33325
33339
|
componentId: "sc-7tgzv2-0"
|
|
33326
|
-
})(["width:100%;max-width:500px;margin:1rem auto;aspect-ratio:
|
|
33340
|
+
})(["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);"]);
|
|
33327
33341
|
var LessonBody = /*#__PURE__*/styled__default.div.withConfig({
|
|
33328
33342
|
displayName: "TutorialStepper__LessonBody",
|
|
33329
33343
|
componentId: "sc-7tgzv2-1"
|
|
@@ -33339,7 +33353,7 @@ var LessonFooter = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
33339
33353
|
var LessonImage = /*#__PURE__*/styled__default.div.withConfig({
|
|
33340
33354
|
displayName: "TutorialStepper__LessonImage",
|
|
33341
33355
|
componentId: "sc-7tgzv2-4"
|
|
33342
|
-
})(["display:flex;justify-content:center;align-items:center;width:100%;
|
|
33356
|
+
})(["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;}"]);
|
|
33343
33357
|
var LessonTitle = /*#__PURE__*/styled__default.h1.withConfig({
|
|
33344
33358
|
displayName: "TutorialStepper__LessonTitle",
|
|
33345
33359
|
componentId: "sc-7tgzv2-5"
|