Refactor and enhance Gallus Pub website:

- **Added component-specific styles**: Introduced scoped CSS files for `Hero`, `Header`, `Drinks`, `Footer`, and `Welcome` components.
- **Expanded functionality**: Added `Drinks` section with a new layout and stylized elements.
- **Assets fix**: Replaced asset links with correct paths, ensuring consistency for images and files (e.g., `Welcome.png`, `Menu.pdf`).
- **Reorganized header and footer**: Modernized `Header` layout with a fixed navbar, added utility spacer, and redesigned footer to include additional details.
- **Integrated Docker and CI/CD**: Added `Dockerfile`, `fly.toml`, and `.woodpecker.yml` for multi-environment deployment.
- **Improved homepage**: Incorporated `Drinks` component and updated styles for cohesive design.
- **CSS cleanup**: Removed redundant global styles from `index.css` and migrated them to appropriate scoped styles.

Complete revamp to provide modular and deployable updates for long-term scalability.
This commit is contained in:
k
2025-07-19 15:47:22 +02:00
parent 675594ae8a
commit 89e1683eee
21 changed files with 587 additions and 220 deletions

View File

@ -0,0 +1,26 @@
pipeline:
build:
image: node:20-alpine
commands:
- npm ci
- npm run build
when:
branch: main
event: [push, pull_request]
deploy:
depends_on: [build]
image: flyio/flyctl:latest
secrets: [fly_api_token]
commands:
- flyctl deploy --remote-only
when:
branch: main
event: push
branches:
include: [main, dev]
cache:
mount:
- node_modules
- .npm

25
Gallus_Pub_v1/Dockerfile Normal file
View File

@ -0,0 +1,25 @@
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-alpine AS production
WORKDIR /app
RUN npm install -g serve
COPY --from=build /app/dist /app
EXPOSE 3000
CMD ["serve", "-s", ".", "-l", "3000"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost:3000/ || exit 1

42
Gallus_Pub_v1/fly.toml Normal file
View File

@ -0,0 +1,42 @@
app = "gallus-pub"
primary_region = "fra" # Frankfurt region, change if needed
kill_signal = "SIGINT"
kill_timeout = 5
[build]
dockerfile = "Dockerfile"
[env]
PORT = "3000"
NODE_ENV = "production"
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]
[http_service.concurrency]
type = "connections"
hard_limit = 1000
soft_limit = 500
[[http_service.checks]]
interval = "30s"
timeout = "5s"
grace_period = "10s"
method = "GET"
path = "/"
protocol = "http"
tls_skip_verify = false
[metrics]
port = 9091
path = "/metrics"
[[vm]]
memory = "512MB"
cpu_kind = "shared"
cpus = 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

View File

@ -0,0 +1,25 @@
---
import "../../styles/components/Drinks.css"
---
<div class="Drinks">
<div class="title">Drinks</div>
<a href="/pdf/Menu.pdf" class="card-link" target="_blank" rel="noopener noreferrer">Getränkekarte</a>
<div class="monats-hit">Monats Hit</div>
<div class="mate-vodka">
<div class="circle"></div>
<div>Mate Vodka</div>
</div>
<div class="circle-row">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
<div class="note">
Wir bieten eine Auswahl...
</div>
</div>

View File

@ -6,6 +6,7 @@ interface Event {
description: string; description: string;
} }
const { events = [] }: { events?: Event[] } = Astro.props as { events?: Event[] }; const { events = [] }: { events?: Event[] } = Astro.props as { events?: Event[] };
import '/styles/components/EventsGrid.css';
--- ---
<section class="events-gird container"> <section class="events-gird container">
@ -23,4 +24,4 @@ const { events = [] }: { events?: Event[] } = Astro.props as { events?: Event[]
))} ))}
</section> </section>

View File

