From ef13e8bc259e618838c980a78cc293e6321b302e Mon Sep 17 00:00:00 2001 From: Jamil Date: Mon, 24 Jun 2024 15:37:17 -0700 Subject: [PATCH] fix(website): Disable SVG animations in Safari (#5524) Unfortunately these case the SVGs not to animate, which means major pieces of them fail to appear. Instead, we simply disable animations in Safari by setting their end-state `opacity` and `pathLength` to the desired state. refs #5061 --- website/package.json | 1 + website/pnpm-lock.yaml | 83 ++++++++++++------- .../Animations/ComplianceDiagram.tsx | 11 +-- .../Animations/SimpleArchitecture.tsx | 7 +- .../src/components/Animations/SpeedChart.tsx | 13 +-- .../components/Animations/UpgradeDiagram.tsx | 15 ++-- 6 files changed, 80 insertions(+), 50 deletions(-) diff --git a/website/package.json b/website/package.json index ca613806c..31c8467a4 100644 --- a/website/package.json +++ b/website/package.json @@ -37,6 +37,7 @@ "next-sitemap": "^4.2.3", "postcss": "8.4.38", "react": "18.3.1", + "react-device-detect": "^2.2.3", "react-dom": "18.3.1", "react-fast-marquee": "^1.6.4", "react-icons": "^5.2.1", diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index 68cca0158..758f081ee 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: '@docsearch/react': specifier: ^3.6.0 - version: 3.6.0(@algolia/client-search@4.23.3)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)(search-insights@2.14.0) + version: 3.6.0(@algolia/client-search@4.23.3)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.14.0) '@mdx-js/loader': specifier: ^3.0.1 version: 3.0.1(webpack@5.92.0) @@ -19,10 +19,10 @@ importers: version: 3.0.1(@types/react@18.3.3)(react@18.3.1) '@next/mdx': specifier: ~14.2.3 - version: 14.2.3(@mdx-js/loader@3.0.1)(@mdx-js/react@3.0.1) + version: 14.2.3(@mdx-js/loader@3.0.1(webpack@5.92.0))(@mdx-js/react@3.0.1(@types/react@18.3.3)(react@18.3.1)) '@next/third-parties': specifier: ^14.2.3 - version: 14.2.3(next@14.2.3)(react@18.3.1) + version: 14.2.3(next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) '@types/mdx': specifier: ^2.0.11 version: 2.0.13 @@ -55,10 +55,10 @@ importers: version: 2.3.0 flowbite-react: specifier: ^0.9.0 - version: 0.9.0(react-dom@18.3.1)(react@18.3.1)(tailwindcss@3.4.4) + version: 0.9.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.4) framer-motion: specifier: ^11.2.4 - version: 11.2.10(react-dom@18.3.1)(react@18.3.1) + version: 11.2.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1) google: specifier: link:@next/third-parties/google version: link:@next/third-parties/google @@ -73,25 +73,28 @@ importers: version: 2.52.0 next: specifier: ^14.1.3 - version: 14.2.3(react-dom@18.3.1)(react@18.3.1) + version: 14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next-hubspot: specifier: ^1.3.0 - version: 1.3.0(next@14.2.3)(react-dom@18.3.1)(react@18.3.1) + version: 1.3.0(next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next-sitemap: specifier: ^4.2.3 - version: 4.2.3(next@14.2.3) + version: 4.2.3(next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) postcss: specifier: 8.4.38 version: 8.4.38 react: specifier: 18.3.1 version: 18.3.1 + react-device-detect: + specifier: ^2.2.3 + version: 2.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react-dom: specifier: 18.3.1 version: 18.3.1(react@18.3.1) react-fast-marquee: specifier: ^1.6.4 - version: 1.6.4(react-dom@18.3.1)(react@18.3.1) + version: 1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react-icons: specifier: ^5.2.1 version: 5.2.1(react@18.3.1) @@ -1478,6 +1481,12 @@ packages: randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + react-device-detect@2.2.3: + resolution: {integrity: sha512-buYY3qrCnQVlIFHrC5UcUoAj7iANs/+srdkwsnNjI7anr3Tt7UY6MqNxtMLlr0tMBied0O49UZVK8XKs3ZIiPw==} + peerDependencies: + react: '>= 0.14.0' + react-dom: '>= 0.14.0' + react-dom@18.3.1: resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} peerDependencies: @@ -1766,6 +1775,9 @@ packages: engines: {node: '>=14.17'} hasBin: true + ua-parser-js@1.0.38: + resolution: {integrity: sha512-Aq5ppTOfvrCMgAPneW1HfWj66Xi7XL+/mIy996R1/CLS/rcyJQm6QZdsKrUeivDFQ+Oc9Wyuwor8Ze8peEoUoQ==} + undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} @@ -1979,13 +1991,14 @@ snapshots: '@docsearch/css@3.6.0': {} - '@docsearch/react@3.6.0(@algolia/client-search@4.23.3)(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)(search-insights@2.14.0)': + '@docsearch/react@3.6.0(@algolia/client-search@4.23.3)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.14.0)': dependencies: '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.23.3)(algoliasearch@4.23.3)(search-insights@2.14.0) '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.23.3)(algoliasearch@4.23.3) '@docsearch/css': 3.6.0 - '@types/react': 18.3.3 algoliasearch: 4.23.3 + optionalDependencies: + '@types/react': 18.3.3 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) search-insights: 2.14.0 @@ -2001,15 +2014,15 @@ snapshots: '@floating-ui/core': 1.6.0 '@floating-ui/utils': 0.2.2 - '@floating-ui/react-dom@2.1.0(react-dom@18.3.1)(react@18.3.1)': + '@floating-ui/react-dom@2.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@floating-ui/dom': 1.6.5 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@floating-ui/react@0.26.10(react-dom@18.3.1)(react@18.3.1)': + '@floating-ui/react@0.26.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@floating-ui/react-dom': 2.1.0(react-dom@18.3.1)(react@18.3.1) + '@floating-ui/react-dom': 2.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@floating-ui/utils': 0.2.2 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -2094,11 +2107,12 @@ snapshots: '@next/env@14.2.3': {} - '@next/mdx@14.2.3(@mdx-js/loader@3.0.1)(@mdx-js/react@3.0.1)': + '@next/mdx@14.2.3(@mdx-js/loader@3.0.1(webpack@5.92.0))(@mdx-js/react@3.0.1(@types/react@18.3.3)(react@18.3.1))': dependencies: + source-map: 0.7.4 + optionalDependencies: '@mdx-js/loader': 3.0.1(webpack@5.92.0) '@mdx-js/react': 3.0.1(@types/react@18.3.3)(react@18.3.1) - source-map: 0.7.4 '@next/swc-darwin-arm64@14.2.3': optional: true @@ -2127,9 +2141,9 @@ snapshots: '@next/swc-win32-x64-msvc@14.2.3': optional: true - '@next/third-parties@14.2.3(next@14.2.3)(react@18.3.1)': + '@next/third-parties@14.2.3(next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)': dependencies: - next: 14.2.3(react-dom@18.3.1)(react@18.3.1) + next: 14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 third-party-capital: 1.0.20 @@ -2602,10 +2616,10 @@ snapshots: dependencies: to-regex-range: 5.0.1 - flowbite-react@0.9.0(react-dom@18.3.1)(react@18.3.1)(tailwindcss@3.4.4): + flowbite-react@0.9.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tailwindcss@3.4.4): dependencies: '@floating-ui/core': 1.6.0 - '@floating-ui/react': 0.26.10(react-dom@18.3.1)(react@18.3.1) + '@floating-ui/react': 0.26.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 debounce: 2.0.0 flowbite: 2.3.0 @@ -2636,11 +2650,12 @@ snapshots: fraction.js@4.3.7: {} - framer-motion@11.2.10(react-dom@18.3.1)(react@18.3.1): + framer-motion@11.2.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: + tslib: 2.6.3 + optionalDependencies: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - tslib: 2.6.3 fsevents@2.3.3: optional: true @@ -3416,21 +3431,22 @@ snapshots: neo-async@2.6.2: {} - next-hubspot@1.3.0(next@14.2.3)(react-dom@18.3.1)(react@18.3.1): + next-hubspot@1.3.0(next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - next: 14.2.3(react-dom@18.3.1)(react@18.3.1) + next: 14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 + optionalDependencies: react-dom: 18.3.1(react@18.3.1) - next-sitemap@4.2.3(next@14.2.3): + next-sitemap@4.2.3(next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): dependencies: '@corex/deepmerge': 4.0.43 '@next/env': 13.5.6 fast-glob: 3.3.2 minimist: 1.2.8 - next: 14.2.3(react-dom@18.3.1)(react@18.3.1) + next: 14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - next@14.2.3(react-dom@18.3.1)(react@18.3.1): + next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@next/env': 14.2.3 '@swc/helpers': 0.5.5 @@ -3527,8 +3543,9 @@ snapshots: postcss-load-config@4.0.2(postcss@8.4.38): dependencies: lilconfig: 3.1.2 - postcss: 8.4.38 yaml: 2.4.5 + optionalDependencies: + postcss: 8.4.38 postcss-nested@6.0.1(postcss@8.4.38): dependencies: @@ -3572,13 +3589,19 @@ snapshots: dependencies: safe-buffer: 5.2.1 + react-device-detect@2.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + ua-parser-js: 1.0.38 + react-dom@18.3.1(react@18.3.1): dependencies: loose-envify: 1.4.0 react: 18.3.1 scheduler: 0.23.2 - react-fast-marquee@1.6.4(react-dom@18.3.1)(react@18.3.1): + react-fast-marquee@1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -3929,6 +3952,8 @@ snapshots: typescript@5.4.5: {} + ua-parser-js@1.0.38: {} + undici-types@5.26.5: {} unified@11.0.4: diff --git a/website/src/components/Animations/ComplianceDiagram.tsx b/website/src/components/Animations/ComplianceDiagram.tsx index bf7b0e7ca..6f88b0df0 100644 --- a/website/src/components/Animations/ComplianceDiagram.tsx +++ b/website/src/components/Animations/ComplianceDiagram.tsx @@ -1,5 +1,6 @@ "use client"; import { motion } from "framer-motion"; +import { isSafari } from "react-device-detect"; export default function ComplianceDiagram() { return ( @@ -389,7 +390,7 @@ export default function ComplianceDiagram() {