|
| 1 | +<script setup lang="ts"> |
| 2 | +import { ref } from 'vue' |
| 3 | +import { Sparkles } from 'lucide-vue-next' |
| 4 | +
|
| 5 | +import { useInView, motion } from 'motion-v' |
| 6 | +import { useFlyIn } from './animate' |
| 7 | +
|
| 8 | +const scope = ref(null) |
| 9 | +const isInView = useInView(scope, { |
| 10 | + once: true, |
| 11 | + margin: '0px 0px -35% 0px' |
| 12 | +}) |
| 13 | +const flyIn = useFlyIn(isInView) |
| 14 | +
|
| 15 | +function askAI() { |
| 16 | + // @ts-ignore |
| 17 | + window.toggleAI() |
| 18 | +} |
| 19 | +</script> |
| 20 | + |
| 21 | +<template> |
| 22 | + <div |
| 23 | + class="flex flex-col justify-center items-center w-full h-108 md:h-auto mx-auto mt-12 px-3" |
| 24 | + ref="scope" |
| 25 | + > |
| 26 | + <motion.section |
| 27 | + class="group relative isolate flex flex-col md:flex-row justify-center items-center gap-10 w-full max-w-5xl h-full p-8 md:py-16 border border-gray-200 dark:border-gray-700 lg:rounded-[2.5rem] overflow-hidden rounded-2xl" |
| 28 | + v-bind="flyIn()" |
| 29 | + > |
| 30 | + <div |
| 31 | + class="flex flex-col justify-center items-center md:items-start md:max-w-xs w-full" |
| 32 | + > |
| 33 | + <motion.h4 class="ml-3 mb-1" v-bind="flyIn(0.1)"> |
| 34 | + Got more question? |
| 35 | + </motion.h4> |
| 36 | + <motion.a |
| 37 | + class="text-4xl lg:text-5xl font-bold bg-clip-text text-transparent bg-gradient-to-tl from-emerald-400/80 to-sky-400/80" |
| 38 | + v-bind="flyIn(0.2)" |
| 39 | + > |
| 40 | + Just Ask! |
| 41 | + </motion.a> |
| 42 | + |
| 43 | + <motion.button |
| 44 | + class="flex items-center gap-2 mt-6 md:mr-auto text-white font-semibold md:-translate-x-2 bg-gradient-to-br from-emerald-400 to-sky-400 rounded-full px-6 py-3 box-shadow shadow-cyan-400/40 shadow-lg transition-transform ease-out-expo duration-500 transform hover:scale-110 focus:scale-110" |
| 45 | + @click="askAI" |
| 46 | + v-bind="flyIn(0.3)" |
| 47 | + > |
| 48 | + <Sparkles stroke-width="1.75" /> |
| 49 | + Ask Elysia <sup>(AI)</sup> |
| 50 | + </motion.button> |
| 51 | + </div> |
| 52 | + <div |
| 53 | + class="relative flex flex-col justify-start gap-2 text-base max-w-md w-full mb-auto" |
| 54 | + > |
| 55 | + <motion.p |
| 56 | + class="absolute top-0 md:-top-6 right-0 flex justify-center items-center px-4 py-2 dark:text-gray-400 bg-gray-200/70 dark:bg-gray-800 rounded-3xl" |
| 57 | + v-bind="flyIn(0.4)" |
| 58 | + > |
| 59 | + Can I use Zod with Elysia? |
| 60 | + </motion.p> |
| 61 | + <motion.p |
| 62 | + class="absolute top-12 md:top-6 left-0 flex justify-center items-center px-4 py-2 dark:text-gray-400" |
| 63 | + v-bind="flyIn(0.5)" |
| 64 | + > |
| 65 | + Elysia validates incoming request data (params, query, body, |
| 66 | + headers, cookies, response) before your handler runs. |
| 67 | + <br /> |
| 68 | + <br /> |
| 69 | + It ships with a built‑in schema builder (Elysia.t) based on |
| 70 | + TypeBox, but it also natively supports any “Standard Schema” |
| 71 | + library – that includes Zod, Valibot, Yup, Joi, ArkType, |
| 72 | + Effect‑Schema, and many more. |
| 73 | + </motion.p> |
| 74 | + <div |
| 75 | + class="absolute top-12 md:top-12 left-0 w-full h-46 bg-gradient-to-b from-transparent to-white dark:to-gray-900 pointer-events-none" |
| 76 | + /> |
| 77 | + </div> |
| 78 | + </motion.section> |
| 79 | + </div> |
| 80 | +</template> |
0 commit comments