|
| 1 | +--- |
| 2 | +import { Icon } from "@astrojs/starlight/components"; |
| 3 | +--- |
| 4 | +<div class="hubspot-form-wrapper"> |
| 5 | + <div class="newsletter-pitch"> |
| 6 | + <p class="newsletter-title"> |
| 7 | + <Icon name="email" label="Duende Newsletter" /> |
| 8 | + Subscribe To Our Newsletter!</p> |
| 9 | + <p class="newsletter-subtitle">Stay ahead in the world of identity and access management!</p> |
| 10 | + <ul> |
| 11 | + <li>Latest security best practices</li> |
| 12 | + <li>Product updates and releases</li> |
| 13 | + <li>Technical tips and implementation guides</li> |
| 14 | + <li>Industry news and trends</li> |
| 15 | + </ul> |
| 16 | + <p>Join our community of developers and security professionals building secure applications.</p> |
| 17 | + </div> |
| 18 | + <hubspot-form></hubspot-form> |
| 19 | +</div> |
| 20 | + |
| 21 | +<style> |
| 22 | + .newsletter-title { |
| 23 | + display: flex; |
| 24 | + font-size: var(--sl-text-3xl); |
| 25 | + font-weight: 500; |
| 26 | + svg { |
| 27 | + margin-right: 0.5rem; |
| 28 | + } |
| 29 | + } |
| 30 | + |
| 31 | + .newsletter-subtitle { |
| 32 | + font-size: var(--sl-text-lg); |
| 33 | + font-weight: 400; |
| 34 | + } |
| 35 | + |
| 36 | + .hubspot-form-wrapper { |
| 37 | + display: flex; |
| 38 | + --sl-card-border: var(--sl-color-purple); |
| 39 | + --sl-card-bg: var(--sl-color-purple-low); |
| 40 | + border: 1px solid var(--sl-color-gray-5); |
| 41 | + background-color: var(--sl-color-black); |
| 42 | + padding: clamp(1rem, calc(0.125rem + 3vw), 2.5rem); |
| 43 | + flex-direction: row; |
| 44 | + gap: clamp(0.5rem, calc(0.125rem + 1vw), 1rem); |
| 45 | + flex-wrap: nowrap; |
| 46 | + } |
| 47 | + |
| 48 | + @media (max-width: 768px) { |
| 49 | + .hubspot-form-wrapper { |
| 50 | + flex-wrap: wrap; |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + .newsletter-pitch { |
| 55 | + vertical-align: baseline; |
| 56 | + align-content: center; |
| 57 | + } |
| 58 | + |
| 59 | +</style> |
| 60 | + |
| 61 | +<script> |
| 62 | + import "https://js.hsforms.net/forms/embed/v2.js"; |
| 63 | + |
| 64 | + class HubspotForm extends HTMLElement { |
| 65 | + constructor() { |
| 66 | + super(); |
| 67 | + |
| 68 | + const div = document.createElement("div"); |
| 69 | + div.className = `hubspot-form-${Math.random().toString(36).substring(2, 10)}`; |
| 70 | + this.appendChild(div); |
| 71 | + |
| 72 | + hbspt.forms.create({ |
| 73 | + portalId: "47428297", |
| 74 | + formId: "bdd9b287-d141-46e2-8b1f-90ce29fd262e", |
| 75 | + region: "na1", |
| 76 | + target: `.${div.className}` |
| 77 | + }); |
| 78 | + } |
| 79 | + } |
| 80 | + |
| 81 | + customElements.define("hubspot-form", HubspotForm); |
| 82 | +</script> |
| 83 | + |
0 commit comments