From 6abcb3b230371becbffa05053f4e759e93d88b37 Mon Sep 17 00:00:00 2001 From: treasure Date: Thu, 14 May 2026 06:16:39 +0800 Subject: [PATCH 1/2] perf: defer homepage third-party embeds --- docusaurus.config.ts | 9 ---- .../home/IntroductionVideo/index.tsx | 30 +++++++++---- .../home/IntroductionVideo/style.css | 42 +++++++++++++++++++ src/components/shared/GlobalLayout.tsx | 26 ++++++++++++ 4 files changed, 89 insertions(+), 18 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index da14145d8..49fd05f40 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -13,15 +13,6 @@ export default { trailingSlash: true, tagline: "GraphQL platform engineered for scale", headTags: [ - { - tagName: "script", - attributes: { - id: "chatbotscript", - "data-accountid": "CZPG9aVdtk59Tjz4SMTu8w==", - "data-websiteid": "75VGI0NlBqessD4BQn2pFg==", - src: "https://app.robofy.ai/bot/js/common.js?v=" + new Date().getTime(), - }, - }, { tagName: "script", attributes: { diff --git a/src/components/home/IntroductionVideo/index.tsx b/src/components/home/IntroductionVideo/index.tsx index 70e2a429b..1b30fab05 100644 --- a/src/components/home/IntroductionVideo/index.tsx +++ b/src/components/home/IntroductionVideo/index.tsx @@ -1,10 +1,11 @@ -import React, {useRef} from "react" +import React, {useRef, useState} from "react" import {useCookieConsent} from "@site/src/utils/hooks/useCookieConsent" import "./style.css" const IntroductionVideo: React.FC = () => { const videoId = "1011521201" const videoRef = useRef(null) + const [isPlaying, setIsPlaying] = useState(false) const {getCookieConsent} = useCookieConsent() const cookieConsent = getCookieConsent() @@ -15,14 +16,25 @@ const IntroductionVideo: React.FC = () => { return (
-