Skip to content

Commit 5295ca6

Browse files
clytaemnestranikoshellpre-commit-ci[bot]egeakman
authored
Subscribe for updates section (#1070)
### Changelog * added a section with links to our socials and a newsletter signup * regarding spam protection: starts returning 429 after 5 requests from the same IP, so I guess there's nothing else on our side needed * made footer smaller and removed the social media icons from it as they're in the section above -------- Co-authored-by: Niko <[email protected]> Co-authored-by: Nikoś <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ege Akman <[email protected]>
1 parent be01dc3 commit 5295ca6

File tree

8 files changed

+153
-8
lines changed

8 files changed

+153
-8
lines changed

public/icons/bluesky.svg

Lines changed: 4 additions & 0 deletions
Loading

public/icons/instagram.svg

Lines changed: 7 additions & 0 deletions
Loading

public/icons/linkedin.svg

Lines changed: 16 additions & 0 deletions
Loading

public/icons/mastodon.svg

Lines changed: 2 additions & 0 deletions
Loading

public/icons/x.svg

Lines changed: 1 addition & 0 deletions
Loading

public/icons/youtube.svg

Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
const socialLinks = [
3+
{ href: "https://linkedin.com/company/europython/", icon: "linkedin" },
4+
{ href: "https://instagram.com/europython/", icon: "instagram" },
5+
{ href: "https://youtube.com/channel/UC98CzaYuFNAA_gOINFB0e4Q", icon: "youtube" },
6+
{ href: "https://fosstodon.org/@europython", icon: "mastodon" },
7+
{ href: "https://bsky.app/profile/europython.eu", icon: "bluesky" },
8+
{ href: "https://x.com/europython", icon: "x" },
9+
];
10+
---
11+
12+
<div class="full-bleed w-full bg-[#d4d5e5] flex flex-col items-center justify-center py-08 px-4 text-center">
13+
<div class="w-full bg-[#d4d5e5] flex flex-col items-center justify-center py-20 px-4 text-center relative z-10">
14+
<h1 class="text-4xl md:text-6xl font-bold mb-10 leading-tight text-[#17223A]">
15+
Follow us<br />for updates
16+
</h1>
17+
18+
<div class="flex justify-center flex-wrap gap-6 mb-8">
19+
{socialLinks.map(({ href, icon }) => (
20+
<a
21+
href={href}
22+
target="_blank"
23+
rel="noopener noreferrer"
24+
class="w-16 h-16 flex items-center justify-center border-2 border-yellow-400 rounded-full hover:scale-110 transition-transform"
25+
>
26+
<img src={`/icons/${icon}.svg`} alt={icon} class="w-6 h-6" />
27+
</a>
28+
))}
29+
</div>
30+
31+
<p class="text-[#151f38] mb-8 text-sm md:text-base">
32+
Subscribe to our conference newsletter and get<br />
33+
the latest updates and special deals
34+
</p>
35+
36+
<form
37+
id="subscribeForm"
38+
class="flex flex-col sm:flex-row justify-center items-center gap-4"
39+
>
40+
<input
41+
id="emailInput"
42+
type="email"
43+
name="email"
44+
placeholder="Your email"
45+
required
46+
class="px-4 py-3 rounded-[10px] bg-white text-black text-base font-medium w-72 text-center"
47+
/>
48+
<button
49+
type="submit"
50+
class="font-bold text-lg px-4 py-4 bg-button rounded-[10px] inline-block leading-4 hover:bg-button-hover not-prose outline-solid outline bg-transparent text-xl text-secondary outline-secondary text-black"
51+
>
52+
Subscribe
53+
</button>
54+
</form>
55+
56+
<p
57+
id="subscribeMessage"
58+
class="hidden mt-4 text-green-600 text-lg font-medium transition-opacity duration-500 opacity-0"
59+
>
60+
Please check your email to confirm. 📬
61+
</p>
62+
</div>
63+
</div>
64+
65+
<script>
66+
const form = document.getElementById("subscribeForm");
67+
const message = document.getElementById("subscribeMessage");
68+
69+
form?.addEventListener("submit", handleSubscribe);
70+
71+
async function handleSubscribe(event: SubmitEvent) {
72+
event.preventDefault();
73+
74+
const input = document.getElementById("emailInput");
75+
if (!(input instanceof HTMLInputElement)) return;
76+
77+
const email = input.value.trim();
78+
if (!email) return;
79+
80+
try {
81+
const result = await fetch("https://blog.europython.eu/members/api/send-magic-link/", {
82+
method: "POST",
83+
headers: { "Content-Type": "application/json" },
84+
body: JSON.stringify({ email, emailType: "subscribe" })
85+
});
86+
87+
const r = await result.text();
88+
if (r === "Created.") {
89+
input.value = "";
90+
91+
message?.classList.remove("hidden");
92+
setTimeout(() => message?.classList.add("opacity-100"), 50);
93+
94+
setTimeout(() => {
95+
message?.classList.remove("opacity-100");
96+
setTimeout(() => message?.classList.add("hidden"), 500);
97+
}, 5000);
98+
}
99+
} catch {
100+
}
101+
}
102+
</script>

src/pages/index.astro

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
---
2-
import Hero from "../components/hero2/hero.astro";
3-
import Layout from "../layouts/HomePageLayout.astro";
4-
import Sponsors from "../components/sponsors/sponsors.astro";
5-
import KeynotersComponent from "../components/keynoters/keynoters.astro";
2+
import { getCollection } from "astro:content";
3+
4+
import Layout from "@layouts/HomePageLayout.astro";
5+
import Hero from "@components/hero2/hero.astro";
6+
import Keynoters from "@components/keynoters/keynoters.astro";
67
import Updates from "@sections/updates.astro";
78
import Prague from "@sections/prague.astro";
9+
import Sponsors from "@components/sponsors/sponsors.astro";
10+
import Subscribe from "@sections/subscribe.astro";
11+
12+
let deadlines = await getCollection("deadlines");
13+
deadlines = deadlines
14+
.sort((a, b) => a.slug.localeCompare(b.slug))
15+
.reverse()
16+
.slice(0, 3);
817
---
918

1019
<Layout
1120
title="EuroPython 2025 | July 14th-20th 2025 | Prague, Czech Republic & Remote"
1221
description="EuroPython is the largest Python conference in Europe. We are looking forward to seeing you in Prague, Czech Republic & Remote from July 14th-20th 2025."
1322
>
1423
<Hero />
15-
1624
<Updates />
17-
18-
<KeynotersComponent />
25+
<Keynoters />
1926
<Prague />
20-
2127
<Sponsors />
28+
<Subscribe />
2229
</Layout>

0 commit comments

Comments
 (0)