|
2 | 2 | interface Props { |
3 | 3 | stacked?: boolean; |
4 | 4 | title?: string; |
| 5 | + isPreview?: boolean; |
5 | 6 | } |
6 | 7 |
|
7 | | -const { stacked = false, title } = Astro.props; |
| 8 | +const { stacked = false, title, isPreview = false } = Astro.props; |
8 | 9 | --- |
9 | 10 |
|
10 | 11 | { |
11 | 12 | stacked ? ( |
12 | | - <div class="bg-bkg py-8 md:py-0"> |
13 | | - <div class="mx-auto max-w-7xl px-6"> |
14 | | - {title && ( |
15 | | - <h2 class="max-w-xl text-balance text-xl font-semibold tracking-tight text-content-1 sm:text-2xl"> |
16 | | - {title} |
17 | | - </h2> |
18 | | - )} |
19 | | - <form id="newsletter-form" class="w-full max-w-md pt-2 lg:col-span-5"> |
20 | | - <div class="flex gap-x-4"> |
21 | | - <label for="email" class="sr-only"> |
22 | | - {" "} |
23 | | - Email address{" "} |
24 | | - </label> |
25 | | - <input |
26 | | - id="email" |
27 | | - name="email" |
28 | | - type="email" |
29 | | - autocomplete="email" |
30 | | - required |
31 | | - class="min-w-0 flex-auto rounded-md bg-white px-3.5 py-2 text-base text-black placeholder-black outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-black focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm/6" |
32 | | - placeholder="Enter your email" |
33 | | - /> |
34 | | - <button |
35 | | - type="submit" |
36 | | - class="flex-none rounded-md bg-cta px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-accent-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600" |
37 | | - > |
38 | | - Subscribe |
39 | | - </button> |
40 | | - </div> |
41 | | - <p class="mt-4 text-sm/6 text-content-1"> |
42 | | - This site is built on trust, and your data is safe. Check out the{" "} |
43 | | - <a href="/policies/privacy" class="font-semibold"> |
44 | | - privacy policy |
45 | | - </a> |
46 | | - . |
| 13 | + isPreview ? ( |
| 14 | + <div class="mb-4 mt-10 bg-transparent py-8 md:py-0"> |
| 15 | + <div class="mx-auto max-w-2xl px-6 text-center underline decoration-white"> |
| 16 | + {title && ( |
| 17 | + <h2 class="text-lg font-medium text-gray-200 sm:text-xl"> |
| 18 | + {title} |
| 19 | + </h2> |
| 20 | + )} |
| 21 | + |
| 22 | + <form id="newsletter-form" class="mt-6"> |
| 23 | + <div class="mx-auto max-w-xl overflow-hidden rounded-2xl bg-white/10 p-2 shadow-xl ring-1 ring-black/10 backdrop-blur-md dark:ring-white/15"> |
| 24 | + <div class="flex flex-col gap-2 sm:flex-row"> |
| 25 | + <div class="relative flex-1"> |
| 26 | + <svg |
| 27 | + aria-hidden="true" |
| 28 | + viewBox="0 0 24 24" |
| 29 | + class="pointer-events-none absolute left-3 top-1/2 size-5 -translate-y-1/2 opacity-70" |
| 30 | + > |
| 31 | + <path |
| 32 | + fill="white" |
| 33 | + d="M20 6H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2Zm0 2v.01L12 13 4 8.01V8h16ZM4 16V9.7l7.4 4.63a1 1 0 0 0 1.2 0L20 9.7V16H4Z" |
| 34 | + /> |
| 35 | + </svg> |
| 36 | + <label for="email" class="sr-only"> |
| 37 | + Email address |
| 38 | + </label> |
| 39 | + <input |
| 40 | + id="email" |
| 41 | + name="email" |
| 42 | + type="email" |
| 43 | + autocomplete="email" |
| 44 | + required |
| 45 | + placeholder="Enter your email" |
| 46 | + class="w-full rounded-xl border-0 bg-transparent py-3 pl-11 pr-4 text-base text-gray-100 placeholder-gray-300 outline-none focus:ring-2 focus:ring-cta/70" |
| 47 | + /> |
| 48 | + </div> |
| 49 | + |
| 50 | + <button |
| 51 | + type="submit" |
| 52 | + class="rounded-xl bg-cta px-5 py-3 text-base font-semibold text-ctatext shadow-lg transition-all hover:-translate-y-0.5 hover:bg-accent-1 hover:shadow-xl focus:ring-2 focus:ring-cta/80 focus:ring-offset-2 focus:ring-offset-black focus-visible:outline-none active:translate-y-0" |
| 53 | + > |
| 54 | + Subscribe |
| 55 | + </button> |
| 56 | + </div> |
| 57 | + |
| 58 | + <p class="mt-2 text-center text-xs text-gray-200/85"> |
| 59 | + We'll only email about this course. Read our{" "} |
| 60 | + <a |
| 61 | + href="/policies/privacy" |
| 62 | + class="font-semibold text-gray-100 underline-offset-2 hover:underline" |
| 63 | + > |
| 64 | + privacy policy |
| 65 | + </a> |
| 66 | + . |
| 67 | + </p> |
| 68 | + </div> |
| 69 | + </form> |
| 70 | + |
| 71 | + <p |
| 72 | + id="confirmation-message" |
| 73 | + class="mt-4 hidden text-sm/6 text-green-200" |
| 74 | + > |
| 75 | + Thank you for subscribing! Check your email for confirmation. |
47 | 76 | </p> |
48 | | - </form> |
49 | | - <p |
50 | | - id="confirmation-message" |
51 | | - class="mt-4 hidden text-sm/6 text-green-200" |
52 | | - > |
53 | | - Thank you for subscribing! Check your email for confirmation. |
54 | | - </p> |
| 77 | + </div> |
55 | 78 | </div> |
56 | | - </div> |
| 79 | + ) : ( |
| 80 | + <div class="bg-transparent py-8 md:py-0"> |
| 81 | + <div class="mx-auto max-w-7xl px-6"> |
| 82 | + {title && ( |
| 83 | + <h2 class="max-w-xl text-balance text-xl font-semibold tracking-tight text-content-1 sm:text-2xl"> |
| 84 | + {title} |
| 85 | + </h2> |
| 86 | + )} |
| 87 | + <form id="newsletter-form" class="w-full max-w-md pt-2 lg:col-span-5"> |
| 88 | + <div class="flex gap-x-4"> |
| 89 | + <label for="email" class="sr-only"> |
| 90 | + {" "} |
| 91 | + Email address{" "} |
| 92 | + </label> |
| 93 | + <input |
| 94 | + id="email" |
| 95 | + name="email" |
| 96 | + type="email" |
| 97 | + autocomplete="email" |
| 98 | + required |
| 99 | + class="min-w-0 flex-auto rounded-xl bg-white px-3.5 py-2 text-base text-black placeholder-black outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-black focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-indigo-600 sm:text-sm/6" |
| 100 | + placeholder="Enter your email" |
| 101 | + /> |
| 102 | + <button |
| 103 | + type="submit" |
| 104 | + class="flex-none rounded-md bg-cta px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-accent-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600" |
| 105 | + > |
| 106 | + Subscribe |
| 107 | + </button> |
| 108 | + </div> |
| 109 | + <p class="mt-4 text-sm/6 text-content-1"> |
| 110 | + This site is built on trust, and your data is safe. Check out the{" "} |
| 111 | + <a href="/policies/privacy" class="font-semibold"> |
| 112 | + privacy policy |
| 113 | + </a> |
| 114 | + . |
| 115 | + </p> |
| 116 | + </form> |
| 117 | + <p |
| 118 | + id="confirmation-message" |
| 119 | + class="mt-4 hidden text-sm/6 text-green-200" |
| 120 | + > |
| 121 | + Thank you for subscribing! Check your email for confirmation. |
| 122 | + </p> |
| 123 | + </div> |
| 124 | + </div> |
| 125 | + ) |
57 | 126 | ) : ( |
58 | 127 | <div class="bg-bkg py-8 sm:py-12 lg:py-16"> |
59 | 128 | <div class="mx-auto grid max-w-7xl grid-cols-1 gap-10 px-6 lg:grid-cols-12 lg:gap-8 lg:px-8"> |
|
0 commit comments