Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update dependencies #98

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/webpack.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
]
},
devServer: {
contentBase: path.join(__dirname, './e2e')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this change?

static: './'
},
resolve: {
alias: {
Expand Down
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ <h2>
for more information.
</div>
</div>
<script src="./build/vendors~main.js"></script>
<script src="./build/vendors-node_modules_react-dom_index_js.js"></script>
<script src="./build/main.js"></script>
</body>
2 changes: 1 addition & 1 deletion example/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
],
},
devServer: {
contentBase: path.resolve(__dirname, '.'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the purpose for this change? It appears that this change breaks npm run start

static: './',
open: true,
},
resolve: {
Expand Down
32 changes: 18 additions & 14 deletions lib/ReactCardFlip.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ var __assign = (this && this.__assign) || function () {
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
Expand All @@ -25,7 +29,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Expand All @@ -34,18 +38,18 @@ var React = __importStar(require("react"));
var react_1 = require("react");
var ReactCardFlip = function (props) {
var _a = props.cardStyles, back = _a.back, front = _a.front, cardZIndex = props.cardZIndex, containerStyle = props.containerStyle, containerClassName = props.containerClassName, flipDirection = props.flipDirection, flipSpeedFrontToBack = props.flipSpeedFrontToBack, flipSpeedBackToFront = props.flipSpeedBackToFront, infinite = props.infinite;
var _b = react_1.useState(props.isFlipped), isFlipped = _b[0], setFlipped = _b[1];
var _c = react_1.useState(0), rotation = _c[0], setRotation = _c[1];
react_1.useEffect(function () {
var _b = (0, react_1.useState)(props.isFlipped), isFlipped = _b[0], setFlipped = _b[1];
var _c = (0, react_1.useState)(0), rotation = _c[0], setRotation = _c[1];
(0, react_1.useEffect)(function () {
if (props.isFlipped !== isFlipped) {
setFlipped(props.isFlipped);
setRotation(function (c) { return c + 180; });
}
}, [props.isFlipped]);
var getContainerClassName = react_1.useMemo(function () {
var getContainerClassName = (0, react_1.useMemo)(function () {
var className = 'react-card-flip';
if (containerClassName) {
className += " " + containerClassName;
className += " ".concat(containerClassName);
}
return className;
}, [containerClassName]);
Expand All @@ -55,22 +59,22 @@ var ReactCardFlip = function (props) {
}
return props.children[key];
};
var frontRotateY = "rotateY(" + (infinite ? rotation : isFlipped ? 180 : 0) + "deg)";
var backRotateY = "rotateY(" + (infinite ? rotation + 180 : isFlipped ? 0 : -180) + "deg)";
var frontRotateX = "rotateX(" + (infinite ? rotation : isFlipped ? 180 : 0) + "deg)";
var backRotateX = "rotateX(" + (infinite ? rotation + 180 : isFlipped ? 0 : -180) + "deg)";
var frontRotateY = "rotateY(".concat(infinite ? rotation : isFlipped ? 180 : 0, "deg)");
var backRotateY = "rotateY(".concat(infinite ? rotation + 180 : isFlipped ? 0 : -180, "deg)");
var frontRotateX = "rotateX(".concat(infinite ? rotation : isFlipped ? 180 : 0, "deg)");
var backRotateX = "rotateX(".concat(infinite ? rotation + 180 : isFlipped ? 0 : -180, "deg)");
var styles = {
back: __assign({ WebkitBackfaceVisibility: 'hidden', backfaceVisibility: 'hidden', height: '100%', left: '0', position: isFlipped ? 'relative' : 'absolute', top: '0', transform: flipDirection === 'horizontal' ? backRotateY : backRotateX, transformStyle: 'preserve-3d', transition: flipSpeedFrontToBack + "s", width: '100%' }, back),
back: __assign({ WebkitBackfaceVisibility: 'hidden', backfaceVisibility: 'hidden', height: '100%', left: '0', position: isFlipped ? 'relative' : 'absolute', top: '0', transform: flipDirection === 'horizontal' ? backRotateY : backRotateX, transformStyle: 'preserve-3d', transition: "".concat(flipSpeedFrontToBack, "s"), width: '100%' }, back),
container: {
perspective: '1000px',
zIndex: "" + cardZIndex,
zIndex: "".concat(cardZIndex),
},
flipper: {
height: '100%',
position: 'relative',
width: '100%',
},
front: __assign({ WebkitBackfaceVisibility: 'hidden', backfaceVisibility: 'hidden', height: '100%', left: '0', position: isFlipped ? 'absolute' : 'relative', top: '0', transform: flipDirection === 'horizontal' ? frontRotateY : frontRotateX, transformStyle: 'preserve-3d', transition: flipSpeedBackToFront + "s", width: '100%', zIndex: '2' }, front),
front: __assign({ WebkitBackfaceVisibility: 'hidden', backfaceVisibility: 'hidden', height: '100%', left: '0', position: isFlipped ? 'absolute' : 'relative', top: '0', transform: flipDirection === 'horizontal' ? frontRotateY : frontRotateX, transformStyle: 'preserve-3d', transition: "".concat(flipSpeedBackToFront, "s"), width: '100%', zIndex: '2' }, front),
};
return (React.createElement("div", { className: getContainerClassName, style: __assign(__assign({}, styles.container), containerStyle) },
React.createElement("div", { className: "react-card-flipper", style: styles.flipper },
Expand Down
Loading