diff --git a/components/system/components/Card3D.js b/components/system/components/Card3D.js index 73a09751..188119f8 100644 --- a/components/system/components/Card3D.js +++ b/components/system/components/Card3D.js @@ -54,21 +54,6 @@ const STYLES_SHINE = css` background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 60%); `; -const STYLES_RENDERED_LAYER = css` - position: absolute; - width: 100%; - height: 100%; - top: 0%; - left: 0%; - background-repeat: no-repeat; - background-position: center; - background-color: transparent; - background-size: cover; - transition: all 0.1s ease-out; - overflow: hidden; - border-radius: 8px; -`; - const Card3D = ({ children }) => { const wrapper = React.useRef(); @@ -149,25 +134,16 @@ const Card3D = ({ children }) => { }; }); + const cardChildren = Array.isArray(children) + ? children.map((child) => React.cloneElement(child, { className: "rendered-layer" })) + : React.cloneElement(children, { className: "rendered-layer" }); + return (
-
-
+ {cardChildren}
diff --git a/pages/_/system/card-3d.js b/pages/_/system/card-3d.js index 0df0e919..d158ab48 100644 --- a/pages/_/system/card-3d.js +++ b/pages/_/system/card-3d.js @@ -8,6 +8,21 @@ import SystemPage from "~/components/system/SystemPage"; import ViewSourceLink from "~/components/system/ViewSourceLink"; import CodeBlock from "~/components/system/CodeBlock"; +const STYLES_RENDERED_LAYER = css` + position: absolute; + width: 100%; + height: 100%; + top: 0%; + left: 0%; + background-repeat: no-repeat; + background-position: center; + background-color: transparent; + background-size: cover; + transition: all 0.1s ease-out; + overflow: hidden; + border-radius: 8px; +`; + export default class SystemPageCard3D extends React.Component { render() { return ( @@ -65,7 +80,20 @@ export default class SystemPageCard3D extends React.Component { Output

- + +
+
+ ); }