Files
felhom.eu/website/kapcsolat.html
T
2026-02-26 13:21:55 +01:00

1231 lines
44 KiB
HTML

<!DOCTYPE html>
<html lang="hu">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kapcsolat — Kérj személyre szabott ajánlatot otthoni szerveredhez | Felhom.eu</title>
<meta name="description" content="Írj nekünk és személyre szabott ajánlatot készítünk otthoni szerveredhez. Kérdésed van? Segítünk! Email: info@felhom.eu"> <link rel="preconnect" href="https://fonts.googleapis.com">
<meta name="keywords" content="kapcsolat, ajánlatkérés, otthoni szerver ajánlat, Felhom elérhetőség">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://felhom.eu/kapcsolat">
<meta property="og:type" content="website">
<meta property="og:url" content="https://felhom.eu/kapcsolat">
<meta property="og:title" content="Kapcsolat — Felhom.eu">
<meta property="og:description" content="Írj nekünk és személyre szabott ajánlatot készítünk otthoni szerveredhez.">
<meta property="og:image" content="https://felhom.eu/assets/og-image.png">
<meta property="og:locale" content="hu_HU">
<meta property="og:site_name" content="Felhom.eu">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Kapcsolat — Felhom.eu">
<meta name="twitter:description" content="Kérdésed van? Írj nekünk: info@felhom.eu">
<meta name="twitter:image" content="https://felhom.eu/assets/og-image.png">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="icon" type="image/png" href="/assets/logo_favicon_2.svg">
<script defer src="https://stats.felhom.eu/script.js" data-website-id="d419db57-5e1c-48df-bdb3-c29f25fb1661"></script>
<style>
/* ============================================
UNIFIED CSS - felhom.eu
============================================ */
/* --- CSS Variables --- */
:root {
--bg-primary: #0d1117;
--bg-secondary: #161b22;
--bg-card: #1c2128;
--text-primary: #e6edf3;
--text-secondary: #8b949e;
--text-muted: #6e7681;
--accent-blue: #0088cc;
--accent-light: #00aaff;
--accent-glow: rgba(0, 136, 204, 0.3);
--border-color: #30363d;
--success-green: #238636;
--warning-orange: #d29922;
--error-red: #da3633;
}
/* --- Reset & Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
min-height: 100vh;
}
body::before {
content: '';
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background-image:
linear-gradient(rgba(0, 136, 204, 0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 136, 204, 0.03) 1px, transparent 1px);
background-size: 50px 50px;
pointer-events: none;
z-index: -1;
}
/* --- Layout --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
/* --- Navigation --- */
nav {
position: fixed;
top: 0; left: 0; right: 0;
padding: 20px 0;
background: rgba(13, 17, 23, 0.9);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border-color);
z-index: 200;
}
nav .container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { height: 40px; width: auto; }
.logo-text { font-size: 1.5rem; font-weight: 700; color: var(--accent-light); letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
color: var(--text-secondary);
text-decoration: none;
font-weight: 500;
font-size: 0.95rem;
transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent-light); }
/* --- Typography with gradient span support --- */
h1 span, h2 span, h3 span, h4 span {
background: linear-gradient(135deg, var(--accent-light), var(--accent-blue));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* --- Page Header --- */
.page-header { padding: 140px 0 60px; text-align: center; }
.page-header h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; margin-bottom: 16px; letter-spacing: -0.02em; }
.page-header p { font-size: 1.1rem; color: var(--text-secondary); max-width: 700px; margin: 0 auto; }
/* --- Content Sections --- */
.content-section { padding: 80px 0; }
.content-section.alt-bg { background: var(--bg-secondary); }
/* --- Footer --- */
footer {
padding: 40px 0;
border-top: 1px solid var(--border-color);
text-align: center;
}
footer p { color: var(--text-secondary); font-size: 0.9rem; }
/* ============================================
CONTACT PAGE SPECIFIC
============================================ */
.contact-layout {
display: grid;
grid-template-columns: 1fr 380px;
gap: 60px;
align-items: start;
}
/* --- Form Styles --- */
.contact-form-card {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 16px;
padding: 40px;
}
.form-group {
margin-bottom: 24px;
}
.form-group label {
display: block;
font-size: 0.9rem;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 8px;
}
.form-group label .required {
color: var(--accent-light);
margin-left: 2px;
}
.form-group input,
.form-group select,
.form-group textarea {
width: 100%;
padding: 14px 16px;
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 8px;
color: var(--text-primary);
font-family: inherit;
font-size: 0.95rem;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
border-color: var(--accent-blue);
box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
color: var(--text-muted);
}
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
border-color: var(--error-red);
box-shadow: 0 0 0 3px rgba(218, 54, 51, 0.2);
}
.form-group .error-message {
color: var(--error-red);
font-size: 0.8rem;
margin-top: 6px;
display: none;
}
.form-group .error-message.visible {
display: block;
}
.form-group select {
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 16px center;
padding-right: 40px;
cursor: pointer;
}
.form-group select option {
background: var(--bg-primary);
color: var(--text-primary);
}
.form-group textarea {
resize: vertical;
min-height: 140px;
}
.form-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
}
/* --- File Upload Zone --- */
.file-upload-zone {
border: 2px dashed var(--border-color);
border-radius: 12px;
padding: 32px 24px;
text-align: center;
cursor: pointer;
transition: border-color 0.2s ease, background 0.2s ease;
position: relative;
}
.file-upload-zone:hover,
.file-upload-zone.dragover {
border-color: var(--accent-blue);
background: rgba(0, 136, 204, 0.05);
}
.file-upload-zone input[type="file"] {
position: absolute;
inset: 0;
opacity: 0;
cursor: pointer;
}
.upload-icon {
font-size: 2rem;
margin-bottom: 12px;
}
.upload-text {
color: var(--text-secondary);
font-size: 0.9rem;
line-height: 1.6;
}
.upload-text strong {
color: var(--accent-light);
}
.upload-hint {
color: var(--text-muted);
font-size: 0.8rem;
margin-top: 8px;
}
/* --- File List --- */
.file-list {
margin-top: 16px;
display: flex;
flex-direction: column;
gap: 8px;
}
.file-item {
display: flex;
align-items: center;
gap: 12px;
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 8px;
padding: 10px 14px;
font-size: 0.85rem;
}
.file-item .file-icon {
font-size: 1.2rem;
flex-shrink: 0;
}
.file-item .file-info {
flex: 1;
min-width: 0;
}
.file-item .file-name {
color: var(--text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.file-item .file-size {
color: var(--text-muted);
font-size: 0.75rem;
}
.file-item .file-remove {
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
font-size: 1.1rem;
padding: 4px;
border-radius: 4px;
transition: color 0.2s ease, background 0.2s ease;
flex-shrink: 0;
}
.file-item .file-remove:hover {
color: var(--error-red);
background: rgba(218, 54, 51, 0.1);
}
.file-total-size {
font-size: 0.8rem;
color: var(--text-muted);
margin-top: 8px;
text-align: right;
}
.file-total-size.warning {
color: var(--warning-orange);
}
.file-total-size.error-text {
color: var(--error-red);
}
/* --- Submit Button --- */
.submit-button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
background: linear-gradient(135deg, var(--accent-blue), var(--accent-light));
color: white;
padding: 16px 32px;
border: none;
border-radius: 8px;
font-family: inherit;
font-weight: 600;
font-size: 1.05rem;
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
box-shadow: 0 4px 20px var(--accent-glow);
}
.submit-button:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 8px 30px var(--accent-glow);
}
.submit-button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.submit-button .spinner {
display: none;
width: 18px;
height: 18px;
border: 2px solid rgba(255,255,255,0.3);
border-top-color: white;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
.submit-button.loading .spinner { display: block; }
.submit-button.loading .btn-text { display: none; }
@keyframes spin {
to { transform: rotate(360deg); }
}
/* --- Success / Error States --- */
.form-status {
display: none;
padding: 16px 20px;
border-radius: 8px;
font-size: 0.9rem;
margin-bottom: 24px;
line-height: 1.5;
}
.form-status.success {
display: block;
background: rgba(35, 134, 54, 0.15);
border: 1px solid var(--success-green);
color: #3fb950;
}
.form-status.error-state {
display: block;
background: rgba(218, 54, 51, 0.15);
border: 1px solid var(--error-red);
color: #f85149;
}
/* --- Sidebar Info Cards --- */
.contact-sidebar {
display: flex;
flex-direction: column;
gap: 24px;
position: sticky;
top: 120px;
}
.sidebar-card {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 16px;
padding: 28px;
}
.sidebar-card h3 {
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 10px;
}
.sidebar-card h3 .icon {
font-size: 1.3rem;
}
.sidebar-card p {
color: var(--text-secondary);
font-size: 0.9rem;
line-height: 1.7;
margin-bottom: 12px;
}
.sidebar-card p:last-child {
margin-bottom: 0;
}
.sidebar-card a {
color: var(--accent-light);
text-decoration: none;
font-weight: 500;
transition: color 0.2s ease;
}
.sidebar-card a:hover {
color: var(--text-primary);
}
.sidebar-list {
list-style: none;
margin: 0;
}
.sidebar-list li {
display: flex;
align-items: flex-start;
gap: 10px;
padding: 8px 0;
color: var(--text-secondary);
font-size: 0.9rem;
line-height: 1.5;
}
.sidebar-list li .li-icon {
flex-shrink: 0;
margin-top: 2px;
}
.direct-email {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 18px;
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 8px;
color: var(--text-primary);
text-decoration: none;
font-weight: 500;
font-size: 0.9rem;
transition: border-color 0.2s ease, background 0.2s ease;
}
.direct-email:hover {
border-color: var(--accent-blue);
background: rgba(0, 136, 204, 0.1);
}
/* --- GDPR Checkbox --- */
.checkbox-group {
display: flex;
align-items: flex-start;
gap: 12px;
margin-bottom: 24px;
}
.checkbox-group input[type="checkbox"] {
width: 18px;
height: 18px;
margin-top: 2px;
accent-color: var(--accent-blue);
flex-shrink: 0;
cursor: pointer;
}
.checkbox-group label {
font-size: 0.85rem;
color: var(--text-secondary);
line-height: 1.5;
cursor: pointer;
}
.checkbox-group label a {
color: var(--accent-light);
text-decoration: none;
}
.checkbox-group label a:hover {
text-decoration: underline;
}
/* --- Responsive --- */
@media (max-width: 900px) {
.contact-layout {
grid-template-columns: 1fr;
gap: 40px;
}
.contact-sidebar {
position: static;
order: -1;
}
}
@media (max-width: 600px) {
.page-header { padding: 120px 0 40px; }
.content-section { padding: 60px 0; }
.contact-form-card { padding: 24px; }
.form-row { grid-template-columns: 1fr; gap: 0; }
.sidebar-card { padding: 20px; }
}
/* --- Hamburger Button --- */
.hamburger {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 8px;
z-index: 200;
-webkit-tap-highlight-color: transparent;
}
.hamburger-box {
width: 28px;
height: 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.hamburger-line {
display: block;
width: 100%;
height: 2px;
background: var(--text-primary);
border-radius: 2px;
transition: transform 0.3s ease, opacity 0.3s ease;
transform-origin: center;
}
/* Hamburger → X animation */
.hamburger.is-active .hamburger-line:nth-child(1) {
transform: translateY(9px) rotate(45deg);
}
.hamburger.is-active .hamburger-line:nth-child(2) {
opacity: 0;
}
.hamburger.is-active .hamburger-line:nth-child(3) {
transform: translateY(-9px) rotate(-45deg);
}
/* --- Mobile Menu Overlay --- */
.mobile-overlay {
display: none;
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 140;
opacity: 0;
transition: opacity 0.3s ease;
}
.mobile-overlay.is-visible {
opacity: 1;
}
/* --- Mobile Nav Styles --- */
@media (max-width: 900px) {
.hamburger {
display: block;
}
.nav-links {
display: flex;
flex-direction: column;
position: fixed;
top: 0;
right: -280px;
width: 280px;
height: 100vh;
height: 100dvh;
background: var(--bg-secondary);
border-left: 1px solid var(--border-color);
padding: 80px 32px 32px;
gap: 0;
z-index: 150;
transition: right 0.3s ease;
overflow-y: auto;
}
.nav-links.is-open {
right: 0;
}
.nav-links li {
border-bottom: 1px solid var(--border-color);
}
.nav-links a {
display: block;
padding: 16px 0;
font-size: 1.05rem;
}
.mobile-overlay {
display: block;
pointer-events: none;
}
.mobile-overlay.is-visible {
pointer-events: auto;
}
/* Prevent body scroll when menu is open */
body.menu-open {
overflow: hidden;
}
}
</style>
</head>
<body>
<nav>
<div class="container">
<a href="/" class="logo">
<img src="/assets/logo.png" alt="Felhom.eu logo">
<span class="logo-text">felhom.eu</span>
</a>
<ul class="nav-links">
<li><a href="/#szolgaltatasok">Szolgáltatások</a></li>
<li><a href="/alkalmazasok">Alkalmazások</a></li>
<li><a href="/technologiak">Technológiák</a></li>
<li><a href="/biztonsagimentes">Mentések</a></li>
<li><a href="/gyik">GYIK</a></li>
<li><a href="/kapcsolat" class="active">Kapcsolat</a></li>
</ul>
<button class="hamburger" id="hamburger" aria-label="Menü megnyitása" aria-expanded="false">
<span class="hamburger-box">
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
<span class="hamburger-line"></span>
</span>
</button>
</div>
</nav>
<div class="mobile-overlay" id="mobileOverlay"></div>
<section class="page-header">
<div class="container">
<h1>Írj nekünk <span>bátran!</span></h1>
<p>Kérdésed van, vagy szeretnéd megbeszélni az igényeidet? Töltsd ki az űrlapot, és hamarosan válaszolunk.</p>
</div>
</section>
<main>
<section class="content-section" style="padding-top: 0;">
<div class="container">
<div class="contact-layout">
<!-- Form -->
<div class="contact-form-card">
<div id="formStatus" class="form-status"></div>
<form id="contactForm" novalidate>
<div style="position:absolute;left:-9999px;" aria-hidden="true">
<input type="text" name="website" tabindex="-1" autocomplete="off">
</div>
<div class="form-row">
<div class="form-group">
<label for="name">Név <span class="required">*</span></label>
<input type="text" id="name" name="name" placeholder="Teljes neved" required>
<div class="error-message" id="nameError">Kérlek, add meg a neved.</div>
</div>
<div class="form-group">
<label for="email">Email <span class="required">*</span></label>
<input type="email" id="email" name="email" placeholder="pelda@email.hu" required>
<div class="error-message" id="emailError">Kérlek, adj meg egy érvényes email címet.</div>
</div>
</div>
<div class="form-group">
<label for="subject">Tárgy <span class="required">*</span></label>
<select id="subject" name="subject" required>
<option value="" disabled selected>Válassz témát...</option>
<option value="erdeklodes">Érdeklődés — szeretném megismerni a szolgáltatást</option>
<option value="arajanlat">Árajánlat kérés — konkrét igényeim vannak</option>
<option value="tamogatas">Támogatás — meglévő szerveremet érintő kérdés</option>
<option value="egyeb">Egyéb</option>
</select>
<div class="error-message" id="subjectError">Kérlek, válassz egy témát.</div>
</div>
<div class="form-group">
<label for="message">Üzenet <span class="required">*</span></label>
<textarea id="message" name="message" placeholder="Írd le, miben segíthetünk..." required></textarea>
<div class="error-message" id="messageError">Kérlek, írd le az üzeneted.</div>
</div>
<div class="form-group">
<label>Fájl csatolás <span style="color: var(--text-muted); font-weight: 400;">(opcionális)</span></label>
<div class="file-upload-zone" id="dropZone">
<input type="file" id="fileInput" multiple accept=".pdf,.doc,.docx,.xls,.xlsx,.png,.jpg,.jpeg,.gif,.webp,.txt,.csv,.zip,.7z">
<div class="upload-icon">📎</div>
<div class="upload-text">
<strong>Kattints ide</strong> vagy húzd ide a fájlokat
</div>
<div class="upload-hint">PDF, képek, dokumentumok · Max. 20 MB összesen</div>
</div>
<div class="file-list" id="fileList"></div>
<div class="file-total-size" id="fileTotalSize"></div>
</div>
<div class="checkbox-group">
<input type="checkbox" id="privacy" name="privacy" required>
<label for="privacy">
Elfogadom, hogy az űrlapon megadott adataimat a Felhom.eu a megkeresésem megválaszolásához felhasználja. Az adatokat harmadik félnek nem adjuk ki.
</label>
</div>
<div class="error-message" id="privacyError" style="margin-top: -16px; margin-bottom: 16px;">Az adatkezelési hozzájárulás szükséges.</div>
<button type="submit" class="submit-button" id="submitBtn">
<span class="btn-text">Üzenet küldése →</span>
<span class="spinner"></span>
</button>
</form>
</div>
<!-- Sidebar -->
<div class="contact-sidebar">
<div class="sidebar-card">
<h3><span class="icon">✉️</span> Közvetlen email</h3>
<p>Ha inkább emailben írnál:</p>
<a href="mailto:info@felhom.eu" class="direct-email">
📧 info@felhom.eu
</a>
</div>
<div class="sidebar-card">
<h3><span class="icon">⏱️</span> Válaszidő</h3>
<p>Általában <strong style="color: var(--accent-light);">24 órán belül</strong> válaszolunk munkanapokon.</p>
<p>Sürgős támogatási kérdés esetén jelezd a tárgyban.</p>
</div>
<div class="sidebar-card">
<h3><span class="icon">💡</span> Miben segíthetünk?</h3>
<ul class="sidebar-list">
<li><span class="li-icon">🖥️</span> Szerver konfiguráció tanácsadás</li>
<li><span class="li-icon">📦</span> Alkalmazás telepítés és beállítás</li>
<li><span class="li-icon">🔒</span> Biztonsági mentés kialakítás</li>
<li><span class="li-icon">🌐</span> Távoli elérés beállítása</li>
<li><span class="li-icon">🛠️</span> Meglévő szerver karbantartás</li>
</ul>
</div>
</div>
</div>
</div>
</section>
</main>
<footer>
<div class="container">
<p>© 2026 felhom.eu — Saját felhőd, saját szabályaid</p>
</div>
</footer>
<script>
(() => {
'use strict';
// ==============================================
// CONFIGURATION
// ==============================================
const CONFIG = {
// TODO: Replace with your actual form backend endpoint.
// Options:
// 1. Self-hosted: Deploy a small container (e.g. Go/Python) that receives POST and sends via SMTP
// 2. Formspree: 'https://formspree.io/f/YOUR_FORM_ID'
// 3. Cloudflare Workers: Deploy a worker that forwards to email
//
// For now, falls back to mailto: if no endpoint is configured.
formEndpoint: '/api/contact',
maxTotalFileSize: 20 * 1024 * 1024, // 20 MB
maxSingleFileSize: 10 * 1024 * 1024, // 10 MB per file
maxFiles: 5,
allowedExtensions: ['pdf','doc','docx','xls','xlsx','png','jpg','jpeg','gif','webp','txt','csv','zip','7z'],
};
// ==============================================
// DOM REFS
// ==============================================
const form = document.getElementById('contactForm');
const submitBtn = document.getElementById('submitBtn');
const formStatus = document.getElementById('formStatus');
const dropZone = document.getElementById('dropZone');
const fileInput = document.getElementById('fileInput');
const fileListEl = document.getElementById('fileList');
const fileTotalSizeEl = document.getElementById('fileTotalSize');
let attachedFiles = [];
// ==============================================
// VALIDATION
// ==============================================
function validateField(field) {
const errorEl = document.getElementById(field.id + 'Error');
let valid = true;
if (field.type === 'checkbox') {
valid = field.checked;
} else if (field.required && !field.value.trim()) {
valid = false;
} else if (field.type === 'email' && field.value.trim()) {
valid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(field.value.trim());
}
if (valid) {
field.classList.remove('error');
if (errorEl) errorEl.classList.remove('visible');
} else {
field.classList.add('error');
if (errorEl) errorEl.classList.add('visible');
}
return valid;
}
function validateForm() {
const fields = ['name', 'email', 'subject', 'message', 'privacy'];
let allValid = true;
fields.forEach(id => {
const field = document.getElementById(id);
if (!validateField(field)) allValid = false;
});
return allValid;
}
// Live validation on blur
['name', 'email', 'subject', 'message', 'privacy'].forEach(id => {
const el = document.getElementById(id);
const event = el.type === 'checkbox' ? 'change' : 'blur';
el.addEventListener(event, () => validateField(el));
// Clear error on input
el.addEventListener('input', () => {
if (el.classList.contains('error')) validateField(el);
});
});
// ==============================================
// FILE HANDLING
// ==============================================
function formatFileSize(bytes) {
if (bytes < 1024) return bytes + ' B';
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB';
return (bytes / (1024 * 1024)).toFixed(1) + ' MB';
}
function getFileIcon(name) {
const ext = name.split('.').pop().toLowerCase();
const icons = {
pdf: '📄', doc: '📝', docx: '📝', xls: '📊', xlsx: '📊',
png: '🖼️', jpg: '🖼️', jpeg: '🖼️', gif: '🖼️', webp: '🖼️',
txt: '📃', csv: '📊', zip: '📦', '7z': '📦',
};
return icons[ext] || '📎';
}
function getTotalFileSize() {
return attachedFiles.reduce((sum, f) => sum + f.size, 0);
}
function addFiles(fileArray) {
for (const file of fileArray) {
// Check extension
const ext = file.name.split('.').pop().toLowerCase();
if (!CONFIG.allowedExtensions.includes(ext)) {
showStatus(`A "${file.name}" fájltípus nem engedélyezett.`, 'error-state');
continue;
}
// Check single file size
if (file.size > CONFIG.maxSingleFileSize) {
showStatus(`A "${file.name}" túl nagy (max. ${formatFileSize(CONFIG.maxSingleFileSize)} / fájl).`, 'error-state');
continue;
}
// Check max file count
if (attachedFiles.length >= CONFIG.maxFiles) {
showStatus(`Maximum ${CONFIG.maxFiles} fájl csatolható.`, 'error-state');
break;
}
// Check total size
if (getTotalFileSize() + file.size > CONFIG.maxTotalFileSize) {
showStatus(`Összesített fájlméret meghaladja a ${formatFileSize(CONFIG.maxTotalFileSize)} limitet.`, 'error-state');
break;
}
// Check duplicate
if (attachedFiles.some(f => f.name === file.name && f.size === file.size)) {
continue;
}
attachedFiles.push(file);
}
renderFileList();
}
function removeFile(index) {
attachedFiles.splice(index, 1);
renderFileList();
// Reset file input so same file can be re-added
fileInput.value = '';
}
function renderFileList() {
if (attachedFiles.length === 0) {
fileListEl.innerHTML = '';
fileTotalSizeEl.textContent = '';
return;
}
fileListEl.innerHTML = attachedFiles.map((file, i) => `
<div class="file-item">
<span class="file-icon">${getFileIcon(file.name)}</span>
<div class="file-info">
<div class="file-name" title="${file.name}">${file.name}</div>
<div class="file-size">${formatFileSize(file.size)}</div>
</div>
<button type="button" class="file-remove" data-index="${i}" title="Eltávolítás">✕</button>
</div>
`).join('');
// Bind remove buttons
fileListEl.querySelectorAll('.file-remove').forEach(btn => {
btn.addEventListener('click', () => removeFile(parseInt(btn.dataset.index)));
});
// Total size indicator
const total = getTotalFileSize();
const pct = (total / CONFIG.maxTotalFileSize) * 100;
fileTotalSizeEl.textContent = `${formatFileSize(total)} / ${formatFileSize(CONFIG.maxTotalFileSize)}`;
fileTotalSizeEl.className = 'file-total-size';
if (pct > 90) fileTotalSizeEl.classList.add('error-text');
else if (pct > 70) fileTotalSizeEl.classList.add('warning');
}
// File input change
fileInput.addEventListener('change', () => {
if (fileInput.files.length) {
addFiles(Array.from(fileInput.files));
fileInput.value = '';
}
});
// Drag & drop
['dragenter', 'dragover'].forEach(evt => {
dropZone.addEventListener(evt, e => {
e.preventDefault();
dropZone.classList.add('dragover');
});
});
['dragleave', 'drop'].forEach(evt => {
dropZone.addEventListener(evt, e => {
e.preventDefault();
dropZone.classList.remove('dragover');
});
});
dropZone.addEventListener('drop', e => {
if (e.dataTransfer.files.length) {
addFiles(Array.from(e.dataTransfer.files));
}
});
// ==============================================
// STATUS MESSAGES
// ==============================================
function showStatus(message, type) {
formStatus.textContent = message;
formStatus.className = 'form-status ' + type;
formStatus.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
if (type === 'error-state') {
setTimeout(() => {
formStatus.className = 'form-status';
}, 6000);
}
}
// ==============================================
// FORM SUBMISSION
// ==============================================
form.addEventListener('submit', async (e) => {
e.preventDefault();
formStatus.className = 'form-status';
if (!validateForm()) {
// Build specific error message
const missing = [];
if (!document.getElementById('name').value.trim()) missing.push('név');
const emailVal = document.getElementById('email').value.trim();
if (!emailVal || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(emailVal)) missing.push('email');
if (!document.getElementById('subject').value) missing.push('tárgy');
if (!document.getElementById('message').value.trim()) missing.push('üzenet');
if (!document.getElementById('privacy').checked) missing.push('adatkezelési hozzájárulás');
if (missing.length === 1 && missing[0] === 'adatkezelési hozzájárulás') {
showStatus('Kérlek, fogadd el az adatkezelési hozzájárulást a küldéshez.', 'error-state');
} else {
showStatus('Kérlek, töltsd ki az összes kötelező mezőt.', 'error-state');
}
return;
}
submitBtn.classList.add('loading');
submitBtn.disabled = true;
const formData = {
name: document.getElementById('name').value.trim(),
email: document.getElementById('email').value.trim(),
subject: document.getElementById('subject').value,
message: document.getElementById('message').value.trim(),
};
// Subject label mapping
const subjectLabels = {
erdeklodes: 'Érdeklődés',
arajanlat: 'Árajánlat kérés',
tamogatas: 'Támogatás',
egyeb: 'Egyéb',
};
try {
if (CONFIG.formEndpoint) {
// --- Backend submission ---
const data = new FormData();
data.append('name', formData.name);
data.append('email', formData.email);
data.append('subject', subjectLabels[formData.subject] || formData.subject);
data.append('message', formData.message);
attachedFiles.forEach(file => {
data.append('attachments', file);
});
const response = await fetch(CONFIG.formEndpoint, {
method: 'POST',
body: data,
});
if (!response.ok) {
throw new Error(`Szerver hiba: ${response.status}`);
}
showStatus('✅ Üzeneted sikeresen elküldtük! Hamarosan válaszolunk.', 'success');
form.reset();
attachedFiles = [];
renderFileList();
} else {
// --- Fallback: mailto ---
const subjectLine = `[Felhom.eu] ${subjectLabels[formData.subject] || formData.subject}`;
const body = [
`Név: ${formData.name}`,
`Email: ${formData.email}`,
``,
formData.message,
].join('\n');
const mailtoUrl = `mailto:info@felhom.eu?subject=${encodeURIComponent(subjectLine)}&body=${encodeURIComponent(body)}`;
window.location.href = mailtoUrl;
if (attachedFiles.length > 0) {
showStatus('⚠️ Az email kliens megnyílt. A csatolt fájlokat kézzel kell hozzáadnod az emailhez, mert a mailto: link nem támogatja a mellékleteket.', 'error-state');
} else {
showStatus('✅ Az email kliens megnyílt az üzeneteddel. Küld el az emailt a kapcsolatfelvételhez!', 'success');
}
}
} catch (err) {
console.error('Form submission error:', err);
showStatus(`❌ Hiba történt a küldés során. Kérlek, próbáld újra vagy írj közvetlenül az info@felhom.eu címre.`, 'error-state');
} finally {
submitBtn.classList.remove('loading');
submitBtn.disabled = false;
}
});
// ==============================================
// DEBUG HELPER
// ==============================================
// Uncomment to test form states:
// window.debugForm = {
// showSuccess: () => showStatus('✅ Üzeneted sikeresen elküldtük!', 'success'),
// showError: () => showStatus('❌ Hiba történt.', 'error-state'),
// getFiles: () => console.log(attachedFiles),
// getFormData: () => {
// const fd = new FormData(form);
// for (const [k,v] of fd.entries()) console.log(k, v);
// },
// };
})();
</script>
<script>
(function() {
var hamburger = document.getElementById('hamburger');
var navLinks = document.querySelector('.nav-links');
var overlay = document.getElementById('mobileOverlay');
var body = document.body;
if (!hamburger || !navLinks || !overlay) {
console.warn('[mobile-menu] Missing elements:', {
hamburger: !!hamburger,
navLinks: !!navLinks,
overlay: !!overlay
});
return;
}
function openMenu() {
hamburger.classList.add('is-active');
navLinks.classList.add('is-open');
overlay.classList.add('is-visible');
body.classList.add('menu-open');
hamburger.setAttribute('aria-expanded', 'true');
hamburger.setAttribute('aria-label', 'Menü bezárása');
}
function closeMenu() {
hamburger.classList.remove('is-active');
navLinks.classList.remove('is-open');
overlay.classList.remove('is-visible');
body.classList.remove('menu-open');
hamburger.setAttribute('aria-expanded', 'false');
hamburger.setAttribute('aria-label', 'Menü megnyitása');
}
hamburger.addEventListener('click', function() {
if (navLinks.classList.contains('is-open')) {
closeMenu();
} else {
openMenu();
}
});
overlay.addEventListener('click', closeMenu);
navLinks.querySelectorAll('a').forEach(function(link) {
link.addEventListener('click', closeMenu);
});
document.addEventListener('keydown', function(e) {
if (e.key === 'Escape' && navLinks.classList.contains('is-open')) {
closeMenu();
}
});
window.addEventListener('resize', function() {
if (window.innerWidth > 900 && navLinks.classList.contains('is-open')) {
closeMenu();
}
});
})();
</script>
</body>
</html>