Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pages/constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const SPONSORS_EMAIL = 'sponsors@2026.es.pycon.org'
export const SPONSORS_SUBJECT = 'Interés de patrocinio para PyConES2026'
31 changes: 3 additions & 28 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Layout from '../layouts/Layout.astro'
import '@fontsource-variable/jetbrains-mono'
import { SPONSORS_EMAIL } from './constants'
import { SPONSORS_EMAIL, SPONSORS_SUBJECT } from './constants'
---

<Layout title="PyConES 2026">
Expand Down Expand Up @@ -29,6 +29,7 @@ import { SPONSORS_EMAIL } from './constants'
id="actions"
class="mt-12 flex flex-col md:flex-row gap-6 justify-center items-center opacity-0 transition-opacity duration-1000 ease-in"
>
<a href={`mailto:${SPONSORS_EMAIL}?subject=${encodeURIComponent(SPONSORS_SUBJECT)}`}>
<button
id="sponsor-btn"
type="button"
Expand All @@ -49,6 +50,7 @@ import { SPONSORS_EMAIL } from './constants'
</span>
<span id="sponsor-hint" class="sr-only">Copia el email de contacto para patrocinadores</span>
</button>
</a>

<div
id="copy-confirmation"
Expand Down Expand Up @@ -129,33 +131,6 @@ import { SPONSORS_EMAIL } from './constants'
}, 1500)
}

// COPY MAIL LOGIC
const sponsorBtn = document.getElementById('sponsor-btn')
const copyConfirmation = document.getElementById('copy-confirmation')
const email = sponsorBtn?.dataset.email as string

if (sponsorBtn && copyConfirmation && email) {
sponsorBtn.onclick = async () => {
try {
await navigator.clipboard.writeText(email)

// Hide button, show confirmation
sponsorBtn.classList.add('hidden')
copyConfirmation.classList.remove('hidden')
copyConfirmation.focus()

setTimeout(() => {
// Hide confirmation, show button and restore focus
copyConfirmation.classList.add('hidden')
sponsorBtn.classList.remove('hidden')
sponsorBtn.focus()
}, 2000)
} catch (err) {
console.error('Failed to copy', err)
window.location.href = `mailto:${email}`
}
}
}
}

//not needed now
Expand Down