matrix-design-system 1.0.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/LICENSE +21 -0
- package/README.md +95 -0
- package/dist/atoms/animation/motion-div/index.d.mts +2 -0
- package/dist/atoms/animation/motion-div/motion-div.d.mts +7 -0
- package/dist/atoms/animation/motion-div/motion-div.mjs +37 -0
- package/dist/atoms/animation/motion-div/use-motion-div-store.mjs +17 -0
- package/dist/atoms/buttons/button/button.d.mts +8 -0
- package/dist/atoms/buttons/button/button.mjs +12 -0
- package/dist/atoms/buttons/button/index.d.mts +2 -0
- package/dist/atoms/buttons/switch/index.d.mts +2 -0
- package/dist/atoms/buttons/switch/switch.d.mts +10 -0
- package/dist/atoms/buttons/switch/switch.mjs +40 -0
- package/dist/atoms/buttons/switch/use-switch-store.mjs +7 -0
- package/dist/atoms/call-to-actions/call-to-action-external-with-tracking/call-to-action-external-with-tracking.d.mts +13 -0
- package/dist/atoms/call-to-actions/call-to-action-external-with-tracking/call-to-action-external-with-tracking.mjs +30 -0
- package/dist/atoms/call-to-actions/call-to-action-external-with-tracking/index.d.mts +2 -0
- package/dist/atoms/call-to-actions/call-to-action-internal-with-tracking/call-to-action-internal-with-tracking.d.mts +14 -0
- package/dist/atoms/call-to-actions/call-to-action-internal-with-tracking/call-to-action-internal-with-tracking.mjs +29 -0
- package/dist/atoms/call-to-actions/call-to-action-internal-with-tracking/index.d.mts +2 -0
- package/dist/atoms/chip/chip.d.mts +10 -0
- package/dist/atoms/chip/chip.mjs +10 -0
- package/dist/atoms/chip/index.d.mts +2 -0
- package/dist/atoms/effects/glassmorphism-background/glassmorphism-background.d.mts +8 -0
- package/dist/atoms/effects/glassmorphism-background/glassmorphism-background.mjs +33 -0
- package/dist/atoms/effects/glassmorphism-background/index.d.mts +2 -0
- package/dist/atoms/effects/glassmorphism-background/use-glassmorphism-background-store.mjs +17 -0
- package/dist/atoms/effects/image-glow/image-glow.d.mts +12 -0
- package/dist/atoms/effects/image-glow/image-glow.mjs +20 -0
- package/dist/atoms/effects/image-glow/index.d.mts +2 -0
- package/dist/atoms/effects/image-shimmer-placeholder/image-shimmer-placeholder.d.mts +6 -0
- package/dist/atoms/effects/image-shimmer-placeholder/image-shimmer-placeholder.mjs +22 -0
- package/dist/atoms/effects/image-shimmer-placeholder/index.d.mts +2 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/index.d.mts +2 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-2d-canvas/debounce.mjs +12 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-2d-canvas/matrix-2d-canvas.mjs +25 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-2d-canvas/use-matrix-2d-canvas-store.mjs +186 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-rain.d.mts +5 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-rain.mjs +68 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/use-matrix-rain-activity.mjs +40 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/use-matrix-rain-store.mjs +69 -0
- package/dist/atoms/effects/overlay/index.d.mts +2 -0
- package/dist/atoms/effects/overlay/overlay.d.mts +11 -0
- package/dist/atoms/effects/overlay/overlay.mjs +61 -0
- package/dist/atoms/effects/overlay/use-overlay-store.mjs +8 -0
- package/dist/atoms/effects/pills/index.d.mts +2 -0
- package/dist/atoms/effects/pills/pills.d.mts +10 -0
- package/dist/atoms/effects/pills/pills.mjs +121 -0
- package/dist/atoms/effects/pills/use-pills-store.mjs +17 -0
- package/dist/atoms/effects/plain-image/index.d.mts +2 -0
- package/dist/atoms/effects/plain-image/plain-image.d.mts +45 -0
- package/dist/atoms/effects/plain-image/plain-image.mjs +140 -0
- package/dist/atoms/effects/plain-image/use-plain-image-store.mjs +62 -0
- package/dist/atoms/icons/chat-icon/chat-icon.d.mts +4 -0
- package/dist/atoms/icons/chat-icon/chat-icon.mjs +13 -0
- package/dist/atoms/icons/copy-icon/copy-icon.d.mts +6 -0
- package/dist/atoms/icons/copy-icon/copy-icon.mjs +17 -0
- package/dist/atoms/icons/rounded-icon/index.d.mts +2 -0
- package/dist/atoms/icons/rounded-icon/rounded-icon.d.mts +8 -0
- package/dist/atoms/icons/rounded-icon/rounded-icon.mjs +8 -0
- package/dist/atoms/links/anchor-link/anchor-link.d.mts +31 -0
- package/dist/atoms/links/anchor-link/anchor-link.mjs +14 -0
- package/dist/atoms/links/anchor-link/index.d.mts +2 -0
- package/dist/atoms/links/external-link/external-link.d.mts +13 -0
- package/dist/atoms/links/external-link/external-link.mjs +29 -0
- package/dist/atoms/links/external-link/index.d.mts +2 -0
- package/dist/atoms/links/internal-link/index.d.mts +2 -0
- package/dist/atoms/links/internal-link/internal-link.d.mts +15 -0
- package/dist/atoms/links/internal-link/internal-link.mjs +12 -0
- package/dist/atoms/loader/loader/index.d.mts +2 -0
- package/dist/atoms/loader/loader/loader.d.mts +10 -0
- package/dist/atoms/loader/loader/loader.mjs +62 -0
- package/dist/atoms/typography/input-field/index.d.mts +2 -0
- package/dist/atoms/typography/input-field/input-field.d.mts +9 -0
- package/dist/atoms/typography/input-field/input-field.mjs +8 -0
- package/dist/atoms/typography/label/index.d.mts +2 -0
- package/dist/atoms/typography/label/label.d.mts +9 -0
- package/dist/atoms/typography/label/label.mjs +11 -0
- package/dist/atoms/typography/markdown/markdown-plugins.mjs +16 -0
- package/dist/atoms/typography/markdown/markdown.d.mts +7 -0
- package/dist/atoms/typography/markdown/markdown.mjs +23 -0
- package/dist/atoms/typography/markdown/use-markdown-store.mjs +24 -0
- package/dist/atoms/typography/terminal-blocks/index.d.mts +2 -0
- package/dist/atoms/typography/terminal-blocks/terminal-blocks.d.mts +13 -0
- package/dist/atoms/typography/terminal-blocks/terminal-blocks.mjs +42 -0
- package/dist/atoms/typography/textarea/index.d.mts +2 -0
- package/dist/atoms/typography/textarea/textarea.d.mts +9 -0
- package/dist/atoms/typography/textarea/textarea.mjs +8 -0
- package/dist/chart.d.mts +7 -0
- package/dist/chart.mjs +4 -0
- package/dist/command-palette.d.mts +6 -0
- package/dist/command-palette.mjs +5 -0
- package/dist/hooks/use-clipboard-available.d.mts +4 -0
- package/dist/hooks/use-clipboard-available.mjs +10 -0
- package/dist/hooks/use-device-capabilities.d.mts +10 -0
- package/dist/hooks/use-device-capabilities.mjs +30 -0
- package/dist/hooks/use-glassmorphism.d.mts +10 -0
- package/dist/hooks/use-glassmorphism.mjs +9 -0
- package/dist/hooks/use-in-view-list.d.mts +7 -0
- package/dist/hooks/use-in-view-list.mjs +63 -0
- package/dist/hooks/use-in-view.d.mts +9 -0
- package/dist/hooks/use-in-view.mjs +68 -0
- package/dist/hooks/use-is-ios.d.mts +4 -0
- package/dist/hooks/use-is-ios.mjs +7 -0
- package/dist/hooks/use-lock-body-scroll.d.mts +4 -0
- package/dist/hooks/use-lock-body-scroll.mjs +40 -0
- package/dist/hooks/use-matrix-settings-store.d.mts +5 -0
- package/dist/hooks/use-matrix-settings-store.mjs +15 -0
- package/dist/hooks/use-motion-store.d.mts +13 -0
- package/dist/hooks/use-motion-store.mjs +29 -0
- package/dist/hooks/use-os-modifier-key.d.mts +5 -0
- package/dist/hooks/use-os-modifier-key.mjs +15 -0
- package/dist/hooks/use-reading-progress.d.mts +8 -0
- package/dist/hooks/use-reading-progress.mjs +49 -0
- package/dist/hooks/use-reduced-motions.d.mts +4 -0
- package/dist/hooks/use-reduced-motions.mjs +10 -0
- package/dist/hooks/use-scroll-direction.d.mts +8 -0
- package/dist/hooks/use-scroll-direction.mjs +43 -0
- package/dist/hooks/use-typewriter.d.mts +15 -0
- package/dist/hooks/use-typewriter.mjs +89 -0
- package/dist/hooks/use-webgpu-supported.d.mts +4 -0
- package/dist/hooks/use-webgpu-supported.mjs +16 -0
- package/dist/index.d.mts +153 -0
- package/dist/index.mjs +88 -0
- package/dist/markdown.d.mts +2 -0
- package/dist/markdown.mjs +2 -0
- package/dist/molecules/accordion/accordion/accordion.d.mts +12 -0
- package/dist/molecules/accordion/accordion/accordion.mjs +130 -0
- package/dist/molecules/accordion/accordion/index.d.mts +2 -0
- package/dist/molecules/accordion/accordion/use-accordion-store.mjs +55 -0
- package/dist/molecules/breadcrumbs/breadcrumb/breadcrumb.d.mts +21 -0
- package/dist/molecules/breadcrumbs/breadcrumb/breadcrumb.mjs +186 -0
- package/dist/molecules/breadcrumbs/breadcrumb/index.d.mts +2 -0
- package/dist/molecules/breadcrumbs/breadcrumb/use-breadcrumb-store.mjs +29 -0
- package/dist/molecules/buttons/pagination-navigation/index.d.mts +2 -0
- package/dist/molecules/buttons/pagination-navigation/pagination-navigation.d.mts +11 -0
- package/dist/molecules/buttons/pagination-navigation/pagination-navigation.mjs +17 -0
- package/dist/molecules/buttons/pills-buttons/index.d.mts +2 -0
- package/dist/molecules/buttons/pills-buttons/pills-buttons.d.mts +10 -0
- package/dist/molecules/buttons/pills-buttons/pills-buttons.mjs +55 -0
- package/dist/molecules/buttons/segmented-control/segmented-control.d.mts +13 -0
- package/dist/molecules/buttons/segmented-control/segmented-control.mjs +46 -0
- package/dist/molecules/buttons/segmented-control/use-segmented-control-store.mjs +8 -0
- package/dist/molecules/buttons/social-contact/index.d.mts +2 -0
- package/dist/molecules/buttons/social-contact/social-contact.d.mts +10 -0
- package/dist/molecules/buttons/social-contact/social-contact.mjs +13 -0
- package/dist/molecules/buttons/tag/index.d.mts +2 -0
- package/dist/molecules/buttons/tag/tag.d.mts +17 -0
- package/dist/molecules/buttons/tag/tag.mjs +20 -0
- package/dist/molecules/buttons/terminal-button/index.d.mts +2 -0
- package/dist/molecules/buttons/terminal-button/terminal-button.d.mts +15 -0
- package/dist/molecules/buttons/terminal-button/terminal-button.mjs +38 -0
- package/dist/molecules/chart/chart-panel/chart-panel.d.mts +9 -0
- package/dist/molecules/chart/chart-panel/chart-panel.mjs +12 -0
- package/dist/molecules/chart/chart-panel/index.d.mts +2 -0
- package/dist/molecules/chart/chart-tooltip/chart-tooltip.d.mts +8 -0
- package/dist/molecules/chart/chart-tooltip/chart-tooltip.mjs +18 -0
- package/dist/molecules/chart/chart-tooltip/index.d.mts +2 -0
- package/dist/molecules/chart/donut-chart/donut-chart.d.mts +15 -0
- package/dist/molecules/chart/donut-chart/donut-chart.mjs +142 -0
- package/dist/molecules/chart/donut-chart/index.d.mts +2 -0
- package/dist/molecules/containers/content-container/content-container.d.mts +5 -0
- package/dist/molecules/containers/content-container/content-container.mjs +8 -0
- package/dist/molecules/containers/content-container/index.d.mts +2 -0
- package/dist/molecules/controls/control-slider/control-slider.d.mts +14 -0
- package/dist/molecules/controls/control-slider/control-slider.mjs +76 -0
- package/dist/molecules/controls/control-slider/index.d.mts +2 -0
- package/dist/molecules/controls/control-slider/use-control-slider-store.mjs +10 -0
- package/dist/molecules/effects/matrix-background/index.d.mts +2 -0
- package/dist/molecules/effects/matrix-background/matrix-background.d.mts +8 -0
- package/dist/molecules/effects/matrix-background/matrix-background.mjs +15 -0
- package/dist/molecules/effects/matrix-header-background/index.d.mts +2 -0
- package/dist/molecules/effects/matrix-header-background/matrix-header-background.d.mts +8 -0
- package/dist/molecules/effects/matrix-header-background/matrix-header-background.mjs +14 -0
- package/dist/molecules/effects/matrix-terminal/index.d.mts +2 -0
- package/dist/molecules/effects/matrix-terminal/matrix-terminal.d.mts +15 -0
- package/dist/molecules/effects/matrix-terminal/matrix-terminal.mjs +101 -0
- package/dist/molecules/effects/matrix-terminal/use-matrix-terminal-store.mjs +59 -0
- package/dist/molecules/form/filter-input/filter-input.d.mts +10 -0
- package/dist/molecules/form/filter-input/filter-input.mjs +35 -0
- package/dist/molecules/form/filter-input/index.d.mts +2 -0
- package/dist/molecules/form/form-error-summary/form-error-summary.d.mts +10 -0
- package/dist/molecules/form/form-error-summary/form-error-summary.mjs +71 -0
- package/dist/molecules/form/form-error-summary/index.d.mts +2 -0
- package/dist/molecules/form/form-field/form-field.d.mts +10 -0
- package/dist/molecules/form/form-field/form-field.mjs +60 -0
- package/dist/molecules/form/form-field/index.d.mts +2 -0
- package/dist/molecules/form/form-success-message/form-success-message.d.mts +8 -0
- package/dist/molecules/form/form-success-message/form-success-message.mjs +21 -0
- package/dist/molecules/form/form-success-message/index.d.mts +2 -0
- package/dist/molecules/form/form-textarea/form-textarea.d.mts +10 -0
- package/dist/molecules/form/form-textarea/form-textarea.mjs +60 -0
- package/dist/molecules/form/form-textarea/index.d.mts +2 -0
- package/dist/molecules/lightbox-image/index.d.mts +2 -0
- package/dist/molecules/lightbox-image/lightbox-image.d.mts +6 -0
- package/dist/molecules/lightbox-image/lightbox-image.mjs +49 -0
- package/dist/molecules/lightbox-image/use-lightbox-image-store.mjs +29 -0
- package/dist/molecules/links/pills-links/index.d.mts +2 -0
- package/dist/molecules/links/pills-links/pills-links.d.mts +13 -0
- package/dist/molecules/links/pills-links/pills-links.mjs +60 -0
- package/dist/molecules/menu/close/close.d.mts +8 -0
- package/dist/molecules/menu/close/close.mjs +9 -0
- package/dist/molecules/menu/close/index.d.mts +2 -0
- package/dist/molecules/menu/dropdown-menu/dropdown-menu.d.mts +25 -0
- package/dist/molecules/menu/dropdown-menu/dropdown-menu.mjs +143 -0
- package/dist/molecules/menu/dropdown-menu/index.d.mts +2 -0
- package/dist/molecules/menu/dropdown-menu/use-dropdown-menu-store.mjs +108 -0
- package/dist/molecules/menu/hamburger-menu/hamburger-menu.d.mts +8 -0
- package/dist/molecules/menu/hamburger-menu/hamburger-menu.mjs +9 -0
- package/dist/molecules/menu/hamburger-menu/index.d.mts +2 -0
- package/dist/molecules/menu/menu-item/index.d.mts +2 -0
- package/dist/molecules/menu/menu-item/menu-item.d.mts +16 -0
- package/dist/molecules/menu/menu-item/menu-item.mjs +65 -0
- package/dist/molecules/menu/menu-item/use-menu-item-store.mjs +10 -0
- package/dist/molecules/stat-card/index.d.mts +2 -0
- package/dist/molecules/stat-card/stat-card.d.mts +10 -0
- package/dist/molecules/stat-card/stat-card.mjs +21 -0
- package/dist/molecules/terminal-list-item/index.d.mts +2 -0
- package/dist/molecules/terminal-list-item/terminal-list-item.d.mts +9 -0
- package/dist/molecules/terminal-list-item/terminal-list-item.mjs +13 -0
- package/dist/molecules/terminal-progress-bar/index.d.mts +2 -0
- package/dist/molecules/terminal-progress-bar/terminal-progress-bar.d.mts +11 -0
- package/dist/molecules/terminal-progress-bar/terminal-progress-bar.mjs +20 -0
- package/dist/molecules/typography/page-title/index.d.mts +2 -0
- package/dist/molecules/typography/page-title/page-title.d.mts +5 -0
- package/dist/molecules/typography/page-title/page-title.mjs +8 -0
- package/dist/molecules/typography/paragraph-title-with-icon/index.d.mts +2 -0
- package/dist/molecules/typography/paragraph-title-with-icon/paragraph-title-with-icon.d.mts +8 -0
- package/dist/molecules/typography/paragraph-title-with-icon/paragraph-title-with-icon.mjs +13 -0
- package/dist/molecules/typography/section-heading/index.d.mts +2 -0
- package/dist/molecules/typography/section-heading/section-heading.d.mts +9 -0
- package/dist/molecules/typography/section-heading/section-heading.mjs +17 -0
- package/dist/molecules/video/self-hosted-video/index.d.mts +2 -0
- package/dist/molecules/video/self-hosted-video/self-hosted-video.d.mts +17 -0
- package/dist/molecules/video/self-hosted-video/self-hosted-video.mjs +39 -0
- package/dist/molecules/video/youtube/index.d.mts +2 -0
- package/dist/molecules/video/youtube/youtube.d.mts +9 -0
- package/dist/molecules/video/youtube/youtube.mjs +12 -0
- package/dist/organism/command-palette/command-palette/command-palette.d.mts +12 -0
- package/dist/organism/command-palette/command-palette/command-palette.mjs +148 -0
- package/dist/organism/command-palette/command-palette/index.d.mts +2 -0
- package/dist/organism/command-palette/command-palette/use-command-palette-store.mjs +121 -0
- package/dist/organism/command-palette/command-palette-group/command-palette-group.d.mts +9 -0
- package/dist/organism/command-palette/command-palette-group/command-palette-group.mjs +24 -0
- package/dist/organism/command-palette/command-palette-group/index.d.mts +2 -0
- package/dist/organism/command-palette/command-palette-item/command-palette-item.d.mts +11 -0
- package/dist/organism/command-palette/command-palette-item/command-palette-item.mjs +29 -0
- package/dist/organism/command-palette/command-palette-item/index.d.mts +2 -0
- package/dist/organism/command-palette/command-palette-item/use-command-palette-item-store.mjs +30 -0
- package/dist/organism/command-palette/index.d.mts +9 -0
- package/dist/organism/command-palette/toggle-motion-item/index.d.mts +2 -0
- package/dist/organism/command-palette/toggle-motion-item/toggle-motion-item.d.mts +8 -0
- package/dist/organism/command-palette/toggle-motion-item/toggle-motion-item.mjs +63 -0
- package/dist/organism/command-palette/toggle-motion-item/use-toggle-motion-item-store.mjs +45 -0
- package/dist/organism/cookie-consent-banner/cookie-consent-banner.d.mts +9 -0
- package/dist/organism/cookie-consent-banner/cookie-consent-banner.mjs +71 -0
- package/dist/organism/cookie-consent-banner/use-cookie-consent-banner-store.mjs +10 -0
- package/dist/organism/footer/footer.d.mts +26 -0
- package/dist/organism/footer/footer.mjs +193 -0
- package/dist/organism/footer/index.d.mts +3 -0
- package/dist/organism/footer/use-footer-store.d.mts +22 -0
- package/dist/organism/footer/use-footer-store.mjs +57 -0
- package/dist/organism/header/brand-header/brand-header.d.mts +14 -0
- package/dist/organism/header/brand-header/brand-header.mjs +132 -0
- package/dist/organism/header/brand-header/index.d.mts +2 -0
- package/dist/organism/image-carousel/fullscreen-modal/fullscreen-modal.mjs +148 -0
- package/dist/organism/image-carousel/fullscreen-modal/use-fullscreen-modal-store.mjs +129 -0
- package/dist/organism/image-carousel/image-carousel.d.mts +14 -0
- package/dist/organism/image-carousel/image-carousel.mjs +225 -0
- package/dist/organism/image-carousel/index.d.mts +2 -0
- package/dist/organism/image-carousel/navigation-buttons/navigation-buttons.mjs +22 -0
- package/dist/organism/image-carousel/navigation-buttons/use-navigation-buttons-store.mjs +18 -0
- package/dist/organism/image-carousel/page-indicators/page-indicator-button/page-indicator-button.mjs +14 -0
- package/dist/organism/image-carousel/page-indicators/page-indicator-button/use-page-indicator-button-store.mjs +11 -0
- package/dist/organism/image-carousel/page-indicators/page-indicators.mjs +20 -0
- package/dist/organism/image-carousel/use-image-carousel-store.mjs +88 -0
- package/dist/organism/lightbox/index.d.mts +2 -0
- package/dist/organism/lightbox/lightbox.d.mts +5 -0
- package/dist/organism/lightbox/lightbox.mjs +100 -0
- package/dist/organism/lightbox/use-lightbox-store.mjs +120 -0
- package/dist/organism/loading-bar/loading-bar.d.mts +7 -0
- package/dist/organism/loading-bar/loading-bar.mjs +48 -0
- package/dist/organism/loading-bar/use-loading-bar-store.mjs +52 -0
- package/dist/organism/menu/index.d.mts +3 -0
- package/dist/organism/menu/menu.d.mts +33 -0
- package/dist/organism/menu/menu.mjs +396 -0
- package/dist/organism/menu/use-menu-store.d.mts +22 -0
- package/dist/organism/menu/use-menu-store.mjs +265 -0
- package/dist/organism/profile-hero/index.d.mts +2 -0
- package/dist/organism/profile-hero/profile-hero.d.mts +15 -0
- package/dist/organism/profile-hero/profile-hero.mjs +72 -0
- package/dist/organism/profile-photo/index.d.mts +2 -0
- package/dist/organism/profile-photo/profile-photo.d.mts +12 -0
- package/dist/organism/profile-photo/profile-photo.mjs +17 -0
- package/dist/organism/reading-content-progress-bar/index.d.mts +2 -0
- package/dist/organism/reading-content-progress-bar/reading-content-progress-bar.d.mts +8 -0
- package/dist/organism/reading-content-progress-bar/reading-content-progress-bar.mjs +76 -0
- package/dist/organism/reading-content-progress-bar/use-reading-content-progress-bar-store.mjs +29 -0
- package/dist/organism/social-contacts/index.d.mts +2 -0
- package/dist/organism/social-contacts/social-contacts.d.mts +29 -0
- package/dist/organism/social-contacts/social-contacts.mjs +78 -0
- package/dist/state/command-palette/command-palette-context.d.mts +9 -0
- package/dist/state/command-palette/command-palette-context.mjs +10 -0
- package/dist/state/command-palette/command-palette-events.d.mts +11 -0
- package/dist/state/command-palette/command-palette-events.mjs +15 -0
- package/dist/state/command-palette/command-palette-trigger.d.mts +8 -0
- package/dist/state/lightbox/lightbox-events.d.mts +9 -0
- package/dist/state/lightbox/lightbox-events.mjs +7 -0
- package/dist/state/matrix-rain/matrix-settings.d.mts +37 -0
- package/dist/state/matrix-rain/matrix-settings.mjs +122 -0
- package/dist/state/motion/motion.d.mts +6 -0
- package/dist/state/motion/motion.mjs +17 -0
- package/package.json +160 -0
- package/src/styles/base.css +130 -0
- package/src/styles/components.css +57 -0
- package/src/styles/index.css +23 -0
- package/src/styles/pills.css +85 -0
- package/src/styles/theme.css +254 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useGlassmorphism } from "../../hooks/use-glassmorphism.mjs";
|
|
3
|
+
import { ProfilePhoto } from "../profile-photo/profile-photo.mjs";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/organism/profile-hero/profile-hero.tsx
|
|
7
|
+
const ProfileHero = (t0) => {
|
|
8
|
+
const $ = c(16);
|
|
9
|
+
const { name, role, imageSrc, imageAlt, children, imageComponent } = t0;
|
|
10
|
+
const { glassmorphismClass } = useGlassmorphism();
|
|
11
|
+
const t1 = `my-7 p-4 ${glassmorphismClass}`;
|
|
12
|
+
const t2 = imageAlt ?? name;
|
|
13
|
+
let t3;
|
|
14
|
+
if ($[0] !== imageComponent || $[1] !== imageSrc || $[2] !== t2) {
|
|
15
|
+
t3 = /* @__PURE__ */ jsx(ProfilePhoto, {
|
|
16
|
+
author: t2,
|
|
17
|
+
src: imageSrc,
|
|
18
|
+
imageComponent
|
|
19
|
+
});
|
|
20
|
+
$[0] = imageComponent;
|
|
21
|
+
$[1] = imageSrc;
|
|
22
|
+
$[2] = t2;
|
|
23
|
+
$[3] = t3;
|
|
24
|
+
} else t3 = $[3];
|
|
25
|
+
let t4;
|
|
26
|
+
if ($[4] !== name) {
|
|
27
|
+
t4 = /* @__PURE__ */ jsx("h3", {
|
|
28
|
+
className: "text-primary-text mx-0 mt-3 text-center",
|
|
29
|
+
children: name
|
|
30
|
+
});
|
|
31
|
+
$[4] = name;
|
|
32
|
+
$[5] = t4;
|
|
33
|
+
} else t4 = $[5];
|
|
34
|
+
let t5;
|
|
35
|
+
if ($[6] !== role) {
|
|
36
|
+
t5 = role && /* @__PURE__ */ jsx("h5", {
|
|
37
|
+
className: "text-secondary-text text-center",
|
|
38
|
+
children: role
|
|
39
|
+
});
|
|
40
|
+
$[6] = role;
|
|
41
|
+
$[7] = t5;
|
|
42
|
+
} else t5 = $[7];
|
|
43
|
+
let t6;
|
|
44
|
+
if ($[8] !== t4 || $[9] !== t5) {
|
|
45
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
46
|
+
className: "text-center",
|
|
47
|
+
children: [t4, t5]
|
|
48
|
+
});
|
|
49
|
+
$[8] = t4;
|
|
50
|
+
$[9] = t5;
|
|
51
|
+
$[10] = t6;
|
|
52
|
+
} else t6 = $[10];
|
|
53
|
+
let t7;
|
|
54
|
+
if ($[11] !== children || $[12] !== t1 || $[13] !== t3 || $[14] !== t6) {
|
|
55
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
56
|
+
className: t1,
|
|
57
|
+
children: [
|
|
58
|
+
t3,
|
|
59
|
+
t6,
|
|
60
|
+
children
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
$[11] = children;
|
|
64
|
+
$[12] = t1;
|
|
65
|
+
$[13] = t3;
|
|
66
|
+
$[14] = t6;
|
|
67
|
+
$[15] = t7;
|
|
68
|
+
} else t7 = $[15];
|
|
69
|
+
return t7;
|
|
70
|
+
};
|
|
71
|
+
//#endregion
|
|
72
|
+
export { ProfileHero };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ImageComponent } from "../../atoms/effects/plain-image/plain-image.mjs";
|
|
2
|
+
import "../../atoms/effects/plain-image/index.mjs";
|
|
3
|
+
import { FC } from "react";
|
|
4
|
+
//#region src/organism/profile-photo/profile-photo.d.ts
|
|
5
|
+
interface ProfilePhotoProps {
|
|
6
|
+
author: string;
|
|
7
|
+
src?: string;
|
|
8
|
+
imageComponent?: ImageComponent;
|
|
9
|
+
}
|
|
10
|
+
declare const ProfilePhoto: FC<ProfilePhotoProps>;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ProfilePhoto, ProfilePhotoProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ImageGlow } from "../../atoms/effects/image-glow/image-glow.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/organism/profile-photo/profile-photo.tsx
|
|
4
|
+
const defaultProfilePhoto = "/media/authors/fabrizio-duroni.jpg";
|
|
5
|
+
const ProfilePhoto = ({ author, src = defaultProfilePhoto, imageComponent }) => /* @__PURE__ */ jsx("div", {
|
|
6
|
+
className: "flex items-center justify-center",
|
|
7
|
+
children: /* @__PURE__ */ jsx(ImageGlow, {
|
|
8
|
+
imageComponent,
|
|
9
|
+
className: "w-[150px] h-[150px] rounded-full",
|
|
10
|
+
src,
|
|
11
|
+
alt: author,
|
|
12
|
+
width: 150,
|
|
13
|
+
height: 150
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ProfilePhoto };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
//#region src/organism/reading-content-progress-bar/reading-content-progress-bar.d.ts
|
|
3
|
+
interface ContentProgressBarProps {
|
|
4
|
+
contentId: string;
|
|
5
|
+
}
|
|
6
|
+
declare const ContentProgressBar: React.FC<ContentProgressBarProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { ContentProgressBar };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useGlassmorphism } from "../../hooks/use-glassmorphism.mjs";
|
|
3
|
+
import { TerminalProgressBar } from "../../molecules/terminal-progress-bar/terminal-progress-bar.mjs";
|
|
4
|
+
import { useReadingContentProgressBarStore } from "./use-reading-content-progress-bar-store.mjs";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { motion } from "framer-motion";
|
|
7
|
+
import "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
//#region src/organism/reading-content-progress-bar/reading-content-progress-bar.tsx
|
|
10
|
+
const ContentProgressBar = (t0) => {
|
|
11
|
+
const $ = c(14);
|
|
12
|
+
const { contentId } = t0;
|
|
13
|
+
const { glassmorphismClass } = useGlassmorphism();
|
|
14
|
+
const { state } = useReadingContentProgressBarStore(contentId);
|
|
15
|
+
const { progressPercentage, isVisible, shouldReduceMotion } = state;
|
|
16
|
+
const t1 = `${glassmorphismClass} container-fixed fixed top-0 right-0 left-0 z-60 rounded-tl-none rounded-tr-none border-t-0 px-0 py-2`;
|
|
17
|
+
const t2 = isVisible ? 0 : -100;
|
|
18
|
+
const t3 = isVisible ? "auto" : "none";
|
|
19
|
+
let t4;
|
|
20
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
21
|
+
t4 = {
|
|
22
|
+
delay: .1,
|
|
23
|
+
duration: .4,
|
|
24
|
+
ease: "linear"
|
|
25
|
+
};
|
|
26
|
+
$[0] = t4;
|
|
27
|
+
} else t4 = $[0];
|
|
28
|
+
let t5;
|
|
29
|
+
if ($[1] !== t2 || $[2] !== t3) {
|
|
30
|
+
t5 = {
|
|
31
|
+
y: t2,
|
|
32
|
+
pointerEvents: t3,
|
|
33
|
+
transition: t4
|
|
34
|
+
};
|
|
35
|
+
$[1] = t2;
|
|
36
|
+
$[2] = t3;
|
|
37
|
+
$[3] = t5;
|
|
38
|
+
} else t5 = $[3];
|
|
39
|
+
const t6 = isVisible ? "auto" : "none";
|
|
40
|
+
let t7;
|
|
41
|
+
if ($[4] !== t6) {
|
|
42
|
+
t7 = { pointerEvents: t6 };
|
|
43
|
+
$[4] = t6;
|
|
44
|
+
$[5] = t7;
|
|
45
|
+
} else t7 = $[5];
|
|
46
|
+
let t8;
|
|
47
|
+
if ($[6] !== progressPercentage || $[7] !== shouldReduceMotion) {
|
|
48
|
+
t8 = /* @__PURE__ */ jsx(TerminalProgressBar, {
|
|
49
|
+
percentage: progressPercentage,
|
|
50
|
+
loadingMessage: "Uploading knowledge...",
|
|
51
|
+
completeMessage: "Transfer complete.",
|
|
52
|
+
shouldReduceMotion
|
|
53
|
+
});
|
|
54
|
+
$[6] = progressPercentage;
|
|
55
|
+
$[7] = shouldReduceMotion;
|
|
56
|
+
$[8] = t8;
|
|
57
|
+
} else t8 = $[8];
|
|
58
|
+
let t9;
|
|
59
|
+
if ($[9] !== t1 || $[10] !== t5 || $[11] !== t7 || $[12] !== t8) {
|
|
60
|
+
t9 = /* @__PURE__ */ jsx(motion.div, {
|
|
61
|
+
className: t1,
|
|
62
|
+
initial: false,
|
|
63
|
+
animate: t5,
|
|
64
|
+
style: t7,
|
|
65
|
+
children: t8
|
|
66
|
+
}, "content-progress-bar");
|
|
67
|
+
$[9] = t1;
|
|
68
|
+
$[10] = t5;
|
|
69
|
+
$[11] = t7;
|
|
70
|
+
$[12] = t8;
|
|
71
|
+
$[13] = t9;
|
|
72
|
+
} else t9 = $[13];
|
|
73
|
+
return t9;
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
export { ContentProgressBar };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useReducedMotions } from "../../hooks/use-reduced-motions.mjs";
|
|
3
|
+
import { useScrollDirection } from "../../hooks/use-scroll-direction.mjs";
|
|
4
|
+
import { useReadingProgress } from "../../hooks/use-reading-progress.mjs";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
//#region src/organism/reading-content-progress-bar/use-reading-content-progress-bar-store.ts
|
|
7
|
+
const useReadingContentProgressBarStore = (contentId) => {
|
|
8
|
+
const $ = c(4);
|
|
9
|
+
const shouldReduceMotion = useReducedMotions();
|
|
10
|
+
const { percentage, started, status } = useReadingProgress(contentId);
|
|
11
|
+
const direction = useScrollDirection();
|
|
12
|
+
const isVisible = started && direction === "down";
|
|
13
|
+
const progressPercentage = status === "complete" ? 100 : percentage;
|
|
14
|
+
let t0;
|
|
15
|
+
if ($[0] !== isVisible || $[1] !== progressPercentage || $[2] !== shouldReduceMotion) {
|
|
16
|
+
t0 = { state: {
|
|
17
|
+
progressPercentage,
|
|
18
|
+
isVisible,
|
|
19
|
+
shouldReduceMotion
|
|
20
|
+
} };
|
|
21
|
+
$[0] = isVisible;
|
|
22
|
+
$[1] = progressPercentage;
|
|
23
|
+
$[2] = shouldReduceMotion;
|
|
24
|
+
$[3] = t0;
|
|
25
|
+
} else t0 = $[3];
|
|
26
|
+
return t0;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { useReadingContentProgressBarStore };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LinkComponent } from "../../atoms/links/anchor-link/anchor-link.mjs";
|
|
2
|
+
import "../../atoms/links/anchor-link/index.mjs";
|
|
3
|
+
import { FC } from "react";
|
|
4
|
+
//#region src/organism/social-contacts/social-contacts.d.ts
|
|
5
|
+
interface SocialContactLinks {
|
|
6
|
+
github: string;
|
|
7
|
+
linkedin: string;
|
|
8
|
+
medium: string;
|
|
9
|
+
devto?: string;
|
|
10
|
+
twitter: string;
|
|
11
|
+
facebook: string;
|
|
12
|
+
instagram: string;
|
|
13
|
+
}
|
|
14
|
+
interface SocialContactsProps {
|
|
15
|
+
linkComponent?: LinkComponent;
|
|
16
|
+
links: SocialContactLinks;
|
|
17
|
+
contactHref: string;
|
|
18
|
+
onTrackGithub?: () => void;
|
|
19
|
+
onTrackLinkedin?: () => void;
|
|
20
|
+
onTrackContact?: () => void;
|
|
21
|
+
onTrackMedium?: () => void;
|
|
22
|
+
onTrackDevto?: () => void;
|
|
23
|
+
onTrackTwitter?: () => void;
|
|
24
|
+
onTrackFacebook?: () => void;
|
|
25
|
+
onTrackInstagram?: () => void;
|
|
26
|
+
}
|
|
27
|
+
declare const SocialContacts: FC<SocialContactsProps>;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { SocialContactLinks, SocialContacts, SocialContactsProps };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CallToActionInternalWithTracking } from "../../atoms/call-to-actions/call-to-action-internal-with-tracking/call-to-action-internal-with-tracking.mjs";
|
|
2
|
+
import { SocialContact } from "../../molecules/buttons/social-contact/social-contact.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { BiEnvelope, BiLogoDevTo, BiLogoFacebookSquare, BiLogoGithub, BiLogoInstagram, BiLogoLinkedin, BiLogoMedium } from "react-icons/bi";
|
|
5
|
+
import { FaXTwitter } from "react-icons/fa6";
|
|
6
|
+
//#region src/organism/social-contacts/social-contacts.tsx
|
|
7
|
+
const SocialContacts = ({ links, contactHref, onTrackGithub, onTrackLinkedin, onTrackContact, onTrackMedium, onTrackDevto, onTrackTwitter, onTrackFacebook, onTrackInstagram, linkComponent }) => {
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
9
|
+
className: "flex flex-wrap items-center justify-center p-0 text-center",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx(SocialContact, {
|
|
12
|
+
link: links.github,
|
|
13
|
+
onClick: onTrackGithub,
|
|
14
|
+
icon: /* @__PURE__ */ jsx(BiLogoGithub, {
|
|
15
|
+
size: 30,
|
|
16
|
+
title: "Github"
|
|
17
|
+
})
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ jsx(SocialContact, {
|
|
20
|
+
link: links.linkedin,
|
|
21
|
+
onClick: onTrackLinkedin,
|
|
22
|
+
icon: /* @__PURE__ */ jsx(BiLogoLinkedin, {
|
|
23
|
+
size: 30,
|
|
24
|
+
title: "Linkedin"
|
|
25
|
+
})
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsx(CallToActionInternalWithTracking, {
|
|
28
|
+
linkComponent,
|
|
29
|
+
to: contactHref,
|
|
30
|
+
onClick: onTrackContact,
|
|
31
|
+
className: "min-w-auto!",
|
|
32
|
+
children: /* @__PURE__ */ jsx(BiEnvelope, { size: 30 })
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsx(SocialContact, {
|
|
35
|
+
link: links.medium,
|
|
36
|
+
onClick: onTrackMedium,
|
|
37
|
+
icon: /* @__PURE__ */ jsx(BiLogoMedium, {
|
|
38
|
+
size: 30,
|
|
39
|
+
title: "Medium"
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx(SocialContact, {
|
|
43
|
+
link: links.devto,
|
|
44
|
+
onClick: onTrackDevto,
|
|
45
|
+
icon: /* @__PURE__ */ jsx(BiLogoDevTo, {
|
|
46
|
+
size: 30,
|
|
47
|
+
title: "Devto"
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ jsx(SocialContact, {
|
|
51
|
+
link: links.twitter,
|
|
52
|
+
onClick: onTrackTwitter,
|
|
53
|
+
icon: /* @__PURE__ */ jsx(FaXTwitter, {
|
|
54
|
+
size: 30,
|
|
55
|
+
title: "Twitter"
|
|
56
|
+
})
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ jsx(SocialContact, {
|
|
59
|
+
link: links.facebook,
|
|
60
|
+
onClick: onTrackFacebook,
|
|
61
|
+
icon: /* @__PURE__ */ jsx(BiLogoFacebookSquare, {
|
|
62
|
+
size: 30,
|
|
63
|
+
title: "Facebook"
|
|
64
|
+
})
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ jsx(SocialContact, {
|
|
67
|
+
link: links.instagram,
|
|
68
|
+
onClick: onTrackInstagram,
|
|
69
|
+
icon: /* @__PURE__ */ jsx(BiLogoInstagram, {
|
|
70
|
+
size: 30,
|
|
71
|
+
title: "Instagram"
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { SocialContacts };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/state/command-palette/command-palette-context.d.ts
|
|
2
|
+
type CommandPaletteClose = () => void;
|
|
3
|
+
/**
|
|
4
|
+
* Scopes "close the palette I belong to" to the enclosing CommandPalette, so that two palettes on
|
|
5
|
+
* one page never close each other. Out-of-tree callers use closeCommandPalette() instead.
|
|
6
|
+
*/
|
|
7
|
+
declare const CommandPaletteContext: import("react").Context<CommandPaletteClose | null>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { CommandPaletteClose, CommandPaletteContext };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
//#region src/state/command-palette/command-palette-context.ts
|
|
4
|
+
/**
|
|
5
|
+
* Scopes "close the palette I belong to" to the enclosing CommandPalette, so that two palettes on
|
|
6
|
+
* one page never close each other. Out-of-tree callers use closeCommandPalette() instead.
|
|
7
|
+
*/
|
|
8
|
+
const CommandPaletteContext = createContext(null);
|
|
9
|
+
//#endregion
|
|
10
|
+
export { CommandPaletteContext };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/state/command-palette/command-palette-events.d.ts
|
|
2
|
+
declare const commandPaletteOpenEvent = "command-palette-open";
|
|
3
|
+
declare const openCommandPalette: () => void;
|
|
4
|
+
declare const commandPaletteCloseEvent = "command-palette-close";
|
|
5
|
+
/**
|
|
6
|
+
* Closes every mounted palette. Items inside a palette must not use this — they close their own
|
|
7
|
+
* palette through CommandPaletteContext. This exists for callers outside the palette's React tree.
|
|
8
|
+
*/
|
|
9
|
+
declare const closeCommandPalette: () => void;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { closeCommandPalette, commandPaletteCloseEvent, commandPaletteOpenEvent, openCommandPalette };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/state/command-palette/command-palette-events.ts
|
|
2
|
+
const commandPaletteOpenEvent = "command-palette-open";
|
|
3
|
+
const openCommandPalette = () => {
|
|
4
|
+
if (typeof window !== "undefined") window.dispatchEvent(new Event(commandPaletteOpenEvent));
|
|
5
|
+
};
|
|
6
|
+
const commandPaletteCloseEvent = "command-palette-close";
|
|
7
|
+
/**
|
|
8
|
+
* Closes every mounted palette. Items inside a palette must not use this — they close their own
|
|
9
|
+
* palette through CommandPaletteContext. This exists for callers outside the palette's React tree.
|
|
10
|
+
*/
|
|
11
|
+
const closeCommandPalette = () => {
|
|
12
|
+
if (typeof window !== "undefined") window.dispatchEvent(new Event(commandPaletteCloseEvent));
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { closeCommandPalette, commandPaletteCloseEvent, commandPaletteOpenEvent, openCommandPalette };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/state/command-palette/command-palette-trigger.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* What caused a palette to open or close. Consumers need this to tell a deliberate open (the header
|
|
4
|
+
* button dispatching the open event) apart from an incidental one (the keyboard shortcut).
|
|
5
|
+
*/
|
|
6
|
+
type CommandPaletteTrigger = "shortcut" | "event" | "escape" | "dismiss";
|
|
7
|
+
//#endregion
|
|
8
|
+
export { CommandPaletteTrigger };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/state/lightbox/lightbox-events.d.ts
|
|
2
|
+
interface LightboxOpenDetail {
|
|
3
|
+
src: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
}
|
|
6
|
+
declare const lightboxOpenEvent = "lightbox-open";
|
|
7
|
+
declare const openLightbox: (detail: LightboxOpenDetail) => void;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { LightboxOpenDetail, lightboxOpenEvent, openLightbox };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/state/lightbox/lightbox-events.ts
|
|
2
|
+
const lightboxOpenEvent = "lightbox-open";
|
|
3
|
+
const openLightbox = (detail) => {
|
|
4
|
+
if (typeof window !== "undefined") window.dispatchEvent(new CustomEvent(lightboxOpenEvent, { detail }));
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { lightboxOpenEvent, openLightbox };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BloomOptions, CrtOptions, RainOptions } from "matrix-rain-webgpu";
|
|
2
|
+
//#region src/state/matrix-rain/matrix-settings.d.ts
|
|
3
|
+
interface MatrixRainBloomSettings {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
intensity: number;
|
|
6
|
+
threshold: number;
|
|
7
|
+
emission: number;
|
|
8
|
+
}
|
|
9
|
+
interface MatrixRainCrtSettings {
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
scanlineStrength: number;
|
|
12
|
+
aberration: number;
|
|
13
|
+
}
|
|
14
|
+
interface MatrixRainRainSettings {
|
|
15
|
+
density: number;
|
|
16
|
+
stepRate: number;
|
|
17
|
+
fontSize: number;
|
|
18
|
+
}
|
|
19
|
+
interface MatrixRainSettings {
|
|
20
|
+
version: number;
|
|
21
|
+
rain: MatrixRainRainSettings;
|
|
22
|
+
bloom: MatrixRainBloomSettings;
|
|
23
|
+
crt: MatrixRainCrtSettings;
|
|
24
|
+
}
|
|
25
|
+
interface MatrixRainProps {
|
|
26
|
+
rain: RainOptions;
|
|
27
|
+
bloom: BloomOptions | false;
|
|
28
|
+
crt: CrtOptions | false;
|
|
29
|
+
}
|
|
30
|
+
declare const MATRIX_RAIN_DEFAULTS: MatrixRainSettings;
|
|
31
|
+
declare const MATRIX_RAIN_PRESETS: Record<string, MatrixRainSettings>;
|
|
32
|
+
declare const matrixSettingsChangeEvent = "matrix-settings-change";
|
|
33
|
+
declare const readMatrixSettings: () => MatrixRainSettings;
|
|
34
|
+
declare const writeMatrixSettings: (settings: MatrixRainSettings) => void;
|
|
35
|
+
declare const settingsToProps: (settings: MatrixRainSettings) => MatrixRainProps;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { MATRIX_RAIN_DEFAULTS, MATRIX_RAIN_PRESETS, MatrixRainProps, MatrixRainSettings, matrixSettingsChangeEvent, readMatrixSettings, settingsToProps, writeMatrixSettings };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
//#region src/state/matrix-rain/matrix-settings.ts
|
|
2
|
+
const PREFIX = "fabrizioduroni_";
|
|
3
|
+
const readLocalStorage = (key) => {
|
|
4
|
+
try {
|
|
5
|
+
return localStorage.getItem(`${PREFIX}${key}`);
|
|
6
|
+
} catch {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
const writeLocalStorage = (key, value) => localStorage.setItem(`${PREFIX}${key}`, value);
|
|
11
|
+
const STORAGE_KEY = "matrix-rain-settings";
|
|
12
|
+
const SETTINGS_VERSION = 1;
|
|
13
|
+
const MATRIX_RAIN_DEFAULTS = {
|
|
14
|
+
version: SETTINGS_VERSION,
|
|
15
|
+
rain: {
|
|
16
|
+
density: .95,
|
|
17
|
+
stepRate: 10,
|
|
18
|
+
fontSize: 20
|
|
19
|
+
},
|
|
20
|
+
bloom: {
|
|
21
|
+
enabled: true,
|
|
22
|
+
intensity: 1.5,
|
|
23
|
+
threshold: .8,
|
|
24
|
+
emission: 1.1
|
|
25
|
+
},
|
|
26
|
+
crt: {
|
|
27
|
+
enabled: true,
|
|
28
|
+
scanlineStrength: .3,
|
|
29
|
+
aberration: 1
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const MATRIX_RAIN_PRESETS = {
|
|
33
|
+
Classic: MATRIX_RAIN_DEFAULTS,
|
|
34
|
+
Cyberpunk: {
|
|
35
|
+
version: SETTINGS_VERSION,
|
|
36
|
+
rain: {
|
|
37
|
+
density: .9,
|
|
38
|
+
stepRate: 14,
|
|
39
|
+
fontSize: 16
|
|
40
|
+
},
|
|
41
|
+
bloom: {
|
|
42
|
+
enabled: true,
|
|
43
|
+
intensity: 2.8,
|
|
44
|
+
threshold: .5,
|
|
45
|
+
emission: 2
|
|
46
|
+
},
|
|
47
|
+
crt: {
|
|
48
|
+
enabled: true,
|
|
49
|
+
scanlineStrength: .4,
|
|
50
|
+
aberration: 2.8
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
Overload: {
|
|
54
|
+
version: SETTINGS_VERSION,
|
|
55
|
+
rain: {
|
|
56
|
+
density: .82,
|
|
57
|
+
stepRate: 28,
|
|
58
|
+
fontSize: 12
|
|
59
|
+
},
|
|
60
|
+
bloom: {
|
|
61
|
+
enabled: true,
|
|
62
|
+
intensity: 3,
|
|
63
|
+
threshold: .3,
|
|
64
|
+
emission: 2.5
|
|
65
|
+
},
|
|
66
|
+
crt: {
|
|
67
|
+
enabled: true,
|
|
68
|
+
scanlineStrength: .8,
|
|
69
|
+
aberration: 2
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const matrixSettingsChangeEvent = "matrix-settings-change";
|
|
74
|
+
let cachedRaw = null;
|
|
75
|
+
let cachedSnapshot = MATRIX_RAIN_DEFAULTS;
|
|
76
|
+
const readMatrixSettings = () => {
|
|
77
|
+
let raw;
|
|
78
|
+
try {
|
|
79
|
+
raw = readLocalStorage(STORAGE_KEY);
|
|
80
|
+
} catch {
|
|
81
|
+
return MATRIX_RAIN_DEFAULTS;
|
|
82
|
+
}
|
|
83
|
+
if (raw === null) {
|
|
84
|
+
cachedRaw = null;
|
|
85
|
+
cachedSnapshot = MATRIX_RAIN_DEFAULTS;
|
|
86
|
+
return cachedSnapshot;
|
|
87
|
+
}
|
|
88
|
+
if (raw === cachedRaw) return cachedSnapshot;
|
|
89
|
+
try {
|
|
90
|
+
const parsed = JSON.parse(raw);
|
|
91
|
+
cachedRaw = raw;
|
|
92
|
+
cachedSnapshot = parsed.version === SETTINGS_VERSION ? parsed : MATRIX_RAIN_DEFAULTS;
|
|
93
|
+
return cachedSnapshot;
|
|
94
|
+
} catch {
|
|
95
|
+
return MATRIX_RAIN_DEFAULTS;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const writeMatrixSettings = (settings) => {
|
|
99
|
+
writeLocalStorage(STORAGE_KEY, JSON.stringify({
|
|
100
|
+
...settings,
|
|
101
|
+
version: SETTINGS_VERSION
|
|
102
|
+
}));
|
|
103
|
+
if (typeof window !== "undefined") window.dispatchEvent(new Event(matrixSettingsChangeEvent));
|
|
104
|
+
};
|
|
105
|
+
const settingsToProps = (settings) => ({
|
|
106
|
+
rain: {
|
|
107
|
+
density: settings.rain.density,
|
|
108
|
+
stepRate: settings.rain.stepRate,
|
|
109
|
+
fontSize: settings.rain.fontSize
|
|
110
|
+
},
|
|
111
|
+
bloom: settings.bloom.enabled ? {
|
|
112
|
+
intensity: settings.bloom.intensity,
|
|
113
|
+
threshold: settings.bloom.threshold,
|
|
114
|
+
emission: settings.bloom.emission
|
|
115
|
+
} : false,
|
|
116
|
+
crt: settings.crt.enabled ? {
|
|
117
|
+
scanlineStrength: settings.crt.scanlineStrength,
|
|
118
|
+
aberration: settings.crt.aberration
|
|
119
|
+
} : false
|
|
120
|
+
});
|
|
121
|
+
//#endregion
|
|
122
|
+
export { MATRIX_RAIN_DEFAULTS, MATRIX_RAIN_PRESETS, matrixSettingsChangeEvent, readMatrixSettings, settingsToProps, writeMatrixSettings };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/state/motion/motion.ts
|
|
2
|
+
const PREFIX = "fabrizioduroni_";
|
|
3
|
+
const readLocalStorage = (key) => localStorage.getItem(`${PREFIX}${key}`);
|
|
4
|
+
const writeLocalStorage = (key, value) => localStorage.setItem(`${PREFIX}${key}`, value);
|
|
5
|
+
const key = "motion";
|
|
6
|
+
const readMotion = () => readLocalStorage(key);
|
|
7
|
+
const motionChangeEvent = "motion-change";
|
|
8
|
+
const hasMotion = () => {
|
|
9
|
+
const motionSetting = readMotion();
|
|
10
|
+
return motionSetting === null || motionSetting === "on";
|
|
11
|
+
};
|
|
12
|
+
const writeMotion = (value) => {
|
|
13
|
+
writeLocalStorage(key, value);
|
|
14
|
+
if (typeof window !== "undefined") window.dispatchEvent(new Event(motionChangeEvent));
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { hasMotion, motionChangeEvent, writeMotion };
|