astro-component-kit 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +218 -119
- package/package.json +25 -52
- package/src/components/index.ts +207 -0
- package/src/components/lib/AnimatedGalaxy.astro +185 -0
- package/src/components/lib/Galaxy3D.astro +308 -0
- package/src/components/lib/GlassNavbar.astro +13 -11
- package/src/components/lib/LogoWithGalaxy.astro +63 -0
- package/src/components/lib/buttons/3dPushButton.astro +9 -0
- package/src/components/lib/buttons/AnimatedIconButton.astro +10 -0
- package/src/components/lib/buttons/BorderDrawButton.astro +9 -0
- package/src/components/lib/buttons/CyberpunkButton.astro +10 -0
- package/src/components/lib/buttons/DoubleBorderButton.astro +9 -0
- package/src/components/lib/buttons/GhostOutlineButton.astro +10 -0
- package/src/components/lib/buttons/GlassButton.astro +13 -32
- package/src/components/lib/buttons/GlowButton.astro +9 -0
- package/src/components/lib/buttons/LiquidButton.astro +9 -0
- package/src/components/lib/buttons/LoadingButton.astro +10 -0
- package/src/components/lib/buttons/MagneticButton.astro +10 -0
- package/src/components/lib/buttons/MinimalPillButton.astro +9 -0
- package/src/components/lib/buttons/NeumorphicButton.astro +10 -0
- package/src/components/lib/buttons/PulseButton.astro +10 -0
- package/src/components/lib/buttons/RetroArcadeButton.astro +9 -0
- package/src/components/lib/buttons/RetroShadowButton.astro +9 -0
- package/src/components/lib/buttons/ShimmerButton.astro +9 -0
- package/src/components/lib/buttons/ShinyButton.astro +9 -0
- package/src/components/lib/buttons/TiltGlowButton.astro +10 -0
- package/src/components/lib/cards/BlogHorizontalCard.astro +46 -13
- package/src/components/lib/cards/CyberFeatureCard.astro +50 -6
- package/src/components/lib/cards/EcommerceProductCard.astro +69 -16
- package/src/components/lib/cards/GlassCard.astro +8 -0
- package/src/components/lib/cards/GlassEventCard.astro +53 -12
- package/src/components/lib/cards/GlowPortfolioCard.astro +46 -9
- package/src/components/lib/cards/InteractiveTiltCard.astro +47 -7
- package/src/components/lib/cards/KanbanItemCard.astro +40 -9
- package/src/components/lib/cards/MinimalLinkCard.astro +37 -7
- package/src/components/lib/cards/MusicPlayerMini.astro +54 -14
- package/src/components/lib/cards/NeumorphicCard.astro +32 -2
- package/src/components/lib/cards/NotificationCard.astro +44 -9
- package/src/components/lib/cards/PricingCard.astro +47 -9
- package/src/components/lib/cards/ProfileCard.astro +50 -11
- package/src/components/lib/cards/RetroGameCard.astro +37 -9
- package/src/components/lib/cards/StatCard.astro +43 -8
- package/src/components/lib/cards/TaskKanbanCard.astro +50 -11
- package/src/components/lib/cards/TestimonialCardClean.astro +43 -12
- package/src/components/lib/cards/WeatherWidgetCard.astro +36 -10
- package/src/components/lib/feedback/AnimatedCheckmark.astro +58 -9
- package/src/components/lib/feedback/Badge.astro +47 -12
- package/src/components/lib/feedback/CircleProgress.astro +56 -13
- package/src/components/lib/feedback/ConfettiFeedback.astro +74 -11
- package/src/components/lib/feedback/CyberGlitchAlert.astro +69 -6
- package/src/components/lib/feedback/EmptyStateCard.astro +55 -7
- package/src/components/lib/feedback/GlassAlert.astro +59 -13
- package/src/components/lib/feedback/GlassModal.astro +99 -14
- package/src/components/lib/feedback/GlassProgress.astro +39 -5
- package/src/components/lib/feedback/IndicatorBadgeMinimal.astro +56 -3
- package/src/components/lib/feedback/NeonSpinner.astro +40 -3
- package/src/components/lib/feedback/PulseDot.astro +51 -7
- package/src/components/lib/feedback/RatingPill.astro +38 -8
- package/src/components/lib/feedback/ShakeErrorGroup.astro +44 -3
- package/src/components/lib/feedback/SimpleTooltip.astro +53 -4
- package/src/components/lib/feedback/SkeletonList.astro +59 -13
- package/src/components/lib/feedback/Spotlight.astro +49 -4
- package/src/components/lib/feedback/StepProgress.astro +96 -9
- package/src/components/lib/feedback/ToastNotif.astro +60 -6
- package/src/components/lib/feedback/TypingIndicator.astro +52 -7
- package/src/components/lib/forms/AnimatedInput.astro +47 -5
- package/src/components/lib/forms/ChipInput.astro +116 -8
- package/src/components/lib/forms/ColorPickerInput.astro +53 -6
- package/src/components/lib/forms/CurrencyInput.astro +59 -6
- package/src/components/lib/forms/CustomRadioGroup.astro +61 -9
- package/src/components/lib/forms/CyberpunkCheckbox.astro +64 -8
- package/src/components/lib/forms/DragDropUpload.astro +87 -7
- package/src/components/lib/forms/ErrorInput.astro +31 -4
- package/src/components/lib/forms/FloatingPassword.astro +48 -10
- package/src/components/lib/forms/FormGroupVertical.astro +63 -9
- package/src/components/lib/forms/GlassSlider.astro +84 -3
- package/src/components/lib/forms/GlassTextarea.astro +39 -6
- package/src/components/lib/forms/ModernSelect.astro +66 -10
- package/src/components/lib/forms/NeumorphicSwitch.astro +54 -26
- package/src/components/lib/forms/OTPInput.astro +84 -12
- package/src/components/lib/forms/RatingStars.astro +66 -10
- package/src/components/lib/forms/SearchReveal.astro +44 -6
- package/src/components/lib/forms/SegmentedControl.astro +61 -7
- package/src/components/lib/forms/SimpleFileInput.astro +57 -6
- package/src/components/lib/forms/StepperInput.astro +101 -9
- package/src/components/lib/layout/FeatureHero.astro +70 -6
- package/src/components/lib/layout/FooterCenteredMinimal.astro +5 -2
- package/src/components/lib/navigation/GlassNavbar.astro +10 -5
- package/src/components/lib/navigation/MinimalSidebar.astro +6 -3
- package/src/components/lib/navigation/SimpleFooterGlass.astro +6 -2
- package/src/components/lib/overlays/SplashIntroOverlay.astro +6 -3
- package/src/components/lib/sections/ButtonsShowcase.astro +182 -0
- package/src/components/lib/sections/CardsShowcase.astro +376 -0
- package/src/components/lib/sections/DataShowcase.astro +329 -0
- package/src/components/lib/sections/FeedbackShowcase.astro +320 -0
- package/src/components/lib/sections/FormsShowcase.astro +347 -0
- package/src/components/lib/sections/HeroGlass.astro +202 -0
- package/src/components/lib/sections/HeroGradient.astro +143 -0
- package/src/components/lib/sections/HeroSplit.astro +210 -0
- package/src/components/lib/sections/LayoutShowcase.astro +317 -0
- package/src/components/lib/sections/NavigationShowcase.astro +285 -0
- package/src/components/lib/sections/OverlaysShowcase.astro +373 -0
- package/src/components/lib/sections/TypographyShowcase.astro +239 -0
- package/src/components/lib/sections/index.ts +9 -0
- package/src/components/types.d.ts +6 -0
- package/{dist → src}/styles/global.css +5 -5
- package/dist/AnimatedInput.astro +0 -82
- package/dist/Badge.astro +0 -52
- package/dist/GlassButton.astro +0 -87
- package/dist/GlassCard.astro +0 -72
- package/dist/GlassNavbar.astro +0 -65
- package/dist/GlowButton.astro +0 -60
- package/dist/buttons/3dPushButton.astro +0 -136
- package/dist/buttons/AnimatedIconButton.astro +0 -146
- package/dist/buttons/BorderDrawButton.astro +0 -112
- package/dist/buttons/CyberpunkButton.astro +0 -148
- package/dist/buttons/DoubleBorderButton.astro +0 -131
- package/dist/buttons/GhostOutlineButton.astro +0 -109
- package/dist/buttons/GlassButton.astro +0 -165
- package/dist/buttons/GlowButton.astro +0 -119
- package/dist/buttons/LiquidButton.astro +0 -167
- package/dist/buttons/LoadingButton.astro +0 -148
- package/dist/buttons/MagneticButton.astro +0 -134
- package/dist/buttons/MinimalPillButton.astro +0 -102
- package/dist/buttons/NeumorphicButton.astro +0 -158
- package/dist/buttons/PulseButton.astro +0 -111
- package/dist/buttons/RetroArcadeButton.astro +0 -105
- package/dist/buttons/RetroShadowButton.astro +0 -82
- package/dist/buttons/ShimmerButton.astro +0 -113
- package/dist/buttons/ShinyButton.astro +0 -121
- package/dist/buttons/TiltGlowButton.astro +0 -145
- package/dist/buttons/index.mjs +0 -19
- package/dist/buttons/index.ts +0 -19
- package/dist/cards/BlogHorizontalCard.astro +0 -18
- package/dist/cards/CyberFeatureCard.astro +0 -12
- package/dist/cards/EcommerceProductCard.astro +0 -24
- package/dist/cards/GlassCard.astro +0 -17
- package/dist/cards/GlassEventCard.astro +0 -19
- package/dist/cards/GlowPortfolioCard.astro +0 -16
- package/dist/cards/InteractiveTiltCard.astro +0 -25
- package/dist/cards/KanbanItemCard.astro +0 -15
- package/dist/cards/MinimalLinkCard.astro +0 -12
- package/dist/cards/MusicPlayerMini.astro +0 -21
- package/dist/cards/NeumorphicCard.astro +0 -6
- package/dist/cards/NotificationCard.astro +0 -15
- package/dist/cards/PricingCard.astro +0 -17
- package/dist/cards/ProfileCard.astro +0 -17
- package/dist/cards/RetroGameCard.astro +0 -15
- package/dist/cards/StatCard.astro +0 -15
- package/dist/cards/TaskKanbanCard.astro +0 -18
- package/dist/cards/TestimonialCardClean.astro +0 -20
- package/dist/cards/WeatherWidgetCard.astro +0 -17
- package/dist/cards/index.mjs +0 -19
- package/dist/cards/index.ts +0 -19
- package/dist/data/AccordionGroupGlass.astro +0 -21
- package/dist/data/AvatarGroupStack.astro +0 -15
- package/dist/data/CalendarGridView.astro +0 -18
- package/dist/data/DataChipsGroup.astro +0 -16
- package/dist/data/DescriptionListHoriz.astro +0 -14
- package/dist/data/FileTreeView.astro +0 -22
- package/dist/data/GanttChartMinimal.astro +0 -12
- package/dist/data/GlassTable.astro +0 -23
- package/dist/data/KeyValuePillGroup.astro +0 -12
- package/dist/data/PriceCompareTable.astro +0 -22
- package/dist/data/ProgressListSmall.astro +0 -17
- package/dist/data/RatingBreakdownBar.astro +0 -13
- package/dist/data/SparklineStatCard.astro +0 -16
- package/dist/data/StatsGridDashboard.astro +0 -16
- package/dist/data/StepperDataVertical.astro +0 -15
- package/dist/data/TagCloudData.astro +0 -14
- package/dist/data/TimelineHorizSteps.astro +0 -18
- package/dist/data/TreeItemInteractive.astro +0 -18
- package/dist/data/UserDirectoryItem.astro +0 -15
- package/dist/data/VerticalTimeline.astro +0 -21
- package/dist/data/index.mjs +0 -20
- package/dist/data/index.ts +0 -20
- package/dist/feedback/AnimatedCheckmark.astro +0 -13
- package/dist/feedback/Badge.astro +0 -19
- package/dist/feedback/CircleProgress.astro +0 -22
- package/dist/feedback/ConfettiFeedback.astro +0 -18
- package/dist/feedback/CyberGlitchAlert.astro +0 -11
- package/dist/feedback/EmptyStateCard.astro +0 -13
- package/dist/feedback/GlassAlert.astro +0 -20
- package/dist/feedback/GlassModal.astro +0 -19
- package/dist/feedback/GlassProgress.astro +0 -10
- package/dist/feedback/IndicatorBadgeMinimal.astro +0 -10
- package/dist/feedback/NeonSpinner.astro +0 -7
- package/dist/feedback/PulseDot.astro +0 -12
- package/dist/feedback/RatingPill.astro +0 -13
- package/dist/feedback/ShakeErrorGroup.astro +0 -7
- package/dist/feedback/SimpleTooltip.astro +0 -10
- package/dist/feedback/SkeletonList.astro +0 -20
- package/dist/feedback/Spotlight.astro +0 -9
- package/dist/feedback/StepProgress.astro +0 -14
- package/dist/feedback/ToastNotif.astro +0 -11
- package/dist/feedback/TypingIndicator.astro +0 -12
- package/dist/feedback/index.mjs +0 -20
- package/dist/feedback/index.ts +0 -20
- package/dist/forms/AnimatedInput.astro +0 -16
- package/dist/forms/ChipInput.astro +0 -13
- package/dist/forms/ColorPickerInput.astro +0 -13
- package/dist/forms/CurrencyInput.astro +0 -11
- package/dist/forms/CustomRadioGroup.astro +0 -13
- package/dist/forms/CyberpunkCheckbox.astro +0 -15
- package/dist/forms/DragDropUpload.astro +0 -12
- package/dist/forms/ErrorInput.astro +0 -11
- package/dist/forms/FloatingPassword.astro +0 -20
- package/dist/forms/FormGroupVertical.astro +0 -14
- package/dist/forms/GlassSlider.astro +0 -7
- package/dist/forms/GlassTextarea.astro +0 -14
- package/dist/forms/ModernSelect.astro +0 -16
- package/dist/forms/NeumorphicSwitch.astro +0 -55
- package/dist/forms/OTPInput.astro +0 -22
- package/dist/forms/RatingStars.astro +0 -15
- package/dist/forms/SearchReveal.astro +0 -13
- package/dist/forms/SegmentedControl.astro +0 -13
- package/dist/forms/SimpleFileInput.astro +0 -11
- package/dist/forms/StepperInput.astro +0 -14
- package/dist/forms/index.mjs +0 -20
- package/dist/forms/index.ts +0 -20
- package/dist/index.js +0 -1
- package/dist/index.mjs +0 -1
- package/dist/layout/BentoGrid3.astro +0 -14
- package/dist/layout/CenterFixedBox.astro +0 -6
- package/dist/layout/CenteredContainer.astro +0 -8
- package/dist/layout/ClusterHorizontal.astro +0 -6
- package/dist/layout/FeatureHero.astro +0 -17
- package/dist/layout/FooterCenteredMinimal.astro +0 -11
- package/dist/layout/FullBleedSection.astro +0 -6
- package/dist/layout/GalleryGrid4.astro +0 -7
- package/dist/layout/GlassCardGrid.astro +0 -6
- package/dist/layout/GlassSectionHeader.astro +0 -15
- package/dist/layout/LandingSectionSplit.astro +0 -13
- package/dist/layout/MasonryGrid.astro +0 -7
- package/dist/layout/MinimalFooterGrid.astro +0 -20
- package/dist/layout/ScrollSnapSection.astro +0 -7
- package/dist/layout/SectionDividerText.astro +0 -7
- package/dist/layout/SidebarLayoutWrapper.astro +0 -11
- package/dist/layout/SplitScreenLayout.astro +0 -11
- package/dist/layout/StepLayoutVertical.astro +0 -21
- package/dist/layout/StickySidebarWrapper.astro +0 -10
- package/dist/layout/VerticalStack.astro +0 -8
- package/dist/layout/index.mjs +0 -20
- package/dist/layout/index.ts +0 -20
- package/dist/navigation/AnchorSideNav.astro +0 -13
- package/dist/navigation/BottomNavMobile.astro +0 -13
- package/dist/navigation/BreadcrumbsMinimal.astro +0 -16
- package/dist/navigation/BurgerMorphIcon.astro +0 -12
- package/dist/navigation/CommandPaletteUI.astro +0 -17
- package/dist/navigation/DotNavigationSlider.astro +0 -13
- package/dist/navigation/FloatingTabBar.astro +0 -12
- package/dist/navigation/GlassNavbar.astro +0 -19
- package/dist/navigation/LangSwitcherPill.astro +0 -17
- package/dist/navigation/MegaMenuGlass.astro +0 -25
- package/dist/navigation/MinimalSidebar.astro +0 -18
- package/dist/navigation/PaginationGlass.astro +0 -20
- package/dist/navigation/PaginationInfiniteUI.astro +0 -11
- package/dist/navigation/RadialIconMenu.astro +0 -15
- package/dist/navigation/RetroArcadeMenu.astro +0 -12
- package/dist/navigation/ScrollProgressTop.astro +0 -15
- package/dist/navigation/SimpleFooterGlass.astro +0 -21
- package/dist/navigation/TabUnderline.astro +0 -14
- package/dist/navigation/UserProfileNav.astro +0 -21
- package/dist/navigation/VerticalTabs.astro +0 -14
- package/dist/navigation/index.mjs +0 -20
- package/dist/navigation/index.ts +0 -20
- package/dist/overlays/AgeVerificationOverlay.astro +0 -20
- package/dist/overlays/BackdropBlurMask.astro +0 -6
- package/dist/overlays/BottomSheetMobile.astro +0 -16
- package/dist/overlays/CommandDialog.astro +0 -19
- package/dist/overlays/ContextMenuOverlay.astro +0 -17
- package/dist/overlays/CookieBannerGlass.astro +0 -14
- package/dist/overlays/ExitIntentOverlay.astro +0 -19
- package/dist/overlays/FloatingTrayActions.astro +0 -13
- package/dist/overlays/HelpBubbleOverlay.astro +0 -11
- package/dist/overlays/LightboxOverlay.astro +0 -13
- package/dist/overlays/LoadingOverlayFull.astro +0 -10
- package/dist/overlays/MobileNavOverlay.astro +0 -18
- package/dist/overlays/OverlayModal.astro +0 -24
- package/dist/overlays/PopoverMenuGlass.astro +0 -17
- package/dist/overlays/SearchOverlayFullscreen.astro +0 -15
- package/dist/overlays/SideDrawerRight.astro +0 -16
- package/dist/overlays/SplashIntroOverlay.astro +0 -11
- package/dist/overlays/SpotlightIndicator.astro +0 -6
- package/dist/overlays/ToastStackOverlay.astro +0 -12
- package/dist/overlays/TooltipActionTray.astro +0 -14
- package/dist/overlays/index.mjs +0 -20
- package/dist/overlays/index.ts +0 -20
- package/dist/typography/AnimatedUnderlineLink.astro +0 -10
- package/dist/typography/BackgroundClipMask.astro +0 -7
- package/dist/typography/CodeInlineGlass.astro +0 -6
- package/dist/typography/CyberpunkGlitchText.astro +0 -20
- package/dist/typography/DropCapParagraph.astro +0 -7
- package/dist/typography/FadedVerticalText.astro +0 -6
- package/dist/typography/FloatingTextLabel.astro +0 -10
- package/dist/typography/GlassBlockQuote.astro +0 -13
- package/dist/typography/GlassTextReveal.astro +0 -7
- package/dist/typography/GradientHeading.astro +0 -9
- package/dist/typography/GradientUnderlineLink.astro +0 -7
- package/dist/typography/KbdIndicator.astro +0 -6
- package/dist/typography/LetterSpacingWide.astro +0 -6
- package/dist/typography/MinimalListMarkers.astro +0 -10
- package/dist/typography/MonospaceStatLine.astro +0 -6
- package/dist/typography/NeonTextHighlight.astro +0 -6
- package/dist/typography/ShadowRevealText.astro +0 -7
- package/dist/typography/StrokeHeadingOutline.astro +0 -8
- package/dist/typography/Text3DLayer.astro +0 -7
- package/dist/typography/TypewriterText.astro +0 -15
- package/dist/typography/index.mjs +0 -20
- package/dist/typography/index.ts +0 -20
- package/dist/utilities/AspectRatioBox.astro +0 -11
- package/dist/utilities/BackgroundDotPattern.astro +0 -6
- package/dist/utilities/CircularMask.astro +0 -7
- package/dist/utilities/ClickRippleWrapper.astro +0 -7
- package/dist/utilities/FadeInWrapper.astro +0 -11
- package/dist/utilities/FixedRatioImage.astro +0 -7
- package/dist/utilities/GlassBlurLayer.astro +0 -6
- package/dist/utilities/GradientBorderMask.astro +0 -7
- package/dist/utilities/HoverLift.astro +0 -7
- package/dist/utilities/ResponsiveSpacer.astro +0 -15
- package/dist/utilities/ResponsiveVisToggle.astro +0 -11
- package/dist/utilities/ScrollLockParent.astro +0 -11
- package/dist/utilities/ScrollMarginTarget.astro +0 -10
- package/dist/utilities/SlideUpReveal.astro +0 -7
- package/dist/utilities/SmoothAnchorLink.astro +0 -22
- package/dist/utilities/StackLayering.astro +0 -12
- package/dist/utilities/StickyObserver.astro +0 -8
- package/dist/utilities/TextTruncate.astro +0 -10
- package/dist/utilities/TruncateSingleLine.astro +0 -6
- package/dist/utilities/VisuallyHidden.astro +0 -6
- package/dist/utilities/index.mjs +0 -20
- package/dist/utilities/index.ts +0 -20
- package/src/components/lib/utilities/AspectRatioBox.astro +0 -11
- package/src/components/lib/utilities/BackgroundDotPattern.astro +0 -6
- package/src/components/lib/utilities/CircularMask.astro +0 -7
- package/src/components/lib/utilities/ClickRippleWrapper.astro +0 -7
- package/src/components/lib/utilities/FadeInWrapper.astro +0 -11
- package/src/components/lib/utilities/FixedRatioImage.astro +0 -7
- package/src/components/lib/utilities/GlassBlurLayer.astro +0 -6
- package/src/components/lib/utilities/GradientBorderMask.astro +0 -7
- package/src/components/lib/utilities/HoverLift.astro +0 -7
- package/src/components/lib/utilities/ResponsiveSpacer.astro +0 -15
- package/src/components/lib/utilities/ResponsiveVisToggle.astro +0 -11
- package/src/components/lib/utilities/ScrollLockParent.astro +0 -11
- package/src/components/lib/utilities/ScrollMarginTarget.astro +0 -10
- package/src/components/lib/utilities/SlideUpReveal.astro +0 -7
- package/src/components/lib/utilities/SmoothAnchorLink.astro +0 -22
- package/src/components/lib/utilities/StackLayering.astro +0 -12
- package/src/components/lib/utilities/StickyObserver.astro +0 -8
- package/src/components/lib/utilities/TextTruncate.astro +0 -10
- package/src/components/lib/utilities/TruncateSingleLine.astro +0 -6
- package/src/components/lib/utilities/VisuallyHidden.astro +0 -6
- package/src/components/lib/utilities/index.ts +0 -20
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface Props {
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const { className = '' } = Astro.props;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<div class="galaxy-3d-container {className}" id="galaxy-3d-wrapper">
|
|
10
|
+
<canvas id="galaxy-3d-canvas"></canvas>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
.galaxy-3d-container {
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
z-index: 0;
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
}
|
|
22
|
+
#galaxy-3d-canvas {
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
|
|
31
|
+
<script is:inline>
|
|
32
|
+
(async function() {
|
|
33
|
+
const THREE = await import('https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.module.js');
|
|
34
|
+
|
|
35
|
+
const canvas = document.getElementById('galaxy-3d-canvas');
|
|
36
|
+
if (!canvas) return;
|
|
37
|
+
|
|
38
|
+
const container = canvas.parentElement;
|
|
39
|
+
if (!container) return;
|
|
40
|
+
|
|
41
|
+
// Scene setup
|
|
42
|
+
const scene = new THREE.Scene();
|
|
43
|
+
const camera = new THREE.PerspectiveCamera(75, 1, 0.1, 100);
|
|
44
|
+
camera.position.set(0, 0, 5);
|
|
45
|
+
camera.lookAt(0, 0, 0);
|
|
46
|
+
|
|
47
|
+
const renderer = new THREE.WebGLRenderer({ canvas, alpha: true, antialias: true });
|
|
48
|
+
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
|
|
49
|
+
|
|
50
|
+
function resize() {
|
|
51
|
+
const w = container.clientWidth;
|
|
52
|
+
const h = container.clientHeight;
|
|
53
|
+
renderer.setSize(w, h);
|
|
54
|
+
camera.aspect = w / h;
|
|
55
|
+
camera.updateProjectionMatrix();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
resize();
|
|
59
|
+
window.addEventListener('resize', resize);
|
|
60
|
+
|
|
61
|
+
// Corporate color palette (gold, white, subtle blue accents)
|
|
62
|
+
const galaxyColors = [
|
|
63
|
+
new THREE.Color('#fef3c7'), // Light gold
|
|
64
|
+
new THREE.Color('#fbbf24'), // Gold
|
|
65
|
+
new THREE.Color('#d4a017'), // Dark gold
|
|
66
|
+
new THREE.Color('#ffffff'), // White
|
|
67
|
+
new THREE.Color('#b8860b'), // Darker gold
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
const bgStarColors = [
|
|
71
|
+
new THREE.Color('#ffffff'),
|
|
72
|
+
new THREE.Color('#fef3c7'),
|
|
73
|
+
new THREE.Color('#fde68a'),
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
// ========== GALAXY ==========
|
|
77
|
+
const galaxyParams = {
|
|
78
|
+
count: 8000,
|
|
79
|
+
size: 0.025,
|
|
80
|
+
radius: 2.8,
|
|
81
|
+
branches: 5,
|
|
82
|
+
spin: 1.5,
|
|
83
|
+
randomness: 0.35,
|
|
84
|
+
randomnessPower: 2.5,
|
|
85
|
+
colors: galaxyColors,
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
function createGalaxy() {
|
|
89
|
+
const geometry = new THREE.BufferGeometry();
|
|
90
|
+
const positions = new Float32Array(galaxyParams.count * 3);
|
|
91
|
+
const colors = new Float32Array(galaxyParams.count * 3);
|
|
92
|
+
const sizes = new Float32Array(galaxyParams.count);
|
|
93
|
+
const randomness = new Float32Array(galaxyParams.count);
|
|
94
|
+
|
|
95
|
+
for (let i = 0; i < galaxyParams.count; i++) {
|
|
96
|
+
const i3 = i * 3;
|
|
97
|
+
const radius = Math.random() * galaxyParams.radius;
|
|
98
|
+
const spinAngle = radius * galaxyParams.spin;
|
|
99
|
+
const branchIndex = i % galaxyParams.branches;
|
|
100
|
+
const branchAngle = (branchIndex / galaxyParams.branches) * Math.PI * 2;
|
|
101
|
+
|
|
102
|
+
const power = galaxyParams.randomnessPower;
|
|
103
|
+
const randomX = Math.pow(Math.random(), power) * (Math.random() < 0.5 ? 1 : -1) * galaxyParams.randomness * radius;
|
|
104
|
+
const randomY = Math.pow(Math.random(), power) * (Math.random() < 0.5 ? 1 : -1) * galaxyParams.randomness * radius * 0.15;
|
|
105
|
+
const randomZ = Math.pow(Math.random(), power) * (Math.random() < 0.5 ? 1 : -1) * galaxyParams.randomness * radius;
|
|
106
|
+
|
|
107
|
+
const angle = branchAngle + spinAngle;
|
|
108
|
+
positions[i3] = Math.cos(angle) * radius + randomX;
|
|
109
|
+
positions[i3 + 1] = randomY;
|
|
110
|
+
positions[i3 + 2] = Math.sin(angle) * radius + randomZ;
|
|
111
|
+
|
|
112
|
+
// Color based on radius
|
|
113
|
+
const colorIndex = Math.floor(Math.random() * galaxyColors.length);
|
|
114
|
+
const color = galaxyColors[colorIndex];
|
|
115
|
+
const mixFactor = Math.random() * 0.3 + (radius / galaxyParams.radius) * 0.7;
|
|
116
|
+
const finalColor = color.clone().lerp(galaxyColors[(colorIndex + 1) % galaxyColors.length], mixFactor);
|
|
117
|
+
|
|
118
|
+
colors[i3] = finalColor.r;
|
|
119
|
+
colors[i3 + 1] = finalColor.g;
|
|
120
|
+
colors[i3 + 2] = finalColor.b;
|
|
121
|
+
|
|
122
|
+
sizes[i] = (Math.random() + 0.8) * galaxyParams.size;
|
|
123
|
+
randomness[i] = Math.random();
|
|
124
|
+
|
|
125
|
+
// Store for animation
|
|
126
|
+
randomness[i3] = randomX;
|
|
127
|
+
randomness[i3 + 1] = randomY;
|
|
128
|
+
randomness[i3 + 2] = randomZ;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
|
|
132
|
+
geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));
|
|
133
|
+
geometry.setAttribute('size', new THREE.BufferAttribute(sizes, 1));
|
|
134
|
+
|
|
135
|
+
const material = new THREE.PointsMaterial({
|
|
136
|
+
size: galaxyParams.size,
|
|
137
|
+
sizeAttenuation: true,
|
|
138
|
+
depthWrite: false,
|
|
139
|
+
blending: THREE.AdditiveBlending,
|
|
140
|
+
vertexColors: true,
|
|
141
|
+
transparent: true,
|
|
142
|
+
opacity: 0.85,
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
const points = new THREE.Points(geometry, material);
|
|
146
|
+
// Tilt the galaxy slightly for dramatic effect
|
|
147
|
+
points.rotation.x = -0.3;
|
|
148
|
+
points.rotation.z = 0.15;
|
|
149
|
+
scene.add(points);
|
|
150
|
+
|
|
151
|
+
return { points, geometry };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const galaxy = createGalaxy();
|
|
155
|
+
|
|
156
|
+
// ========== BACKGROUND STARS ==========
|
|
157
|
+
const bgStarsParams = {
|
|
158
|
+
count: 1500,
|
|
159
|
+
size: 0.012,
|
|
160
|
+
spread: 15,
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
function createBgStars() {
|
|
164
|
+
const geometry = new THREE.BufferGeometry();
|
|
165
|
+
const positions = new Float32Array(bgStarsParams.count * 3);
|
|
166
|
+
const colors = new Float32Array(bgStarsParams.count * 3);
|
|
167
|
+
const opacities = new Float32Array(bgStarsParams.count);
|
|
168
|
+
|
|
169
|
+
for (let i = 0; i < bgStarsParams.count; i++) {
|
|
170
|
+
const i3 = i * 3;
|
|
171
|
+
positions[i3] = (Math.random() - 0.5) * bgStarsParams.spread;
|
|
172
|
+
positions[i3 + 1] = (Math.random() - 0.5) * bgStarsParams.spread;
|
|
173
|
+
positions[i3 + 2] = (Math.random() - 0.5) * bgStarsParams.spread * 0.5 - 3;
|
|
174
|
+
|
|
175
|
+
const color = bgStarColors[Math.floor(Math.random() * bgStarColors.length)];
|
|
176
|
+
colors[i3] = color.r;
|
|
177
|
+
colors[i3 + 1] = color.g;
|
|
178
|
+
colors[i3 + 2] = color.b;
|
|
179
|
+
|
|
180
|
+
opacities[i] = Math.random() * 0.5 + 0.2;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
|
|
184
|
+
geometry.setAttribute('color', new THREE.BufferAttribute(colors, 3));
|
|
185
|
+
|
|
186
|
+
const material = new THREE.PointsMaterial({
|
|
187
|
+
size: bgStarsParams.size,
|
|
188
|
+
sizeAttenuation: true,
|
|
189
|
+
depthWrite: false,
|
|
190
|
+
transparent: true,
|
|
191
|
+
opacity: 0.5,
|
|
192
|
+
vertexColors: true,
|
|
193
|
+
blending: THREE.AdditiveBlending,
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const stars = new THREE.Points(geometry, material);
|
|
197
|
+
scene.add(stars);
|
|
198
|
+
return stars;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const bgStars = createBgStars();
|
|
202
|
+
|
|
203
|
+
// ========== CENTRAL GLOW ==========
|
|
204
|
+
const glowGeometry = new THREE.SphereGeometry(0.3, 16, 16);
|
|
205
|
+
const glowMaterial = new THREE.MeshBasicMaterial({
|
|
206
|
+
color: new THREE.Color('#fef3c7'),
|
|
207
|
+
transparent: true,
|
|
208
|
+
opacity: 0.15,
|
|
209
|
+
});
|
|
210
|
+
const glow = new THREE.Mesh(glowGeometry, glowMaterial);
|
|
211
|
+
glow.position.z = -0.2;
|
|
212
|
+
scene.add(glow);
|
|
213
|
+
|
|
214
|
+
// ========== AMBIENT PARTICLES (floating dust) ==========
|
|
215
|
+
const dustCount = 500;
|
|
216
|
+
const dustGeometry = new THREE.BufferGeometry();
|
|
217
|
+
const dustPositions = new Float32Array(dustCount * 3);
|
|
218
|
+
const dustColors = new Float32Array(dustCount * 3);
|
|
219
|
+
|
|
220
|
+
for (let i = 0; i < dustCount; i++) {
|
|
221
|
+
const i3 = i * 3;
|
|
222
|
+
dustPositions[i3] = (Math.random() - 0.5) * 6;
|
|
223
|
+
dustPositions[i3 + 1] = (Math.random() - 0.5) * 3;
|
|
224
|
+
dustPositions[i3 + 2] = (Math.random() - 0.5) * 2;
|
|
225
|
+
|
|
226
|
+
const color = galaxyColors[Math.floor(Math.random() * galaxyColors.length)];
|
|
227
|
+
dustColors[i3] = color.r;
|
|
228
|
+
dustColors[i3 + 1] = color.g;
|
|
229
|
+
dustColors[i3 + 2] = color.b;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
dustGeometry.setAttribute('position', new THREE.BufferAttribute(dustPositions, 3));
|
|
233
|
+
dustGeometry.setAttribute('color', new THREE.BufferAttribute(dustColors, 3));
|
|
234
|
+
|
|
235
|
+
const dustMaterial = new THREE.PointsMaterial({
|
|
236
|
+
size: 0.008,
|
|
237
|
+
sizeAttenuation: true,
|
|
238
|
+
depthWrite: false,
|
|
239
|
+
transparent: true,
|
|
240
|
+
opacity: 0.3,
|
|
241
|
+
vertexColors: true,
|
|
242
|
+
blending: THREE.AdditiveBlending,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const dust = new THREE.Points(dustGeometry, dustMaterial);
|
|
246
|
+
scene.add(dust);
|
|
247
|
+
|
|
248
|
+
// ========== MOUSE INTERACTION ==========
|
|
249
|
+
const mouse = { x: 0, y: 0 };
|
|
250
|
+
let targetMouseX = 0;
|
|
251
|
+
let targetMouseY = 0;
|
|
252
|
+
|
|
253
|
+
container.addEventListener('mousemove', (e) => {
|
|
254
|
+
const rect = canvas.getBoundingClientRect();
|
|
255
|
+
targetMouseX = ((e.clientX - rect.left) / rect.width) * 2 - 1;
|
|
256
|
+
targetMouseY = -((e.clientY - rect.top) / rect.height) * 2 + 1;
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
container.addEventListener('mouseleave', () => {
|
|
260
|
+
targetMouseX = 0;
|
|
261
|
+
targetMouseY = 0;
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// ========== ANIMATION ==========
|
|
265
|
+
const clock = new THREE.Clock();
|
|
266
|
+
|
|
267
|
+
function animate() {
|
|
268
|
+
requestAnimationFrame(animate);
|
|
269
|
+
const elapsed = clock.getElapsedTime();
|
|
270
|
+
|
|
271
|
+
// Smooth mouse movement
|
|
272
|
+
mouse.x += (targetMouseX - mouse.x) * 0.05;
|
|
273
|
+
mouse.y += (targetMouseY - mouse.y) * 0.05;
|
|
274
|
+
|
|
275
|
+
// Rotate galaxy slowly
|
|
276
|
+
if (galaxy.points) {
|
|
277
|
+
galaxy.points.rotation.y = elapsed * 0.06;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Rotate background stars
|
|
281
|
+
bgStars.rotation.y = elapsed * 0.01;
|
|
282
|
+
bgStars.rotation.x = elapsed * 0.005;
|
|
283
|
+
|
|
284
|
+
// Animate dust particles
|
|
285
|
+
const dustPos = dust.geometry.attributes.position.array;
|
|
286
|
+
for (let i = 0; i < dustCount; i++) {
|
|
287
|
+
const i3 = i * 3;
|
|
288
|
+
dustPos[i3] += Math.sin(elapsed + i) * 0.0003;
|
|
289
|
+
dustPos[i3 + 1] += Math.cos(elapsed * 0.8 + i) * 0.0002;
|
|
290
|
+
}
|
|
291
|
+
dust.geometry.attributes.position.needsUpdate = true;
|
|
292
|
+
|
|
293
|
+
// Central glow pulse
|
|
294
|
+
const pulseScale = 1 + Math.sin(elapsed * 2) * 0.1;
|
|
295
|
+
glow.scale.set(pulseScale, pulseScale, pulseScale);
|
|
296
|
+
glowMaterial.opacity = 0.12 + Math.sin(elapsed * 2) * 0.03;
|
|
297
|
+
|
|
298
|
+
// Camera follows mouse slightly
|
|
299
|
+
camera.position.x = mouse.x * 0.3;
|
|
300
|
+
camera.position.y = mouse.y * 0.3;
|
|
301
|
+
camera.lookAt(0, 0, 0);
|
|
302
|
+
|
|
303
|
+
renderer.render(scene, camera);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
animate();
|
|
307
|
+
})();
|
|
308
|
+
</script>
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
// src/components/lib/GlassNavbar.astro
|
|
3
|
+
import LogoWithGalaxy from './LogoWithGalaxy.astro';
|
|
4
|
+
|
|
3
5
|
interface Props {
|
|
4
|
-
brand?: string;
|
|
5
6
|
brandHref?: string;
|
|
6
7
|
}
|
|
7
|
-
const {
|
|
8
|
+
const { brandHref = '/' } = Astro.props;
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
<header class="glass-nav">
|
|
11
12
|
<div class="glass-nav__inner">
|
|
12
|
-
<a href={brandHref} class="glass-nav__brand">
|
|
13
|
+
<a href={brandHref} class="glass-nav__brand">
|
|
14
|
+
<LogoWithGalaxy size="small" />
|
|
15
|
+
</a>
|
|
13
16
|
<nav class="glass-nav__links">
|
|
14
17
|
<slot name="links" />
|
|
15
18
|
</nav>
|
|
@@ -29,22 +32,21 @@ const { brand = 'Astro Components', brandHref = '/' } = Astro.props;
|
|
|
29
32
|
|
|
30
33
|
.glass-nav__inner {
|
|
31
34
|
padding: 0 1.5rem;
|
|
32
|
-
height:
|
|
35
|
+
height: 70px;
|
|
33
36
|
display: flex;
|
|
34
37
|
align-items: center;
|
|
35
38
|
gap: 2rem;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
.glass-nav__brand {
|
|
39
|
-
font-size: 1rem;
|
|
40
|
-
font-weight: 800;
|
|
41
|
-
color: #f1f5f9;
|
|
42
42
|
text-decoration: none;
|
|
43
|
-
background: linear-gradient(135deg, #818cf8, #c084fc);
|
|
44
|
-
-webkit-background-clip: text;
|
|
45
|
-
-webkit-text-fill-color: transparent;
|
|
46
|
-
background-clip: text;
|
|
47
43
|
flex-shrink: 0;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.glass-nav__brand:hover {
|
|
49
|
+
opacity: 0.9;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
.glass-nav__links {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
import AnimatedGalaxy from './AnimatedGalaxy.astro';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
size?: 'small' | 'medium' | 'large';
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { size = 'medium', className = '' } = Astro.props;
|
|
10
|
+
|
|
11
|
+
const sizes = {
|
|
12
|
+
small: { logoHeight: '36px', galaxyWidth: '160px', galaxyHeight: '96px', galaxyTop: '-5px', galaxyLeft: '-40px' },
|
|
13
|
+
medium: { logoHeight: '48px', galaxyWidth: '220px', galaxyHeight: '132px', galaxyTop: '0px', galaxyLeft: '-55px' },
|
|
14
|
+
large: { logoHeight: '70px', galaxyWidth: '320px', galaxyHeight: '192px', galaxyTop: '5px', galaxyLeft: '-70px' },
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const s = sizes[size];
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<div class="logo-container {className}">
|
|
21
|
+
<!-- Galaxy behind, bottom-left -->
|
|
22
|
+
<div class="galaxy-wrap">
|
|
23
|
+
<AnimatedGalaxy class="galaxy-svg" style={`width: ${s.galaxyWidth}; height: ${s.galaxyHeight};`} />
|
|
24
|
+
</div>
|
|
25
|
+
<!-- Logo text on top -->
|
|
26
|
+
<div class="logo-text">
|
|
27
|
+
<img src="/logo.svg" alt="Astro Kit Components" />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.logo-container {
|
|
33
|
+
position: relative;
|
|
34
|
+
display: inline-block;
|
|
35
|
+
vertical-align: middle;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.galaxy-wrap {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: v-bind('s.galaxyTop');
|
|
41
|
+
left: v-bind('s.galaxyLeft');
|
|
42
|
+
z-index: 0;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
overflow: visible;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.galaxy-wrap :global(.galaxy-svg) {
|
|
48
|
+
display: block;
|
|
49
|
+
opacity: 0.7;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.logo-text {
|
|
53
|
+
position: relative;
|
|
54
|
+
z-index: 2;
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.logo-text img {
|
|
59
|
+
height: v-bind('s.logoHeight');
|
|
60
|
+
width: auto;
|
|
61
|
+
display: block;
|
|
62
|
+
}
|
|
63
|
+
</style>
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* 3dPushButton — A satisfying tactile 3D button that depresses when clicked, with depth layers.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {string} color - Optional. The base color to generate the 3D depth shades from. Default is '#3b82f6'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
10
|
+
*/
|
|
2
11
|
interface Props {
|
|
3
12
|
href?: string;
|
|
4
13
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* AnimatedIconButton — A button that elegantly slides an icon into view on hover.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {'primary'|'secondary'|'ghost'} variant - Optional. The visual style variant. Default is 'primary'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {'left'|'right'} iconPos - Optional. Side where the icon slides in. Default is 'right'.
|
|
10
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
11
|
+
*/
|
|
2
12
|
interface Props {
|
|
3
13
|
href?: string;
|
|
4
14
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* BorderDrawButton — A button that animates its SVG border being drawn on hover.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {string} color - Optional. The stroke color of the drawing border. Default is '#3b82f6'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
10
|
+
*/
|
|
2
11
|
interface Props {
|
|
3
12
|
href?: string;
|
|
4
13
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* CyberpunkButton — A glitchy, neon-styled button inspired by futuristic sci-fi aesthetics.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {string} primaryColor - Optional. The main neon background. Default is '#ff003c'.
|
|
8
|
+
* @param {string} secondaryColor - Optional. The glitch accent. Default is '#00e0ff'.
|
|
9
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
10
|
+
* @param {string} label - Optional. Text used exclusively for duplicate glitch iterations. Default is 'READY'.
|
|
11
|
+
*/
|
|
2
12
|
interface Props {
|
|
3
13
|
href?: string;
|
|
4
14
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* DoubleBorderButton — A button with a sophisticated offset double-border effect and sleek hover transitions.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {'primary'|'secondary'|'ghost'} variant - Optional. The visual style variant. Default is 'primary'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
10
|
+
*/
|
|
2
11
|
interface Props {
|
|
3
12
|
href?: string;
|
|
4
13
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* GhostOutlineButton — A minimalist transparent button with gradient outlines and animated borders.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {string} primaryColor - Optional. Starts the gradient outline color.
|
|
8
|
+
* @param {string} secondaryColor - Optional. Ends the gradient outline color.
|
|
9
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
10
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
11
|
+
*/
|
|
2
12
|
interface Props {
|
|
3
13
|
href?: string;
|
|
4
14
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* GlassButton — A premium button with glassmorphism effect, gradient border and smooth hover animations.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {'primary'|'secondary'|'ghost'} variant - Optional. The visual style variant. Default is 'primary'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
10
|
+
*/
|
|
2
11
|
interface Props {
|
|
3
12
|
href?: string;
|
|
4
13
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -10,32 +19,10 @@ interface Props {
|
|
|
10
19
|
const { href, type = 'button', variant = 'primary', size = 'md', disabled = false } = Astro.props;
|
|
11
20
|
const Tag = href ? 'a' : 'button';
|
|
12
21
|
---
|
|
13
|
-
<Tag
|
|
14
|
-
href={href}
|
|
22
|
+
<Tag
|
|
23
|
+
href={href}
|
|
15
24
|
type={href ? undefined : type}
|
|
16
|
-
disabled={disabled}
|
|
17
|
-
class={`glass-btn glass-btn--${variant} glass-btn--${size}`}
|
|
18
|
-
>
|
|
19
|
-
<slot />
|
|
20
|
-
</Tag>
|
|
21
|
-
|
|
22
|
-
<style>
|
|
23
|
-
---
|
|
24
|
-
interface Props {
|
|
25
|
-
href?: string;
|
|
26
|
-
type?: 'button' | 'submit' | 'reset';
|
|
27
|
-
variant?: 'primary' | 'secondary' | 'ghost';
|
|
28
|
-
size?: 'sm' | 'md' | 'lg';
|
|
29
|
-
disabled?: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const { href, type = 'button', variant = 'primary', size = 'md', disabled = false } = Astro.props;
|
|
33
|
-
const Tag = href ? 'a' : 'button';
|
|
34
|
-
---
|
|
35
|
-
<Tag
|
|
36
|
-
href={href}
|
|
37
|
-
type={href ? undefined : type}
|
|
38
|
-
disabled={disabled}
|
|
25
|
+
disabled={disabled}
|
|
39
26
|
class={`glass-btn glass-btn--${variant} glass-btn--${size}`}
|
|
40
27
|
>
|
|
41
28
|
<span class="glass-btn__shimmer"></span>
|
|
@@ -50,7 +37,7 @@ const Tag = href ? 'a' : 'button';
|
|
|
50
37
|
--btn-border: rgba(255, 255, 255, 0.1);
|
|
51
38
|
--btn-text: var(--c-text-1, #d4d4d4);
|
|
52
39
|
--btn-glow: rgba(184, 134, 11, 0);
|
|
53
|
-
|
|
40
|
+
|
|
54
41
|
display: inline-flex;
|
|
55
42
|
align-items: center;
|
|
56
43
|
justify-content: center;
|
|
@@ -73,7 +60,6 @@ const Tag = href ? 'a' : 'button';
|
|
|
73
60
|
color: var(--btn-text);
|
|
74
61
|
}
|
|
75
62
|
|
|
76
|
-
/* Shimmer Effect */
|
|
77
63
|
.glass-btn__shimmer {
|
|
78
64
|
position: absolute;
|
|
79
65
|
inset: 0;
|
|
@@ -94,7 +80,6 @@ const Tag = href ? 'a' : 'button';
|
|
|
94
80
|
transform: translateX(100%);
|
|
95
81
|
}
|
|
96
82
|
|
|
97
|
-
/* Glass Border Glow */
|
|
98
83
|
.glass-btn::after {
|
|
99
84
|
content: '';
|
|
100
85
|
position: absolute;
|
|
@@ -130,7 +115,6 @@ const Tag = href ? 'a' : 'button';
|
|
|
130
115
|
filter: grayscale(1);
|
|
131
116
|
}
|
|
132
117
|
|
|
133
|
-
/* Variants */
|
|
134
118
|
.glass-btn--primary {
|
|
135
119
|
--btn-bg: linear-gradient(135deg, rgba(184, 134, 11, 0.7), rgba(212, 160, 23, 0.7));
|
|
136
120
|
--btn-text: #0a0a0a;
|
|
@@ -156,10 +140,7 @@ const Tag = href ? 'a' : 'button';
|
|
|
156
140
|
border-color: rgba(184, 134, 11, 0.4);
|
|
157
141
|
}
|
|
158
142
|
|
|
159
|
-
/* Sizes */
|
|
160
143
|
.glass-btn--sm { padding: 0.45rem 1.1rem; font-size: 0.85rem; }
|
|
161
144
|
.glass-btn--md { padding: 0.75rem 1.6rem; font-size: 0.95rem; }
|
|
162
145
|
.glass-btn--lg { padding: 1.1rem 2.4rem; font-size: 1.1rem; }
|
|
163
146
|
</style>
|
|
164
|
-
</style>
|
|
165
|
-
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* GlowButton — A button with an animated glow effect that pulsates on hover.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} color - Optional. The base color for the glow effect. Default is '#6366f1'.
|
|
6
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
7
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
10
|
+
*/
|
|
2
11
|
interface Props {
|
|
3
12
|
color?: string;
|
|
4
13
|
href?: string;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* LiquidButton — A button featuring a fluid, liquid-like animated background layer.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {string} color - Optional. The base color for the fluid liquid effect. Default is '#3b82f6'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
10
|
+
*/
|
|
2
11
|
interface Props {
|
|
3
12
|
href?: string;
|
|
4
13
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* LoadingButton — A button supporting async states with a built-in spinner and disabled logic.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {'primary'|'secondary'|'ghost'} variant - Optional. The visual style variant. Default is 'primary'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {boolean} isLoading - Required indicator to display spinner state and lock interaction. Default is false.
|
|
10
|
+
* @param {boolean} disabled - Optional. Whether the button is strictly disabled aside from loading. Default is false.
|
|
11
|
+
*/
|
|
2
12
|
interface Props {
|
|
3
13
|
isLoading?: boolean;
|
|
4
14
|
href?: string;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* MagneticButton — A button that physically follows the user's cursor when hovered, providing a satisfying magnetic snap effect.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {'primary'|'secondary'|'ghost'} variant - Optional. The visual style variant. Default is 'primary'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {number} strength - Optional. How intense the magnetic pull effect is. Default is 40.
|
|
10
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
11
|
+
*/
|
|
2
12
|
interface Props {
|
|
3
13
|
href?: string;
|
|
4
14
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
+
/**
|
|
3
|
+
* MinimalPillButton — A cleanly rounded pill button optimized for minimal interactions and tags.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} href - Optional. If provided, renders an <a> tag instead of <button>.
|
|
6
|
+
* @param {'button'|'submit'|'reset'} type - Optional. The HTML button type. Default is 'button'.
|
|
7
|
+
* @param {'primary'|'secondary'|'ghost'} variant - Optional. The visual style variant. Default is 'primary'.
|
|
8
|
+
* @param {'sm'|'md'|'lg'} size - Optional. The size variant of the button. Default is 'md'.
|
|
9
|
+
* @param {boolean} disabled - Optional. Whether the button is disabled. Default is false.
|
|
10
|
+
*/
|
|
2
11
|
interface Props {
|
|
3
12
|
href?: string;
|
|
4
13
|
type?: 'button' | 'submit' | 'reset';
|