This commit is contained in:
Jetomit_Bio 2026-01-23 19:07:57 +01:00
parent 7ada5a5ee1
commit 89b97d8b6c
4 changed files with 77 additions and 53 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Farby pre krajší terminál # --- FARBY PRE TERMINÁL ---
GREEN='\033[0;32m' GREEN='\033[0;32m'
BLUE='\033[0;34m' BLUE='\033[0;34m'
YELLOW='\033[1;33m' YELLOW='\033[1;33m'
@ -8,52 +8,70 @@ RED='\033[0;31m'
NC='\033[0m' NC='\033[0m'
echo -e "${BLUE}==========================================${NC}" echo -e "${BLUE}==========================================${NC}"
echo -e "${BLUE} Jetomit_Bio - Automatická Inštalácia ${NC}" echo -e "${BLUE} JETOMIT_BIO - AUTOMATICKÝ DEPLOY ${NC}"
echo -e "${BLUE}==========================================${NC}" echo -e "${BLUE}==========================================${NC}"
# 1. Kontrola prostredia # 1. ZBER ÚDAJOV
echo -e "\n${YELLOW}🔍 Kontrolujem prostredie...${NC}" read -p "Zadaj svoju doménu (napr. jetomit.bio): " DOMAIN
if ! command -v npm &> /dev/null; then read -p "Zadaj svoj e-mail (pre SSL/Certbot): " EMAIL
echo -e "${RED}❌ Chyba: NPM nie je nainštalované. Nainštaluj si Node.js.${NC}" read -p "Vlož svoj RESEND_API_KEY: " RESEND_KEY
exit 1
fi
# 2. Inštalácia závislostí # 2. INŠTALÁCIA SYSTÉMOVÝCH BALÍKOV
echo -e "${GREEN}📦 Inštalujem balíčky (Next.js, Framer Motion, Resend, Lucide, Tailwind)...${NC}" echo -e "\n${YELLOW}📦 Inštalujem Nginx, Node.js a Certbot...${NC}"
sudo apt update
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs nginx certbot python3-certbot-nginx
# 3. PRÍPRAVA APLIKÁCIE
echo -e "${GREEN}📦 Inštalujem NPM balíky a buildujem projekt...${NC}"
npm install npm install
npm run build
# 3. Kontrola .env súboru # 4. NASTAVENIE .env
echo -e "${GREEN}🔑 Kontrolujem konfiguračné súbory...${NC}" echo -e "${GREEN}🔑 Vytváram .env súbor...${NC}"
if [ ! -f .env ]; then echo "RESEND_API_KEY=$RESEND_KEY" > .env
echo -e "${YELLOW}📝 Súbor .env nebol nájdený. Vytváram šablónu...${NC}" echo "NEXT_PUBLIC_DOMAIN=$DOMAIN" >> .env
echo "RESEND_API_KEY=re_tvoj_kluc_tu" > .env
echo -e "${RED}⚠ DOPLŇ SI API KĽÚČ DO SÚBORU .env!${NC}"
else
echo -e "${BLUE}✅ Súbor .env už existuje.${NC}"
fi
# 4. Kontrola dátových súborov (JSON) # 5. AUTOMATICKÁ KONFIGURÁCIA NGINX
echo -e "${GREEN}📂 Kontrolujem dátovú štruktúru...${NC}" echo -e "${GREEN}🌐 Konfigurujem Nginx pre doménu $DOMAIN...${NC}"
FILES=("src/data/navbar.json" "src/data/main_page.json" "src/data/socials.json" "src/data/mainprojects.json" "src/data/contact.json")
for file in "${FILES[@]}"; do NGINX_CONF="/etc/nginx/sites-available/$DOMAIN"
if [ ! -f "$file" ]; then
echo -e "${YELLOW}⚠ Varovanie: Súbor $file chýba. Skontroluj si priečinok src/data/.${NC}"
fi
done
# 5. Príprava priečinkov pre obrázky # Vytvorenie konfiguračného súboru pre Nginx
echo -e "${GREEN}🖼️ Pripravujem priečinky pre médiá...${NC}" sudo bash -c "cat <<EOF > $NGINX_CONF
mkdir -p public/images server {
listen 80;
server_name $DOMAIN www.$DOMAIN;
if [ ! -f public/images/me1.jpg ] || [ ! -f public/images/me2.jpg ]; then location / {
echo -e "${YELLOW}📸 Nezabudni pridať fotky me1.jpg a me2.jpg do public/images/ pre správne zobrazenie polaroidov.${NC}" proxy_pass http://localhost:3000;
fi proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host \$host;
proxy_cache_bypass \$http_upgrade;
}
}
EOF"
# 6. Finálne nastavenie práv pre skripty # Aktivácia konfigurácie a reštart Nginxu
chmod +x install.sh sudo ln -sf $NGINX_CONF /etc/nginx/sites-enabled/
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t && sudo systemctl restart nginx
# 6. AUTOMATICKÉ SSL (HTTPS)
echo -e "${YELLOW}🔒 Spúšťam Certbot pre automatické SSL...${NC}"
# Certbot sám upraví Nginx konfig a pridá SSL certifikáty
sudo certbot --nginx -d $DOMAIN -d www.$DOMAIN --non-interactive --agree-tos -m $EMAIL --redirect
# 7. NASTAVENIE PM2 (Proces manažér)
echo -e "${GREEN}🚀 Spúšťam aplikáciu cez PM2, aby bežala nonstop...${NC}"
sudo npm install -g pm2
pm2 delete jetomit-bio 2>/dev/null || true
pm2 start npm --name "jetomit-bio" -- start
pm2 save
pm2 startup | bash
echo -e "\n${BLUE}==========================================${NC}" echo -e "\n${BLUE}==========================================${NC}"
echo -e "${GREEN}✅ Všetko je pripravené!${NC}" echo -e "${GREEN}✅ HOTOVO! Tvoj web je live na: https://$DOMAIN${NC}"
echo -e "${BLUE}Spusti projekt príkazom:${NC} ${YELLOW}npm run dev${NC}"
echo -e "${BLUE}==========================================${NC}" echo -e "${BLUE}==========================================${NC}"

