Merge pull request #18 from JBB0807/homepage-2nd-sprint

Homepage 2nd sprint
This commit is contained in:
JB Balahadia 2025-05-07 14:00:05 -07:00 committed by GitHub
commit f7cae6fe34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 412 additions and 100 deletions

View file

@ -5,6 +5,9 @@ import { Link } from "react-router-dom";
const authUrl = import.meta.env.VITE_AUTH_URL;
// Using URL reference for ByteCamp logo
const bytecampLogo = "/images/bytecamp.png";
const Navbar = () => {
const [glitchEffect, setGlitchEffect] = useState(false);
const [activeLink, setActiveLink] = useState("/");
@ -74,8 +77,13 @@ const Navbar = () => {
>
<div className="navbar__logo">
<div className="navbar__logo-scanner"></div>
<img
src={bytecampLogo}
alt="ByteCamp Logo"
style={{ height: "40px", marginRight: "10px" }}
/>
<span className="navbar__logo-text">
BATTLE<span className="navbar__logo-text">SNAKE</span>
BYTE<span className="navbar__logo-text">CAMP</span>
</span>
</div>

View file

@ -1,29 +1,55 @@
import React from 'react';
import '../scss/components/Services.scss';
import ServiceCard from '../components/ServicesCard.jsx';
import React from "react";
import "../scss/components/_services.scss";
import ServiceCard from "../components/ServicesCard.jsx";
import { FaYoutube } from "react-icons/fa";
import battlesnakeLogo from "../../public/images/battlesnake.png";
import bytecampLogo from "../../public/images/bytecamp.png";
// // Using URL references for public assets instead of direct imports
// const battlesnakeLogo = "/images/battlesnake.png";
// const bytecampLogo = "/images/bytecamp.png";
function Services() {
return (
<section className="services">
<h2>Develop your own algorithm to find food, stay alive, and eliminate others. Battlesnakes are controlled by a web server you deploy, running the code you write.</h2>
<h2>
Develop your own algorithm to find food, stay alive, and eliminate
others. Battlesnakes are controlled by a web server you deploy, running
the code you write.
</h2>
<div className="cards">
<ServiceCard
icon="🖥️"
icon={
<img
src={battlesnakeLogo}
alt="BattleSnake Logo"
style={{ width: "100px", height: "100px" }}
/>
}
title="What is Battlesnake?"
desc="Battlesnake is a competitive game where your code is the controller. All you need is a web server that responds to the Battlesnake API."
cta="What how it works"
cta="How it works?"
link="https://docs.battlesnake.com/"
/>
<ServiceCard
icon="🏆"
title="Leaderboard"
desc="Choose your tech stack, deploy your Battlesnake, and see how your code ranks against other developers."
cta="Check the leaderboard"
icon={<FaYoutube style={{ color: "#FF0000", fontSize: "5rem" }} />}
title="Tutorial"
desc="Learn how to create your first Battlesnake with an easy-to-follow video guide to get you started quickly."
cta="Watch tutorial"
link="https://www.youtube.com/watch?v=IA7CeGRfuNE"
/>
<ServiceCard
icon="💡"
title="Try new languages and technologies in a high-stakes environment."
desc="Battlesnake is a great outlet to learn something new and mess around with that platform, language, or library you've been meaning to try"
cta="Learn more"
icon={
<img
src={bytecampLogo}
alt="ByteCamp Logo"
style={{ width: "100px", height: "100px" }}
/>
}
title="Are you ready to start?"
desc="Join ByteCamp coding bootcamp and start learning Battlesnake today!"
cta="Register here"
link="https://www.bytecamp.ca/#r"
/>
</div>
</section>

View file

@ -1,14 +1,95 @@
import React from 'react';
import '../scss/components/ServicesCard.scss';
// src/components/ServicesCard.jsx
import React from "react";
import { motion, useInView, useAnimation } from "framer-motion";
import { useRef, useEffect } from "react";
import "../scss/components/_servicesCard.scss";
function ServiceCard({ icon, title, desc, cta, link = "#", index = 0 }) {
const ref = useRef(null);
const isInView = useInView(ref, { once: true, amount: 0.8 });
const controls = useAnimation();
useEffect(() => {
if (isInView) {
controls.start("visible");
}
}, [isInView, controls]);
// Different animation variants based on the card index for a staggered effect
const getVariants = () => {
// Alternate between slide-in directions based on index
const direction = index % 2 === 0 ? 1 : -1;
return {
hidden: {
opacity: 0,
x: 60 * direction,
y: 20,
},
visible: {
opacity: 1,
x: 0,
y: 0,
transition: {
type: "spring",
duration: 0.8,
delay: index * 0.2, // Stagger effect based on index
damping: 15,
stiffness: 100,
},
},
};
};
function ServiceCard({ icon, title, desc, cta }) {
return (
<div className="service-card">
<div className="icon">{icon}</div>
<h3>{title}</h3>
<motion.div
ref={ref}
className="service-card"
variants={getVariants()}
initial="hidden"
animate={controls}
>
<div className="card-border"></div>
<div className="card-glow"></div>
<motion.div
className="icon"
whileHover={{
scale: 1.2,
color: "#ff2a6d",
textShadow: "0 0 10px #ff2a6d",
}}
transition={{ type: "spring", stiffness: 300 }}
>
{icon}
</motion.div>
<motion.h3
whileHover={{
scale: 1.05,
color: "#05d9e8",
textShadow: "0 0 8px rgba(5, 217, 232, 0.7)",
}}
>
{title}
</motion.h3>
<p>{desc}</p>
<a href="#" className="link">{cta} </a>
</div>
<motion.a
href={link}
className="link"
target="_blank"
rel="noopener noreferrer"
whileHover={{
x: 5,
color: "#ff2a6d",
transition: { type: "spring", stiffness: 500 },
}}
>
{cta}
</motion.a>
</motion.div>
);
}

View file

@ -2,7 +2,6 @@ import React from "react";
function SignUpForm() {
const authUrl = import.meta.env.VITE_AUTH_URL;
const [state, setState] = React.useState({
name: "",
email: "",
@ -33,7 +32,6 @@ function SignUpForm() {
};
const googleAuth = () => {
window.open(`${authUrl}/auth/google`, "_self");
};

View file

@ -1,26 +0,0 @@
.services {
padding: 5rem 3rem;
// background-image: url("../../../public/images/grid-background-3.png");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
h2 {
font-size: 2.5rem;
font-weight: 900;
text-align: center;
margin-bottom: 3rem;
color: #fff;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
background-color: rgba(0, 0, 0, 0.5);
padding: 1.5rem;
border-radius: 10px;
}
.cards {
display: flex;
justify-content: space-between;
gap: 2rem;
}
}

View file

@ -1,32 +0,0 @@
.service-card {
background-color: #fff;
border: 2px solid #000;
border-radius: 1rem;
padding: 2rem;
box-shadow: 6px 6px 0 #000;
flex: 1;
.icon {
font-size: 2.5rem;
margin-bottom: 1rem;
}
h3 {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 1rem;
}
p {
font-size: 1rem;
line-height: 1.6;
margin-bottom: 1.5rem;
}
.link {
font-weight: bold;
text-decoration: none;
color: #202020;
}
}

View file

@ -93,7 +93,7 @@ $cyber-black: #1a1a1a;
margin-top: 0;
background-color: $dark-bg;
overflow: hidden;
// Matrix digital rain canvas
.matrix-rain {
position: absolute;
@ -154,7 +154,7 @@ $cyber-black: #1a1a1a;
padding: 2rem;
// Add a subtle backdrop filter to make content more readable against the matrix rain
backdrop-filter: blur(2px);
@media (max-width: 768px) {
flex-direction: column-reverse;
gap: 2rem;
@ -169,34 +169,37 @@ $cyber-black: #1a1a1a;
align-items: flex-start;
justify-content: center;
padding-right: 2rem;
@media (max-width: 768px) {
align-items: center;
text-align: center;
padding-right: 0;
}
}
// Title styling
&-title {
font-size: 3.5rem;
font-size: 5rem;
font-weight: bold;
color: white;
margin-bottom: 1rem;
letter-spacing: 4px;
text-shadow: 0 0 10px rgba($neon-blue, 0.7);
text-shadow: 0 0 10px rgba($neon-blue, 0.7), 0 0 20px rgba($neon-blue, 0.7),
0 0 30px rgba($neon-blue, 0.7);
animation: flicker 3s infinite alternate;
&-highlight {
font-size: 5rem;
color: $neon-pink;
text-shadow: 0 0 10px rgba($neon-pink, 0.7);
text-shadow: 0 0 10px rgba($neon-pink, 0.7),
0 0 20px rgba($neon-pink, 0.7), 0 0 30px rgba($neon-pink, 0.7);
}
@media (max-width: 768px) {
font-size: 2.5rem;
font-size: 5rem;
}
}
// Subtitle styling
&-subtitle {
font-size: 1.2rem;
@ -205,12 +208,12 @@ $cyber-black: #1a1a1a;
max-width: 500px;
line-height: 1.6;
letter-spacing: 1px;
@media (max-width: 768px) {
font-size: 1rem;
}
}
// Logo styling
&-logo-container {
position: relative;
@ -219,7 +222,7 @@ $cyber-black: #1a1a1a;
justify-content: center;
align-items: center;
max-width: 50%;
@media (max-width: 768px) {
max-width: 80%;
margin-bottom: 1rem;
@ -231,7 +234,7 @@ $cyber-black: #1a1a1a;
height: auto;
border-radius: 8px;
filter: drop-shadow(0 0 10px rgba($neon-blue, 0.7))
drop-shadow(0 0 20px rgba($neon-purple, 0.5));
drop-shadow(0 0 20px rgba($neon-purple, 1));
animation: pulse 4s ease-in-out infinite;
z-index: 2;
}
@ -317,7 +320,7 @@ $cyber-black: #1a1a1a;
left: 0;
width: 100%;
height: 100%;
background-color: rgba($neon-pink, 0.2);
background-color: rgba($neon-pink, 0.5);
opacity: 0;
z-index: 1;

View file

@ -7,7 +7,7 @@ $dark-bg: #0d0221;
$cyber-black: #1a1a1a;
// Breakpoints
$mobile-breakpoint: 768px;
$mobile-breakpoint: 1160px;
@keyframes scanline {
0% {
@ -202,6 +202,7 @@ $mobile-breakpoint: 768px;
background-color: rgba($dark-bg, 0.7);
&-text {
font-size: 1.2rem;
color: white;
letter-spacing: 2px;
animation: neon-flicker 5s infinite alternate;

View file

@ -0,0 +1,77 @@
// Services.scss
$neon-pink: #ff2a6d;
$neon-blue: #05d9e8;
$neon-purple: #d300c5;
$neon-yellow: #f7f500;
$dark-bg: #0d0221;
$cyber-black: #1a1a1a;
@keyframes gridMovement {
0% {
background-position: 0 0;
}
100% {
background-position: 0 25px;
}
}
.services {
padding: 5rem 3rem;
background-color: $dark-bg;
position: relative;
overflow: hidden;
// Grid background effect
.grid-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: linear-gradient(
rgba($neon-blue, 0.1) 1px,
transparent 1px
),
linear-gradient(90deg, rgba($neon-blue, 0.1) 1px, transparent 1px);
background-size: 25px 25px;
z-index: 0;
opacity: 0.3;
pointer-events: none;
animation: gridMovement 15s linear infinite;
}
.services-heading {
font-size: 2rem;
font-weight: 700;
text-align: center;
margin-bottom: 4rem;
color: white;
text-shadow: 0 0 10px rgba($neon-pink, 0.5);
position: relative;
z-index: 1;
max-width: 900px;
margin-left: auto;
margin-right: auto;
// Responsive font size
@media (max-width: 768px) {
font-size: 1.5rem;
margin-bottom: 2.5rem;
}
}
.cards-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
position: relative;
z-index: 1;
max-width: 1200px;
margin: 0 auto;
// Stack cards on small screens
@media (max-width: 768px) {
grid-template-columns: 1fr;
}
}
}

View file

@ -0,0 +1,115 @@
// ServicesCard.scss
$neon-pink: #ff2a6d;
$neon-blue: #05d9e8;
$neon-purple: #d300c5;
$neon-yellow: #f7f500;
$dark-bg: #0d0221;
$cyber-black: #1a1a1a;
@keyframes scanline {
0% {
transform: translateY(-100%);
}
100% {
transform: translateY(100%);
}
}
@keyframes borderGlow {
0% {
box-shadow: 0 0 5px $neon-pink;
}
50% {
box-shadow: 0 0 15px $neon-pink, 0 0 25px $neon-pink;
}
100% {
box-shadow: 0 0 5px $neon-pink;
}
}
.service-card {
position: relative;
background-color: $cyber-black;
border-radius: 4px;
padding: 2rem;
color: white;
margin-bottom: 20px;
overflow: hidden;
border: 1px solid rgba($neon-pink, 0.5);
box-shadow: 0 0 10px rgba($neon-pink, 0.3);
width: 100%;
// The card border effect
.card-border {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
opacity: 0;
transition: opacity 0.5s ease;
}
// Scanline effect
.card-glow {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, $neon-pink, transparent);
animation: scanline 2s linear infinite;
opacity: 0;
transition: opacity 0.5s ease;
}
&:hover {
animation: borderGlow 1.5s infinite;
border-color: $neon-pink;
.card-border {
opacity: 1;
}
.card-glow {
opacity: 0.7;
}
}
.icon {
font-size: 2.5rem;
margin-bottom: 1rem;
transition: color 0.3s ease, text-shadow 0.3s ease;
}
h3 {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 1rem;
letter-spacing: 1px;
color: white;
transition: color 0.3s ease, text-shadow 0.3s ease;
}
p {
font-size: 1rem;
line-height: 1.6;
margin-bottom: 1.5rem;
color: #aaa;
}
.link {
font-weight: bold;
text-decoration: none;
color: white;
transition: color 0.3s ease;
display: inline-block;
letter-spacing: 0.5px;
position: relative;
&:hover {
color: $neon-pink;
}
}
}