Skip to content
Merged
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: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"start": "next start"
},
"dependencies": {
"@popmotion/popcorn": "^0.4.4",
"classnames": "2.2.6",
"date-fns": "2.10.0",
"framer-motion": "^2.9.4",
"gray-matter": "4.0.2",
"next": "latest",
"react": "^16.13.0",
Expand Down
1 change: 0 additions & 1 deletion pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import "../styles/reset.css";
import "../styles/index.css";
import "../styles/main.css";

export default function MyApp({ Component, pageProps }) {
Expand Down
4 changes: 2 additions & 2 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import Intro from "../components/intro";
import Layout from "../components/layout";
import { getAllPosts } from "../lib/api";
import Head from "next/head";
import { CMS_NAME } from "../lib/constants";

import { CallToAction, Blog } from "../sections";
import { CallToAction, Blog, Services } from "../sections";

export default function Index({ allPosts }) {
return (
Expand All @@ -19,6 +18,7 @@ export default function Index({ allPosts }) {
<Container>
<Intro />
</Container>
<Services />
<Blog posts={allPosts} />
<CallToAction />
</Layout>
Expand Down
143 changes: 143 additions & 0 deletions sections/Services/Services.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
import { useState } from "react";

import { motion, AnimatePresence } from "framer-motion";
import { wrap } from "@popmotion/popcorn";

import styles from "./Services.module.css";
import data from "./ServicesData";

const Slideshow = () => {
const [[panel, direction], setPanel] = useState([0, 0]);
const testData = ["test", "sample", "other"];
const index = wrap(0, testData.length, panel);

const paginate = (newDirection) => {
setPanel([panel + newDirection, newDirection]);
};

const variants = {
enter: (direction) => {
return {
x: direction > 0 ? 1000 : -1000,
opacity: 0,
};
},
center: {
zIndex: 1,
x: 0,
opacity: 1,
},
exit: (direction) => {
return {
zIndex: 0,
x: direction < 0 ? 1000 : -1000,
opacity: 0,
};
},
};

const swipeConfidenceThreshold = 10000;
const swipePower = (offset, velocity) => {
return Math.abs(offset) * velocity;
};

return (
<div style={{ position: "relative" }}>
<AnimatePresence initial={false} custom={direction}>
<motion.div
style={{
height: 400,
background: "blue",
width: "100%",
position: "absolute",
top: 0,
left: 0,
}}
key={panel}
drag="x"
dragElastic={1}
variants={variants}
initial="enter"
animate="center"
exit="exit"
transition={{
x: { type: "spring", stiffness: 300, damping: 30 },
opacity: { duration: 0.2 },
}}
onDragEnd={(e, { offset, velocity }) => {
const swipe = swipePower(offset.x, velocity.x);

if (swipe < -swipeConfidenceThreshold) {
paginate(1);
} else if (swipe > swipeConfidenceThreshold) {
paginate(-1);
}
}}
>
{testData[index]}
</motion.div>
</AnimatePresence>

<div className="next" onClick={() => paginate(1)}>
{"‣"}
</div>
<div className="prev" onClick={() => paginate(-1)}>
{"‣"}
</div>
</div>
);
};

export default function Services() {
const [panel, setActivePanel] = useState(0);

const displayPanel = (key) => {
return (
<div className={styles.servicesContainer}>
<div className={styles.service}>
<div className={styles.summaryContainer}>
<div className={styles.summary}>
<h4>{data[key].title}</h4>
<p>{data[key].summary}</p>
</div>
</div>
<div className={styles.details}>
{data[key].details.map((item) => (
<>
<h4>{item.title}</h4>
<ul>
{item.points.map((point) => (
<li>{point}</li>
))}
</ul>
</>
))}
</div>
</div>
</div>
);
};
return (
<section className={styles.container}>
<div className={styles.title}>
<h1>Services</h1>
<p>
We always bring our “A” game to all projects! With our swift delivery
method, you’ll be part of the building process, and you’ll be aware of
every step taken, to ensure optimum satisfaction.
</p>
</div>
<div className={styles.buttonGroup}>
<button className={styles.active} onClick={() => setActivePanel(0)}>
Product Planning
</button>
<button onClick={() => setActivePanel(1)}>Product Development</button>
<button onClick={() => setActivePanel(2)}>Product Launch</button>
<button onClick={() => setActivePanel(3)}>Product Scaling</button>
</div>
{displayPanel(panel)}

<Slideshow />
</section>
);
}
76 changes: 76 additions & 0 deletions sections/Services/Services.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
.container {
--textColor: var(--white);
--hColor: var(--white);
background: linear-gradient(0.3turn, var(--pink) 30%, var(--blue));
padding: 40px 0 350px;
margin-bottom: -350px;
}

.title {
padding: 40px 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.title > p {
text-align: center;
}

.buttonGroup {
display: flex;
justify-content: center;
margin-bottom: 40px;
}

.buttonGroup > button {
background: rgba(255, 255, 255, 0);
border-radius: 0;
border: 2px solid white;
font-size: 1.2rem;
width: 250px;
}

.buttonGroup > button:first-of-type {
border-radius: 50px 0 0 50px;
}

.buttonGroup > button:last-of-type {
border-radius: 0 50px 50px 0;
}

.buttonGroup > .active {
background: var(--white);
color: var(--purple);
}

.servicesContainer {
display: flex;
justify-content: center;
}

.service {
display: grid;
grid-template-columns: 1fr 1fr;
}

.summaryContainer {
display: flex;
align-items: center;
}

.summary {
background: #210d37;
padding: 100px 40px 40px;
border-radius: 50px 0 0 50px;
}

.details {
--textColor: var(--black);
--hColor: var(--black);
background: var(--white);
border-radius: 20px;
min-height: 400px;
padding: 20px;
}
96 changes: 96 additions & 0 deletions sections/Services/ServicesData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
const panels = [
{
title: "Product Planning",
summary:
"Planning is crucial to a successful product build and launch. Our job in this step is to help your product vision become clear and easy to communicate. From thinking about the user experience to building an entire visual language for your product.",
details: [
{
title: "Definition",
points: [
"User definition and audience profiling",
"User flow creation",
"UX research and analysis",
],
},
{
title: "Definition",
points: [
"User definition and audience profiling",
"User flow creation",
"UX research and analysis",
],
},
],
},
{
title: "Product Development",
summary:
"Planning is crucial to a successful product build and launch. Our job in this step is to help your product vision become clear and easy to communicate. From thinking about the user experience to building an entire visual language for your product.",
details: [
{
title: "Definition",
points: [
"User definition and audience profiling",
"User flow creation",
"UX research and analysis",
],
},
{
title: "Definition",
points: [
"User definition and audience profiling",
"User flow creation",
"UX research and analysis",
],
},
],
},
{
title: "Product Launch",
summary:
"Planning is crucial to a successful product build and launch. Our job in this step is to help your product vision become clear and easy to communicate. From thinking about the user experience to building an entire visual language for your product, Planning is crucial to a successful product build and launch. Our job in this step is to help your product vision become clear and easy to communicate. From thinking about the user experience to building an entire visual language for your product.",
details: [
{
title: "Definition",
points: [
"User definition and audience profiling",
"User flow creation",
"UX research and analysis",
],
},
{
title: "Definition",
points: [
"User definition and audience profiling",
"User flow creation",
"UX research and analysis",
],
},
],
},
{
title: "Product Scaling",
summary:
"Planning is crucial to a successful product build and launch. Our job in this step is to help your product vision become clear and easy to communicate. From thinking about the user experience to building an entire visual language for your product.",
details: [
{
title: "Definition",
points: [
"User definition and audience profiling",
"User flow creation",
"UX research and analysis",
],
},
{
title: "Definition",
points: [
"User definition and audience profiling",
"User flow creation",
"UX research and analysis",
],
},
],
},
];

export default panels;
1 change: 1 addition & 0 deletions sections/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { default as CallToAction } from "./CallToAction/CallToAction";
export { default as Blog } from "./Blog/Blog";
export { default as Services } from "./Services/Services";
15 changes: 0 additions & 15 deletions styles/index.css

This file was deleted.

Loading