View File

@ -10,7 +10,6 @@ export default function Navbar() {
const [isMounted, setIsMounted] = useState(false); const [isMounted, setIsMounted] = useState(false);
const [activeTab, setActiveTab] = useState(""); const [activeTab, setActiveTab] = useState("");
// Funkcia na plynulý scroll
const performScroll = (id: string) => { const performScroll = (id: string) => {
const element = document.getElementById(id); const element = document.getElementById(id);
if (element) { if (element) {
@ -22,11 +21,10 @@ export default function Navbar() {
useEffect(() => { useEffect(() => {
setIsMounted(true); setIsMounted(true);
// Detekcia počiatočného stavu a scrollu po príchode z inej stránky
if (pathname === "/") { if (pathname === "/") {
const hash = window.location.hash.replace("#", ""); const hash = window.location.hash.replace("#", "");
if (hash) { if (hash) {
setTimeout(() => performScroll(hash), 400); // Dlhší timeout pre istotu setTimeout(() => performScroll(hash), 400);
} else { } else {
setActiveTab("/#home"); setActiveTab("/#home");
} }
@ -41,14 +39,13 @@ export default function Navbar() {
return; return;
} }
// Dynamické sledovanie sekcií z JSONu
navbarData.navItems.forEach((item) => { navbarData.navItems.forEach((item) => {
if (item.href.includes("#")) { if (item.href.includes("#")) {
const id = item.href.replace("/#", ""); const id = item.href.replace("/#", "");
const el = document.getElementById(id); const el = document.getElementById(id);
if (el) { if (el) {
const rect = el.getBoundingClientRect(); const rect = el.getBoundingClientRect();
if (rect.top <= 200 && rect.bottom >= 200) { if (rect.top <= 250 && rect.bottom >= 250) {
setActiveTab(item.href); setActiveTab(item.href);
} }
} }
@ -67,18 +64,19 @@ export default function Navbar() {
performScroll(id); performScroll(id);
window.history.pushState(null, "", href); window.history.pushState(null, "", href);
} }
// Ak ideme na /projects alebo z /projects na Home, necháme Next.js pracovať
}; };
return ( return (
<nav className="fixed top-8 left-0 w-full z-50 px-8 pointer-events-none"> <nav className="fixed top-6 md:top-8 left-0 w-full z-50 px-4 md:px-8 pointer-events-none">
<div className="max-w-7xl mx-auto flex justify-between items-center"> <div className="max-w-7xl mx-auto flex flex-row justify-between items-center w-full">
{/* LOGO Z JSONU */}
<Link href="/" className="text-2xl font-black text-white pointer-events-auto"> {/* LOGO - Ponechaná veľkosť pre čitateľnosť */}
<Link href="/" className="text-xl md:text-2xl font-black text-white pointer-events-auto shrink-0 mr-4">
{navbarData.logo} {navbarData.logo}
</Link> </Link>
<div className="flex bg-[#1a1a1c]/80 backdrop-blur-md p-1.5 rounded-full border border-white/5 relative pointer-events-auto"> {/* MENU CONTAINER - Trochu vyšší a priestrannejší */}
<div className="flex bg-[#1a1a1c]/80 backdrop-blur-md p-1.5 rounded-full border border-white/5 relative pointer-events-auto items-center shadow-2xl">
{navbarData.navItems.map((item) => { {navbarData.navItems.map((item) => {
const isActive = activeTab === item.href; const isActive = activeTab === item.href;
@ -87,8 +85,9 @@ export default function Navbar() {
key={item.href} key={item.href}
href={item.href} href={item.href}
onClick={(e) => handleLinkClick(e, item.href)} onClick={(e) => handleLinkClick(e, item.href)}
className="relative px-6 py-2 text-sm font-bold transition-colors duration-500 z-10" /* ZVÄČŠENÉ: px-4 a text-xs na mobile (predtým px-3 a text-[11px]) */
style={{ color: isActive ? "#000000" : "#9ca3af" }} // Explicitná čierna pre aktívny tab className="relative px-4 md:px-7 py-2 md:py-2.5 text-xs md:text-sm font-bold transition-colors duration-500 z-10 whitespace-nowrap"
style={{ color: isActive ? "#000000" : "#9ca3af" }}
> >
<AnimatePresence> <AnimatePresence>
{isActive && isMounted && ( {isActive && isMounted && (
@ -98,7 +97,7 @@ export default function Navbar() {
animate={{ opacity: 1 }} animate={{ opacity: 1 }}
exit={{ opacity: 0 }} exit={{ opacity: 0 }}
transition={{ type: "spring", stiffness: 380, damping: 30 }} transition={{ type: "spring", stiffness: 380, damping: 30 }}
className="absolute inset-0 bg-white rounded-full -z-10 shadow-xl" className="absolute inset-0 bg-white rounded-full -z-10 shadow-lg"
/> />
)} )}
</AnimatePresence> </AnimatePresence>

View File

@ -9,7 +9,7 @@
{ "name": "UI/UX", "color": "bg-orange-500/20 text-orange-400 border-orange-500/20" } { "name": "UI/UX", "color": "bg-orange-500/20 text-orange-400 border-orange-500/20" }
], ],
"config": { "config": {
"from_email": "test@kadernictvotama.sk", "from_email": "system@jetomit.bio",
"to_email": "hello@jetomit.bio" "to_email": "hello@jetomit.bio"
} }
} }

View File

@ -47,5 +47,12 @@
"url": "https://github.com/Jetomit-Bio/ticket-system", "url": "https://github.com/Jetomit-Bio/ticket-system",
"category": "Support", "category": "Support",
"year": "2026" "year": "2026"
},
{
"title": "Stroj Na Jednotky (Extention)",
"description": "Help with school tests in Slovak Language",
"url": "https://chromewebstore.google.com/detail/stroj-na-jednotky/jopboaofnkkbmmpllbjfgiimfinhekoi",
"category": "AI, Help",
"year": "2026"
} }
] ]