-
-
-
-
-
- {/* Add a simple fallback for mobile if video doesn't play */}
-
+ const isMobile = isMobileDevice() // Better mobile detection with more specific scaling
+ let initialScale, finalScale
+ if (isMobile) {
+ // For mobile, use a more appropriate scale based on screen size
+ const screenRatio = window.innerHeight / window.innerWidth
+ initialScale = screenRatio > 1.6 ? 0.4 : 0.6 // Adjust for portrait vs landscape
+ finalScale = Math.max(window.innerWidth / 30, 20) // More controlled final scale
+ } else {
+ initialScale = 1.15
+ finalScale = 15
+ }
- {/* About Section */}
-
-
-
-
-
-
-
- $~ mkdir Computer-Science-Society
-
-
- $~ cat About.txt
-
- The{" "}
-
- Computer Science Society
- , run by the CSE department of
-
- {" "}NIT Silchar
- , aims to impart academic, technical, and socio-cultural awareness
- to the students of our college.
-
+ // Set initial state
+ gsap.set('.vi-mask-group', {
+ scale: initialScale,
+ transformOrigin: 'center center',
+ })
-
-
- $~
- setInput(e.target.value)}
- onKeyDown={handleKeyDown}
- className="bg-transparent outline-none border-none text-lg font-mono text-white w-full caret-cyan-400"
- placeholder="type a command..."
- autoFocus
- />
-
-
-
-

-
-
-
+ // Create the animation
+ animationRef.current = gsap.to('.vi-mask-group', {
+ rotate: 10,
+ scale: finalScale,
+ transformOrigin: '50% 50%',
+ ease: 'none',
+ scrollTrigger: {
+ trigger: '.svg-container',
+ start: 'top top',
+ end: 'bottom top',
+ scrub: true,
+ pin: true,
+ onEnter: () => setShowContent(true),
+ onLeaveBack: () => setShowContent(false),
+ },
+ })
- {/* Announcement Section */}
-
-
+ // Fade out background video gradually when About starts
+ gsap.to('.bg-video', {
+ opacity: 0.5,
+ scrollTrigger: {
+ trigger: '.about',
+ start: 'top center',
+ end: 'top top',
+ scrub: true,
+ },
+ })
-
-
-
-
- {[...Array(30)].map((_, i) => (
-
- {Math.random() > 0.5 ? "1" : "0"}
-
- ))}
-
-
-
+ gsap.to('.chat-launcher', {
+ autoAlpha: 1, // Fades in and handles visibility
+ scale: 1, // Scales it from its default 0.5 to 1
+ duration: 0.5,
+ scrollTrigger: {
+ trigger: '.about', // The element that triggers the animation
+ start: 'top center', // Starts when the top of ".about" hits the viewport center
+ toggleActions: 'play none none reverse', // Fades in on scroll down, fades out on scroll up
+ },
+ })
- {/* Foreground Terminal Box */}
-
- {/* Terminal Header */}
-
-
-
-
-
ANNOUNCEMENTS_TERMINAL
-
+ // Add resize event listener to refresh ScrollTrigger on orientation changes
+ const handleResize = () => {
+ ScrollTrigger.refresh()
+ }
+ window.addEventListener('resize', handleResize)
+ return () => {
+ window.removeEventListener('resize', handleResize)
+ }
+ }, [])
- {/* Terminal Title */}
-
- $~ Announcements
-
-
- {/* Carousel */}
-
-
-
-
-
-
-
-
-
- {/* Pillars Section */}
-
-
- );
+ return (
+
+
+
+
+
+ {/* Add NavbarDemo after the video section */}
+
+ {/* Add a simple fallback for mobile if video doesn't play */}
+
+ {/* About Section */}
+
+
+
+
+
+
+ $~ mkdir{' '}
+ Computer-Science-Society
+
+
+ $~ cat{' '}
+ About.txt
+
+ The
+
+ Computer Science Society
+
+ , run by the CSE department of
+
+ NIT Silchar
+
+ , aims to impart academic, technical, and socio-cultural
+ awareness to the students of our college.
+
+
+
+ $~
+ setInput(e.target.value)}
+ onKeyDown={handleKeyDown}
+ className="bg-transparent outline-none border-none text-lg font-mono text-white w-full caret-cyan-400"
+ placeholder="type a command..."
+ autoFocus
+ />
+
+
+
+