@ -1,9 +1,44 @@
--- ---
// src/components/Footer.astro // src/components/Footer.astro
import "/styles/components/Footer.css"
const currentYear = new Date().getFullYear();
--- ---
<footer class="footer"> <footer class="footer">
<p> <div class="footer-content">
&copy; {new Date().getFullYear()} Gallus Pub. Alle Rechte vorbehalten. <div class="copyright">
</p> &copy; {currentYear} Gallus Pub. Alle Rechte vorbehalten.
</div>
<div class="footer-sections">
<div class="footer-section">
<h3>Öffnungszeiten</h3>
<p>Mittwoch: 19:00 - 00:00</p>
<p>Donnerstag: 19:00 - 00:00</p>
<p>Freitag: 19:00 - 01:00</p>
<p>Samstag: 19:00 - 01:00</p>
</div>
<div class="footer-section">
<h3>Kontakt</h3>
<p>Gallus Pub</p>
<p>Metzgergasse 13</p>
<p>9000 St. Gallen</p>
<p>Reservierungen via Whatsapp</p>
<p><a href="tel:0772322770">077 232 27 70</a></p>
</div>
<div class="footer-section">
<h3>Raumreservationen</h3>
<p>Du planst einen Event?</p>
<p>Der "St.Gallerruum" im 2.OG</p>
<p>kann gemietet werden.</p>
<br/>
<p>Gerne öffnen wir auf Anfrage</p>
<p>auch ausserhalb unserer</p>
<p>Betriebszeiten.</p>
</div>
</div>
</div>
</footer> </footer>

View File

@ -1,14 +1,15 @@
--- ---
// src/components/Header.astro // src/components/Header.astro
const { url } = Astro; const { url } = Astro;
import "../../styles/components/Header.css"
--- ---
<header class="header"> <header class="header">
<div> <div class="logo-container">
<a href="/">
<img src="/Gallus_Pub_v1/public/images/Logo.png" alt="Gallus Pub Logo" /> <img src="/images/Logo.png" alt="Logo" class="logo">
</a>
</div> </div>
<!-- Hauptnavigation: immer Home, About, Contact --> <!-- Hauptnavigation: immer Home, About, Contact -->
@ -35,3 +36,4 @@ const { url } = Astro;
</nav> </nav>
</header> </header>
<div class="header-spacer"></div>

View File

@ -1,5 +1,6 @@
--- ---
// src/components/Hero.astro // src/components/Hero.astro
import "../../styles/components/Hero.css"
--- ---
<section class="hero container"> <section class="hero container">
@ -18,3 +19,18 @@
</div> </div>
</section> </section>
<style>
.hero-overlay {
background-image: url('/images/Background.png');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
margin-top: 2em;
}
h1 {
padding-top: 2em;
}
</style>

View File

@ -13,7 +13,7 @@ import Footer from "./Footer.astro";
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gallus Pub</title> <title>Gallus Pub</title>
<link rel="stylesheet" href="/styles/index.css" /> <link rel="stylesheet" href="/Gallus_Pub_v1/styles/index.css" />
</head> </head>

View File

@ -1,5 +1,6 @@
--- ---
// src/components/Welcome.astro // src/components/Welcome.astro
import "../../styles/components/Welcome.css"
--- ---
<section class="welcome container"> <section class="welcome container">
@ -48,9 +49,7 @@
<div class="welcome-image"> <div class="welcome-image">
<img src="/images/Welcome.png" alt="Welcome backgrount image" />
<img src="/Gallus_Pub_v1/public/images/Background.png" alt="Welcome backgrount image" />
</div> </div>
</section> </section>

View File

@ -1,11 +0,0 @@
---
import Layout from "../components/Layout.astro";
---
<Layout>
<h1>Drinks</h1>
<p>Hier findest du alle aktuellen und kommenden Drinks im Gallus Pub.</p>
</Layout>

View File

