Skip to content

Commit c059d96

Browse files
Merge pull request #129 from gofr-dev/Issue-static-build
removed the hackthon banner
2 parents f521f02 + 8874982 commit c059d96

File tree

4 files changed

+136
-29
lines changed

4 files changed

+136
-29
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea
22
.next
33
node_modules
4+
out
45

56

nginix.conf

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# server {
2+
# listen 3000;
3+
# server_name localhost;
4+
5+
# # Root directory for the exported static site
6+
# root /usr/share/nginx/html;
7+
# index index.html;
8+
9+
# # Global 404 error handling
10+
# error_page 404 /404.html;
11+
12+
# # Comprehensive location blocks for routing
13+
# location / {
14+
# # Try to serve exact URI, then .html version, then fall back to 404 or index
15+
# try_files $uri $uri.html $uri/ =404;
16+
# }
17+
18+
# # Specific route handling with fallback to 404
19+
# location /docs/ {
20+
# try_files $uri $uri.html $uri/ /404.html =404;
21+
# }
22+
23+
# # Dynamic route handling
24+
# location ~ ^/([^/]+)/([^/]+)/?$ {
25+
# try_files $uri $uri.html /404.html =404;
26+
# }
27+
28+
# # Explicit 404 location to ensure it's always served
29+
# location = /404.html {
30+
# internal;
31+
# }
32+
33+
# # Serve static assets with caching
34+
# location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|mp4|webm|ogv|ogg|mp3|wav|json)$ {
35+
# expires 30d;
36+
# add_header Cache-Control "public, no-transform";
37+
# access_log off;
38+
# }
39+
40+
# # Enable Gzip compression
41+
# gzip on;
42+
# gzip_vary on;
43+
# gzip_proxied any;
44+
# gzip_comp_level 6;
45+
# gzip_types
46+
# text/plain
47+
# text/css
48+
# application/json
49+
# application/javascript
50+
# text/xml
51+
# application/xml
52+
# application/xml+rss
53+
# text/javascript
54+
# image/svg+xml;
55+
56+
# # Logging for debugging
57+
# error_log /var/log/nginx/error.log debug;
58+
# access_log /var/log/nginx/access.log;
59+
# }
60+
61+
server {
62+
listen 3000;
63+
server_name your-domain.com; # Replace with your domain or IP
64+
65+
# Root directory for the exported static site
66+
root /usr/share/nginx/html;
67+
index index.html;
68+
69+
# Serve static files
70+
location / {
71+
try_files $uri $uri.html /$uri /$uri/ /404.html;
72+
}
73+
74+
# Handle 404 errors with the custom 404 page
75+
error_page 404 /404.html;
76+
77+
# Serve static assets with caching
78+
location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|mp4|webm|ogv|ogg|mp3|wav|json|txt)$ {
79+
expires 6M; # Cache static assets for 6 months
80+
access_log off;
81+
add_header Cache-Control "public";
82+
}
83+
84+
# Enable Gzip compression for text-based assets
85+
gzip on;
86+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
87+
gzip_min_length 256;
88+
89+
# Optional: Redirect HTTP to HTTPS (if HTTPS is set up)
90+
# Uncomment if needed
91+
# return 301 https://$host$request_uri;
92+
}

src/components/Accordion.jsx

+35-19
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use client'
22

3-
import React, {useEffect, useRef, useState} from 'react'
3+
import React, { useEffect, useRef, useState } from 'react'
44
import AnimateHeight from '@/components/AnimateHeight'
5-
import ArrowRight from "@/images/icons8-arrow-white.png"
6-
import Image from "next/image";
5+
import ArrowRight from '@/images/icons8-arrow-white.png'
6+
import Image from 'next/image'
77

