Poprawki w stylach oraz zmienne środowiskowe dla smtp
This commit is contained in:
@@ -11,6 +11,8 @@ services:
|
|||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
- FUZ_DB_PATH=/app/data/ServicesRange.db
|
- FUZ_DB_PATH=/app/data/ServicesRange.db
|
||||||
|
- SMTP_FROM_NAME="Formularz kontaktowy FUZ"
|
||||||
|
- SMTP_TO="cieniu2009@gmail.com"
|
||||||
ports:
|
ports:
|
||||||
- "4000:4321"
|
- "4000:4321"
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 87 KiB |
@@ -1,55 +1,47 @@
|
|||||||
---
|
---
|
||||||
import yaml from "js-yaml";
|
import yaml from "js-yaml";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import "../../styles/footer.css";
|
|
||||||
|
|
||||||
const footer = yaml.load(
|
const footer = yaml.load(
|
||||||
fs.readFileSync("./src/content/site/footer.yaml", "utf8"),
|
fs.readFileSync("./src/content/site/footer.yaml", "utf8"),
|
||||||
);
|
);
|
||||||
---
|
---
|
||||||
|
|
||||||
<footer
|
<footer class="f-footer">
|
||||||
class="fuz-footer mt-0 border-t border-gray-200 dark:border-slate-700"
|
<div class="f-footer-inner">
|
||||||
>
|
<div class="f-footer-col space-y-1">
|
||||||
<!-- GŁÓWNY GRID -->
|
<h3 class="f-footer-col-title">{footer.company.name}</h3>
|
||||||
<div class="footer-inner max-w-7xl mx-auto px-6 grid md:grid-cols-3 gap-12">
|
<p class="f-footer-col-text">
|
||||||
<!-- Kolumna 1 – Firma -->
|
|
||||||
<div class="footer-col space-y-3">
|
|
||||||
<h3 class="fuz-footer-title">{footer.company.name}</h3>
|
|
||||||
<p class="fuz-footer-text leading-relaxed">
|
|
||||||
{footer.company.address.line1}<br />
|
{footer.company.address.line1}<br />
|
||||||
{footer.company.address.line2}
|
{footer.company.address.line2}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Kolumna 2 – Kontakt -->
|
<div class="f-footer-col space-y-1">
|
||||||
<div class="footer-col space-y-1">
|
<h4 class="f-footer-col-title">Kontakt</h4>
|
||||||
<h4 class="fuz-footer-title">Kontakt</h4>
|
|
||||||
{
|
{
|
||||||
footer.contact.phones.map((phone: string) => (
|
footer.contact.phones.map((phone: string) => (
|
||||||
<p class="fuz-footer-text">
|
<p class="f-footer=col-text">
|
||||||
<a href={`tel:${phone.replace(/\s/g, "")}`} class="fuz-footer-link">
|
{/* <a href={`tel:${phone.replace(/\s/g, "")}`} class="fuz-footer-link"> */}
|
||||||
{phone}
|
{phone}
|
||||||
</a>
|
{/* </a> */}
|
||||||
</p>
|
</p>
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
<p class="f-footer-col-text">
|
||||||
<p class="fuz-footer-text">
|
<a href={`mailto:${footer.contact.email}`}>
|
||||||
<a href={`mailto:${footer.contact.email}`} class="fuz-footer-link">
|
|
||||||
{footer.contact.email}
|
{footer.contact.email}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Kolumna 3 – Usługi -->
|
<div class="f-footer-col space-y-1">
|
||||||
<div class="footer-col">
|
<h4 class="f-footer-col-title">Usługi</h4>
|
||||||
<h4 class="fuz-footer-title">Usługi</h4>
|
<ul>
|
||||||
<ul class="space-y-1">
|
|
||||||
{
|
{
|
||||||
footer.services.map((item: any) => (
|
footer.services.map((item: any) => (
|
||||||
<li>
|
<li>
|
||||||
<a href={item.url} class="fuz-footer-link" title={item.title}>
|
<a href={item.url} title={item.title}>
|
||||||
{item.name}
|
{item.name}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -59,16 +51,9 @@ const footer = yaml.load(
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- DÓŁ FOOTERA -->
|
<div class="f-footer-copyright">
|
||||||
<div
|
|
||||||
class="text-center py-0 text-sm"
|
|
||||||
>
|
|
||||||
© {new Date().getFullYear()} FUZ Adam Rojek. Wszystkie prawa zastrzeżone.
|
© {new Date().getFullYear()} FUZ Adam Rojek. Wszystkie prawa zastrzeżone.
|
||||||
|
|
||||||
<!-- ReCAPTCHA info -->
|
<div class="f-footer-recaptcha" set:html={footer.recaptcha} />
|
||||||
<div
|
|
||||||
class="mt-2 fuz-footer-text text-xs"
|
|
||||||
set:html={footer.recaptcha}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -8,29 +8,37 @@ const links = [
|
|||||||
{ name: "INTERNET RADIOWY", href: "/internet-radiowy" },
|
{ name: "INTERNET RADIOWY", href: "/internet-radiowy" },
|
||||||
{ name: "TELEFON", href: "/telefon" },
|
{ name: "TELEFON", href: "/telefon" },
|
||||||
{ name: "ZASIĘG SIECI", href: "/mapa-zasiegu" },
|
{ name: "ZASIĘG SIECI", href: "/mapa-zasiegu" },
|
||||||
{ name: "KONTAKT", href: "/#contact" }
|
{ name: "KONTAKT", href: "/#contact" },
|
||||||
|
{
|
||||||
|
name: "BOK",
|
||||||
|
href: "https://panel.fuz.pl/userpanel/auth",
|
||||||
|
external: true,
|
||||||
|
target: "_blank",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
---
|
---
|
||||||
|
|
||||||
<nav class="fuz-navbar">
|
<nav class="fuz-navbar">
|
||||||
<div class="fuz-navbar-inner">
|
<div class="fuz-navbar-inner">
|
||||||
|
|
||||||
<!-- Logo -->
|
|
||||||
<a href="/" class="flex items-center gap-2 font-semibold">
|
<a href="/" class="flex items-center gap-2 font-semibold">
|
||||||
<!-- <span class="inline-flex h-8 w-8 items-center justify-center rounded-full text-sm font-bold"> -->
|
<img src="/assets/logo.webp" alt="FUZ Logo" class="my-0" />
|
||||||
<img src="/assets/logo.webp" alt="FUZ Logo" class="my-0"/>
|
|
||||||
</span>
|
|
||||||
<!-- <span>FUZ</span> -->
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- Linki desktop -->
|
|
||||||
<div class="hidden md:flex fuz-navbar-links">
|
<div class="hidden md:flex fuz-navbar-links">
|
||||||
{links.map(link => (
|
{
|
||||||
<a href={link.href} class="fuz-navbar-link">{link.name}</a>
|
links.map((link) => (
|
||||||
))}
|
<a
|
||||||
|
href={link.href}
|
||||||
|
class="fuz-navbar-link"
|
||||||
|
target={link.target}
|
||||||
|
rel={link.target === "_blank" ? "noopener noreferrer" : undefined}
|
||||||
|
>
|
||||||
|
{link.name}
|
||||||
|
</a>
|
||||||
|
))
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Mobilne menu (hamburger + panel) -->
|
|
||||||
<MobileMenu client:load links={links} />
|
<MobileMenu client:load links={links} />
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -21,10 +21,6 @@ contactFormTitle: Pisząc wiadomość ...
|
|||||||
maps:
|
maps:
|
||||||
mapId: "8e0a97af9476f2d3"
|
mapId: "8e0a97af9476f2d3"
|
||||||
|
|
||||||
mail:
|
|
||||||
from_name: "www.fuz.pl"
|
|
||||||
to: "cieniu2009@gmail.com"
|
|
||||||
|
|
||||||
form:
|
form:
|
||||||
firstName:
|
firstName:
|
||||||
placeholder: "Imię"
|
placeholder: "Imię"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useState } from "preact/hooks";
|
import { useEffect, useState } from "preact/hooks";
|
||||||
import "../styles/cookie.css";
|
// import "../styles/cookie.css";
|
||||||
|
|
||||||
export default function Cookie({ config }) {
|
export default function Cookie({ config }) {
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
@@ -27,20 +27,20 @@ export default function Cookie({ config }) {
|
|||||||
transform: visible ? "translateY(0)" : "translateY(100%)",
|
transform: visible ? "translateY(0)" : "translateY(100%)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class="cookie-panel-inner max-w-4xl mx-auto flex flex-col md:flex-row items-start md:items-center justify-between gap-4">
|
<div class="f-cookie-panel-inner">
|
||||||
|
|
||||||
<p class="text-sm leading-snug">
|
<p class="f-cookie-text">
|
||||||
{config.text.message}
|
{config.text.message}
|
||||||
<a href={config.links.privacy} class="cookie-privacy-link ml-1">
|
<a href={config.links.privacy} class="f-cookie-privacy-link" rel="noopener noreferrer">
|
||||||
{config.text.more}
|
{config.text.more}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="flex gap-3 shrink-0">
|
<div class="flex gap-3 shrink-0">
|
||||||
<button onClick={() => handle("accepted")} class="cookie-accept">
|
<button onClick={() => handle("accepted")} class="f-cookie-accept">
|
||||||
{config.text.accept}
|
{config.text.accept}
|
||||||
</button>
|
</button>
|
||||||
<button onClick={() => handle("rejected")} class="cookie-reject">
|
<button onClick={() => handle("rejected")} class="f-cookie-reject">
|
||||||
{config.text.reject}
|
{config.text.reject}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,36 +1,27 @@
|
|||||||
import type { APIRoute } from "astro";
|
import type { APIRoute } from "astro";
|
||||||
import nodemailer from "nodemailer";
|
import nodemailer from "nodemailer";
|
||||||
import yaml from "js-yaml";
|
|
||||||
import fs from "fs";
|
|
||||||
|
|
||||||
export const POST: APIRoute = async ({ request }) => {
|
export const POST: APIRoute = async ({ request }) => {
|
||||||
try {
|
try {
|
||||||
const form = await request.json();
|
const form = await request.json();
|
||||||
|
|
||||||
// Wczytanie YAML
|
|
||||||
const mailCfg = yaml.load(
|
|
||||||
fs.readFileSync("./src/content/contact/contact.yaml", "utf8")
|
|
||||||
) as any;
|
|
||||||
|
|
||||||
// Stworzenie transportera
|
|
||||||
const transporter = nodemailer.createTransport({
|
const transporter = nodemailer.createTransport({
|
||||||
host: import.meta.env.SMTP_HOST,
|
host: import.meta.env.SMTP_HOST,
|
||||||
port: Number(import.meta.env.SMTP_PORT),
|
port: Number(import.meta.env.SMTP_PORT),
|
||||||
secure: true,
|
secure: true, // 465 = SSL
|
||||||
auth: {
|
auth: {
|
||||||
user: import.meta.env.SMTP_USER,
|
user: import.meta.env.SMTP_USER,
|
||||||
pass: import.meta.env.SMTP_PASS,
|
pass: import.meta.env.SMTP_PASS,
|
||||||
},
|
},
|
||||||
tls: {
|
tls: {
|
||||||
rejectUnauthorized: false,
|
rejectUnauthorized: false, // wymagane przez Webio
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Wysyłka
|
|
||||||
await transporter.sendMail({
|
await transporter.sendMail({
|
||||||
from: `"${mailCfg.mail.from_name}" <${import.meta.env.SMTP_USER}>`,
|
from: `"${import.meta.env.SMTP_FROM_NAME}" <${import.meta.env.SMTP_USER}>`,
|
||||||
to: mailCfg.mail.to,
|
to: import.meta.env.SMTP_TO,
|
||||||
subject: `Od ${form.firstName} ${form.lastName}`,
|
subject: `FUZ: wiadomość od ${form.firstName} ${form.lastName}`,
|
||||||
text: `
|
text: `
|
||||||
Imię: ${form.firstName}
|
Imię: ${form.firstName}
|
||||||
Nazwisko: ${form.lastName}
|
Nazwisko: ${form.lastName}
|
||||||
@@ -40,13 +31,13 @@ Temat: ${form.subject}
|
|||||||
|
|
||||||
Wiadomość:
|
Wiadomość:
|
||||||
${form.message}
|
${form.message}
|
||||||
`,
|
`.trim()
|
||||||
});
|
});
|
||||||
|
|
||||||
return new Response(JSON.stringify({ ok: true }), { status: 200 });
|
return new Response(JSON.stringify({ ok: true }), { status: 200 });
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("MAIL ERROR:", error);
|
console.error("MAIL ERROR:", error);
|
||||||
return new Response(JSON.stringify({ ok: false, error }), { status: 500 });
|
return new Response(JSON.stringify({ ok: false }), { status: 500 });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
@import "./buttons.css";
|
@import "./buttons.css";
|
||||||
@import "./sections.css";
|
@import "./sections.css";
|
||||||
@import "./markdown.css";
|
@import "./markdown.css";
|
||||||
|
@import "./footer.css";
|
||||||
|
@import "./cookie.css";
|
||||||
|
|
||||||
.grecaptcha-badge {
|
.grecaptcha-badge {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
|
|||||||
@@ -1,50 +1,48 @@
|
|||||||
#cookie-banner {
|
@layer components {
|
||||||
position: fixed;
|
#cookie-banner {
|
||||||
bottom: 0;
|
@apply fixed bottom-0 left-0 w-full translate-y-full transition-transform duration-500 ease-in-out;
|
||||||
left: 0;
|
background: var(--fuz-bg-invert);
|
||||||
width: 100%;
|
color: var(--fuz-text-invert);
|
||||||
transform: translateY(100%);
|
border-top: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
transition: transform 0.4s ease;
|
}
|
||||||
/* z-index: 9999; */
|
|
||||||
|
|
||||||
background: var(--fuz-bg-invert);
|
.f-cookie-panel-inner {
|
||||||
color: var(--fuz-text-invert);
|
@apply max-w-4xl mx-auto flex flex-col md:flex-row items-start
|
||||||
border-top: 1px solid rgba(0,0,0,0.1);
|
md:items-center justify-between gap-4 px-6 py-6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cookie-panel-inner {
|
.f-cookie-text{
|
||||||
padding: 1rem 1.5rem;
|
@apply text-base leading-snug;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cookie-privacy-link {
|
.f-cookie-privacy-link {
|
||||||
color: var(--fuz-link);
|
@apply ml-3;
|
||||||
text-decoration: underline;
|
color: var(--btn-outline-invert);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cookie-privacy-link:hover {
|
.f-cookie-accept,
|
||||||
color: var(--fuz-link-hover);
|
.f-cookie-reject {
|
||||||
}
|
@apply px-4 py-2 rounded-md text-sm font-medium transition-colors;
|
||||||
|
}
|
||||||
|
|
||||||
.cookie-accept,
|
.f-cookie-accept {
|
||||||
.cookie-reject {
|
background: var(--btn-bg-invert);
|
||||||
@apply px-4 py-2 rounded-md text-sm font-medium;
|
color: var(--btn-text-invert);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cookie-accept {
|
.f-cookie-accept:hover {
|
||||||
background: var(--btn-bg-invert);
|
background: var(--fuz-accent-hover);
|
||||||
color: var(--btn-text-invert);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.cookie-accept:hover {
|
.f-cookie-reject {
|
||||||
background: var(--fuz-accent-hover);
|
@apply border;
|
||||||
}
|
border-color: var(--btn-outline-invert);
|
||||||
|
color: var(--btn-outline-invert);
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
.cookie-reject {
|
.f-cookie-reject:hover {
|
||||||
background: transparent;
|
background: var(--btn-outline-bg-invert);
|
||||||
border: 1px solid var(--btn-outline-invert);
|
}
|
||||||
color: var(--btn-outline-invert);
|
|
||||||
}
|
|
||||||
|
|
||||||
.cookie-reject:hover {
|
|
||||||
background: var(--btn-outline-bg-invert);
|
|
||||||
}
|
}
|
||||||
@@ -1,26 +1,31 @@
|
|||||||
.fuz-footer-title {
|
@layer components {
|
||||||
@apply text-xl font-semibold;
|
.f-footer {
|
||||||
}
|
@apply mt-0 border-t border-[var(--fuz-border)] bg-[var(--fuz-bg)] text-[var(--fuz-text)] pt-2;
|
||||||
|
}
|
||||||
|
|
||||||
.fuz-footer-text {
|
.f-footer-inner {
|
||||||
@apply text-base;
|
@apply max-w-7xl mx-auto px-6 grid md:grid-cols-3 gap-12;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Linki */
|
.f-footer-col {
|
||||||
/* .fuz-footer-link {
|
@apply max-w-sm pt-4;
|
||||||
color: var(--fuz-text);
|
}
|
||||||
text-decoration: none;
|
|
||||||
transition: opacity 0.2s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fuz-footer-link:hover {
|
.f-footer-col-title {
|
||||||
opacity: 0.7;
|
@apply text-xl font-semibold;
|
||||||
} */
|
|
||||||
|
|
||||||
.footer-col {
|
}
|
||||||
@apply max-w-sm pt-4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-inner {
|
.f-footer-col-text {
|
||||||
@apply w-full px-6 max-w-screen-2xl mx-auto flex flex-col gap-10 md:flex-row md:justify-between md:items-start;
|
@apply text-base;
|
||||||
|
}
|
||||||
|
|
||||||
|
.f-footer-copyright {
|
||||||
|
@apply text-center py-4 text-base text-[var(--fuz-text)];
|
||||||
|
/* text-center py-0 text-sm */
|
||||||
|
}
|
||||||
|
|
||||||
|
.f-footer-recaptcha {
|
||||||
|
@apply text-base;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
--btn-ghost-text: var(--fuz-text);
|
--btn-ghost-text: var(--fuz-text);
|
||||||
--btn-ghost-hover-bg: rgba(0, 0, 0, 0.05);
|
--btn-ghost-hover-bg: rgba(0, 0, 0, 0.05);
|
||||||
|
--fuz-border: rgb(229, 231, 235);
|
||||||
}
|
}
|
||||||
|
|
||||||
:root.dark {
|
:root.dark {
|
||||||
@@ -61,6 +62,8 @@
|
|||||||
|
|
||||||
--btn-ghost-text: var(--fuz-text);
|
--btn-ghost-text: var(--fuz-text);
|
||||||
--btn-ghost-hover-bg: rgba(255,255,255,0.08);
|
--btn-ghost-hover-bg: rgba(255,255,255,0.08);
|
||||||
|
|
||||||
|
--fuz-border: rgb(229, 231, 235);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Body */
|
/* Body */
|
||||||
|
|||||||
Reference in New Issue
Block a user