)}
diff --git a/src/landing/animations/AnimationCarousel.tsx b/src/landing/animations/AnimationCarousel.tsx
index 3e4a28584..3f7f952cc 100644
--- a/src/landing/animations/AnimationCarousel.tsx
+++ b/src/landing/animations/AnimationCarousel.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import { motion, AnimatePresence } from 'framer-motion';
export default function AnimationCarousel({ items, currentIndex, itemWidth = 1000 }) {
- const initialOffsetX = -(currentIndex * itemWidth + currentIndex * 16);
+ const initialOffsetX = items.length === 1 ? 0 : -(currentIndex * itemWidth + currentIndex * 16);
return (
);
};
-export default function ProgressBars({ setStep, handleClick }) {
- const x = useContext(ScrollContext);
+export default function ProgressBars({ setStep, handleClick, subIndex }) {
+ const ctx = useContext(ScrollContext);
const [progress, setProgress] = React.useState(0);
- useEffect(
- () =>
- x.onChange((latest) => {
- const latestAsNumber = latest;
- setProgress(latestAsNumber);
+ useEffect(() => {
+ ctx?.on('change', (latest) => {
+ const latestAsNumber = latest;
+ setProgress(latestAsNumber);
- let newStep = 0;
- if (latestAsNumber < scriptScrollCount) {
- newStep = 0;
- } else if (
- latestAsNumber >= scriptScrollCount &&
- latestAsNumber < scriptScrollCount + flowScrollCount
- ) {
- newStep = 1;
- } else if (latestAsNumber >= scriptScrollCount + flowScrollCount) {
- newStep = 2;
- }
+ let newStep = 0;
+ if (latestAsNumber < scriptScrollCount) {
+ newStep = 0;
+ } else if (
+ latestAsNumber >= scriptScrollCount &&
+ latestAsNumber < scriptScrollCount + flowScrollCount
+ ) {
+ newStep = 1;
+ } else if (latestAsNumber >= scriptScrollCount + flowScrollCount) {
+ newStep = 2;
+ }
- setStep(newStep);
- }),
- []
- );
+ setStep(newStep);
+ });
+ }, []);
- return (
-
-
handleClick(0)}
- title={'Scripts'}
- progressColor="dark:bg-blue-600 bg-blue-400"
- steps={[20, 40, 50, 60, 70, 80]}
- barColor="bg-blue-700"
- />
- scriptScrollCount}
- onClick={() => handleClick(1)}
- progressColor="dark:bg-green-600 bg-green-400"
- title={'Flows'}
- steps={[10, 20, 30, 40, 50, 60, 75, 80, 90]}
- barColor="bg-green-700"
- />
- scriptScrollCount + flowScrollCount}
- onClick={() => handleClick(2)}
- progressColor="dark:bg-orange-600 bg-orange-400"
- title={'Apps'}
- steps={[10, 15, 30, 45, 60, 72, 90, 99]}
- barColor="bg-orange-700"
- />
-
- );
+ if (subIndex === undefined) {
+ return (
+
+
handleClick(0)}
+ title={'Scripts'}
+ progressColor="dark:bg-blue-600 bg-blue-400"
+ steps={[20, 40, 50, 60, 70, 80]}
+ barColor="bg-blue-700"
+ />
+ scriptScrollCount}
+ onClick={() => handleClick(1)}
+ progressColor="dark:bg-green-600 bg-green-400"
+ title={'Flows'}
+ steps={[10, 20, 30, 40, 50, 60, 75, 80, 90]}
+ barColor="bg-green-700"
+ />
+ scriptScrollCount + flowScrollCount}
+ onClick={() => handleClick(2)}
+ progressColor="dark:bg-orange-600 bg-orange-400"
+ title={'Apps'}
+ steps={[10, 15, 30, 45, 60, 72, 90, 99]}
+ barColor="bg-orange-700"
+ />
+
+ );
+ } else if (subIndex === 0) {
+ return (
+
+
handleClick(0)}
+ title={'Scripts'}
+ progressColor="dark:bg-blue-600 bg-blue-400"
+ steps={[20, 40, 50, 60, 70, 80]}
+ barColor="bg-blue-700"
+ />
+
+ );
+ } else if (subIndex === 1) {
+ return (
+
+
handleClick(1)}
+ progressColor="dark:bg-green-600 bg-green-400"
+ title={'Flows'}
+ steps={[10, 20, 30, 40, 50, 60, 75, 80, 90]}
+ barColor="bg-green-700"
+ />
+
+ );
+ } else if (subIndex === 2) {
+ return (
+
+
handleClick(2)}
+ progressColor="dark:bg-orange-600 bg-orange-400"
+ title={'Apps'}
+ steps={[10, 15, 30, 45, 60, 72, 90, 99]}
+ barColor="bg-orange-700"
+ />
+
+ );
+ }
}
diff --git a/src/landing/animations/SmoothScroll.tsx b/src/landing/animations/SmoothScroll.tsx
index 55faa589d..91abad983 100644
--- a/src/landing/animations/SmoothScroll.tsx
+++ b/src/landing/animations/SmoothScroll.tsx
@@ -3,7 +3,7 @@ import React, { useEffect, useRef, useState } from 'react';
import ScrollContext from './ScrollContext';
import { flowScrollCount, scriptScrollCount, appScrollCount } from './useAnimateScroll';
-export default function SmoothScrol({ children, onReachEnd, animationEnabled }) {
+export default function SmoothScrol({ children, onReachEnd, animationEnabled, count }) {
const targetRef = useRef(null);
const [hasReachedEnd, setHasReachedEnd] = useState(false);
const { scrollYProgress } = useScroll({
@@ -18,7 +18,9 @@ export default function SmoothScrol({ children, onReachEnd, animationEnabled })
useEffect(() => {
const unsubscribe = scrollYProgress.onChange((value) => {
- if (value >= 0.999 && !hasReachedEnd) {
+ const coef = count === 1 ? 3 : 1;
+
+ if (value * coef >= 0.999 && !hasReachedEnd) {
setHasReachedEnd(true);
onReachEnd();
window.scrollTo({
@@ -53,7 +55,7 @@ export default function SmoothScrol({ children, onReachEnd, animationEnabled })
ref={targetRef}
className="relative max-w-7xl px-4 lg:px-8 mx-auto w-full"
style={{
- height: hasReachedEnd ? '100vh' : 15000
+ height: hasReachedEnd ? '100vh' : 5000 * count
}}
>
-
+
+
{'Develop and iterate with instant feedback'}
-
-
-
-
-
-
+
+
diff --git a/src/pages/flows.jsx b/src/pages/flows.jsx
index 9c882187c..f10eb79a7 100644
--- a/src/pages/flows.jsx
+++ b/src/pages/flows.jsx
@@ -8,7 +8,7 @@ import CallToAction from '../landing/CallToAction';
import LogoClouds from '../landing/LogoClouds';
import RadialBlur from '../landing/RadialBlur';
import HubExamples from '../landing/HubExamples';
-import Window from '../landing/animations/Window';
+import TutorialSection from '../landing/TutorialSection';
const hubExamples = [
{
@@ -66,26 +66,13 @@ export default function FlowPage() {
-
+
{'Develop and iterate with instant feedback'}
-
-
-
-
-
-
+
diff --git a/src/pages/index.js b/src/pages/index.js
index 62650c520..c205b7433 100644
--- a/src/pages/index.js
+++ b/src/pages/index.js
@@ -25,7 +25,7 @@ function HomepageHeader() {
-
+
diff --git a/src/pages/scripts.jsx b/src/pages/scripts.jsx
index 73c958de3..16cfc5492 100644
--- a/src/pages/scripts.jsx
+++ b/src/pages/scripts.jsx
@@ -8,7 +8,7 @@ import CallToAction from '../landing/CallToAction';
import LogoClouds from '../landing/LogoClouds';
import RadialBlur from '../landing/RadialBlur';
import HubExamples from '../landing/HubExamples';
-import Window from '../landing/animations/Window';
+import TutorialSection from '../landing/TutorialSection';
const hubExamples = [
{
@@ -81,26 +81,14 @@ export default function ScriptPage() {
-
+
+
{'Develop and iterate with instant feedback'}
-
-
-
-
-
-
+