@sonordev/agency-site-kit 0.3.1 → 0.4.1
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 +302 -0
- package/bin/setup.mjs +79 -0
- package/dist/{chunk-RXBK2EOE.js → chunk-4IES23GV.js} +3 -3
- package/dist/{chunk-RXBK2EOE.js.map → chunk-4IES23GV.js.map} +1 -1
- package/dist/{chunk-WNR4KNG4.cjs → chunk-5MEZU3OG.cjs} +4 -4
- package/dist/{chunk-WNR4KNG4.cjs.map → chunk-5MEZU3OG.cjs.map} +1 -1
- package/dist/chunk-7D4H36UF.js +13 -0
- package/dist/chunk-7D4H36UF.js.map +1 -0
- package/dist/chunk-7ZHRMWJU.cjs +306 -0
- package/dist/chunk-7ZHRMWJU.cjs.map +1 -0
- package/dist/chunk-CVT7I5BQ.js +71 -0
- package/dist/chunk-CVT7I5BQ.js.map +1 -0
- package/dist/chunk-HQGAX2LI.cjs +8 -0
- package/dist/chunk-HQGAX2LI.cjs.map +1 -0
- package/dist/chunk-K2BGTDSN.js +45 -0
- package/dist/chunk-K2BGTDSN.js.map +1 -0
- package/dist/chunk-KXLROAO5.js +291 -0
- package/dist/chunk-KXLROAO5.js.map +1 -0
- package/dist/chunk-L4EOQVRJ.js +6 -0
- package/dist/chunk-L4EOQVRJ.js.map +1 -0
- package/dist/chunk-NI4FVCLS.cjs +32 -0
- package/dist/chunk-NI4FVCLS.cjs.map +1 -0
- package/dist/chunk-NLGUPJZA.js +507 -0
- package/dist/chunk-NLGUPJZA.js.map +1 -0
- package/dist/chunk-QDXZ27R7.js +33 -0
- package/dist/chunk-QDXZ27R7.js.map +1 -0
- package/dist/chunk-QGSW43TM.cjs +538 -0
- package/dist/chunk-QGSW43TM.cjs.map +1 -0
- package/dist/{chunk-TVFXN6W6.js → chunk-QL6KVIFR.js} +8 -4
- package/dist/chunk-QL6KVIFR.js.map +1 -0
- package/dist/chunk-RWQ675N6.js +165 -0
- package/dist/chunk-RWQ675N6.js.map +1 -0
- package/dist/chunk-UXUU7FVT.cjs +171 -0
- package/dist/chunk-UXUU7FVT.cjs.map +1 -0
- package/dist/chunk-XJ434N7I.js +30 -0
- package/dist/chunk-XJ434N7I.js.map +1 -0
- package/dist/{chunk-EE75WRCM.cjs → chunk-XOWSXZYW.cjs} +8 -4
- package/dist/chunk-XOWSXZYW.cjs.map +1 -0
- package/dist/chunk-ZBPF7TLZ.cjs +16 -0
- package/dist/chunk-ZBPF7TLZ.cjs.map +1 -0
- package/dist/chunk-ZINKVJQU.js +67 -0
- package/dist/chunk-ZINKVJQU.js.map +1 -0
- package/dist/index.cjs +53 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -9
- package/dist/index.d.ts +17 -9
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/dist/layout/index.cjs +3 -3
- package/dist/layout/index.d.cts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +2 -2
- package/dist/portfolio/client.cjs +376 -12
- package/dist/portfolio/client.cjs.map +1 -1
- package/dist/portfolio/client.d.cts +27 -85
- package/dist/portfolio/client.d.ts +27 -85
- package/dist/portfolio/client.js +182 -4
- package/dist/portfolio/client.js.map +1 -1
- package/dist/portfolio/components/PortfolioAnalytics.cjs +87 -0
- package/dist/portfolio/components/PortfolioAnalytics.cjs.map +1 -0
- package/dist/portfolio/components/PortfolioAnalytics.d.cts +5 -0
- package/dist/portfolio/components/PortfolioAnalytics.d.ts +5 -0
- package/dist/portfolio/components/PortfolioAnalytics.js +9 -0
- package/dist/portfolio/components/PortfolioAnalytics.js.map +1 -0
- package/dist/portfolio/components/PortfolioErrorFallback.cjs +65 -0
- package/dist/portfolio/components/PortfolioErrorFallback.cjs.map +1 -0
- package/dist/portfolio/components/PortfolioErrorFallback.d.cts +22 -0
- package/dist/portfolio/components/PortfolioErrorFallback.d.ts +22 -0
- package/dist/portfolio/components/PortfolioErrorFallback.js +9 -0
- package/dist/portfolio/components/PortfolioErrorFallback.js.map +1 -0
- package/dist/portfolio/components/PortfolioLeadCTA.cjs +91 -0
- package/dist/portfolio/components/PortfolioLeadCTA.cjs.map +1 -0
- package/dist/portfolio/components/PortfolioLeadCTA.d.cts +34 -0
- package/dist/portfolio/components/PortfolioLeadCTA.d.ts +34 -0
- package/dist/portfolio/components/PortfolioLeadCTA.js +9 -0
- package/dist/portfolio/components/PortfolioLeadCTA.js.map +1 -0
- package/dist/portfolio/index.cjs +43 -19
- package/dist/portfolio/index.d.cts +210 -7
- package/dist/portfolio/index.d.ts +210 -7
- package/dist/portfolio/index.js +7 -7
- package/dist/portfolio/primitives/AnimatedCounter.cjs +88 -0
- package/dist/portfolio/primitives/AnimatedCounter.cjs.map +1 -0
- package/dist/portfolio/primitives/AnimatedCounter.d.cts +22 -0
- package/dist/portfolio/primitives/AnimatedCounter.d.ts +22 -0
- package/dist/portfolio/primitives/AnimatedCounter.js +68 -0
- package/dist/portfolio/primitives/AnimatedCounter.js.map +1 -0
- package/dist/portfolio/primitives/AnnotatedImage.cjs +320 -0
- package/dist/portfolio/primitives/AnnotatedImage.cjs.map +1 -0
- package/dist/portfolio/primitives/AnnotatedImage.d.cts +18 -0
- package/dist/portfolio/primitives/AnnotatedImage.d.ts +18 -0
- package/dist/portfolio/primitives/AnnotatedImage.js +264 -0
- package/dist/portfolio/primitives/AnnotatedImage.js.map +1 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.cjs +348 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.cjs.map +1 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.d.cts +13 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.d.ts +13 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.js +292 -0
- package/dist/portfolio/primitives/BeforeAfterSlider.js.map +1 -0
- package/dist/portfolio/primitives/DeviceTrifolio.cjs +298 -0
- package/dist/portfolio/primitives/DeviceTrifolio.cjs.map +1 -0
- package/dist/portfolio/primitives/DeviceTrifolio.d.cts +14 -0
- package/dist/portfolio/primitives/DeviceTrifolio.d.ts +14 -0
- package/dist/portfolio/primitives/DeviceTrifolio.js +242 -0
- package/dist/portfolio/primitives/DeviceTrifolio.js.map +1 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.cjs +88 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.cjs.map +1 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.d.cts +10 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.d.ts +10 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.js +68 -0
- package/dist/portfolio/primitives/FrequencyBarSkeleton.js.map +1 -0
- package/dist/portfolio/primitives/GlassCard.cjs +45 -0
- package/dist/portfolio/primitives/GlassCard.cjs.map +1 -0
- package/dist/portfolio/primitives/GlassCard.d.cts +11 -0
- package/dist/portfolio/primitives/GlassCard.d.ts +11 -0
- package/dist/portfolio/primitives/GlassCard.js +43 -0
- package/dist/portfolio/primitives/GlassCard.js.map +1 -0
- package/dist/portfolio/primitives/MetricBadge.cjs +74 -0
- package/dist/portfolio/primitives/MetricBadge.cjs.map +1 -0
- package/dist/portfolio/primitives/MetricBadge.d.cts +9 -0
- package/dist/portfolio/primitives/MetricBadge.d.ts +9 -0
- package/dist/portfolio/primitives/MetricBadge.js +54 -0
- package/dist/portfolio/primitives/MetricBadge.js.map +1 -0
- package/dist/portfolio/primitives/SVGChart.cjs +316 -0
- package/dist/portfolio/primitives/SVGChart.cjs.map +1 -0
- package/dist/portfolio/primitives/SVGChart.d.cts +18 -0
- package/dist/portfolio/primitives/SVGChart.d.ts +18 -0
- package/dist/portfolio/primitives/SVGChart.js +296 -0
- package/dist/portfolio/primitives/SVGChart.js.map +1 -0
- package/dist/portfolio/primitives/ScrollReveal.cjs +97 -0
- package/dist/portfolio/primitives/ScrollReveal.cjs.map +1 -0
- package/dist/portfolio/primitives/ScrollReveal.d.cts +27 -0
- package/dist/portfolio/primitives/ScrollReveal.d.ts +27 -0
- package/dist/portfolio/primitives/ScrollReveal.js +77 -0
- package/dist/portfolio/primitives/ScrollReveal.js.map +1 -0
- package/dist/portfolio/primitives/SplitHeadline.cjs +107 -0
- package/dist/portfolio/primitives/SplitHeadline.cjs.map +1 -0
- package/dist/portfolio/primitives/SplitHeadline.d.cts +24 -0
- package/dist/portfolio/primitives/SplitHeadline.d.ts +24 -0
- package/dist/portfolio/primitives/SplitHeadline.js +87 -0
- package/dist/portfolio/primitives/SplitHeadline.js.map +1 -0
- package/dist/portfolio/sections/BeforeAfterSection.cjs +271 -0
- package/dist/portfolio/sections/BeforeAfterSection.cjs.map +1 -0
- package/dist/portfolio/sections/BeforeAfterSection.d.cts +9 -0
- package/dist/portfolio/sections/BeforeAfterSection.d.ts +9 -0
- package/dist/{BeforeAfterSection-6BHFLY4Y.js → portfolio/sections/BeforeAfterSection.js} +66 -27
- package/dist/portfolio/sections/BeforeAfterSection.js.map +1 -0
- package/dist/portfolio/sections/CTASection.cjs +123 -0
- package/dist/portfolio/sections/CTASection.cjs.map +1 -0
- package/dist/portfolio/sections/CTASection.d.cts +9 -0
- package/dist/portfolio/sections/CTASection.d.ts +9 -0
- package/dist/portfolio/sections/CTASection.js +93 -0
- package/dist/portfolio/sections/CTASection.js.map +1 -0
- package/dist/{ChallengesSection-IZ3DHECS.cjs → portfolio/sections/ChallengesSection.cjs} +13 -7
- package/dist/portfolio/sections/ChallengesSection.cjs.map +1 -0
- package/dist/portfolio/sections/ChallengesSection.d.cts +9 -0
- package/dist/portfolio/sections/ChallengesSection.d.ts +9 -0
- package/dist/{ChallengesSection-GEQGVSJN.js → portfolio/sections/ChallengesSection.js} +6 -5
- package/dist/portfolio/sections/ChallengesSection.js.map +1 -0
- package/dist/portfolio/sections/ConversionFunnelSection.cjs +263 -0
- package/dist/portfolio/sections/ConversionFunnelSection.cjs.map +1 -0
- package/dist/portfolio/sections/ConversionFunnelSection.d.cts +9 -0
- package/dist/portfolio/sections/ConversionFunnelSection.d.ts +9 -0
- package/dist/{ConversionFunnelSection-D3GE4NKE.js → portfolio/sections/ConversionFunnelSection.js} +60 -56
- package/dist/portfolio/sections/ConversionFunnelSection.js.map +1 -0
- package/dist/{DesignSystemSection-KXIQXITF.cjs → portfolio/sections/DesignSystemSection.cjs} +13 -7
- package/dist/portfolio/sections/DesignSystemSection.cjs.map +1 -0
- package/dist/portfolio/sections/DesignSystemSection.d.cts +32 -0
- package/dist/portfolio/sections/DesignSystemSection.d.ts +32 -0
- package/dist/{DesignSystemSection-2R5BRBGO.js → portfolio/sections/DesignSystemSection.js} +5 -4
- package/dist/portfolio/sections/DesignSystemSection.js.map +1 -0
- package/dist/{DetailsSection-TTUZAPZZ.cjs → portfolio/sections/DetailsSection.cjs} +12 -6
- package/dist/portfolio/sections/DetailsSection.cjs.map +1 -0
- package/dist/portfolio/sections/DetailsSection.d.cts +9 -0
- package/dist/portfolio/sections/DetailsSection.d.ts +9 -0
- package/dist/{DetailsSection-A6PZQUQL.js → portfolio/sections/DetailsSection.js} +5 -4
- package/dist/portfolio/sections/DetailsSection.js.map +1 -0
- package/dist/portfolio/sections/FeatureSpotlightSection.cjs +267 -0
- package/dist/portfolio/sections/FeatureSpotlightSection.cjs.map +1 -0
- package/dist/portfolio/sections/FeatureSpotlightSection.d.cts +9 -0
- package/dist/portfolio/sections/FeatureSpotlightSection.d.ts +9 -0
- package/dist/{FeatureSpotlightSection-B7P3JGNL.js → portfolio/sections/FeatureSpotlightSection.js} +39 -33
- package/dist/portfolio/sections/FeatureSpotlightSection.js.map +1 -0
- package/dist/portfolio/sections/GallerySection.cjs +321 -0
- package/dist/portfolio/sections/GallerySection.cjs.map +1 -0
- package/dist/portfolio/sections/GallerySection.d.cts +9 -0
- package/dist/portfolio/sections/GallerySection.d.ts +9 -0
- package/dist/{GallerySection-VMKORC47.js → portfolio/sections/GallerySection.js} +65 -18
- package/dist/portfolio/sections/GallerySection.js.map +1 -0
- package/dist/portfolio/sections/HeroSection.cjs +180 -0
- package/dist/portfolio/sections/HeroSection.cjs.map +1 -0
- package/dist/portfolio/sections/HeroSection.d.cts +15 -0
- package/dist/portfolio/sections/HeroSection.d.ts +15 -0
- package/dist/portfolio/sections/HeroSection.js +171 -0
- package/dist/portfolio/sections/HeroSection.js.map +1 -0
- package/dist/{MetricsTimelineSection-4L6DUHJ5.cjs → portfolio/sections/MetricsTimelineSection.cjs} +102 -61
- package/dist/portfolio/sections/MetricsTimelineSection.cjs.map +1 -0
- package/dist/portfolio/sections/MetricsTimelineSection.d.cts +9 -0
- package/dist/portfolio/sections/MetricsTimelineSection.d.ts +9 -0
- package/dist/{MetricsTimelineSection-6BT5GNFV.js → portfolio/sections/MetricsTimelineSection.js} +45 -29
- package/dist/portfolio/sections/MetricsTimelineSection.js.map +1 -0
- package/dist/portfolio/sections/PerformanceSection.cjs +336 -0
- package/dist/portfolio/sections/PerformanceSection.cjs.map +1 -0
- package/dist/portfolio/sections/PerformanceSection.d.cts +22 -0
- package/dist/portfolio/sections/PerformanceSection.d.ts +22 -0
- package/dist/{PerformanceSection-MGCEIXDX.js → portfolio/sections/PerformanceSection.js} +59 -104
- package/dist/portfolio/sections/PerformanceSection.js.map +1 -0
- package/dist/{ResultsSection-XLGMMQKY.cjs → portfolio/sections/ResultsSection.cjs} +23 -10
- package/dist/portfolio/sections/ResultsSection.cjs.map +1 -0
- package/dist/portfolio/sections/ResultsSection.d.cts +13 -0
- package/dist/portfolio/sections/ResultsSection.d.ts +13 -0
- package/dist/{ResultsSection-DFUJ5U6M.js → portfolio/sections/ResultsSection.js} +14 -7
- package/dist/portfolio/sections/ResultsSection.js.map +1 -0
- package/dist/portfolio/sections/ServicesSection.cjs +129 -0
- package/dist/portfolio/sections/ServicesSection.cjs.map +1 -0
- package/dist/portfolio/sections/ServicesSection.d.cts +9 -0
- package/dist/portfolio/sections/ServicesSection.d.ts +9 -0
- package/dist/portfolio/sections/ServicesSection.js +122 -0
- package/dist/portfolio/sections/ServicesSection.js.map +1 -0
- package/dist/{SiteArchitectureSection-J7BPBERH.cjs → portfolio/sections/SiteArchitectureSection.cjs} +117 -93
- package/dist/portfolio/sections/SiteArchitectureSection.cjs.map +1 -0
- package/dist/portfolio/sections/SiteArchitectureSection.d.cts +21 -0
- package/dist/portfolio/sections/SiteArchitectureSection.d.ts +21 -0
- package/dist/{SiteArchitectureSection-TE22OAWV.js → portfolio/sections/SiteArchitectureSection.js} +47 -48
- package/dist/portfolio/sections/SiteArchitectureSection.js.map +1 -0
- package/dist/{SpeedComparisonSection-EZKFQVGW.cjs → portfolio/sections/SpeedComparisonSection.cjs} +13 -7
- package/dist/portfolio/sections/SpeedComparisonSection.cjs.map +1 -0
- package/dist/portfolio/sections/SpeedComparisonSection.d.cts +20 -0
- package/dist/portfolio/sections/SpeedComparisonSection.d.ts +20 -0
- package/dist/{SpeedComparisonSection-Y3K7OFZQ.js → portfolio/sections/SpeedComparisonSection.js} +6 -5
- package/dist/portfolio/sections/SpeedComparisonSection.js.map +1 -0
- package/dist/portfolio/sections/StrategySection.cjs +233 -0
- package/dist/portfolio/sections/StrategySection.cjs.map +1 -0
- package/dist/portfolio/sections/StrategySection.d.cts +9 -0
- package/dist/portfolio/sections/StrategySection.d.ts +9 -0
- package/dist/{StrategySection-DI5RSCJU.js → portfolio/sections/StrategySection.js} +60 -26
- package/dist/portfolio/sections/StrategySection.js.map +1 -0
- package/dist/portfolio/sections/TeamSection.cjs +162 -0
- package/dist/portfolio/sections/TeamSection.cjs.map +1 -0
- package/dist/portfolio/sections/TeamSection.d.cts +9 -0
- package/dist/portfolio/sections/TeamSection.d.ts +9 -0
- package/dist/portfolio/sections/TeamSection.js +106 -0
- package/dist/portfolio/sections/TeamSection.js.map +1 -0
- package/dist/portfolio/sections/TechStackSection.cjs +106 -0
- package/dist/portfolio/sections/TechStackSection.cjs.map +1 -0
- package/dist/portfolio/sections/TechStackSection.d.cts +9 -0
- package/dist/portfolio/sections/TechStackSection.d.ts +9 -0
- package/dist/portfolio/sections/TechStackSection.js +99 -0
- package/dist/portfolio/sections/TechStackSection.js.map +1 -0
- package/dist/{TestimonialSection-XPTFUQIN.cjs → portfolio/sections/TestimonialSection.cjs} +47 -28
- package/dist/portfolio/sections/TestimonialSection.cjs.map +1 -0
- package/dist/portfolio/sections/TestimonialSection.d.cts +9 -0
- package/dist/portfolio/sections/TestimonialSection.d.ts +9 -0
- package/dist/{TestimonialSection-6RGSMXQB.js → portfolio/sections/TestimonialSection.js} +40 -27
- package/dist/portfolio/sections/TestimonialSection.js.map +1 -0
- package/dist/portfolio/sections/VideoSection.cjs +181 -0
- package/dist/portfolio/sections/VideoSection.cjs.map +1 -0
- package/dist/portfolio/sections/VideoSection.d.cts +9 -0
- package/dist/portfolio/sections/VideoSection.d.ts +9 -0
- package/dist/{VideoSection-4A2HC6K6.js → portfolio/sections/VideoSection.js} +21 -13
- package/dist/portfolio/sections/VideoSection.js.map +1 -0
- package/dist/portfolio/server.cjs +56 -144
- package/dist/portfolio/server.cjs.map +1 -1
- package/dist/portfolio/server.d.cts +157 -7
- package/dist/portfolio/server.d.ts +157 -7
- package/dist/portfolio/server.js +3 -142
- package/dist/portfolio/server.js.map +1 -1
- package/dist/preview.cjs +56 -0
- package/dist/preview.cjs.map +1 -0
- package/dist/preview.d.cts +31 -0
- package/dist/preview.d.ts +31 -0
- package/dist/preview.js +54 -0
- package/dist/preview.js.map +1 -0
- package/dist/{types-DL4t_Cfa.d.ts → types-0tVPy4pU.d.cts} +7 -1
- package/dist/{types-DL4t_Cfa.d.cts → types-0tVPy4pU.d.ts} +7 -1
- package/dist/types-D0nb6KAx.d.cts +299 -0
- package/dist/types-D0nb6KAx.d.ts +299 -0
- package/package.json +38 -14
- package/templates/api-portfolio-preview.ts +6 -0
- package/templates/api-revalidate.ts +5 -0
- package/templates/work-category-page.tsx +40 -0
- package/templates/work-error.tsx +3 -0
- package/templates/work-loading.tsx +1 -0
- package/templates/work-page.tsx +37 -0
- package/templates/work-slug-loading.tsx +1 -0
- package/templates/work-slug-page.tsx +41 -0
- package/dist/BeforeAfterSection-6BHFLY4Y.js.map +0 -1
- package/dist/BeforeAfterSection-JTORBR3A.cjs +0 -181
- package/dist/BeforeAfterSection-JTORBR3A.cjs.map +0 -1
- package/dist/CTASection-4JKLXEUF.cjs +0 -111
- package/dist/CTASection-4JKLXEUF.cjs.map +0 -1
- package/dist/CTASection-BJA72XIL.js +0 -106
- package/dist/CTASection-BJA72XIL.js.map +0 -1
- package/dist/ChallengesSection-GEQGVSJN.js.map +0 -1
- package/dist/ChallengesSection-IZ3DHECS.cjs.map +0 -1
- package/dist/ConversionFunnelSection-AUUSJ5HQ.cjs +0 -209
- package/dist/ConversionFunnelSection-AUUSJ5HQ.cjs.map +0 -1
- package/dist/ConversionFunnelSection-D3GE4NKE.js.map +0 -1
- package/dist/DesignSystemSection-2R5BRBGO.js.map +0 -1
- package/dist/DesignSystemSection-KXIQXITF.cjs.map +0 -1
- package/dist/DetailsSection-A6PZQUQL.js.map +0 -1
- package/dist/DetailsSection-TTUZAPZZ.cjs.map +0 -1
- package/dist/FeatureSpotlightSection-B7P3JGNL.js.map +0 -1
- package/dist/FeatureSpotlightSection-WRHXS7TU.cjs +0 -210
- package/dist/FeatureSpotlightSection-WRHXS7TU.cjs.map +0 -1
- package/dist/GallerySection-VMKORC47.js.map +0 -1
- package/dist/GallerySection-WJ4PQDBI.cjs +0 -219
- package/dist/GallerySection-WJ4PQDBI.cjs.map +0 -1
- package/dist/MetricsTimelineSection-4L6DUHJ5.cjs.map +0 -1
- package/dist/MetricsTimelineSection-6BT5GNFV.js.map +0 -1
- package/dist/PerformanceSection-24TVVFZA.cjs +0 -356
- package/dist/PerformanceSection-24TVVFZA.cjs.map +0 -1
- package/dist/PerformanceSection-MGCEIXDX.js.map +0 -1
- package/dist/ResultsSection-DFUJ5U6M.js.map +0 -1
- package/dist/ResultsSection-XLGMMQKY.cjs.map +0 -1
- package/dist/ServicesSection-D5V3Q4GR.js +0 -118
- package/dist/ServicesSection-D5V3Q4GR.js.map +0 -1
- package/dist/ServicesSection-WJMGK2MF.cjs +0 -120
- package/dist/ServicesSection-WJMGK2MF.cjs.map +0 -1
- package/dist/SiteArchitectureSection-J7BPBERH.cjs.map +0 -1
- package/dist/SiteArchitectureSection-TE22OAWV.js.map +0 -1
- package/dist/SpeedComparisonSection-EZKFQVGW.cjs.map +0 -1
- package/dist/SpeedComparisonSection-Y3K7OFZQ.js.map +0 -1
- package/dist/StrategySection-CJ7Y6OFQ.cjs +0 -174
- package/dist/StrategySection-CJ7Y6OFQ.cjs.map +0 -1
- package/dist/StrategySection-DI5RSCJU.js.map +0 -1
- package/dist/TeamSection-DZVSNZE6.cjs +0 -112
- package/dist/TeamSection-DZVSNZE6.cjs.map +0 -1
- package/dist/TeamSection-HGKFW6PQ.js +0 -107
- package/dist/TeamSection-HGKFW6PQ.js.map +0 -1
- package/dist/TechStackSection-2AQ7RGY3.js +0 -93
- package/dist/TechStackSection-2AQ7RGY3.js.map +0 -1
- package/dist/TechStackSection-VTNNZR5V.cjs +0 -95
- package/dist/TechStackSection-VTNNZR5V.cjs.map +0 -1
- package/dist/TestimonialSection-6RGSMXQB.js.map +0 -1
- package/dist/TestimonialSection-XPTFUQIN.cjs.map +0 -1
- package/dist/VideoSection-4A2HC6K6.js.map +0 -1
- package/dist/VideoSection-G3DFS7UH.cjs +0 -118
- package/dist/VideoSection-G3DFS7UH.cjs.map +0 -1
- package/dist/chunk-2Y4O3LWM.js +0 -53
- package/dist/chunk-2Y4O3LWM.js.map +0 -1
- package/dist/chunk-633UMQQH.cjs +0 -31
- package/dist/chunk-633UMQQH.cjs.map +0 -1
- package/dist/chunk-7CFFAKDM.js +0 -74
- package/dist/chunk-7CFFAKDM.js.map +0 -1
- package/dist/chunk-APG2QSMB.js +0 -131
- package/dist/chunk-APG2QSMB.js.map +0 -1
- package/dist/chunk-AVCH4LMG.cjs +0 -620
- package/dist/chunk-AVCH4LMG.cjs.map +0 -1
- package/dist/chunk-AYBUHRFS.js +0 -613
- package/dist/chunk-AYBUHRFS.js.map +0 -1
- package/dist/chunk-EE75WRCM.cjs.map +0 -1
- package/dist/chunk-IKBK7HYX.cjs +0 -79
- package/dist/chunk-IKBK7HYX.cjs.map +0 -1
- package/dist/chunk-KEOHORIH.cjs +0 -79
- package/dist/chunk-KEOHORIH.cjs.map +0 -1
- package/dist/chunk-OA5ZM4OA.cjs +0 -139
- package/dist/chunk-OA5ZM4OA.cjs.map +0 -1
- package/dist/chunk-TVFXN6W6.js.map +0 -1
- package/dist/chunk-VVTK4OL6.js +0 -28
- package/dist/chunk-VVTK4OL6.js.map +0 -1
- package/dist/chunk-XCKXHK44.js +0 -15
- package/dist/chunk-XCKXHK44.js.map +0 -1
- package/dist/chunk-XONXEFJY.cjs +0 -58
- package/dist/chunk-XONXEFJY.cjs.map +0 -1
- package/dist/chunk-XQNJED46.cjs +0 -19
- package/dist/chunk-XQNJED46.cjs.map +0 -1
- package/dist/chunk-YB4B3OMC.js +0 -74
- package/dist/chunk-YB4B3OMC.js.map +0 -1
- package/dist/portfolio/sections.cjs +0 -20
- package/dist/portfolio/sections.cjs.map +0 -1
- package/dist/portfolio/sections.d.cts +0 -42
- package/dist/portfolio/sections.d.ts +0 -42
- package/dist/portfolio/sections.js +0 -4
- package/dist/portfolio/sections.js.map +0 -1
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use client";
|
|
3
|
+
import {
|
|
4
|
+
resolvePortfolioImage
|
|
5
|
+
} from "../../chunk-QDXZ27R7.js";
|
|
6
|
+
|
|
7
|
+
// src/portfolio/components/primitives/BeforeAfterSlider.tsx
|
|
8
|
+
import { useRef, useEffect, useState, useCallback } from "react";
|
|
9
|
+
import Image from "next/image";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
function BeforeAfterSlider({
|
|
12
|
+
beforeSrc,
|
|
13
|
+
afterSrc,
|
|
14
|
+
beforeAlt = "Before",
|
|
15
|
+
afterAlt = "After",
|
|
16
|
+
defaultPosition = 50,
|
|
17
|
+
className = ""
|
|
18
|
+
}) {
|
|
19
|
+
const containerRef = useRef(null);
|
|
20
|
+
const dividerRef = useRef(null);
|
|
21
|
+
const clipRef = useRef(null);
|
|
22
|
+
const [position, setPosition] = useState(defaultPosition);
|
|
23
|
+
const isDragging = useRef(false);
|
|
24
|
+
const hasAnimated = useRef(false);
|
|
25
|
+
const updatePosition = useCallback((pct) => {
|
|
26
|
+
const clamped = Math.max(0, Math.min(100, pct));
|
|
27
|
+
setPosition(clamped);
|
|
28
|
+
if (clipRef.current) {
|
|
29
|
+
clipRef.current.style.clipPath = `inset(0 ${100 - clamped}% 0 0)`;
|
|
30
|
+
}
|
|
31
|
+
if (dividerRef.current) {
|
|
32
|
+
dividerRef.current.style.left = `${clamped}%`;
|
|
33
|
+
}
|
|
34
|
+
}, []);
|
|
35
|
+
const getPositionFromEvent = useCallback((e) => {
|
|
36
|
+
const container = containerRef.current;
|
|
37
|
+
if (!container) return defaultPosition;
|
|
38
|
+
const rect = container.getBoundingClientRect();
|
|
39
|
+
return (e.clientX - rect.left) / rect.width * 100;
|
|
40
|
+
}, [defaultPosition]);
|
|
41
|
+
const handlePointerDown = useCallback((e) => {
|
|
42
|
+
isDragging.current = true;
|
|
43
|
+
e.target.setPointerCapture(e.pointerId);
|
|
44
|
+
updatePosition(getPositionFromEvent(e));
|
|
45
|
+
}, [getPositionFromEvent, updatePosition]);
|
|
46
|
+
const handlePointerMove = useCallback((e) => {
|
|
47
|
+
if (!isDragging.current) return;
|
|
48
|
+
updatePosition(getPositionFromEvent(e));
|
|
49
|
+
}, [getPositionFromEvent, updatePosition]);
|
|
50
|
+
const handlePointerUp = useCallback(() => {
|
|
51
|
+
isDragging.current = false;
|
|
52
|
+
}, []);
|
|
53
|
+
const handleKeyDown = useCallback(
|
|
54
|
+
(e) => {
|
|
55
|
+
const step = e.shiftKey ? 10 : 5;
|
|
56
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
updatePosition(position - step);
|
|
59
|
+
} else if (e.key === "ArrowRight" || e.key === "ArrowUp") {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
updatePosition(position + step);
|
|
62
|
+
} else if (e.key === "Home") {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
updatePosition(0);
|
|
65
|
+
} else if (e.key === "End") {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
updatePosition(100);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
[position, updatePosition]
|
|
71
|
+
);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
updatePosition(defaultPosition);
|
|
74
|
+
}, [defaultPosition, updatePosition]);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
const container = containerRef.current;
|
|
77
|
+
if (!container) return;
|
|
78
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
79
|
+
const easeInOut = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
|
|
80
|
+
const easeOut = (t) => 1 - Math.pow(1 - t, 2);
|
|
81
|
+
const segments = [
|
|
82
|
+
{ to: 80, duration: 0.6, ease: easeInOut },
|
|
83
|
+
{ to: 20, duration: 0.8, ease: easeInOut },
|
|
84
|
+
{ to: 50, duration: 0.6, ease: easeOut }
|
|
85
|
+
];
|
|
86
|
+
let raf = 0;
|
|
87
|
+
const play = () => {
|
|
88
|
+
let index = 0;
|
|
89
|
+
let from = defaultPosition;
|
|
90
|
+
let start = performance.now();
|
|
91
|
+
const tick = (now) => {
|
|
92
|
+
const seg = segments[index];
|
|
93
|
+
const p = Math.min(1, (now - start) / (seg.duration * 1e3));
|
|
94
|
+
updatePosition(from + (seg.to - from) * seg.ease(p));
|
|
95
|
+
if (p >= 1) {
|
|
96
|
+
from = seg.to;
|
|
97
|
+
index += 1;
|
|
98
|
+
if (index >= segments.length) return;
|
|
99
|
+
start = now;
|
|
100
|
+
}
|
|
101
|
+
raf = requestAnimationFrame(tick);
|
|
102
|
+
};
|
|
103
|
+
raf = requestAnimationFrame(tick);
|
|
104
|
+
};
|
|
105
|
+
const io = new IntersectionObserver(
|
|
106
|
+
([entry]) => {
|
|
107
|
+
if (!entry.isIntersecting) return;
|
|
108
|
+
io.disconnect();
|
|
109
|
+
if (hasAnimated.current) return;
|
|
110
|
+
hasAnimated.current = true;
|
|
111
|
+
play();
|
|
112
|
+
},
|
|
113
|
+
{ rootMargin: "0px 0px -20% 0px" }
|
|
114
|
+
// ≈ 'top 80%' trigger start
|
|
115
|
+
);
|
|
116
|
+
io.observe(container);
|
|
117
|
+
return () => {
|
|
118
|
+
io.disconnect();
|
|
119
|
+
cancelAnimationFrame(raf);
|
|
120
|
+
};
|
|
121
|
+
}, [defaultPosition, updatePosition]);
|
|
122
|
+
const before = resolvePortfolioImage(beforeSrc);
|
|
123
|
+
const after = resolvePortfolioImage(afterSrc);
|
|
124
|
+
if (!before || !after) return null;
|
|
125
|
+
return /* @__PURE__ */ jsxs(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
ref: containerRef,
|
|
129
|
+
role: "slider",
|
|
130
|
+
tabIndex: 0,
|
|
131
|
+
"aria-label": "Before and after comparison",
|
|
132
|
+
"aria-valuemin": 0,
|
|
133
|
+
"aria-valuemax": 100,
|
|
134
|
+
"aria-valuenow": Math.round(position),
|
|
135
|
+
"aria-valuetext": `${Math.round(position)}% before, ${100 - Math.round(position)}% after`,
|
|
136
|
+
className: `relative select-none overflow-hidden ${className}`,
|
|
137
|
+
style: { touchAction: "pan-y", cursor: "ew-resize" },
|
|
138
|
+
onPointerDown: handlePointerDown,
|
|
139
|
+
onPointerMove: handlePointerMove,
|
|
140
|
+
onPointerUp: handlePointerUp,
|
|
141
|
+
onPointerCancel: handlePointerUp,
|
|
142
|
+
onKeyDown: handleKeyDown,
|
|
143
|
+
children: [
|
|
144
|
+
after.width && after.height ? /* @__PURE__ */ jsx(
|
|
145
|
+
Image,
|
|
146
|
+
{
|
|
147
|
+
src: after.url,
|
|
148
|
+
alt: afterAlt,
|
|
149
|
+
width: after.width,
|
|
150
|
+
height: after.height,
|
|
151
|
+
sizes: "(max-width: 1280px) 100vw, 1200px",
|
|
152
|
+
draggable: false,
|
|
153
|
+
style: {
|
|
154
|
+
display: "block",
|
|
155
|
+
width: "100%",
|
|
156
|
+
height: "auto",
|
|
157
|
+
objectFit: "cover"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
) : /* @__PURE__ */ jsx(
|
|
161
|
+
"img",
|
|
162
|
+
{
|
|
163
|
+
src: after.url,
|
|
164
|
+
alt: afterAlt,
|
|
165
|
+
draggable: false,
|
|
166
|
+
loading: "lazy",
|
|
167
|
+
decoding: "async",
|
|
168
|
+
style: {
|
|
169
|
+
display: "block",
|
|
170
|
+
width: "100%",
|
|
171
|
+
height: "100%",
|
|
172
|
+
objectFit: "cover"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ jsx(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
ref: clipRef,
|
|
180
|
+
style: {
|
|
181
|
+
position: "absolute",
|
|
182
|
+
inset: 0,
|
|
183
|
+
clipPath: `inset(0 ${100 - position}% 0 0)`
|
|
184
|
+
},
|
|
185
|
+
children: /* @__PURE__ */ jsx(
|
|
186
|
+
Image,
|
|
187
|
+
{
|
|
188
|
+
src: before.url,
|
|
189
|
+
alt: beforeAlt,
|
|
190
|
+
fill: true,
|
|
191
|
+
sizes: "(max-width: 1280px) 100vw, 1200px",
|
|
192
|
+
draggable: false,
|
|
193
|
+
style: { objectFit: "cover" }
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
/* @__PURE__ */ jsx(
|
|
199
|
+
"div",
|
|
200
|
+
{
|
|
201
|
+
ref: dividerRef,
|
|
202
|
+
style: {
|
|
203
|
+
position: "absolute",
|
|
204
|
+
top: 0,
|
|
205
|
+
bottom: 0,
|
|
206
|
+
left: `${position}%`,
|
|
207
|
+
width: "3px",
|
|
208
|
+
background: "var(--sk-primary, #6366f1)",
|
|
209
|
+
transform: "translateX(-50%)",
|
|
210
|
+
zIndex: 10
|
|
211
|
+
},
|
|
212
|
+
children: /* @__PURE__ */ jsx(
|
|
213
|
+
"div",
|
|
214
|
+
{
|
|
215
|
+
style: {
|
|
216
|
+
position: "absolute",
|
|
217
|
+
top: "50%",
|
|
218
|
+
left: "50%",
|
|
219
|
+
transform: "translate(-50%, -50%)",
|
|
220
|
+
width: "40px",
|
|
221
|
+
height: "40px",
|
|
222
|
+
borderRadius: "9999px",
|
|
223
|
+
background: "var(--sk-primary, #6366f1)",
|
|
224
|
+
display: "flex",
|
|
225
|
+
alignItems: "center",
|
|
226
|
+
justifyContent: "center",
|
|
227
|
+
boxShadow: "0 2px 8px rgba(0,0,0,0.3)"
|
|
228
|
+
},
|
|
229
|
+
children: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
|
|
230
|
+
/* @__PURE__ */ jsx("circle", { cx: "5", cy: "4", r: "1.5", fill: "white" }),
|
|
231
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "4", r: "1.5", fill: "white" }),
|
|
232
|
+
/* @__PURE__ */ jsx("circle", { cx: "5", cy: "8", r: "1.5", fill: "white" }),
|
|
233
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "8", r: "1.5", fill: "white" }),
|
|
234
|
+
/* @__PURE__ */ jsx("circle", { cx: "5", cy: "12", r: "1.5", fill: "white" }),
|
|
235
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "12", r: "1.5", fill: "white" })
|
|
236
|
+
] })
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ jsx(
|
|
242
|
+
"div",
|
|
243
|
+
{
|
|
244
|
+
style: {
|
|
245
|
+
position: "absolute",
|
|
246
|
+
top: "12px",
|
|
247
|
+
left: "12px",
|
|
248
|
+
padding: "4px 10px",
|
|
249
|
+
borderRadius: "6px",
|
|
250
|
+
background: "rgba(0,0,0,0.6)",
|
|
251
|
+
backdropFilter: "blur(4px)",
|
|
252
|
+
color: "white",
|
|
253
|
+
fontSize: "12px",
|
|
254
|
+
fontWeight: 600,
|
|
255
|
+
letterSpacing: "0.05em",
|
|
256
|
+
textTransform: "uppercase",
|
|
257
|
+
pointerEvents: "none",
|
|
258
|
+
zIndex: 5
|
|
259
|
+
},
|
|
260
|
+
children: "Before"
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
/* @__PURE__ */ jsx(
|
|
264
|
+
"div",
|
|
265
|
+
{
|
|
266
|
+
style: {
|
|
267
|
+
position: "absolute",
|
|
268
|
+
top: "12px",
|
|
269
|
+
right: "12px",
|
|
270
|
+
padding: "4px 10px",
|
|
271
|
+
borderRadius: "6px",
|
|
272
|
+
background: "rgba(0,0,0,0.6)",
|
|
273
|
+
backdropFilter: "blur(4px)",
|
|
274
|
+
color: "white",
|
|
275
|
+
fontSize: "12px",
|
|
276
|
+
fontWeight: 600,
|
|
277
|
+
letterSpacing: "0.05em",
|
|
278
|
+
textTransform: "uppercase",
|
|
279
|
+
pointerEvents: "none",
|
|
280
|
+
zIndex: 5
|
|
281
|
+
},
|
|
282
|
+
children: "After"
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
export {
|
|
290
|
+
BeforeAfterSlider as default
|
|
291
|
+
};
|
|
292
|
+
//# sourceMappingURL=BeforeAfterSlider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/portfolio/components/primitives/BeforeAfterSlider.tsx"],"sourcesContent":["'use client';\n\nimport React, { useRef, useEffect, useState, useCallback } from 'react';\nimport Image from 'next/image';\nimport { resolvePortfolioImage } from '../../../shared/images';\n\ninterface BeforeAfterSliderProps {\n beforeSrc: string;\n afterSrc: string;\n beforeAlt?: string;\n afterAlt?: string;\n defaultPosition?: number;\n className?: string;\n}\n\nexport default function BeforeAfterSlider({\n beforeSrc,\n afterSrc,\n beforeAlt = 'Before',\n afterAlt = 'After',\n defaultPosition = 50,\n className = '',\n}: BeforeAfterSliderProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n const dividerRef = useRef<HTMLDivElement>(null);\n const clipRef = useRef<HTMLDivElement>(null);\n const [position, setPosition] = useState(defaultPosition);\n const isDragging = useRef(false);\n const hasAnimated = useRef(false);\n\n // Update clip path\n const updatePosition = useCallback((pct: number) => {\n const clamped = Math.max(0, Math.min(100, pct));\n setPosition(clamped);\n if (clipRef.current) {\n clipRef.current.style.clipPath = `inset(0 ${100 - clamped}% 0 0)`;\n }\n if (dividerRef.current) {\n dividerRef.current.style.left = `${clamped}%`;\n }\n }, []);\n\n // Pointer event handlers\n const getPositionFromEvent = useCallback((e: PointerEvent | React.PointerEvent) => {\n const container = containerRef.current;\n if (!container) return defaultPosition;\n const rect = container.getBoundingClientRect();\n return ((e.clientX - rect.left) / rect.width) * 100;\n }, [defaultPosition]);\n\n const handlePointerDown = useCallback((e: React.PointerEvent) => {\n isDragging.current = true;\n (e.target as HTMLElement).setPointerCapture(e.pointerId);\n updatePosition(getPositionFromEvent(e));\n }, [getPositionFromEvent, updatePosition]);\n\n const handlePointerMove = useCallback((e: React.PointerEvent) => {\n if (!isDragging.current) return;\n updatePosition(getPositionFromEvent(e));\n }, [getPositionFromEvent, updatePosition]);\n\n const handlePointerUp = useCallback(() => {\n isDragging.current = false;\n }, []);\n\n // Keyboard operation — arrows nudge, Home/End jump (WAI-ARIA slider)\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n const step = e.shiftKey ? 10 : 5;\n if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {\n e.preventDefault();\n updatePosition(position - step);\n } else if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {\n e.preventDefault();\n updatePosition(position + step);\n } else if (e.key === 'Home') {\n e.preventDefault();\n updatePosition(0);\n } else if (e.key === 'End') {\n e.preventDefault();\n updatePosition(100);\n }\n },\n [position, updatePosition],\n );\n\n // Initial clip position\n useEffect(() => {\n updatePosition(defaultPosition);\n }, [defaultPosition, updatePosition]);\n\n // Entry auto-demo: IntersectionObserver + a rAF tween chain that wiggles\n // the divider 80 -> 20 -> 50 once, so visitors see the slider is draggable.\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;\n\n const easeInOut = (t: number) =>\n t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2; // ≈ power2.inOut\n const easeOut = (t: number) => 1 - Math.pow(1 - t, 2); // ≈ power2.out\n\n // Same waypoints, segment durations, and eases as the old timeline.\n const segments = [\n { to: 80, duration: 0.6, ease: easeInOut },\n { to: 20, duration: 0.8, ease: easeInOut },\n { to: 50, duration: 0.6, ease: easeOut },\n ];\n\n let raf = 0;\n\n const play = () => {\n let index = 0;\n let from = defaultPosition;\n let start = performance.now();\n const tick = (now: number) => {\n const seg = segments[index];\n const p = Math.min(1, (now - start) / (seg.duration * 1000));\n updatePosition(from + (seg.to - from) * seg.ease(p));\n if (p >= 1) {\n from = seg.to;\n index += 1;\n if (index >= segments.length) return;\n start = now;\n }\n raf = requestAnimationFrame(tick);\n };\n raf = requestAnimationFrame(tick);\n };\n\n const io = new IntersectionObserver(\n ([entry]) => {\n if (!entry.isIntersecting) return;\n io.disconnect();\n if (hasAnimated.current) return;\n hasAnimated.current = true;\n play();\n },\n { rootMargin: '0px 0px -20% 0px' }, // ≈ 'top 80%' trigger start\n );\n io.observe(container);\n\n return () => {\n io.disconnect();\n cancelAnimationFrame(raf);\n };\n }, [defaultPosition, updatePosition]);\n\n const before = resolvePortfolioImage(beforeSrc);\n const after = resolvePortfolioImage(afterSrc);\n // Without both images the comparison is meaningless.\n if (!before || !after) return null;\n\n return (\n <div\n ref={containerRef}\n role=\"slider\"\n tabIndex={0}\n aria-label=\"Before and after comparison\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(position)}\n aria-valuetext={`${Math.round(position)}% before, ${100 - Math.round(position)}% after`}\n className={`relative select-none overflow-hidden ${className}`}\n style={{ touchAction: 'pan-y', cursor: 'ew-resize' }}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerUp}\n onKeyDown={handleKeyDown}\n >\n {/* After image (background — establishes the container's height) */}\n {after.width && after.height ? (\n <Image\n src={after.url}\n alt={afterAlt}\n width={after.width}\n height={after.height}\n sizes=\"(max-width: 1280px) 100vw, 1200px\"\n draggable={false}\n style={{\n display: 'block',\n width: '100%',\n height: 'auto',\n objectFit: 'cover',\n }}\n />\n ) : (\n <img\n src={after.url}\n alt={afterAlt}\n draggable={false}\n loading=\"lazy\"\n decoding=\"async\"\n style={{\n display: 'block',\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n }}\n />\n )}\n\n {/* Before image (clipped overlay) */}\n <div\n ref={clipRef}\n style={{\n position: 'absolute',\n inset: 0,\n clipPath: `inset(0 ${100 - position}% 0 0)`,\n }}\n >\n <Image\n src={before.url}\n alt={beforeAlt}\n fill\n sizes=\"(max-width: 1280px) 100vw, 1200px\"\n draggable={false}\n style={{ objectFit: 'cover' }}\n />\n </div>\n\n {/* Divider line */}\n <div\n ref={dividerRef}\n style={{\n position: 'absolute',\n top: 0,\n bottom: 0,\n left: `${position}%`,\n width: '3px',\n background: 'var(--sk-primary, #6366f1)',\n transform: 'translateX(-50%)',\n zIndex: 10,\n }}\n >\n {/* Handle */}\n <div\n style={{\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: '40px',\n height: '40px',\n borderRadius: '9999px',\n background: 'var(--sk-primary, #6366f1)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n boxShadow: '0 2px 8px rgba(0,0,0,0.3)',\n }}\n >\n {/* Grip dots */}\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\">\n <circle cx=\"5\" cy=\"4\" r=\"1.5\" fill=\"white\" />\n <circle cx=\"11\" cy=\"4\" r=\"1.5\" fill=\"white\" />\n <circle cx=\"5\" cy=\"8\" r=\"1.5\" fill=\"white\" />\n <circle cx=\"11\" cy=\"8\" r=\"1.5\" fill=\"white\" />\n <circle cx=\"5\" cy=\"12\" r=\"1.5\" fill=\"white\" />\n <circle cx=\"11\" cy=\"12\" r=\"1.5\" fill=\"white\" />\n </svg>\n </div>\n </div>\n\n {/* Labels */}\n <div\n style={{\n position: 'absolute',\n top: '12px',\n left: '12px',\n padding: '4px 10px',\n borderRadius: '6px',\n background: 'rgba(0,0,0,0.6)',\n backdropFilter: 'blur(4px)',\n color: 'white',\n fontSize: '12px',\n fontWeight: 600,\n letterSpacing: '0.05em',\n textTransform: 'uppercase',\n pointerEvents: 'none',\n zIndex: 5,\n }}\n >\n Before\n </div>\n <div\n style={{\n position: 'absolute',\n top: '12px',\n right: '12px',\n padding: '4px 10px',\n borderRadius: '6px',\n background: 'rgba(0,0,0,0.6)',\n backdropFilter: 'blur(4px)',\n color: 'white',\n fontSize: '12px',\n fontWeight: 600,\n letterSpacing: '0.05em',\n textTransform: 'uppercase',\n pointerEvents: 'none',\n zIndex: 5,\n }}\n >\n After\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAEA,SAAgB,QAAQ,WAAW,UAAU,mBAAmB;AAChE,OAAO,WAAW;AA2KV,cAiFE,YAjFF;AA/JO,SAAR,kBAAmC;AAAA,EACxC;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,YAAY;AACd,GAA2B;AACzB,QAAM,eAAe,OAAuB,IAAI;AAChD,QAAM,aAAa,OAAuB,IAAI;AAC9C,QAAM,UAAU,OAAuB,IAAI;AAC3C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;","names":[]}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/portfolio/components/primitives/DeviceTrifolio.tsx
|
|
33
|
+
var DeviceTrifolio_exports = {};
|
|
34
|
+
__export(DeviceTrifolio_exports, {
|
|
35
|
+
default: () => DeviceTrifolio
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(DeviceTrifolio_exports);
|
|
38
|
+
var import_react = require("react");
|
|
39
|
+
var import_image = __toESM(require("next/image"), 1);
|
|
40
|
+
|
|
41
|
+
// src/shared/images.ts
|
|
42
|
+
var SANITY_ASSET_REF = /^image-[A-Za-z0-9]+-\d+x\d+-[a-z0-9]+$/;
|
|
43
|
+
var FILENAME_DIMS = /-(\d{2,5})x(\d{2,5})\.[a-z0-9]+(?:\?.*)?$/i;
|
|
44
|
+
var warnedAboutRefs = false;
|
|
45
|
+
function resolvePortfolioImage(input) {
|
|
46
|
+
const raw = typeof input === "string" ? input : input?.asset?._ref ?? "";
|
|
47
|
+
const value = (raw || "").trim();
|
|
48
|
+
if (!value) return null;
|
|
49
|
+
if (SANITY_ASSET_REF.test(value)) {
|
|
50
|
+
if (!warnedAboutRefs && typeof console !== "undefined") {
|
|
51
|
+
warnedAboutRefs = true;
|
|
52
|
+
console.warn(
|
|
53
|
+
"[@sonordev/agency-site-kit] Received a raw Sanity asset ref instead of an image URL \u2014 skipping render. The Sonor API should resolve image refs to cdn.sanity.io URLs before returning portfolio sections."
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
if (!/^https?:\/\//i.test(value) && !value.startsWith("/")) return null;
|
|
59
|
+
const dims = value.match(FILENAME_DIMS);
|
|
60
|
+
if (dims) {
|
|
61
|
+
const width = parseInt(dims[1], 10);
|
|
62
|
+
const height = parseInt(dims[2], 10);
|
|
63
|
+
if (width > 0 && height > 0) return { url: value, width, height };
|
|
64
|
+
}
|
|
65
|
+
return { url: value };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/portfolio/components/primitives/DeviceTrifolio.tsx
|
|
69
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
70
|
+
function ScreenshotOverlay({
|
|
71
|
+
src,
|
|
72
|
+
alt,
|
|
73
|
+
sizes,
|
|
74
|
+
priority = false,
|
|
75
|
+
hidden
|
|
76
|
+
}) {
|
|
77
|
+
const resolved = resolvePortfolioImage(src);
|
|
78
|
+
if (!resolved) return null;
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
+
import_image.default,
|
|
81
|
+
{
|
|
82
|
+
src: resolved.url,
|
|
83
|
+
alt,
|
|
84
|
+
fill: true,
|
|
85
|
+
sizes,
|
|
86
|
+
priority,
|
|
87
|
+
fetchPriority: priority ? "high" : void 0,
|
|
88
|
+
style: {
|
|
89
|
+
objectFit: "cover",
|
|
90
|
+
objectPosition: "top center",
|
|
91
|
+
zIndex: 2,
|
|
92
|
+
opacity: hidden ? 0 : 1,
|
|
93
|
+
transition: "opacity 0.8s ease",
|
|
94
|
+
pointerEvents: "none"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
function useScaledIframe(viewportWidth) {
|
|
100
|
+
const containerRef = (0, import_react.useRef)(null);
|
|
101
|
+
const [scale, setScale] = (0, import_react.useState)(1);
|
|
102
|
+
(0, import_react.useEffect)(() => {
|
|
103
|
+
const container = containerRef.current;
|
|
104
|
+
if (!container) return;
|
|
105
|
+
const updateScale = () => {
|
|
106
|
+
const containerWidth = container.offsetWidth;
|
|
107
|
+
setScale(containerWidth / viewportWidth);
|
|
108
|
+
};
|
|
109
|
+
updateScale();
|
|
110
|
+
const resizeObserver = new ResizeObserver(updateScale);
|
|
111
|
+
resizeObserver.observe(container);
|
|
112
|
+
return () => resizeObserver.disconnect();
|
|
113
|
+
}, [viewportWidth]);
|
|
114
|
+
return { containerRef, scale };
|
|
115
|
+
}
|
|
116
|
+
function useIframeLoadDetection() {
|
|
117
|
+
const [loaded, setLoaded] = (0, import_react.useState)(false);
|
|
118
|
+
const iframeRef = (0, import_react.useRef)(null);
|
|
119
|
+
const onLoad = (0, import_react.useCallback)(() => {
|
|
120
|
+
const iframe = iframeRef.current;
|
|
121
|
+
if (!iframe) return;
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
try {
|
|
124
|
+
const doc = iframe.contentDocument;
|
|
125
|
+
if (!doc?.body) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const numElements = doc.querySelectorAll("*").length;
|
|
129
|
+
if (numElements > 20) setLoaded(true);
|
|
130
|
+
} catch {
|
|
131
|
+
setLoaded(true);
|
|
132
|
+
}
|
|
133
|
+
}, 1500);
|
|
134
|
+
}, []);
|
|
135
|
+
return { iframeRef, loaded, onLoad };
|
|
136
|
+
}
|
|
137
|
+
function MacBookFrame({ url, screenshot }) {
|
|
138
|
+
const viewportWidth = 1440;
|
|
139
|
+
const viewportHeight = 900;
|
|
140
|
+
const { containerRef, scale } = useScaledIframe(viewportWidth);
|
|
141
|
+
const { iframeRef, loaded: iframeLoaded, onLoad: onIframeLoad } = useIframeLoadDetection();
|
|
142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full", children: [
|
|
143
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
144
|
+
"div",
|
|
145
|
+
{
|
|
146
|
+
className: "relative rounded-t-[10px] p-[4px] pb-0",
|
|
147
|
+
style: {
|
|
148
|
+
background: "linear-gradient(135deg, #e8e8ed 0%, #d1d1d6 100%)",
|
|
149
|
+
boxShadow: "0 -4px 30px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.9)"
|
|
150
|
+
},
|
|
151
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
className: "relative rounded-t-[7px] px-[8px] pt-[8px] pb-0",
|
|
155
|
+
style: { background: "#0a0a0a" },
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
className: "absolute top-0 left-1/2 -translate-x-1/2 w-[70px] h-[18px] flex items-center justify-center z-10",
|
|
161
|
+
style: { background: "#0a0a0a", borderRadius: "0 0 10px 10px" },
|
|
162
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-[5px] h-[5px] rounded-full", style: { background: "#2a3a2a", boxShadow: "0 0 0 1px #1a1a1a" } })
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: containerRef, className: "relative overflow-hidden rounded-t-[3px]", style: { aspectRatio: `${viewportWidth}/${viewportHeight}`, background: "#0a0a0a" }, children: [
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScreenshotOverlay, { src: screenshot, alt: "Desktop preview", sizes: "(max-width: 1024px) 90vw, 640px", priority: true, hidden: iframeLoaded }),
|
|
167
|
+
url && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("iframe", { src: url, title: "Desktop", loading: "eager", scrolling: "no", tabIndex: -1, sandbox: "allow-scripts allow-same-origin", ref: iframeRef, onLoad: onIframeLoad, className: "border-0 pointer-events-none", style: { position: "absolute", top: 0, left: 0, width: `${viewportWidth}px`, height: `${viewportHeight}px`, transformOrigin: "top left", transform: `scale(${scale})` } })
|
|
168
|
+
] })
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-[8px]", style: { background: "#0a0a0a", boxShadow: "0 1px 4px rgba(0,0,0,0.3)" } }),
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
className: "relative h-[12px] rounded-b-[10px]",
|
|
179
|
+
style: {
|
|
180
|
+
background: "linear-gradient(to bottom, #e0e0e5, #c8c8cd 20%, #b0b0b5 80%, #a0a0a5)",
|
|
181
|
+
boxShadow: "0 4px 15px rgba(0,0,0,0.3)"
|
|
182
|
+
},
|
|
183
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
className: "absolute top-0 left-1/2 -translate-x-1/2 w-[25%] h-[4px] rounded-b-[4px]",
|
|
187
|
+
style: { background: "linear-gradient(to bottom, #909095, #a8a8ad)" }
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] });
|
|
193
|
+
}
|
|
194
|
+
function IPadFrame({ url, screenshot }) {
|
|
195
|
+
const viewportWidth = 768;
|
|
196
|
+
const viewportHeight = 1024;
|
|
197
|
+
const { containerRef, scale } = useScaledIframe(viewportWidth);
|
|
198
|
+
const { iframeRef, loaded: iframeLoaded, onLoad: onIframeLoad } = useIframeLoadDetection();
|
|
199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative p-[1.5%]", style: { background: "linear-gradient(135deg, #e8e8ed 0%, #d1d1d6 100%)", borderRadius: "8% / 6%", boxShadow: "0 30px 60px -15px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.9) inset, inset 0 1px 0 rgba(255,255,255,0.8)" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative p-[2%]", style: { background: "#0a0a0a", borderRadius: "6% / 4.5%" }, children: [
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute top-[1.2%] left-1/2 -translate-x-1/2 w-[1.8%] aspect-square rounded-full z-10", style: { background: "#1a1a1f" } }),
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: containerRef, className: "relative overflow-hidden", style: { borderRadius: "2%", aspectRatio: `${viewportWidth}/${viewportHeight}`, background: "#0a0a0a" }, children: [
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScreenshotOverlay, { src: screenshot, alt: "Tablet preview", sizes: "(max-width: 1024px) 40vw, 240px", hidden: iframeLoaded }),
|
|
203
|
+
url && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("iframe", { src: url, title: "Tablet", loading: "eager", scrolling: "no", tabIndex: -1, sandbox: "allow-scripts allow-same-origin", ref: iframeRef, onLoad: onIframeLoad, className: "border-0 pointer-events-none", style: { position: "absolute", top: 0, left: 0, width: `${viewportWidth}px`, height: `${viewportHeight}px`, transformOrigin: "top left", transform: `scale(${scale})` } })
|
|
204
|
+
] })
|
|
205
|
+
] }) });
|
|
206
|
+
}
|
|
207
|
+
function IPhoneFrame({ url, screenshot }) {
|
|
208
|
+
const viewportWidth = 393;
|
|
209
|
+
const viewportHeight = 852;
|
|
210
|
+
const { containerRef, scale } = useScaledIframe(viewportWidth);
|
|
211
|
+
const { iframeRef, loaded: iframeLoaded, onLoad: onIframeLoad } = useIframeLoadDetection();
|
|
212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
213
|
+
"div",
|
|
214
|
+
{
|
|
215
|
+
className: "relative p-[2.5%]",
|
|
216
|
+
style: {
|
|
217
|
+
background: "linear-gradient(135deg, #e8e8ed 0%, #d1d1d6 100%)",
|
|
218
|
+
borderRadius: "18% / 8%",
|
|
219
|
+
boxShadow: "0 30px 60px -15px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.9) inset, inset 0 1px 0 rgba(255,255,255,0.8)"
|
|
220
|
+
},
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute left-0 top-[18%] w-[1%] h-[6%] rounded-l-sm", style: { background: "#c8c8cd" } }),
|
|
223
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute left-0 top-[26%] w-[1%] h-[10%] rounded-l-sm", style: { background: "#c8c8cd" } }),
|
|
224
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute left-0 top-[38%] w-[1%] h-[10%] rounded-l-sm", style: { background: "#c8c8cd" } }),
|
|
225
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute right-0 top-[22%] w-[1%] h-[12%] rounded-r-sm", style: { background: "#c8c8cd" } }),
|
|
226
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
className: "relative p-[3%]",
|
|
230
|
+
style: { background: "#0a0a0a", borderRadius: "14% / 6%" },
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
233
|
+
"div",
|
|
234
|
+
{
|
|
235
|
+
className: "absolute top-[2.5%] left-1/2 -translate-x-1/2 w-[28%] h-[3.5%] rounded-full z-10",
|
|
236
|
+
style: { background: "#1a1a1a" }
|
|
237
|
+
}
|
|
238
|
+
),
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: containerRef, className: "relative overflow-hidden", style: { borderRadius: "8% / 4%", aspectRatio: `${viewportWidth}/${viewportHeight}`, background: "#0a0a0a" }, children: [
|
|
240
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScreenshotOverlay, { src: screenshot, alt: "Mobile preview", sizes: "(max-width: 1024px) 25vw, 150px", hidden: iframeLoaded }),
|
|
241
|
+
url && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("iframe", { src: url, title: "Mobile", loading: "eager", scrolling: "no", tabIndex: -1, sandbox: "allow-scripts allow-same-origin", ref: iframeRef, onLoad: onIframeLoad, className: "border-0 pointer-events-none", style: { position: "absolute", top: 0, left: 0, width: `${viewportWidth}px`, height: `${viewportHeight}px`, transformOrigin: "top left", transform: `scale(${scale})` } })
|
|
242
|
+
] }),
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
className: "absolute bottom-[2%] left-1/2 -translate-x-1/2 w-[34%] h-[1%] rounded-full",
|
|
247
|
+
style: { background: "rgba(255,255,255,0.25)" }
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
function DeviceTrifolio({
|
|
258
|
+
url,
|
|
259
|
+
screenshots,
|
|
260
|
+
className = ""
|
|
261
|
+
}) {
|
|
262
|
+
const frameUrl = url || "";
|
|
263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
264
|
+
"div",
|
|
265
|
+
{
|
|
266
|
+
"data-screenshot-target": "device-trifolio",
|
|
267
|
+
className: `relative w-full min-w-0 max-w-full overflow-x-clip ${className}`,
|
|
268
|
+
style: { aspectRatio: "11/5", minHeight: "200px" },
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
271
|
+
"div",
|
|
272
|
+
{
|
|
273
|
+
"data-device": "macbook",
|
|
274
|
+
className: "absolute left-1/2 -translate-x-1/2 bottom-0 w-[65%] z-10",
|
|
275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MacBookFrame, { url: frameUrl, screenshot: screenshots?.desktop })
|
|
276
|
+
}
|
|
277
|
+
),
|
|
278
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
279
|
+
"div",
|
|
280
|
+
{
|
|
281
|
+
"data-device": "ipad",
|
|
282
|
+
className: "absolute left-[8%] bottom-0 w-[28%] z-20",
|
|
283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IPadFrame, { url: frameUrl, screenshot: screenshots?.tablet })
|
|
284
|
+
}
|
|
285
|
+
),
|
|
286
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
287
|
+
"div",
|
|
288
|
+
{
|
|
289
|
+
"data-device": "iphone",
|
|
290
|
+
className: "absolute right-[10%] bottom-0 w-[14%] z-30",
|
|
291
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IPhoneFrame, { url: frameUrl, screenshot: screenshots?.mobile })
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
]
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
//# sourceMappingURL=DeviceTrifolio.cjs.map
|