|
| 1 | +--- |
| 2 | +const socialLinks = [ |
| 3 | + { href: "https://x.com/europython", icon: "x" }, |
| 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://linkedin.com/company/europython/", icon: "linkedin" }, |
| 9 | +]; |
| 10 | +--- |
| 11 | + |
| 12 | +<!-- Same background and structure as your other bluebox sections --> |
| 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 | + onsubmit="handleSubscribe(event)" |
| 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 | +</div> |
| 57 | + |
| 58 | +<script> |
| 59 | + async function handleSubscribe(event) { |
| 60 | + event.preventDefault(); |
| 61 | + |
| 62 | + const input = document.getElementById("emailInput"); |
| 63 | + if (!(input instanceof HTMLInputElement)) return; |
| 64 | + |
| 65 | + const email = input.value.trim(); |
| 66 | + if (!email) return alert("Please enter a valid email"); |
| 67 | + |
| 68 | + try { |
| 69 | + const result = await fetch( |
| 70 | + "https://blog.europython.eu/members/api/send-magic-link/", |
| 71 | + { |
| 72 | + method: "POST", |
| 73 | + headers: { "Content-Type": "application/json" }, |
| 74 | + body: JSON.stringify({ email, emailType: "subscribe" }) |
| 75 | + } |
| 76 | + ); |
| 77 | + |
| 78 | + const r = await result.text(); |
| 79 | + if (r !== "Created.") { |
| 80 | + alert("Something went wrong"); |
| 81 | + } else { |
| 82 | + alert("Check your inbox!"); |
| 83 | + input.value = ""; |
| 84 | + } |
| 85 | + } catch (e) { |
| 86 | + console.error(e); |
| 87 | + alert("Network error"); |
| 88 | + } |
| 89 | + } |
| 90 | +</script> |
| 91 | + |
0 commit comments