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
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
<meta name="twitter:title" content="Python Cameroon" />
<meta name="twitter:description" content="Welcome to the Python Cameroon Community - a vibrant and supportive space for individuals passionate about Python programming." />
<meta name="twitter:image" content="./src/assets/opengraph/og-image.png" />

<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DotGothic16&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
</head>

<body>
Expand Down
116 changes: 65 additions & 51 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,57 +69,71 @@

/* *=========== Green theme =========== */
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 142.1 76.2% 36.3%;
--primary-foreground: 355.7 100% 97.3%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 240 5.9% 90%;
--input: 240 5.9% 90%;
--ring: 142.1 76.2% 36.3%;
--radius: 0.5rem;
}

.dark {
--background: 20 14.3% 4.1%;
--foreground: 0 0% 95%;
--card: 24 9.8% 10%;
--card-foreground: 0 0% 95%;
--popover: 0 0% 9%;
--popover-foreground: 0 0% 95%;
--primary: 142.1 70.6% 45.3%;
--primary-foreground: 144.9 80.4% 10%;
--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;
--muted: 0 0% 15%;
--muted-foreground: 240 5% 64.9%;
--accent: 12 6.5% 15.1%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 85.7% 97.3%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 142.4 71.8% 29.2%;
}
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 166, 95%, 29%;
--primary-foreground: 355.7 100% 97.3%;
--secondary: 50, 96%, 59%;
--secondary-foreground: 240 5.9% 10%;
--muted: 50, 96%, 59%;
--muted-foreground: 240 3.8% 46.1%;
--accent: 50, 96%, 59%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 240 5.9% 90%;
--input: 240 5.9% 90%;
--ring: 142.1 76.2% 36.3%;
--radius: 0.5rem;

/* Fonts */
--font-dotgothic16: "DotGothic16", sans-serif;
--font-space-mono: "Space Mono", monospace;
}

.dark {
--background: 20 14.3% 4.1%;
--foreground: 0 0% 95%;
--card: 24 9.8% 10%;
--card-foreground: 0 0% 95%;
--popover: 0 0% 9%;
--popover-foreground: 0 0% 95%;
--primary: 166, 95%, 29%;
--primary-foreground: 144.9 80.4% 10%;
--secondary: 50, 96%, 59%;
--secondary-foreground: 0 0% 98%;
--muted: 0 0% 15%;
--muted-foreground: 240 5% 64.9%;
--accent: 12 6.5% 15.1%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 85.7% 97.3%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 142.4 71.8% 29.2%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
* {
@apply border-border;
}

body {
@apply bg-background text-foreground font-space-mono;
}

h1,
h2,
h3,
h4,
h5,
h6 {
@apply font-dotgothic16;
}
}
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {ScrollToTop} from "@/components/ScrollToTop";
import {Services} from "@/containers/Services";
import {Sponsors} from "@/containers/Sponsors";
import {Team} from "@/containers/Team";
import {Applications} from "@/containers/Testimonials";
import {Applications} from "@/containers/Applications";
import "./App.css";


Expand Down
Binary file added src/assets/images/flag-cameroon.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// logo
import logoLight from "./logo/light.svg";
import logoDark from "./logo/dark.svg";

// Images
import cameroonFlag from "./images/flag-cameroon.webp";

export { logoLight, logoDark, cameroonFlag };
112 changes: 112 additions & 0 deletions src/components/HeroNetwork.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import { useEffect, useRef } from "react";

const COLORS = ["#fcd116", "#ce1126", "#009a44", "#ffffff"];
const NODE_COUNT = 70;
const MAX_DIST = 130;

interface Node {
x: number;
y: number;
vx: number;
vy: number;
r: number;
color: string;
opacity: number;
}

const hexAlpha = (hex: string, alpha: number): string =>
hex + Math.floor(alpha * 255).toString(16).padStart(2, "0");

export default function HeroNetwork() {
const canvasRef = useRef<HTMLCanvasElement>(null);

useEffect(() => {
const canvas = canvasRef.current;
if (!canvas) return;

const ctx = canvas.getContext("2d");
if (!ctx) return;

let animId: number;
let nodes: Node[] = [];

const initNodes = () => {
nodes = Array.from({ length: NODE_COUNT }, () => ({
x: Math.random() * canvas.width,
y: Math.random() * canvas.height,
vx: (Math.random() - 0.5) * 0.4,
vy: (Math.random() - 0.5) * 0.4,
r: Math.random() * 2 + 1,
color: COLORS[Math.floor(Math.random() * COLORS.length)],
opacity: Math.random() * 0.5 + 0.25,
}));
};

const resize = () => {
canvas.width = canvas.offsetWidth;
canvas.height = canvas.offsetHeight;
initNodes();
};

const draw = () => {
const { width: W, height: H } = canvas;
ctx.clearRect(0, 0, W, H);

for (const n of nodes) {
n.x += n.vx;
n.y += n.vy;
if (n.x < 0 || n.x > W) n.vx *= -1;
if (n.y < 0 || n.y > H) n.vy *= -1;
}

for (let i = 0; i < nodes.length; i++) {
for (let j = i + 1; j < nodes.length; j++) {
const dx = nodes[i].x - nodes[j].x;
const dy = nodes[i].y - nodes[j].y;
const d = Math.sqrt(dx * dx + dy * dy);
if (d < MAX_DIST) {
const alpha = (1 - d / MAX_DIST) * 0.22;
ctx.beginPath();
ctx.moveTo(nodes[i].x, nodes[i].y);
ctx.lineTo(nodes[j].x, nodes[j].y);
ctx.strokeStyle = hexAlpha(nodes[i].color, alpha);
ctx.lineWidth = 0.6;
ctx.stroke();
}
}
}

for (const n of nodes) {
ctx.beginPath();
ctx.arc(n.x, n.y, n.r, 0, Math.PI * 2);
ctx.fillStyle = hexAlpha(n.color, n.opacity);
ctx.fill();
}

animId = requestAnimationFrame(draw);
};

const ro = new ResizeObserver(() => {
cancelAnimationFrame(animId);
resize();
draw();
});

ro.observe(canvas);
resize();
draw();

return () => {
cancelAnimationFrame(animId);
ro.disconnect();
};
}, []);

return (
<canvas
ref={canvasRef}
style={{ width: "100%", height: "100%", display: "block" }}
className="absolute inset-0 z-0"
/>
);
}
Loading
Loading