|
1 | 1 | <script lang="ts"> |
2 | 2 | import { submitContactRequest } from '$lib/api/contact'; |
3 | | - import { emailLink } from '$lib/api/socials'; |
| 3 | + import { emailLink, whatsappLink } from '$lib/api/socials'; |
| 4 | +
|
| 5 | + import bg from '$lib/components/graphics/hero-bg.svg'; |
4 | 6 |
|
5 | 7 | import type { ButtonColorVariant } from '$lib/components/colors'; |
6 | 8 | import { inputClass } from '$lib/components/form'; |
|
16 | 18 | import Saos from 'saos'; |
17 | 19 | import Fa from 'svelte-fa'; |
18 | 20 |
|
19 | | - // const whatsappButton: ButtonColorVariant = { key: 'whatsapp' }; |
| 21 | + const whatsappButton: ButtonColorVariant = { key: 'whatsapp' }; |
20 | 22 | const emailButton: ButtonColorVariant = { key: 'email' }; |
21 | 23 | const primaryButton: ButtonColorVariant = { key: 'primary' }; |
22 | 24 | const disabledButton: ButtonColorVariant = { key: 'disabled' }; |
|
45 | 47 | </script> |
46 | 48 |
|
47 | 49 | <section> |
48 | | - <Wrappper> |
49 | | - <div class="w-full"> |
50 | | - <Saos animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} once> |
51 | | - <h1 |
52 | | - class="text-center mx-auto my-10 md:my-12 lg:my-16 dark:text-white duration-500" |
53 | | - id="contact" |
54 | | - > |
55 | | - Contact |
56 | | - </h1> |
57 | | - </Saos> |
58 | | - |
59 | | - <div class="flex flex-wrap sm:flex-nowrap justify-between gap-4 lg:gap-5 xl:gap-6"> |
60 | | - <!-- Whatsapp Button --> |
61 | | - <div class="w-full"> |
62 | | - <Saos animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} once> |
63 | | - <Button |
64 | | - disabled={true} |
65 | | - noDarkVariant={false} |
66 | | - fullWidth={true} |
67 | | - variant={disabledButton} |
68 | | - centerText={true} |
69 | | - > |
70 | | - <div class="w-8 h-8" slot="icon"> |
71 | | - <Whatsapp /> |
72 | | - </div> |
73 | | - <span>Whatsapp me (disabled)</span> |
74 | | - </Button> |
75 | | - </Saos> |
| 50 | + <div |
| 51 | + class="bg-cover bg-no-repeat bg-center flex relative duration-500" |
| 52 | + style="background-image: url({bg});" |
| 53 | + > |
| 54 | + <Wrappper> |
| 55 | + <div class="w-full"> |
| 56 | + <Saos animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} once> |
| 57 | + <h1 |
| 58 | + class="text-center mx-auto my-10 md:my-12 lg:my-16 dark:text-white duration-500" |
| 59 | + id="contact" |
| 60 | + > |
| 61 | + Contact |
| 62 | + </h1> |
| 63 | + </Saos> |
| 64 | + |
| 65 | + <div class="flex flex-wrap sm:flex-nowrap justify-between gap-4 lg:gap-5 xl:gap-6"> |
| 66 | + <!-- Whatsapp Button --> |
| 67 | + <a href={whatsappLink} target="_blank" class="w-full"> |
| 68 | + <Saos animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} once> |
| 69 | + <Button noDarkVariant={false} fullWidth={true} variant={whatsappButton}> |
| 70 | + <div class="w-8 h-8" slot="icon"> |
| 71 | + <Whatsapp /> |
| 72 | + </div> |
| 73 | + <span>WhatsApp Me!</span> |
| 74 | + </Button> |
| 75 | + </Saos> |
| 76 | + </a> |
| 77 | + <!-- Email Button --> |
| 78 | + <a href={emailLink} target="_blank" class="w-full"> |
| 79 | + <Saos animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} once> |
| 80 | + <Button noDarkVariant={false} fullWidth={true} variant={emailButton}> |
| 81 | + <div class="w-8 h-8" slot="icon"> |
| 82 | + <Email /> |
| 83 | + </div> |
| 84 | + <span>Email Me!</span> |
| 85 | + </Button> |
| 86 | + </Saos> |
| 87 | + </a> |
76 | 88 | </div> |
77 | | - <!-- Email Button --> |
78 | | - <a href={emailLink} target="_blank" class="w-full"> |
79 | | - <Saos animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} once> |
80 | | - <Button noDarkVariant={false} fullWidth={true} variant={emailButton}> |
81 | | - <div class="w-8 h-8" slot="icon"> |
82 | | - <Email /> |
83 | | - </div> |
84 | | - <span>Email me</span> |
85 | | - </Button> |
86 | | - </Saos> |
87 | | - </a> |
88 | | - </div> |
89 | 89 |
|
90 | | - <div class="my-16"> |
91 | | - {#if enableMessageForm} |
92 | | - <div class="lg:flex lg:justify-between"> |
93 | | - <div class="hidden lg:block my-auto pr-8 xl:pr-12"> |
94 | | - <Saos animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} once> |
95 | | - <h1 class="dark:text-white duration-500">Message me!</h1> |
96 | | - </Saos> |
97 | | - </div> |
98 | | - <Saos |
99 | | - animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} |
100 | | - once |
101 | | - css_observer={'width: 100%;'} |
102 | | - > |
103 | | - <div |
104 | | - class="w-full bg-custom-1 dark:bg-slate-700 border-4 border-slate-900 dark:border-white h-max px-8 py-4 md:px-12 md:py-6" |
| 90 | + <div class="my-16"> |
| 91 | + {#if enableMessageForm} |
| 92 | + <div class="lg:flex lg:justify-between"> |
| 93 | + <div class="hidden lg:block my-auto pr-8 xl:pr-12"> |
| 94 | + <Saos animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} once> |
| 95 | + <h1 class="dark:text-white duration-500">Message me!</h1> |
| 96 | + </Saos> |
| 97 | + </div> |
| 98 | + <Saos |
| 99 | + animation={'scale-up-center 1s cubic-bezier(0.4, 0, 0.2, 1) both'} |
| 100 | + once |
| 101 | + css_observer={'width: 100%;'} |
105 | 102 | > |
106 | | - <!-- CONTACT FORM --> |
107 | | - <form method="dialog"> |
108 | | - <div class="flex flex-col mb-4"> |
109 | | - <label for="name"><h4 class="dark:text-white">Name</h4></label> |
110 | | - <input |
111 | | - bind:value={data.name} |
112 | | - type="text" |
113 | | - id="name" |
114 | | - name="name" |
115 | | - class={inputClass} |
116 | | - required |
117 | | - /> |
118 | | - |
119 | | - <label for="email"><h4 class="dark:text-white">Email</h4></label> |
120 | | - <input |
121 | | - bind:value={data.email} |
122 | | - type="email" |
123 | | - id="email" |
124 | | - name="email" |
125 | | - class={inputClass} |
126 | | - required |
127 | | - /> |
128 | | - |
129 | | - <label for="message"><h4 class="dark:text-white">Message</h4></label> |
130 | | - <textarea |
131 | | - bind:value={data.message} |
132 | | - id="message" |
133 | | - name="message" |
134 | | - class={inputClass} |
135 | | - required |
136 | | - /> |
137 | | - </div> |
138 | | - <div class="ml-1"> |
139 | | - <button |
140 | | - type="submit" |
141 | | - class="block w-full" |
142 | | - on:click={buttonDisabled ? () => 0 : handleSubmit} |
143 | | - > |
144 | | - <Button |
145 | | - noDarkVariant={false} |
146 | | - fullWidth={true} |
147 | | - variant={buttonDisabled ? disabledButton : primaryButton} |
148 | | - disabled={buttonDisabled} |
| 103 | + <div |
| 104 | + class="w-full bg-custom-1 dark:bg-slate-700 border-4 border-slate-900 dark:border-white h-max px-8 py-4 md:px-12 md:py-6" |
| 105 | + > |
| 106 | + <!-- CONTACT FORM --> |
| 107 | + <form method="dialog"> |
| 108 | + <div class="flex flex-col mb-4"> |
| 109 | + <label for="name"><h4 class="dark:text-white">Name</h4></label> |
| 110 | + <input |
| 111 | + bind:value={data.name} |
| 112 | + type="text" |
| 113 | + id="name" |
| 114 | + name="name" |
| 115 | + class={inputClass} |
| 116 | + required |
| 117 | + /> |
| 118 | + |
| 119 | + <label for="email"><h4 class="dark:text-white">Email</h4></label> |
| 120 | + <input |
| 121 | + bind:value={data.email} |
| 122 | + type="email" |
| 123 | + id="email" |
| 124 | + name="email" |
| 125 | + class={inputClass} |
| 126 | + required |
| 127 | + /> |
| 128 | + |
| 129 | + <label for="message"><h4 class="dark:text-white">Message</h4></label> |
| 130 | + <textarea |
| 131 | + bind:value={data.message} |
| 132 | + id="message" |
| 133 | + name="message" |
| 134 | + class={inputClass} |
| 135 | + required |
| 136 | + /> |
| 137 | + </div> |
| 138 | + <div class="ml-1"> |
| 139 | + <button |
| 140 | + type="submit" |
| 141 | + class="block w-full" |
| 142 | + on:click={buttonDisabled ? () => 0 : handleSubmit} |
149 | 143 | > |
150 | | - <Fa icon={faPaperPlane} slot="icon" /> |
151 | | - <h4 |
152 | | - class="{submisstionStatus === 'Failed' |
153 | | - ? 'text-red-500' |
154 | | - : 'text-inherit'} " |
| 144 | + <Button |
| 145 | + noDarkVariant={false} |
| 146 | + fullWidth={true} |
| 147 | + variant={buttonDisabled ? disabledButton : primaryButton} |
| 148 | + disabled={buttonDisabled} |
155 | 149 | > |
156 | | - {submisstionStatus === 'Initial' |
157 | | - ? 'Send' |
158 | | - : submisstionStatus === 'Failed' |
159 | | - ? 'Failed, try again' |
160 | | - : submisstionStatus} |
161 | | - </h4> |
162 | | - </Button> |
163 | | - </button> |
164 | | - </div> |
165 | | - </form> |
166 | | - <!-- CONTACT FROM END --> |
167 | | - </div> |
168 | | - </Saos> |
169 | | - </div> |
170 | | - {/if} |
| 150 | + <Fa icon={faPaperPlane} slot="icon" /> |
| 151 | + <h4 |
| 152 | + class="{submisstionStatus === 'Failed' |
| 153 | + ? 'text-red-500' |
| 154 | + : 'text-inherit'} " |
| 155 | + > |
| 156 | + {submisstionStatus === 'Initial' |
| 157 | + ? 'Send' |
| 158 | + : submisstionStatus === 'Failed' |
| 159 | + ? 'Failed, try again' |
| 160 | + : submisstionStatus} |
| 161 | + </h4> |
| 162 | + </Button> |
| 163 | + </button> |
| 164 | + </div> |
| 165 | + </form> |
| 166 | + <!-- CONTACT FROM END --> |
| 167 | + </div> |
| 168 | + </Saos> |
| 169 | + </div> |
| 170 | + {/if} |
| 171 | + </div> |
171 | 172 | </div> |
172 | | - </div> |
173 | | - </Wrappper> |
| 173 | + </Wrappper> |
| 174 | + </div> |
174 | 175 | </section> |
0 commit comments