@ -1,9 +1,11 @@
--- ---
// src/pages/index.astro // src/pages/index.astro
import "../../styles/index.css"
import Layout from "../components/Layout.astro"; import Layout from "../components/Layout.astro";
import Hero from "../components/Hero.astro"; import Hero from "../components/Hero.astro";
import Welcome from "../components/Welcome.astro"; import Welcome from "../components/Welcome.astro";
import EventsGrid from '../components/EventsGrid.astro'; import EventsGrid from '../components/EventsGrid.astro';
import Drinks from "../components/Drinks.astro";
const events = [ const events = [
{ title: 'Karaoke Night', date: 'Mi, 23. Juli 2025', description: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua' }, { title: 'Karaoke Night', date: 'Mi, 23. Juli 2025', description: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua' },
@ -18,5 +20,5 @@ const events = [
<Hero /> <Hero />
<Welcome /> <Welcome />
<EventsGrid events={events} /> <EventsGrid events={events} />
<Drinks />
</Layout> </Layout>

View File

@ -0,0 +1,57 @@
.Drinks {
font-family: sans-serif;
display: flex;
flex-direction: column;
align-items: center;
margin-top: 2rem;
text-align: center;
background-color: #fff;
color: #ceb39b;
padding: 2rem;
width: 100%;
}
.title {
font-size: 1.5rem;
margin-bottom: 1rem;
}
.card-link {
border: 1px solid #000;
padding: 0.5rem 1rem;
margin-bottom: 2rem;
color: #fff;
background: linear-gradient(45deg, #ffa500, #ff7f00);
}
.monats-hit {
margin-bottom: 1rem;
}
.mate-vodka {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 1rem;
}
.circle {
height: 6em;
width: 6em;
border: 2px solid #000;
border-radius: 50%;
margin: 1rem;
}
.circle-row {
display: flex;
justify-content: center;
gap: 2rem;
margin: 1rem 0;
}
.note {
margin-top: 2rem;
font-style: italic;
text-align: center;
}

View File

@ -0,0 +1,32 @@
article {
margin-bottom: 1em;
}
.events-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 2rem;
margin: 3rem 0;
}
.event-card {
background-color: #2a2a2a;
padding: 1.5rem;
border-radius: 8px;
transition: transform 0.2s;
}
.event-card:hover {
transform: translateY(-5px);
}
.event-card h3 {
margin-bottom: 0.5rem;
color: #ffa500;
}
.event-card .date {
font-size: 0.9rem;
color: #ccc;
margin-bottom: 1rem;
}
.event-card .description {
font-size: 1rem;
color: #eee;
}

View File

@ -0,0 +1,62 @@
.footer {
background-color: #213b28;
color: white;
padding: 3rem 0;
margin-top: 4rem;
}
.footer-content {
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
}
.copyright {
text-align: center;
margin-bottom: 2rem;
padding-bottom: 1rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-sections {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
justify-content: center;
}
.footer-section {
text-align: center;
}
.footer-section h3 {
color: #ffffff;
margin-bottom: 1rem;
font-size: 1.2rem;
}
.footer-section p {
margin: 0.5rem 0;
color: #cccccc;
font-size: 0.9rem;
}
.footer-section a {
color: #ffffff;
text-decoration: none;
}
.footer-section a:hover {
text-decoration: underline;
}
@media (max-width: 768px) {
.footer-sections {
grid-template-columns: 1fr;
gap: 2rem;
}
.footer-section {
padding: 0 1rem;
}
}

View File

@ -0,0 +1,94 @@
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: rgba(26, 26, 26, 0.95);
z-index: 1000;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(5px);
}
.header-spacer {
height: 70px; /* Should match the header height */
}
.logo-container {
display: flex;
align-items: center;
}
.logo {
margin-left: 2em;
height: 4em;
width: auto;
transition: transform 0.3s ease;
}
.logo:hover {
transform: scale(1.05);
}
.nav-main {
display: flex;
align-items: center;
margin-right: 377px;
}
.nav-main a,
.dropdbtn {
margin: 0 1rem;
color: white;
text-decoration: none;
font-size: 1rem;
cursor: pointer;
}
.nav-main a:hover,
.dropdbtn:hover {
color: #ffa500;
}
/* Dropdown für Home */
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #0e0c0c;
min-width: 160px;
z-index: 1;
border: 1px solid #444;
border-radius: 4px;
}
.dropdown-content a {
color: #f5f5f5;
padding: 0.5rem 1rem;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: #1f1a1a;
color: #ffa500;
}
.dropdown:hover .dropdown-content {
display: block;
}
@media (max-width: 768px) {
.nav-container {
padding: 1rem;
}
.nav-links {
gap: 1rem;
}
}

View File

@ -0,0 +1,115 @@
/* === Header & Nav === */
.header {
background-color: #0e0c0c;
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 2rem;
border-bottom: 1px solid #444;
}
.nav-main {
display: flex;
align-items: center;
margin-right: 377px;
}
.nav-main a,
.dropdbtn {
margin: 0 1rem;
color: white;
text-decoration: none;
font-size: 1rem;
cursor: pointer;
}
.nav-main a:hover,
.dropdbtn:hover {
color: #ffa500;
}
/* Dropdown für Home */
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #0e0c0c;
min-width: 160px;
z-index: 1;
border: 1px solid #444;
border-radius: 4px;
}
.dropdown-content a {
color: #f5f5f5;
padding: 0.5rem 1rem;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: #1f1a1a;
color: #ffa500;
}
.dropdown:hover .dropdown-content {
display: block;
}
.hero {
position: relative;
height: 70vh;
display: flex;
align-items: center;
justify-content: center;
color: white;
margin-bottom: 2rem;
}
.hero-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
}
.hero-content {
position: relative;
text-align: center;
z-index: 1;
}
.hero-content h1 {
font-size: 4rem;
font-weight: bold;
}
.hero-content p {
margin: 0.5rem 0 1rem 0;
font-size: 1.2rem;
}
.button {
margin-top: 2rem;
padding: 0.8rem 2rem;
background: linear-gradient(45deg, #ffa500, #ff7f00);
color: white;
border: none;
border-radius: 30px;
font-size: 1rem;
font-weight: bold;
text-decoration: none;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
transition: transform 0.2s, box-shadow 0.2s;
}
.button:hover {
transform: translateY(-3px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

View File

@ -0,0 +1,41 @@
/* === Welcome === */
.welcome {
display: flex;
flex-wrap: wrap;
align-items: center;
background-color: #1f3a2d;
padding: 3rem 0;
margin-bottom: 2rem;
gap: 2rem;
}
.welcome-text {
order: 1;
flex: 2 1 400px;
padding: 0 1.6rem 0 2rem;
color: #fff3e0;
}
.welcome-text h2 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: #e8c6a7;
}
.welcome-text ul {
margin: 1rem 0;
padding-left: 1.2rem;
}
.welcome-image {
order: 2;
height: 100%;
flex: 1 1 300px;
margin-right: 2em;
}
.welcome-image img {
width: 100%;
height: auto;
border-radius: 8px;
}

View File

@ -17,200 +17,4 @@ body {
max-width: 1140px; max-width: 1140px;
margin: 0 auto; margin: 0 auto;
padding: 0 1rem; padding: 0 1rem;
}
/* === Header & Nav === */
.header {
background-color: #0e0c0c;
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 2rem;
border-bottom: 1px solid #444;
}
.nav-main {
display: flex;
align-items: center;
margin-right: 377px;
}
.nav-main a,
.dropdbtn {
margin: 0 1rem;
color: white;
text-decoration: none;
font-size: 1rem;
cursor: pointer;
}
.nav-main a:hover,
.dropdbtn:hover {
color: #ffa500;
}
/* Dropdown für Home */
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #0e0c0c;
min-width: 160px;
z-index: 1;
border: 1px solid #444;
border-radius: 4px;
}
.dropdown-content a {
color: #f5f5f5;
padding: 0.5rem 1rem;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: #1f1a1a;
color: #ffa500;
}
.dropdown:hover .dropdown-content {
display: block;
}
/* === Hero === */
.hero {
position: relative;
height: 70vh;
display: flex;
align-items: center;
justify-content: center;
color: white;
margin-bottom: 2rem;
}
.hero-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
}
.hero-content {
position: relative;
text-align: center;
z-index: 1;
}
.hero-content h1 {
font-size: 4rem;
font-weight: bold;
}
.hero-content p {
margin: 0.5rem 0 1rem 0;
font-size: 1.2rem;
}
.button {
margin-top: 2rem;
padding: 0.8rem 2rem;
background: linear-gradient(45deg, #ffa500, #ff7f00);
color: white;
border: none;
border-radius: 30px;
font-size: 1rem;
font-weight: bold;
text-decoration: none;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
transition: transform 0.2s, box-shadow 0.2s;
}
.button:hover {
transform: translateY(-3px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
/* === Welcome === */
.welcome {
display: flex;
flex-wrap: wrap;
align-items: center;
background-color: #1f3a2d;
padding: 3rem 0;
margin-bottom: 2rem;
gap: 2rem;
}
.welcome-text {
order: 1;
flex: 2 1 400px;
padding: 0 1.6rem 0 2rem;
color: #fff3e0;
}
.welcome-text h2 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: #e8c6a7;
}
.welcome-text ul {
margin: 1rem 0;
padding-left: 1.2rem;
}
.welcome-image {
order: 2;
flex: 1 1 300px;
}
.welcome-image img {
width: 100%;
height: auto;
border-radius: 8px;
}
/* === Events Grid === */
.events-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 2rem;
margin: 3rem 0;
}
.event-card {
background-color: #2a2a2a;
padding: 1.5rem;
border-radius: 8px;
transition: transform 0.2s;
}
.event-card:hover {
transform: translateY(-5px);
}
.event-card h3 {
margin-bottom: 0.5rem;
color: #ffa500;
}
.event-card .date {
font-size: 0.9rem;
color: #ccc;
margin-bottom: 1rem;
}
.event-card .description {
font-size: 1rem;
color: #eee;
}
/* === Footer === */
.footer {
text-align: center;
padding: 1.5rem 0;
background-color: #0e0c0c;
color: #aaa;
margin-top: 4rem;
} }