02be8ea7f0
gates / gates (push) Successful in 6m12s
A page-by-page review of the live site (1440px and 390px) found six defects and
two editorial questions. The operator answered three questions; the answers and
the evidence are in REPORT-review-2026-10-12.md.
Fixed:
- The contact form showed its consent error before any submit, on both pages:
#privacyError sits outside any .form-group and the hide rule was scoped to
.form-group. Scoped to the page. Checked: load (none) -> submit unticked
(shown) -> tick (gone), with no message sent.
- The consent checkbox is the site's own control now: 24px box, keyboard focus
ring, and a second <label for="privacy"> at 44x44 round it for touch.
- The contact page promised a reply within 24 hours while /feltetelek 1.1 §4
promises no reply time. Now 1-2 days usually, and no promise during the test.
- sitemap.xml was missing /szolgaltatasok and /en/services: 18 -> 20 URLs.
- The pre-shell mobile-menu script still ran on 20 pages and logged
"[mobile-menu] Missing elements" on every one. Removed.
- The sidebar's tester button was btn-outline while the hero's was btn-primary.
- The home page's "Mit tud a doboz ma?" was three bare links; each card now
carries 2-3 of the services page's own items, word for word.
- A plain Facebook link in the footer of all 22 pages. No script, widget or
pixel: the only external hosts any page refers to are still felhom.eu and
stats.felhom.eu.
Voice (operator ruling: "I" everywhere a person speaks): contact, tester and FAQ
pages in both languages, and the home and services pages that repeat the same
promises. An inclusive "we" (you and I, talking) stays plural, and the legal
texts are untouched. Each FAQ answer exists twice (JSON-LD + visible) and gate 18
holds them equal - it caught the five answers whose markup split the sentence.
Hero clip rebuilt: Immich first, so the poster is a wall of real photographs;
the Jellyfin scene starts after the demo's library wall (eleven pieces of poster
art whose licence cannot be quoted from a first-party source); 1.3s of blank
screen cut from the OnlyOffice scene. The film that plays, Caminandes 3:
Llamigos, is CC BY per Blender's own video platform ("licence": {"id": 1,
"label": "Attribution"}) - NOT public domain as website/CHANGELOG.md said
yesterday. That sentence is corrected in place and the film is credited under
the hero caption.
New gate 24: sitemap.xml lists every public page once, with its twin's hreflang
pair, and lists nothing else. Decoy: site/sitemap-missing-page, the exact shape
the reviewer found by hand.
site.css ?v=30; hero clip and poster ?v=2.
597 lines
33 KiB
HTML
597 lines
33 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="hu" class="no-js">
|
||
<head>
|
||
<script>document.documentElement.className=document.documentElement.className.replace('no-js','js');</script>
|
||
<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">
|
||
|
||
<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">
|
||
<link rel="alternate" hreflang="hu" href="https://felhom.eu/kapcsolat">
|
||
<link rel="alternate" hreflang="en" href="https://felhom.eu/en/contact">
|
||
<link rel="alternate" hreflang="x-default" 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="preload" as="font" type="font/woff2" crossorigin href="/assets/fonts/pjs-latin.woff2">
|
||
<link rel="preload" as="font" type="font/woff2" crossorigin href="/assets/fonts/pjs-latin-ext.woff2">
|
||
<!-- shared assets: bump ?v= together on any site.css/icons.svg change -->
|
||
<link rel="stylesheet" href="/assets/site.css?v=30">
|
||
<link rel="stylesheet" href="/assets/shell.css?v=25">
|
||
<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>
|
||
</head>
|
||
<body class="shell page-kapcsolat">
|
||
<header class="mobile-topbar">
|
||
<a href="/" class="mobile-topbar-logo"><img src="/assets/logo_notext_white.svg" alt="Felhom.eu"></a>
|
||
<button type="button" class="nav-burger" id="navBurger" aria-expanded="false" aria-controls="sidebar" aria-label="Menü">
|
||
<span class="hamburger-box"><span class="hamburger-line"></span><span class="hamburger-line"></span><span class="hamburger-line"></span></span>
|
||
</button>
|
||
</header>
|
||
<div class="nav-backdrop" id="navBackdrop" hidden></div>
|
||
<nav class="sidebar" id="sidebar">
|
||
<div class="sidebar-header">
|
||
<a href="/" class="sidebar-logo-link">
|
||
<img src="/assets/logo_notext_white.svg" alt="" class="sidebar-logo" aria-hidden="true">
|
||
<img src="/assets/logo-wordmark.png" alt="felhom.eu" class="sidebar-word">
|
||
</a>
|
||
</div>
|
||
<ul class="nav-links">
|
||
<li><a href="/"><svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-home"/></svg>Kezdőlap</a></li>
|
||
<li><a href="/szolgaltatasok"><svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-rocket"/></svg>Szolgáltatások</a></li>
|
||
<li class="nav-group">
|
||
<button type="button" class="nav-group-toggle" aria-expanded="false" aria-controls="nav-group-apps"><svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-package"/></svg>Alkalmazások<svg class="ico nav-chevron" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-chevron-down"/></svg></button>
|
||
<ul id="nav-group-apps" class="nav-links nav-links-sub nav-links-nested">
|
||
<li><a href="/alkalmazasok">Az alkalmazásokról</a></li>
|
||
<li><a href="/alkalmazasok#fajlkezeles">Fájlkezelés & Irodai</a></li>
|
||
<li><a href="/alkalmazasok#media">Média & Szórakozás</a></li>
|
||
<li><a href="/alkalmazasok#otthon">Otthon & Életmód</a></li>
|
||
<li><a href="/alkalmazasok#produktivitas">Produktivitás & Tudáskezelés</a></li>
|
||
<li><a href="/alkalmazasok#rendszer">Rendszer & Fejlesztés</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a href="/technologiak"><svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-layers"/></svg>Technológiák</a></li>
|
||
<li><a href="/biztonsagimentes"><svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-shield-check"/></svg>Biztonsági mentés</a></li>
|
||
</ul>
|
||
<div class="sidebar-bottom">
|
||
<a href="/teszteles" class="btn btn-primary sidebar-cta">Jelentkezem tesztelőnek →</a>
|
||
<div class="nav-group-label">A Felhomról</div>
|
||
<ul class="nav-links nav-links-sub">
|
||
<li><a href="/#hogyan-mukodik">Hogyan működik</a></li>
|
||
<li><a href="/gyik">GYIK</a></li>
|
||
<li><a href="/kapcsolat" class="active">Kapcsolat</a></li>
|
||
</ul>
|
||
<div class="sidebar-footer">
|
||
<details class="lang-globe"><summary class="lang-globe-btn" aria-label="Nyelv" title="Nyelv"><svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-globe"/></svg></summary><ul class="lang-globe-menu"><li><a href="/kapcsolat" lang="hu" hreflang="hu" class="lang-globe-item current" aria-current="true">Magyar</a></li><li><a href="/en/contact" lang="en" hreflang="en" class="lang-globe-item">English</a></li></ul></details>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
<main class="content">
|
||
<div class="page-header">
|
||
<h1>Írj nekem <span>bátran!</span></h1>
|
||
</div>
|
||
<p class="page-lede">Kérdésed van, vagy szeretnéd megbeszélni az igényeidet? Töltsd ki az űrlapot, és hamarosan válaszolok.</p>
|
||
<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="zart-teszt">Zárt teszt – jelentkezem tesztelőnek</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-3); 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"><svg class="ico-tile" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-paperclip"/></svg></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">
|
||
<label class="cb-hit" for="privacy"><input type="checkbox" id="privacy" name="privacy" required></label>
|
||
<label for="privacy">
|
||
Elolvastam az <a href="/adatkezeles" target="_blank" rel="noopener">Adatkezelési tájékoztatót</a>, és hozzájárulok, hogy a megadott nevemet, e-mail-címemet, üzenetemet és csatolt fájljaimat a megkeresésem megválaszolására kezeljék. Az üzenetet levélküldő és levelezési szolgáltatók továbbítják. A hozzájárulásomat bármikor visszavonhatom az info@felhom.eu címen.
|
||
</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"><svg class="ico-lg" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-mail"/></svg></span> Közvetlen email</h3>
|
||
<p>Ha inkább emailben írnál:</p>
|
||
<a href="mailto:info@felhom.eu" class="direct-email">
|
||
<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-mail"/></svg> info@felhom.eu
|
||
</a>
|
||
</div>
|
||
|
||
<div class="sidebar-card">
|
||
<h3><span class="icon"><svg class="ico-lg" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-clock"/></svg></span> Válaszidő</h3>
|
||
<p>Általában <strong style="color: var(--blue-bright);">1–2 napon belül</strong> válaszolok.</p>
|
||
<p>A zárt teszt alatt válaszidőt nem vállalok – ez a teszt feltételeiben is így áll.</p>
|
||
</div>
|
||
|
||
<div class="sidebar-card">
|
||
<h3><span class="icon"><svg class="ico-lg" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-lightbulb"/></svg></span> Miben segíthetek?</h3>
|
||
<ul class="sidebar-list">
|
||
<li><span class="li-icon"><svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-package"/></svg></span> Alkalmazás telepítés és beállítás</li>
|
||
<li><span class="li-icon"><svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-lock"/></svg></span> Biztonsági mentés kialakítás</li>
|
||
<li><span class="li-icon"><svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-monitor"/></svg></span> Kérdés a zárt tesztről</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<section class="content-section alt-bg" id="ki-all-mogotte">
|
||
<div class="container">
|
||
<div class="who">
|
||
<figure class="who-photo">
|
||
<img src="/assets/operator-portrait.webp" alt="Nagyfenyvesi Viktor, a Felhom üzemeltetője" width="720" height="900" loading="lazy">
|
||
</figure>
|
||
<div class="who-text">
|
||
<h2>Ki áll <span>mögötte</span></h2>
|
||
<p><strong>Nagyfenyvesi Viktor vagyok.</strong> Tíz éve tervezek hálózatokat és infrastruktúrát, ma DevOps mérnökként dolgozom, otthon pedig évek óta megy a saját szerverem; a mostani nagyjából egy éve fut.</p>
|
||
<p>A Felhom onnan indult, hogy ilyen szolgáltatást itthon nem találtam. Saját szervert sokan meg tudnak építeni, de utána menteni, frissíteni és figyelni is kell valakinek. Ezt a részét vállalom át.</p>
|
||
<p>Ha írsz, én válaszolok, és nem ígérek olyat, amit a doboz ma nem tud.</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
<footer>
|
||
<div class="container">
|
||
<p>© 2026 felhom.eu – Saját felhőd, saját szabályaid</p>
|
||
<p class="footer-legal">Üzemeltető: Nagyfenyvesi Viktor · <a href="mailto:info@felhom.eu">info@felhom.eu</a> · <a href="/adatkezeles">Adatkezelési tájékoztató</a> · <a href="/feltetelek">Feltételek</a> · <a href="https://www.facebook.com/felhom.eu">Facebook</a></p>
|
||
</div>
|
||
</footer>
|
||
</main>
|
||
|
||
<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 = [];
|
||
|
||
// Preselect the subject from ?tema= (the „Zárt teszt" CTA on the landing page
|
||
// links here as /kapcsolat?tema=zart-teszt). Unknown values are ignored.
|
||
(function preselectSubject() {
|
||
const wanted = new URLSearchParams(window.location.search).get('tema');
|
||
if (!wanted) return;
|
||
const select = document.getElementById('subject');
|
||
if (!select) return;
|
||
const match = Array.from(select.options).some(o => o.value === wanted);
|
||
if (match) {
|
||
select.value = wanted;
|
||
} else {
|
||
console.warn('[kapcsolat] unknown ?tema= value, ignoring:', wanted);
|
||
}
|
||
})();
|
||
|
||
// ==============================================
|
||
// 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: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-file-text"/></svg>', doc: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-file-text"/></svg>', docx: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-file-text"/></svg>', xls: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-chart-column"/></svg>', xlsx: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-chart-column"/></svg>',
|
||
png: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-image"/></svg>', jpg: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-image"/></svg>', jpeg: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-image"/></svg>', gif: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-image"/></svg>', webp: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-image"/></svg>',
|
||
txt: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-file-text"/></svg>', csv: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-chart-column"/></svg>', zip: '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-package"/></svg>', '7z': '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-package"/></svg>',
|
||
};
|
||
return icons[ext] || '<svg class="ico" aria-hidden="true"><use href="/assets/icons.svg?v=1#i-paperclip"/></svg>';
|
||
}
|
||
|
||
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 = {
|
||
'zart-teszt': 'Jelentkezés – zárt teszt',
|
||
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('Az üzeneted elment. Hamarosan válaszolok.', '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 b=document.getElementById('navBurger'),s=document.getElementById('sidebar'),k=document.getElementById('navBackdrop');
|
||
if(!b||!s||!k)return;
|
||
function open(){s.classList.add('is-open');k.hidden=false;document.body.classList.add('nav-open');b.setAttribute('aria-expanded','true');}
|
||
function close(){s.classList.remove('is-open');k.hidden=true;document.body.classList.remove('nav-open');b.setAttribute('aria-expanded','false');}
|
||
b.addEventListener('click',function(){s.classList.contains('is-open')?close():open();});
|
||
k.addEventListener('click',close);
|
||
document.addEventListener('keydown',function(e){if(e.key==='Escape'&&s.classList.contains('is-open')){close();b.focus();}});
|
||
s.querySelectorAll('a').forEach(function(l){l.addEventListener('click',close);});
|
||
window.addEventListener('resize',function(){if(window.innerWidth>768)close();});
|
||
})();
|
||
document.addEventListener('click',function(e){
|
||
var btn=e.target.closest?e.target.closest('.nav-group-toggle'):null;
|
||
if(!btn)return;
|
||
var g=btn.closest('.nav-group');if(!g)return;
|
||
var willOpen=!g.classList.contains('is-open');
|
||
document.querySelectorAll('.nav-group.is-open').forEach(function(x){
|
||
x.classList.remove('is-open');
|
||
var t=x.querySelector('.nav-group-toggle');if(t)t.setAttribute('aria-expanded','false');
|
||
});
|
||
if(willOpen){g.classList.add('is-open');btn.setAttribute('aria-expanded','true');}
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|