Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/y2k. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
89 lines
4.1 KiB
Plaintext
89 lines
4.1 KiB
Plaintext
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.dev.alexdunmow.com/block/core/templates"
|
|
)
|
|
|
|
// y2kEmailTemplate is the Y2K-branded email shell.
|
|
templ y2kEmailTemplate(emailCtx templates.EmailContext, body string) {
|
|
<!DOCTYPE html>
|
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office">
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<meta name="x-apple-disable-message-reformatting"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
|
<title>{ emailCtx.SiteSettings.SiteName }</title>
|
|
<style type="text/css">
|
|
body, table, td, p, a, li { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
|
|
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
|
|
img { -ms-interpolation-mode: bicubic; border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; }
|
|
body { margin: 0 !important; padding: 0 !important; width: 100% !important; }
|
|
a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; }
|
|
@media only screen and (max-width: 620px) {
|
|
.y2k-email-container { width: 100% !important; max-width: 100% !important; }
|
|
.y2k-email-content { padding-left: 20px !important; padding-right: 20px !important; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body style={ fmt.Sprintf("background-color: %s; margin: 0; padding: 0; font-family: 'Inter Tight','Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;", y2kEmailBg(emailCtx)) }>
|
|
if emailCtx.PreviewText != "" {
|
|
<div style="display:none;max-height:0;overflow:hidden;mso-hide:all;">{ emailCtx.PreviewText }</div>
|
|
}
|
|
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0">
|
|
<tr>
|
|
<td align="center" style={ fmt.Sprintf("padding: 36px 12px; background-color: %s;", y2kEmailBg(emailCtx)) }>
|
|
<table
|
|
role="presentation"
|
|
class="y2k-email-container"
|
|
width="600"
|
|
cellspacing="0"
|
|
cellpadding="0"
|
|
border="0"
|
|
style={ fmt.Sprintf("max-width: 600px; background-color: %s; border: 2px solid %s; border-radius: 12px; overflow: hidden;", y2kEmailCard(emailCtx), y2kEmailBorder(emailCtx)) }
|
|
>
|
|
<!-- gradient header bar -->
|
|
<tr>
|
|
<td style={ fmt.Sprintf("padding: 18px 28px; background-image: linear-gradient(90deg, %s 0%%, %s 100%%); color: %s; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;", y2kEmailPrimary(emailCtx), y2kEmailSecondary(emailCtx), y2kEmailFg(emailCtx)) }>
|
|
if emailCtx.SiteSettings.SiteName != "" {
|
|
{ emailCtx.SiteSettings.SiteName }
|
|
} else {
|
|
y2k.fm
|
|
}
|
|
</td>
|
|
</tr>
|
|
<!-- body content -->
|
|
<tr>
|
|
<td class="y2k-email-content" style={ fmt.Sprintf("padding: 32px 40px; color: %s; font-size: 16px; line-height: 1.7;", y2kEmailFg(emailCtx)) }>
|
|
@templ.Raw(body)
|
|
</td>
|
|
</tr>
|
|
<!-- marquee pill footer -->
|
|
<tr>
|
|
<td align="center" style={ fmt.Sprintf("padding: 18px 28px; background-color: %s;", y2kEmailMuted(emailCtx)) }>
|
|
<table role="presentation" cellspacing="0" cellpadding="0" border="0">
|
|
<tr>
|
|
<td style={ fmt.Sprintf("padding: 8px 18px; border-radius: 999px; background-image: linear-gradient(90deg, %s 0%%, %s 100%%); color: %s; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;", y2kEmailPrimary(emailCtx), y2kEmailSecondary(emailCtx), y2kEmailFg(emailCtx)) }>
|
|
* now playing * new drop friday * subscribe to the zine *
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
if emailCtx.UnsubscribeURL != "" {
|
|
<p style={ fmt.Sprintf("margin: 12px 0 0; font-size: 11px; color: %s;", y2kEmailMutedFg(emailCtx)) }>
|
|
<a href={ templ.SafeURL(emailCtx.UnsubscribeURL) } style={ fmt.Sprintf("color: %s; text-decoration: underline;", y2kEmailMutedFg(emailCtx)) }>
|
|
unsubscribe
|
|
</a>
|
|
</p>
|
|
}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|
|
}
|