Skip to content

Commit 823c8a2

Browse files
authored
Merge pull request #34 from Abh1noob/master
feat: added scrollto action
2 parents cd32ece + 2937f51 commit 823c8a2

File tree

5 files changed

+43
-7
lines changed

5 files changed

+43
-7
lines changed

devsoc24-landing/src/components/about.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const About = () => {
4848
return (
4949
<>
5050
{showOriginal && (
51-
<div className={`overlay_about overflow-hidden`}>
5251
<div className=" font-disket min-w-screen relative h-fit overflow-hidden bg-[#020202] px-2 text-center text-[35px] font-black text-[#9CE79ACC] md:px-10 md:text-[100px]">
5352
<span className="relative block">DEVSOC’24</span>
5453
&nbsp; ignites the tech scene with a blaze of innovation, where
@@ -92,15 +91,14 @@ const About = () => {
9291
Join the fray as we smash barriers and redefine what&apos;s
9392
possible.
9493
</div>
95-
</div>
9694
)}
9795
{showGlitchImage && (
9896
<Image
9997
src={glitch}
10098
alt="glitch"
10199
height={0}
102100
width={0}
103-
className="absolute -z-10 min-h-screen w-screen"
101+
className="absolute z-50 min-h-screen w-screen"
104102
/>
105103
)}
106104
{showGlitch && (
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"use client";
2+
import { motion } from "framer-motion";
3+
import styles from "@/styles/btnToPortal.module.css";
4+
import Image from "next/image";
5+
import type { StaticImport } from "next/dist/shared/lib/get-img-props";
6+
import DSLogo from "@/assets/images/DSLogo.svg";
7+
8+
const ActionButton = (props: { link: string; body: string }) => {
9+
return (
10+
<>
11+
<motion.a
12+
href={props.link}
13+
className={`${styles.btn} font-disket px-3 py-1 text-xl tracking-tighter`}
14+
whileHover={{ backgroundPosition: "-100%,100%" }}
15+
>
16+
{props.body}
17+
</motion.a>
18+
</>
19+
);
20+
};
21+
22+
export default ActionButton;

devsoc24-landing/src/components/footer.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ import Image from "next/image";
33
import pattern from "@/assets/images/pattern.svg";
44
import glitch from "@/assets/images/footer_glitch.gif";
55
import Link from "next/link";
6+
import { useLenis } from "@studio-freight/react-lenis";
67

78
const Footer = () => {
9+
const lenis = useLenis(({ scroll }) => {
10+
// console.log(scroll);
11+
});
12+
813
return (
914
<>
1015
<Image
@@ -33,7 +38,12 @@ const Footer = () => {
3338
width={0}
3439
className="w-[100%]"
3540
/>
36-
<div className="font-vcr absolute right-0 flex h-[100%] w-fit items-center justify-center border-l-2 border-black bg-[#7F32DA] p-1 hover:cursor-pointer hover:bg-black hover:text-white">
41+
<div
42+
className="font-vcr absolute right-0 flex h-[100%] w-fit items-center justify-center border-l-2 border-black bg-[#7F32DA] p-1 hover:cursor-pointer hover:bg-black hover:text-white"
43+
onClick={() =>
44+
lenis?.scrollTo("#Main", { lerp: 0.1, duration: 1 })
45+
}
46+
>
3747
X
3848
</div>
3949
</div>

devsoc24-landing/src/components/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function Main() {
6868
}, []);
6969
return (
7070
<>
71-
<motion.div style={{ y: -y }}>
71+
<motion.div style={{ y: -y }} className="">
7272
<div style={{ opacity: scrollOpacity }}>
7373
<div className={className}>
7474
<Image src={glitch as StaticImageData} alt="glitch" fill />
@@ -177,7 +177,7 @@ function Main() {
177177
</div>
178178
</div>
179179
</motion.div>
180-
<motion.div style={{ y: y }} className="relative z-50">
180+
<motion.div style={{ y: y }} className="relative z-30">
181181
<div className="flex h-[1000px] items-center justify-center overflow-hidden bg-[#020202]">
182182
<div className="bg-logo font-disket overflow-hidden bg-[#020202]">
183183
<motion.span style={{ y: y }} className="relative block">

devsoc24-landing/src/pages/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import Timeline from "@/components/Timeline";
22
import About from "@/components/about";
3+
import ActionButton from "@/components/actionButton";
34
import Main from "@/components/main";
45
import SmoothScrolling from "@/components/smoothscrolling";
56

67
export default function Home() {
78
return (
89
<>
910
<SmoothScrolling>
10-
<Main />
11+
<section id="Main">
12+
<Main />
13+
</section>
1114

1215
<About />
16+
<div className="fixed bottom-0 z-40 mb-10 flex w-full justify-center">
17+
<ActionButton body="Kuch toh" link="/" />
18+
</div>
1319
</SmoothScrolling>
1420
</>
1521
);

0 commit comments

Comments
 (0)