88
const Accordion = ({ data }) => {
99
return (
@@ -23,60 +23,76 @@ const AccordionCard = ({ data }) => {
2323
const [titleHeight, setTitleHeight] = useState(50)
2424
const titleRef = useRef(null)
2525

26-
useEffect(()=>{
27-
if(!titleRef.current) return
26+
useEffect(() => {
27+
if (!titleRef.current) return
2828

29-
const getTitleHeight = () =>{
29+
const getTitleHeight = () => {
3030
const height = titleRef.current.getBoundingClientRect().height
3131
setTitleHeight(height + 35)
3232
}
3333

3434
getTitleHeight()
3535

36-
window.addEventListener("resize",getTitleHeight)
36+
window.addEventListener('resize', getTitleHeight)
3737

3838
return () => {
39-
window.removeEventListener("resize",getTitleHeight)
39+
window.removeEventListener('resize', getTitleHeight)
4040
}
41-
},[titleRef.current])
41+
}, [titleRef.current])
4242

4343
return (
4444
<div
45-
className={`relative flex flex-col gap-1 overflow-hidden rounded-md p-2 transition-all duration-500 cursor-pointer group border border-slate-200 dark:border-slate-800`}
45+
className={`group relative flex cursor-pointer flex-col gap-1 overflow-hidden rounded-md border border-slate-200 p-2 transition-all duration-500 dark:border-slate-800`}
4646
style={{
4747
height: titleHeight + height,
4848
}}
4949
onClick={() => {
5050
setIsOpen((prevState) => !prevState)
5151
}}
5252
>
53-
<div className="absolute inset-0 rounded-md border-2 border-transparent opacity-0 transition-opacity duration-500 group-hover:opacity-100 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.indigo.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] dark:[--quick-links-hover-bg:theme(colors.slate.800)] pointer-events-none" style={{ clipPath: 'inset(0 round var(--rounded-md))' }} />
53+
<div
54+
className="pointer-events-none absolute inset-0 rounded-md border-2 border-transparent opacity-0 transition-opacity duration-500 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.indigo.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] group-hover:opacity-100 dark:[--quick-links-hover-bg:theme(colors.slate.800)]"
55+
style={{ clipPath: 'inset(0 round var(--rounded-md))' }}
56+
/>
5457
<div
5558
className="absolute inset-0 rounded-md transition-opacity duration-300"
5659
style={{
5760
background: isOpen
58-
? 'linear-gradient(136deg, rgba(56, 189, 248, 1) 0%, rgb(129, 140, 248,1)50%, rgba(56, 189, 248, 1) 100%)':
59-
'transparent'
61+
? 'linear-gradient(136deg, rgba(56, 189, 248, 1) 0%, rgb(129, 140, 248,1)50%, rgba(56, 189, 248, 1) 100%)'
62+
: 'transparent',
6063
}}
6164
/>
6265

6366
<div className="absolute inset-[1px] top-[1px] z-10 flex flex-col rounded-md bg-slate-900 p-4">
6467
<div className={`flex flex-col`}>
6568
<div className={`flex justify-between gap-2`}>
66-
<span ref={titleRef} className={`font-semibold text-sm md:text-xl`}>{data.title}</span>
67-
<button
68-
>
69+
<span ref={titleRef} className={`text-sm font-semibold md:text-xl`}>
70+
{data.title}
71+
</span>
72+
<button>
6973
<Image
7074
src={ArrowRight}
7175
alt={'arrow-right'}
7276
width={20}
7377
height={20}
74-
className={`transition-all duration-500 ${ isOpen ? 'rotate-90' : ''}`}
78+
className={`transition-all duration-500 ${
79+
isOpen ? 'rotate-90' : ''
80+
}`}
81+
unoptimized
7582
/>
7683
</button>
7784
</div>
78-
<AnimateHeight onChange={(w)=>{setHeight(w)}} customAnimation={'duration-300'}>
79-
{isOpen && <span className={`text-gray-400 pt-4 text-xs md:text-sm`}>{data.description}</span>}
85+
<AnimateHeight
86+
onChange={(w) => {
87+
setHeight(w)
88+
}}
89+
customAnimation={'duration-300'}
90+
>
91+
{isOpen && (
92+
<span className={`pt-4 text-xs text-gray-400 md:text-sm`}>
93+
{data.description}
94+
</span>
95+
)}
8096
</AnimateHeight>
8197
</div>
8298
</div>

src/components/Layout.jsx

+8-10
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { MobileNavigation } from '@/components/MobileNavigation'
99
import { Search } from '@/components/Search'
1010
import { formatNumber } from '@/lib/common'
1111
import { ErrorBoundary } from './BugsnagWrapper'
12-
import FooterUi from "@/components/Footer";
12+
import FooterUi from '@/components/Footer'
1313
import { HackathonLinkButton } from './goforgofr/HackathonLinkButton'
1414

1515
export function GitHubIcon(props) {
@@ -135,18 +135,16 @@ export function Layout({ children }) {
135135
return (
136136
<ErrorBoundary FallbackComponent={ErrorView}>
137137
<div className="flex w-full flex-col">
138-
{
139-
pathname !== '/hackathon' &&
140-
<>
141-
<div className='relative sm:fixed sm:top-0 sm:left-0 sm:right-0 z-50'>
138+
{pathname !== '/hackathon' && (
139+
<>
140+
{/* <div className='relative sm:fixed sm:top-0 sm:left-0 sm:right-0 z-50'>
142141
<HackathonLinkButton />
143-
</div>
144-
<div className="sticky top-0 sm:top-8 left-0 right-0 z-40">
142+
</div> */}
143+
<div className="sticky left-0 right-0 top-0 z-40">
145144
<Header />
146145
</div>
147-
</>
148-
149-
}
146+
</>
147+
)}
150148
{children}
151149
<FooterUi />
152150
</div>

0 commit comments

Comments
 (0)