Skip to content

Commit 0705c2a

Browse files
committed
feat: update background and cleaning
1 parent 02845a2 commit 0705c2a

File tree

11 files changed

+130
-84
lines changed

11 files changed

+130
-84
lines changed
732 KB
Loading

public/img/bg-turtle-pink.png

528 KB
Loading
54.6 KB
Loading

public/img/gaman-new-banner.png

53.2 KB
Loading

src/components/CodeTabs.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, useEffect } from "react";
2-
import { Home, Route, Code2, Cog, Shield } from "lucide-react";
2+
import { Home, Route, Code2, Cog, Shield, Bug } from "lucide-react";
33

4-
type Section = "Entry" | "Router" | "Controller" | "Service" | "Middleware";
4+
type Section = "Entry" | "Router" | "Controller" | "Service" | "Middleware" | "ExceptionHandler";
55

66
interface FileMap {
77
file: string;
@@ -81,6 +81,22 @@ export default autoComposeMiddleware(async (ctx, next) => {
8181
return await next();
8282
});`,
8383
},
84+
ExceptionHandler: {
85+
file: "AppException.ts",
86+
lang: "ts",
87+
title: "Exception Handler",
88+
desc: "Gaman has an exceptions handler, which can be called error handling, so it controls the existing error system. Its usage is quite simple",
89+
code: `import { autoComposeExceptionHandler } from "@gaman/core";
90+
import { HttpException } from "@gaman/common";
91+
92+
export default autoComposeExceptionHandler((err) => {
93+
if(err instanceof HttpException){
94+
return Res.json({
95+
message: err.message
96+
}, err.statusCode);
97+
}
98+
}); `,
99+
}
84100
};
85101

86102
const ICONS: Record<Section, any> = {
@@ -89,6 +105,7 @@ const ICONS: Record<Section, any> = {
89105
Controller: Code2,
90106
Service: Cog,
91107
Middleware: Shield,
108+
ExceptionHandler: Bug
92109
};
93110

94111
export default function CodeTabs() {

src/components/Navbar.astro

Lines changed: 19 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,42 @@
11
---
2-
import Github from "../icons/github.astro";
3-
import { navbar } from "../utils/content";
2+
import { FaDiscord, FaGithub } from "react-icons/fa";
3+
// import ThemeToggle from "../components/buttons/ThemeToggle.astro";
44
---
55

6-
<nav
7-
class="bg-[#1f1111]/40 backdrop-blur-sm md:bg-black/40 md:backdrop-blur-sm border-b border-gray-600/40 fixed inset-x-0 top-0 z-50"
8-
>
6+
<nav class="fixed inset-x-0 top-0 z-50">
97
<input type="checkbox" id="menu-toggle" class="peer hidden" />
108

119
<div
12-
class="max-w-[95rem] mx-auto flex items-center justify-between px-4 py-3"
10+
class="px-4 md:px-0 md:max-w-7xl mx-auto flex items-center justify-between w-full py-3"
1311
>
1412
<!-- Logo -->
15-
<a href="/" class="text-xl font-bold flex items-center gap-x-2">
16-
<img class="h-14" src="/img/new/2.png" alt="GamanJS" />
17-
<h1 class="text-3xl bg-gradient-to-r from-white to-pink-400 bg-clip-text text-transparent">GamanJS</h1>
13+
<a href="/" class="text-xl font-bold flex items-center gap-x-1">
14+
<img class="h-14" src="/img/new/2.png" alt="GamanJS" title="GamanJS" />
15+
<h1 class="text-xl text-white hidden md:block">GamanJS</h1>
1816
</a>
1917

20-
<!-- Hamburger -->
21-
<label
22-
for="menu-toggle"
23-
class="md:hidden flex flex-col space-y-2 cursor-pointer p-3 card bg-white/10"
24-
>
25-
<span
26-
class="block w-6 h-0.5 bg-gray-300 transition-all duration-200 peer-checked:rotate-45 peer-checked:translate-y-1.5"
27-
></span>
28-
<span
29-
class="block w-6 h-0.5 bg-gray-300 transition-all duration-200 peer-checked:opacity-0"
30-
></span>
31-
<span
32-
class="block w-6 h-0.5 bg-gray-300 transition-all duration-500 peer-checked:-rotate-45 peer-checked:-translate-y-1.5"
33-
></span>
34-
</label>
35-
3618
<!-- Desktop Menu -->
37-
<div class="hidden md:flex items-center gap-6">
38-
<ul class="flex space-x-6 text-gray-400 font-medium">
39-
{
40-
navbar.links.map((item) => (
41-
<li>
42-
<a href={item.url} class="hover:text-pink-400 transition">
43-
{item.label}
44-
</a>
45-
</li>
46-
))
47-
}
48-
</ul>
49-
<div class="w-[2px] h-8 bg-gray-600 hidden md:block"></div>
19+
<div class="flex items-center gap-5 text-gray-300 font-medium bg-gray-500/50 border border-gray-800 shadow-lg shadow-gray-500/30 py-2 px-4 rounded-full">
20+
<a href="/docs" class="hover:text-pink-400 transition">Docs</a>
21+
22+
<div class="w-px h-6 bg-gray-600/80"></div>
23+
<!-- <ThemeToggle client:load /> -->
5024
<a
5125
href="https://github.com/7TogkID/gaman"
5226
target="_blank"
53-
class="hidden md:inline-flex items-center gap-1 bg-gradient-to-r from-pink-500 to-purple-500 px-6 py-3 rounded-full font-semibold text-white hover:shadow-lg hover:shadow-pink-500/40 transition-transform transform hover:scale-110"
27+
class="hover:text-white hover:scale-110 transition-transform"
28+
title="GitHub"
5429
>
55-
<Github />
56-
Give it Star
30+
<FaGithub className="w-5 h-5" />
5731
</a>
58-
</div>
59-
</div>
6032

61-
<!-- Mobile Menu -->
62-
<div
63-
class="max-h-0 overflow-hidden peer-checked:max-h-96 transition-all duration-500 ease-in-out md:hidden border-b border-gray-600/40"
64-
>
65-
<div class="flex flex-col space-y-4 px-4 py-6">
66-
<a href="/" class="block hover:text-pink-400 transition-all">Home</a>
67-
<a href="/docs" class="block hover:text-pink-400 transition-all">Docs</a>
68-
<a href="/about" class="block hover:text-pink-400 transition-all">About</a
69-
>
7033
<a
71-
href="https://github.com/7TogkID/gaman"
34+
href="https://discord.gg/"
7235
target="_blank"
73-
class="inline-flex md:hidden justify-center items-center gap-1 bg-gradient-to-r from-pink-500 to-purple-500 px-6 py-3 rounded-full font-semibold text-white hover:shadow-lg hover:shadow-pink-500/40"
36+
class="hover:text-white hover:scale-110 transition-transform"
37+
title="Discord"
7438
>
75-
<Github />
76-
Give it Star
39+
<FaDiscord className="w-5 h-5" />
7740
</a>
7841
</div>
7942
</div>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<button
2+
id="theme-toggle"
3+
class="p-2 transition-all flex items-center justify-center hover:scale-110 duration-300 text-gray-300 hover:text-white"
4+
aria-label="Toggle theme"
5+
>
6+
<svg id="theme-icon" xmlns="http://www.w3.org/2000/svg" class="h-6 " viewBox="0 0 24 24" fill="currentColor">
7+
<path d="M21.64 13.64A9 9 0 0110.36 2.36 7 7 0 0012 22a9 9 0 009.64-8.36z"/>
8+
</svg>
9+
</button>
10+
11+
<script is:inline>
12+
const root = document.documentElement;
13+
const btn = document.getElementById("theme-toggle");
14+
const icon = document.getElementById("theme-icon");
15+
16+
// ⛅️ Ambil tema dari localStorage atau sistem
17+
const saved = localStorage.getItem("theme");
18+
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
19+
const current = saved || (prefersDark ? "dark" : "light");
20+
21+
// Terapkan langsung sebelum render
22+
root.setAttribute("data-theme", current);
23+
updateIcon(current);
24+
25+
btn.addEventListener("click", () => {
26+
const newTheme = root.getAttribute("data-theme") === "light" ? "dark" : "light";
27+
root.setAttribute("data-theme", newTheme);
28+
localStorage.setItem("theme", newTheme);
29+
updateIcon(newTheme);
30+
});
31+
32+
function updateIcon(theme) {
33+
if (theme === "light") {
34+
icon.innerHTML = '<path d="M21.64 13.64A9 9 0 0110.36 2.36 7 7 0 0012 22a9 9 0 009.64-8.36z"/>';
35+
} else {
36+
icon.innerHTML = '<path d="M12 4.354a1 1 0 011 1V7a1 1 0 11-2 0V5.354a1 1 0 011-1zm5.657 1.989a1 1 0 010 1.414L16.414 9a1 1 0 11-1.414-1.414l1.243-1.243a1 1 0 011.414 0zM18.646 11a1 1 0 010 2h-1.646a1 1 0 110-2h1.646zM6.343 6.343a1 1 0 010 1.414L5.1 9a1 1 0 01-1.414-1.414l1.243-1.243a1 1 0 011.414 0zM12 17a5 5 0 110-10 5 5 0 010 10zM4.354 11a1 1 0 010 2H2.708a1 1 0 110-2h1.646zM6.343 17.657a1 1 0 010-1.414L7.586 15a1 1 0 011.414 1.414l-1.243 1.243a1 1 0 01-1.414 0zM12 18.646a1 1 0 011-1H13a1 1 0 010 2h-.354a1 1 0 01-1-1z"/>';
37+
}
38+
}
39+
</script>

src/components/sections/HeroSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function HeroSection() {
4949
return (
5050
<section className="relative flex flex-col items-center justify-center text-center px-6 h-[100dvh] overflow-hidden">
5151

52-
<div className="absolute inset-0 bg-[url('/img/pattern.png')] bg-black/50 bg-blend-multiply before:absolute before:inset-0 before:bg-gradient-to-t before:from-black before:via-black/60 before:to-transparent after:absolute after:inset-0 after:bg-[radial-gradient(ellipse_at_center,_rgba(255,0,150,0.1),_transparent_70%)]" />
52+
<div className="absolute inset-0 bg-[url('/img/bg-turtle-pink.png')] bg-cover bg-bg-primary/50 bg-blend-multiply before:absolute before:inset-0 before:bg-gradient-to-t before:from-bg-primary before:via-bg-primary/60 before:to-transparent after:absolute after:inset-0 after:bg-[radial-gradient(ellipse_at_center,_rgba(255,0,150,0.1),_transparent_70%)]" />
5353

5454
<div className="absolute -top-20 -left-32 w-96 h-96 bg-pink-500/20 rounded-full blur-[160px] animate-pulse" />
5555
<div className="absolute -top-20 right-0 w-[28rem] h-[28rem] bg-purple-600/20 rounded-full blur-[180px] animate-pulse delay-1000" />
@@ -63,7 +63,7 @@ export default function HeroSection() {
6363
Fast
6464
</h1>
6565

66-
<p className="text-lg md:text-xl md:max-w-3xl text-stone-300 leading-relaxed mb-10">
66+
<p className="text-lg md:text-xl md:max-w-3xl text-text-primary leading-relaxed mb-10">
6767
GamanJS is a modern backend framework built for resilience,
6868
scalability, simplicity, and blazing performance — empowering
6969
developers to build beautiful APIs faster than ever.

src/pages/index.astro

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,32 @@ import { features, plugins } from "../utils/content";
1515
<meta charset="UTF-8" />
1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1717
<title>GamanJS - Backend Framework</title>
18-
<link rel="shortcut icon" href="/img/new/1.png" type="image/png" />
18+
<link
19+
id="favicon"
20+
rel="icon"
21+
type="image/png"
22+
href="/img/new/3.png"
23+
/>
24+
25+
<script is:inline>
26+
const favicon = document.getElementById("favicon");
27+
const activeIcon = "/img/new/3.png"; // saat tab aktif
28+
const inactiveIcon = "/img/new/2.png"; // saat tab tidak aktif
29+
30+
document.addEventListener("visibilitychange", () => {
31+
if (document.hidden) {
32+
favicon.href = inactiveIcon;
33+
} else {
34+
favicon.href = activeIcon;
35+
}
36+
});
37+
</script>
1938
</head>
20-
<body class="bg-black text-pink-100 relative overflow-x-hidden">
39+
<body class="bg-bg-primary text-pink-100 relative overflow-x-hidden">
2140
<Navbar />
2241

2342
<main class="backdrop-blur-[2px]">
24-
<HeroSection client:load/>
43+
<HeroSection client:load />
2544

2645
<!-- END: Hero Content -->
2746

@@ -33,7 +52,7 @@ import { features, plugins } from "../utils/content";
3352
>
3453
The GamanJS Structure
3554
</h3>
36-
<p class="w-[90%] text-stone-400 mb-10">
55+
<p class="w-[90%] text-text-primary mb-10">
3756
GamanJS adopts a <span class="text-pink-300">functional-first</span>
3857
design. Instead of relying on heavy OOP patterns, everything — from routes
3958
to controllers — is built through <span class="text-purple-300"
@@ -54,7 +73,7 @@ import { features, plugins } from "../utils/content";
5473
</div>
5574
</section>
5675

57-
<section class="relative py-16 px-4 bg-black/40 backdrop-blur-sm">
76+
<section class="relative py-16 px-4 bg-bg-primary/40 backdrop-blur-sm">
5877
<div
5978
class="max-w-6xl mx-auto grid grid-cols-1 md:grid-cols-[1fr_2fr] gap-10 items-start"
6079
>
@@ -65,7 +84,7 @@ import { features, plugins } from "../utils/content";
6584
>
6685
Framework Performance Overview
6786
</h3>
68-
<p class="text-stone-400 leading-relaxed">
87+
<p class="text-text-primary leading-relaxed">
6988
A quick look at how <span class="text-pink-300 font-semibold"
7089
>GamanJS</span
7190
>
@@ -95,7 +114,7 @@ import { features, plugins } from "../utils/content";
95114
>
96115
</div>
97116
</div>
98-
<p class="text-stone-400 text-sm mt-2">
117+
<p class="text-text-primary text-sm mt-2">
99118
Lightweight, modular, and purely functional — crafted for
100119
clarity and speed.
101120
</p>
@@ -105,15 +124,15 @@ import { features, plugins } from "../utils/content";
105124
<div class="relative">
106125
<div class="flex justify-between mb-2 text-sm font-mono">
107126
<span class="text-stone-300">NestJS</span>
108-
<span class="text-stone-400">Balanced</span>
127+
<span class="text-text-primary">Balanced</span>
109128
</div>
110129
<div class="w-full h-4 bg-white/10 rounded-full overflow-hidden">
111130
<div
112131
class="h-full bg-gradient-to-r from-purple-600 to-purple-700 rounded-full w-[70%]"
113132
>
114133
</div>
115134
</div>
116-
<p class="text-stone-400 text-sm mt-2">
135+
<p class="text-text-primary text-sm mt-2">
117136
OOP-based and well-structured, but introduces runtime overhead.
118137
</p>
119138
</div>
@@ -122,15 +141,15 @@ import { features, plugins } from "../utils/content";
122141
<div class="relative">
123142
<div class="flex justify-between mb-2 text-sm font-mono">
124143
<span class="text-stone-300">AdonisJS</span>
125-
<span class="text-stone-400">Feature-rich</span>
144+
<span class="text-text-primary">Feature-rich</span>
126145
</div>
127146
<div class="w-full h-4 bg-white/10 rounded-full overflow-hidden">
128147
<div
129148
class="h-full bg-gradient-to-r from-pink-800 to-purple-900 rounded-full w-[50%]"
130149
>
131150
</div>
132151
</div>
133-
<p class="text-stone-400 text-sm mt-2">
152+
<p class="text-text-primary text-sm mt-2">
134153
Complete ecosystem and full-stack tools — trades off performance
135154
for convenience.
136155
</p>
@@ -148,14 +167,14 @@ import { features, plugins } from "../utils/content";
148167
>
149168
</div>
150169
</section>
151-
<section class="relative py-16 px-4 bg-black/40 backdrop-blur-sm">
170+
<section class="relative py-16 px-4 bg-bg-primary/40 backdrop-blur-sm">
152171
<div class="max-w-6xl mx-auto">
153172
<GamanLivePreview client:load />
154173
</div>
155174
</section>
156175

157176
<section
158-
class="py-16 px-6 bg-gradient-to-b from-purple-500/10 to-transparent relative "
177+
class="py-16 px-6 bg-gradient-to-b from-purple-500/10 to-transparent relative"
159178
>
160179
<div
161180
class="absolute top-0 left-1/2 -translate-x-1/2 w-[90%] h-px bg-gradient-to-r from-transparent via-purple-500/40 to-transparent"
@@ -167,7 +186,7 @@ import { features, plugins } from "../utils/content";
167186
>
168187
Contributors
169188
</h3>
170-
<p class="text-stone-400 mb-10">
189+
<p class="text-text-primary mb-10">
171190
These amazing developers have helped shape GamanJS and its
172191
documentation.
173192
</p>

src/styles/global.css

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
22
@import "tailwindcss";
33

4+
/* input.css or your main CSS file */
5+
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
6+
7+
:root {
8+
--bg-primary: #233241;
9+
--text-primary: #d6d3d1;
10+
}
11+
12+
:root[data-theme="light"] {
13+
--bg-primary: #edfafd;
14+
--text-primary: #31454e;
15+
}
16+
417
@theme {
518
--font-poppins: "Poppins", sans-serif;
19+
--color-bg-primary: var(--bg-primary);
20+
--color-text-primary: var(--text-primary);
621
}
722

23+
824
@layer utilities {
925
body {
1026
@apply font-poppins;
@@ -63,4 +79,4 @@
6379
* {
6480
scrollbar-width: thin;
6581
scrollbar-color: #ff9ecf #b44378;
66-
}
82+
}

0 commit comments

Comments
 (0)