index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <template>
  2. <div>
  3. <section
  4. id="quem-somos"
  5. class="relative min-h-screen flex flex-col bg-cover bg-center"
  6. :style="{ backgroundImage: `url(${heroBg})` }"
  7. >
  8. <div class="absolute inset-0 bg-violet-normal/45"/>
  9. <div class="relative z-10 flex-1 flex items-center">
  10. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 w-full py-16 lg:py-24">
  11. <div class="max-w-2xl">
  12. <h1
  13. class="reveal text-h2 text-white font-black mb-6"
  14. style="font-size: clamp(2rem, 5vw, 3.75rem); font-weight: 900;"
  15. >
  16. Ser PRATI é fazer parte de algo maior
  17. </h1>
  18. <p class="reveal reveal-delay-1 text-white/90 mb-10 leading-relaxed" style="font-size: clamp(1rem, 1.5vw, 1.125rem); font-weight: 600;">
  19. Benefícios exclusivos, parceiros de qualidade e uma comunidade
  20. que cuida de você e sua família.
  21. </p>
  22. <div class="reveal reveal-delay-2 flex flex-col sm:flex-row gap-4 mb-12 lg:mb-16">
  23. <button
  24. class="btn-primary"
  25. @click="scrollTo('associe-se')"
  26. >
  27. ASSOCIE-SE AGORA
  28. </button>
  29. <button
  30. class="btn-outline"
  31. @click="scrollTo('beneficios')"
  32. >
  33. CONHEÇA OS BENEFÍCIOS
  34. </button>
  35. </div>
  36. <!-- Stats inline na hero, sem barra escura -->
  37. <div class="reveal reveal-delay-3 grid grid-cols-3 gap-4 text-left">
  38. <div class="flex flex-col items-start gap-1">
  39. <span class="material-icons text-white/90 text-3xl lg:text-4xl">group</span>
  40. <span class="text-white font-bold" style="font-size: clamp(1.25rem, 2.5vw, 1.75rem);">1.000+</span>
  41. <span class="text-white/80 text-sm">Associados</span>
  42. </div>
  43. <div class="flex flex-col items-start gap-1">
  44. <span class="material-icons text-white/90 text-3xl lg:text-4xl">handshake</span>
  45. <span class="text-white font-bold" style="font-size: clamp(1.25rem, 2.5vw, 1.75rem);">50+</span>
  46. <span class="text-white/80 text-sm">Parceiros</span>
  47. </div>
  48. <div class="flex flex-col items-start gap-1">
  49. <span class="material-icons text-white/90 text-3xl lg:text-4xl">favorite_border</span>
  50. <span class="text-white font-bold" style="font-size: clamp(1.25rem, 2.5vw, 1.75rem);">30+</span>
  51. <span class="text-white/80 text-sm">Anos de História</span>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </section>
  58. <section id="beneficios" class="bg-neutral-light py-16 lg:py-24">
  59. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  60. <div class="reveal text-center mb-12 lg:mb-16">
  61. <h2 class="text-h4 text-text" style="font-size: clamp(1.5rem, 3vw, 2.125rem);">
  62. Benefícios para você
  63. </h2>
  64. </div>
  65. <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
  66. <div
  67. v-for="(benefit, index) in benefits"
  68. :key="benefit.title"
  69. :class="`reveal reveal-delay-${index + 1}`"
  70. class="benefit-card"
  71. >
  72. <div class="benefit-icon-wrap">
  73. <span class="material-icons text-violet-normal text-2xl">{{ benefit.icon }}</span>
  74. </div>
  75. <h3 class="text-subtitle-1 font-semibold text-text mt-4 mb-2">
  76. {{ benefit.title }}
  77. </h3>
  78. <p class="text-body-2 text-text-2 leading-relaxed">
  79. {{ benefit.description }}
  80. </p>
  81. </div>
  82. </div>
  83. </div>
  84. </section>
  85. <section id="associe-se" class="bg-violet-light py-16 lg:py-24">
  86. <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  87. <div class="reveal text-center mb-10 lg:mb-12">
  88. <h2 class="text-h4 text-text" style="font-size: clamp(1.5rem, 3vw, 2.125rem);">
  89. Associe-se
  90. </h2>
  91. </div>
  92. <div class="reveal reveal-delay-1 max-w-3xl mx-auto">
  93. <div class="mb-0">
  94. <button class="tab-active">
  95. NOVA ASSOCIAÇÃO
  96. </button>
  97. </div>
  98. <div class="bg-white rounded-b-2xl rounded-tr-2xl shadow-md p-6 lg:p-10">
  99. <form novalidate @submit.prevent="handleSubmit" >
  100. <div class="grid grid-cols-1 sm:grid-cols-2 gap-5 mb-6">
  101. <div class="field-group">
  102. <label class="field-label">Nome Completo</label>
  103. <div class="field-input-wrap">
  104. <span class="material-icons field-icon">person</span>
  105. <input
  106. v-model="form.nomeCompleto"
  107. type="text"
  108. placeholder="Seu Nome"
  109. class="field-input"
  110. >
  111. </div>
  112. </div>
  113. <div class="field-group">
  114. <label class="field-label">CPF</label>
  115. <div class="field-input-wrap">
  116. <span class="material-icons field-icon">badge</span>
  117. <input
  118. :value="form.cpf"
  119. type="text"
  120. placeholder="000.000.000-00"
  121. maxlength="14"
  122. class="field-input"
  123. @input="handleCPF"
  124. >
  125. </div>
  126. </div>
  127. <div class="field-group">
  128. <label class="field-label">E-mail</label>
  129. <div class="field-input-wrap">
  130. <span class="material-icons field-icon">email</span>
  131. <input
  132. v-model="form.email"
  133. type="email"
  134. placeholder="nome@conta.com"
  135. class="field-input"
  136. >
  137. </div>
  138. </div>
  139. <div class="field-group">
  140. <label class="field-label">Telefone</label>
  141. <div class="field-input-wrap">
  142. <span class="material-icons field-icon">phone</span>
  143. <input
  144. v-model="form.telefone"
  145. type="tel"
  146. placeholder="00000000"
  147. class="field-input"
  148. >
  149. </div>
  150. </div>
  151. <div class="field-group">
  152. <label class="field-label">Cargo</label>
  153. <div class="field-input-wrap">
  154. <span class="material-icons field-icon">work</span>
  155. <input
  156. v-model="form.cargo"
  157. type="text"
  158. placeholder="Assistente Financeiro"
  159. class="field-input"
  160. >
  161. </div>
  162. </div>
  163. <div class="field-group">
  164. <label class="field-label">Setor</label>
  165. <div class="field-input-wrap">
  166. <span class="material-icons field-icon">business</span>
  167. <input
  168. v-model="form.setor"
  169. type="text"
  170. placeholder="Financeiro"
  171. class="field-input"
  172. >
  173. </div>
  174. </div>
  175. </div>
  176. <div class="flex justify-center">
  177. <button type="submit" class="btn-submit" :disabled="isLoading" :style="isLoading ? 'opacity: 0.7; cursor: not-allowed;' : ''">
  178. {{ isLoading ? 'ENVIANDO...' : 'ENVIAR SOLICITAÇÃO' }}
  179. </button>
  180. </div>
  181. </form>
  182. </div>
  183. </div>
  184. </div>
  185. </section>
  186. <Transition name="toast">
  187. <div
  188. v-if="showSuccess"
  189. class="fixed bottom-6 right-6 z-50 bg-violet-normal text-white px-5 py-4 rounded-xl shadow-xl flex items-center gap-3"
  190. >
  191. <span class="material-icons text-xl">check_circle</span>
  192. <span class="text-sm font-medium">Solicitação enviada com sucesso!</span>
  193. </div>
  194. </Transition>
  195. <Transition name="toast">
  196. <div
  197. v-if="showError"
  198. class="fixed bottom-6 right-6 z-50 bg-red-600 text-white px-5 py-4 rounded-xl shadow-xl flex items-center gap-3"
  199. >
  200. <span class="material-icons text-xl">error_outline</span>
  201. <span class="text-sm font-medium">{{ errorMessage }}</span>
  202. </div>
  203. </Transition>
  204. </div>
  205. </template>
  206. <script setup lang="ts">
  207. import heroBg from '~/assets/images/imagem_fundo.png'
  208. useHead({ title: 'Ser Prati — Associação dos Servidores' })
  209. definePageMeta({ layout: 'default' })
  210. const scrollTo = (id: string) => {
  211. document.getElementById(id)?.scrollIntoView({ behavior: 'smooth' })
  212. }
  213. const benefits = [
  214. {
  215. icon: 'local_offer',
  216. title: 'Descontos Exclusivos',
  217. description: 'Até 50% de desconto em parceiros selecionados.',
  218. },
  219. {
  220. icon: 'health_and_safety',
  221. title: 'Convênios Médicos',
  222. description: 'Planos de saúde com condições especiais.',
  223. },
  224. {
  225. icon: 'store',
  226. title: 'Loja do Associado',
  227. description: 'Produtos com preços diferenciados.',
  228. },
  229. {
  230. icon: 'badge',
  231. title: 'Carteirinha Digital',
  232. description: 'Acesso rápido aos benefícios pelo celular.',
  233. },
  234. {
  235. icon: 'notifications',
  236. title: 'Notificações',
  237. description: 'Fique por dentro das novidades e promoções.',
  238. },
  239. {
  240. icon: 'family_restroom',
  241. title: 'Dependentes',
  242. description: 'Inclua sua família nos benefícios.',
  243. },
  244. ]
  245. const form = reactive({
  246. nomeCompleto: '',
  247. cpf: '',
  248. email: '',
  249. telefone: '',
  250. cargo: '',
  251. setor: '',
  252. })
  253. const formatCPF = (value: string): string => {
  254. return value
  255. .replace(/\D/g, '')
  256. .replace(/(\d{3})(\d)/, '$1.$2')
  257. .replace(/(\d{3})(\d)/, '$1.$2')
  258. .replace(/(\d{3})(\d{1,2})$/, '$1-$2')
  259. .slice(0, 14)
  260. }
  261. const handleCPF = (e: Event) => {
  262. form.cpf = formatCPF((e.target as HTMLInputElement).value)
  263. }
  264. const { registerLandingUser } = useRegisterApi()
  265. const isLoading = ref(false)
  266. const showSuccess = ref(false)
  267. const showError = ref(false)
  268. const errorMessage = ref('')
  269. const resetForm = () => {
  270. Object.assign(form, { nomeCompleto: '', cpf: '', email: '', telefone: '', cargo: '', setor: '' })
  271. }
  272. const handleSubmit = async () => {
  273. isLoading.value = true
  274. showError.value = false
  275. try {
  276. await registerLandingUser({
  277. name: form.nomeCompleto,
  278. cpf: form.cpf,
  279. email: form.email,
  280. phone: form.telefone,
  281. position_label: form.cargo,
  282. sector_label: form.setor,
  283. })
  284. showSuccess.value = true
  285. setTimeout(() => { showSuccess.value = false }, 4000)
  286. resetForm()
  287. } catch (err: unknown) {
  288. const error = err as { data?: { errors?: Record<string, string[]>; message?: string } }
  289. const firstError = error?.data?.errors
  290. ? Object.values(error.data.errors)[0]?.[0]
  291. : error?.data?.message
  292. errorMessage.value = firstError || 'Erro ao enviar solicitação. Tente novamente.'
  293. showError.value = true
  294. setTimeout(() => { showError.value = false }, 5000)
  295. } finally {
  296. isLoading.value = false
  297. }
  298. }
  299. onMounted(() => {
  300. const observer = new IntersectionObserver(
  301. (entries) => {
  302. entries.forEach((entry) => {
  303. if (entry.isIntersecting) {
  304. entry.target.classList.add('is-visible')
  305. observer.unobserve(entry.target)
  306. }
  307. })
  308. },
  309. { threshold: 0.1, rootMargin: '0px 0px -40px 0px' }
  310. )
  311. document.querySelectorAll('.reveal').forEach((el) => observer.observe(el))
  312. })
  313. </script>
  314. <style scoped>
  315. .btn-primary {
  316. background: linear-gradient(90deg, #4d1658 0%, #8b30a5 100%);
  317. color: #ffffff;
  318. font-family: "Nunito", sans-serif;
  319. font-weight: 800;
  320. font-size: 0.875rem;
  321. letter-spacing: 1px;
  322. padding: 0.75rem 1.75rem;
  323. border-radius: 0.5rem;
  324. transition: opacity 0.2s;
  325. cursor: pointer;
  326. white-space: nowrap;
  327. }
  328. .btn-primary:hover {
  329. opacity: 0.88;
  330. }
  331. .btn-outline {
  332. background-color: rgba(102, 29, 117, 0.18);
  333. color: #ffffff;
  334. font-family: "Nunito", sans-serif;
  335. font-weight: 700;
  336. font-size: 0.875rem;
  337. letter-spacing: 1px;
  338. padding: 0.75rem 1.75rem;
  339. border-radius: 0.5rem;
  340. border: 2px solid #a855c8;
  341. transition: background-color 0.2s, border-color 0.2s;
  342. cursor: pointer;
  343. white-space: nowrap;
  344. }
  345. .btn-outline:hover {
  346. background-color: rgba(102, 29, 117, 0.32);
  347. border-color: #ffffff;
  348. }
  349. .benefit-card {
  350. background-color: #ffffff;
  351. border-radius: 1rem;
  352. padding: 1.75rem;
  353. box-shadow: 0 2px 12px rgba(102, 29, 117, 0.07);
  354. transition: box-shadow 0.2s, transform 0.2s;
  355. }
  356. .benefit-card:hover {
  357. box-shadow: 0 6px 24px rgba(102, 29, 117, 0.13);
  358. transform: translateY(-2px);
  359. }
  360. .benefit-icon-wrap {
  361. display: inline-flex;
  362. align-items: center;
  363. justify-content: center;
  364. width: 48px;
  365. height: 48px;
  366. background-color: #f0e8f1;
  367. border-radius: 0.75rem;
  368. }
  369. .tab-active {
  370. background-color: #661d75;
  371. color: #ffffff;
  372. font-family: "Nunito", sans-serif;
  373. font-weight: 600;
  374. font-size: 0.75rem;
  375. letter-spacing: 1.25px;
  376. padding: 0.625rem 1.5rem;
  377. border-radius: 0.5rem 0.5rem 0 0;
  378. cursor: default;
  379. }
  380. .field-group {
  381. display: flex;
  382. flex-direction: column;
  383. gap: 0.375rem;
  384. }
  385. .field-label {
  386. font-family: "Nunito", sans-serif;
  387. font-size: 0.8125rem;
  388. font-weight: 600;
  389. color: #505050;
  390. }
  391. .field-input-wrap {
  392. display: flex;
  393. align-items: center;
  394. gap: 0.5rem;
  395. border: 1.5px solid #C0C0C0;
  396. border-radius: 0.5rem;
  397. padding: 0.5rem 0.75rem;
  398. background-color: #fefefe;
  399. transition: border-color 0.2s;
  400. }
  401. .field-input-wrap:focus-within {
  402. border-color: #661d75;
  403. }
  404. .field-icon {
  405. font-size: 1.125rem;
  406. color: #b6b6b6;
  407. flex-shrink: 0;
  408. }
  409. .field-input {
  410. flex: 1;
  411. border: none;
  412. outline: none;
  413. background: transparent;
  414. font-family: "Nunito", sans-serif;
  415. font-size: 0.875rem;
  416. color: #161616;
  417. }
  418. .field-input::placeholder {
  419. color: #b6b6b6;
  420. }
  421. .btn-submit {
  422. background-color: #661d75;
  423. color: #ffffff;
  424. font-family: "Nunito", sans-serif;
  425. font-weight: 600;
  426. font-size: 0.875rem;
  427. letter-spacing: 1.25px;
  428. padding: 0.875rem 3rem;
  429. border-radius: 0.5rem;
  430. transition: background-color 0.2s;
  431. cursor: pointer;
  432. }
  433. .btn-submit:hover {
  434. background-color: #5c1a69;
  435. }
  436. .toast-enter-active,
  437. .toast-leave-active {
  438. transition: opacity 0.4s ease, transform 0.4s ease;
  439. }
  440. .toast-enter-from,
  441. .toast-leave-to {
  442. opacity: 0;
  443. transform: translateY(12px);
  444. }
  445. </style>