From bcfe90ccb6a8a667fab3f2999af5d8cc7e9adbcc Mon Sep 17 00:00:00 2001 From: Kurt Hutten Date: Wed, 22 Sep 2021 07:27:56 +1000 Subject: [PATCH] Add parallax to floaty homepage cards --- app/web/src/components/Hero/Hero.tsx | 71 +++++++++++++++----- app/web/src/index.html | 2 +- app/web/src/layouts/MainLayout/MainLayout.js | 5 +- app/web/src/pages/HomePage/HomePage.tsx | 4 +- 4 files changed, 62 insertions(+), 20 deletions(-) diff --git a/app/web/src/components/Hero/Hero.tsx b/app/web/src/components/Hero/Hero.tsx index 97fdc3a..c597280 100644 --- a/app/web/src/components/Hero/Hero.tsx +++ b/app/web/src/components/Hero/Hero.tsx @@ -13,7 +13,9 @@ import ProjectsCell from 'src/components/ProjectsCell' import OutBound from 'src/components/OutBound/OutBound' // dynamic import to enable pre-render iof the homepage -const AssetWithGooey = React.lazy(() => import('src/components/Hero/AssetWithGooey')) +const AssetWithGooey = React.lazy( + () => import('src/components/Hero/AssetWithGooey') +) const cqCode = `from cadquery import * d1 = 58.5 @@ -79,24 +81,41 @@ export const Hero = () => { return (
- + - - + +
- -
+
-              {cqCode.map((line, index) => 
{index+1}{line}
)} + {cqCode.map((line, index) => ( +
+ + {index + 1} + + {line} +
+ ))}
- - -
@@ -108,7 +127,13 @@ export const Hero = () => { projectTitle: 'coffee-lid', })} > -
+
{
- -
+
-              {scadCode.map((line, index) => 
{index+1}{line}
)} + {scadCode.map((line, index) => ( +
+ + {index + 1} + + {line} +
+ ))}
-
@@ -200,7 +233,13 @@ export const Hero = () => { projectTitle: 'tutorial-hinge', })} > -
+
-
+
<%= prerenderPlaceholder %>
diff --git a/app/web/src/layouts/MainLayout/MainLayout.js b/app/web/src/layouts/MainLayout/MainLayout.js index b56cfc8..0cef864 100644 --- a/app/web/src/layouts/MainLayout/MainLayout.js +++ b/app/web/src/layouts/MainLayout/MainLayout.js @@ -69,7 +69,10 @@ const MainLayout = ({ children, shouldRemoveFooterInIde }) => { } }, [hash, client]) return ( -
+