From c1389166b8251337c0565cb17f2a03108bbf9838 Mon Sep 17 00:00:00 2001 From: Jewgeni Lewash Date: Fri, 4 Oct 2024 22:07:20 +0200 Subject: [PATCH] feat: add interactive components --- src/components/Modal.astro | 68 +++++++++++++++++++++++++++ src/components/Tooltip.astro | 26 +++++++++++ src/pages/index.astro | 90 ++++++++++++++++++++++++++---------- 3 files changed, 160 insertions(+), 24 deletions(-) create mode 100644 src/components/Modal.astro create mode 100644 src/components/Tooltip.astro diff --git a/src/components/Modal.astro b/src/components/Modal.astro new file mode 100644 index 0000000..4f7ddc4 --- /dev/null +++ b/src/components/Modal.astro @@ -0,0 +1,68 @@ +--- +interface Props { + id: string; + title: string; +} + +const { id, title } = Astro.props; +--- + + + + diff --git a/src/components/Tooltip.astro b/src/components/Tooltip.astro new file mode 100644 index 0000000..30649b4 --- /dev/null +++ b/src/components/Tooltip.astro @@ -0,0 +1,26 @@ +--- +interface Props { + text: string; + position?: 'top' | 'right' | 'bottom' | 'left'; +} + +const { text, position = 'top' } = Astro.props; + +const positionClasses = { + top: 'bottom-full left-1/2 mb-2 -translate-x-1/2', + right: 'left-full top-1/2 ml-2 -translate-y-1/2', + bottom: 'top-full left-1/2 mt-2 -translate-x-1/2', + left: 'right-full top-1/2 mr-2 -translate-y-1/2', +}; +--- + +
+ +
+ {text} +
+
+
+
diff --git a/src/pages/index.astro b/src/pages/index.astro index 74bd9d7..2e823ee 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -3,6 +3,8 @@ import { Icon } from 'astro-icon/components'; import BaseLayout from '@/layouts/BaseLayout.astro'; import Heading from '@/components/ui/Heading.astro'; import FeatureSection from '@/components/FeatureSection.astro'; +import Modal from '@/components/Modal.astro'; +import Tooltip from '@/components/Tooltip.astro'; import index1 from '@/assets/images/index-1.png'; import index2 from '@/assets/images/index-2.png'; @@ -47,37 +49,44 @@ const features = [ -
- - Deploy Your - - Astro.js - - Site! - -

- Supercharge your website with the Astro Deploy boilerplate with Docker support for - out-of-this-world web experiences. Launch today! -

-
- - Get started! - - +
+
+
+
+ + Deploy Your + + Astro.js + + Site! + +

+ Supercharge your website with the Astro Deploy boilerplate with Docker support for + out-of-this-world web experiences. Launch today! +

+
-
+
+ classes="max-w-3xl text-center mx-auto pb-2 text-3xl sm:text-4xl lg:text-5xl font-bold bg-clip-text bg-gradient-to-r from-primary-700 to-primary-500 dark:from-primary-400 dark:to-primary-200 text-transparent"> Launch Stunning Websites Effortlessly with Astro Deploy -

+

Empower your success with Astro Deploy. Leverage cutting-edge technologies for seamless experiences.

@@ -94,6 +103,39 @@ const features = [ )) } +
+
+ + Interactive Components + +
+ +

+ This is the content of a modal. It can include any HTML content. +

+ +
+ + + + + + +
+
+
+