Skip to content

Commit 97541a2

Browse files
committed
Merge branch 'ep2025' into ep2025-search
2 parents 9c1a30a + 5295ca6 commit 97541a2

File tree

9 files changed

+155
-9
lines changed

9 files changed

+155
-9
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

src/components/search/Search.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Button from "@ui/Button.astro";
1515
</div>
1616

1717
<div class="modal__overlay"></div>
18+
1819
<SearchComponent
1920
id="search"
2021
className="pagefind-ui"
@@ -150,7 +151,7 @@ document.addEventListener("DOMContentLoaded", function () {
150151
});
151152
</script>
152153

153-
<style>
154+
<style is:global>
154155
.search-wrapper div{
155156
max-width: calc(48rem + 8vw);
156157
}
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,10 +1,19 @@
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
@@ -13,11 +22,9 @@ import Prague from "@sections/prague.astro";
1322
>
1423

1524
<Hero />
16-
1725
<Updates />
18-
19-
<KeynotersComponent />
26+
<Keynoters />
2027
<Prague />
21-
2228
<Sponsors />
29+
<Subscribe />
2330
</Layout>

0 commit comments

Comments
 (0)