+
+
+
+ {/* Announcement Section */}
+
+
+
+
+
+
+ {[...Array(30)].map((_, i) => (
+
+ {Math.random() > 0.5 ? '1' : '0'}
+
+ ))}
+
+
+
+ {/* Foreground Terminal Box */}
+
+ {/* Terminal Header */}
+
+
+
+
+
+ ANNOUNCEMENTS_TERMINAL
+
+
+ {/* Terminal Title */}
+
+ $~ Announcements
+
+ {/* Carousel */}
+
+
+
+
+
+
+ {/* Pillars Section */}
+
+ )
}
-export default Home;
-
+export default Home
diff --git a/src/pages/Wings.jsx b/src/pages/Wings.jsx
index 0d71996..400c50f 100644
--- a/src/pages/Wings.jsx
+++ b/src/pages/Wings.jsx
@@ -1,47 +1,46 @@
-"use client";
-import { useScroll, useTransform, motion, useInView } from "framer-motion";
-import React, { useEffect, useRef, useState } from "react";
-import { SparklesCore } from "../components/ui/sparkles";
+'use client'
+import { useScroll, useTransform, motion } from 'framer-motion'
+import React, { useEffect, useRef, useState } from 'react'
+import { SparklesCore } from '../components/ui/sparkles'
const Wings = () => {
- const ref = useRef(null);
- const containerRef = useRef(null);
- const [height, setHeight] = useState(0);
- const [activeTerminal, setActiveTerminal] = useState(null);
- const [scrollDirection, setScrollDirection] = useState("down");
- const terminalRefs = useRef([]);
- const lastScrollY = useRef(0);
+ const ref = useRef(null)
+ const containerRef = useRef(null)
+ const [height, setHeight] = useState(0)
+ const [activeTerminal, setActiveTerminal] = useState(null)
+ const [scrollDirection, setScrollDirection] = useState('down')
+ const lastScrollY = useRef(0)
useEffect(() => {
if (ref.current) {
- const rect = ref.current.getBoundingClientRect();
- setHeight(rect.height);
+ const rect = ref.current.getBoundingClientRect()
+ setHeight(rect.height)
}
- }, [ref]);
+ }, [ref])
// Track scroll direction
useEffect(() => {
const handleScroll = () => {
- const currentScrollY = window.scrollY;
+ const currentScrollY = window.scrollY
if (currentScrollY > lastScrollY.current) {
- setScrollDirection("down");
+ setScrollDirection('down')
} else if (currentScrollY < lastScrollY.current) {
- setScrollDirection("up");
+ setScrollDirection('up')
}
- lastScrollY.current = currentScrollY;
- };
+ lastScrollY.current = currentScrollY
+ }
- window.addEventListener("scroll", handleScroll, { passive: true });
- return () => window.removeEventListener("scroll", handleScroll);
- }, []);
+ window.addEventListener('scroll', handleScroll, { passive: true })
+ return () => window.removeEventListener('scroll', handleScroll)
+ }, [])
const { scrollYProgress } = useScroll({
target: containerRef,
- offset: ["start 10%", "end 50%"],
- });
+ offset: ['start 10%', 'end 50%'],
+ })
- const heightTransform = useTransform(scrollYProgress, [0, 1], [0, height]);
- const opacityTransform = useTransform(scrollYProgress, [0, 0.1], [0, 1]);
+ const heightTransform = useTransform(scrollYProgress, [0, 1], [0, height])
+ const opacityTransform = useTransform(scrollYProgress, [0, 0.1], [0, 1])
// Font definitions for each wing
const wingFonts = [
@@ -52,112 +51,115 @@ const Wings = () => {
"font-bold font-['Goldman']", // PR Wing
"font-bold font-['Goldman']", // Design Wing
"font-bold font-['Goldman']", // Literature Wing
- ];
+ ]
- // Icons for each wing
- const wingIcons = [
- "👑", // Executive Wing - crown
- "💻", // Dev Wing - laptop
- "⚡", // CP Wing - lightning bolt
- "🤖", // ML Wing - robot
- "📢", // PR Wing - megaphone
- "🎨", // Design Wing - artist palette
- "📚", // Literature Wing - books
- ];
+ // Emojis for each wing
+ const wingImages = [
+ '👑', // Executive Wing
+ '💻', // Dev Wing
+ '🧠', // CP Wing
+ '🤖', // ML Wing
+ '📢', // PR Wing
+ '🎨', // Design Wing
+ '📝', // Literature Wing
+ ]
// Animation variants for timeline markers
- // Update your marker variants
-const markerVariants = {
- hidden: { scale: 0, opacity: 0 },
- visible: {
- scale: 1,
- opacity: 1,
- transition: {
- type: "spring",
- stiffness: 300,
- damping: 15,
- delay: 0.2
- }
- },
- active: {
- scale: 1.3,
- boxShadow: "0 0 20px rgba(34, 211, 238, 0.8)",
- transition: {
- duration: 0.3,
- repeat: Infinity,
- repeatType: "reverse"
- }
- }
-};
-
-// Add connection lines between markers
-const connectionVariants = {
- hidden: { scaleY: 0, opacity: 0 },
- visible: {
- scaleY: 1,
- opacity: 1,
- transition: {
- duration: 0.8,
- ease: "easeOut"
- }
+ const markerVariants = {
+ hidden: { scale: 0, opacity: 0 },
+ visible: {
+ scale: 1,
+ opacity: 1,
+ transition: {
+ type: 'spring',
+ stiffness: 300,
+ damping: 15,
+ delay: 0.2,
+ },
+ },
+ active: {
+ scale: 1.3,
+ boxShadow: '0 0 20px rgba(34, 211, 238, 0.8)',
+ transition: {
+ duration: 0.3,
+ repeat: Infinity,
+ repeatType: 'reverse',
+ },
+ },
}
-};
// Animation variants for terminal entries
const terminalVariants = {
- hidden: {
- opacity: 0,
- y: scrollDirection === "down" ? 50 : -50,
- rotateX: -15
+ hidden: {
+ opacity: 0,
+ y: scrollDirection === 'down' ? 50 : -50,
+ rotateX: -15,
},
- visible: {
- opacity: 1,
+ visible: {
+ opacity: 1,
y: 0,
rotateX: 0,
- transition: {
- duration: 0.8,
- ease: "easeOut",
- staggerChildren: 0.1
- }
- }
- };
+ transition: {
+ duration: 0.8,
+ ease: 'easeOut',
+ staggerChildren: 0.1,
+ },
+ },
+ }
// Terminal content animation
const contentVariants = {
- hidden: { opacity: 0, y: scrollDirection === "down" ? 20 : -20 },
- visible: {
- opacity: 1,
+ hidden: { opacity: 0, y: scrollDirection === 'down' ? 20 : -20 },
+ visible: {
+ opacity: 1,
y: 0,
- transition: { duration: 0.5 }
- }
- };
+ transition: { duration: 0.5 },
+ },
+ }
+
+ // Header animation
+ const headerVariants = {
+ hidden: { opacity: 0, scale: 0.8 },
+ visible: {
+ opacity: 1,
+ scale: 1,
+ transition: {
+ duration: 0.8,
+ ease: 'easeOut',
+ delay: 0.2,
+ },
+ },
+ }
// Data for the 7 wings of the Computer Science Society
const wingsData = [
{
- title: "Executive Wing",
+ title: 'Executive Wing',
content: (
-