diff --git a/src/pages/home/components/HomePageLanguageCard.tsx b/src/pages/home/components/HomePageLanguageCard.tsx index dd930442a00..ae77cf10d55 100644 --- a/src/pages/home/components/HomePageLanguageCard.tsx +++ b/src/pages/home/components/HomePageLanguageCard.tsx @@ -29,6 +29,7 @@ export default function HomePageLanguageCard() { return (
+

Quick Start!

Choose a language to get started.

@@ -42,33 +43,37 @@ export default function HomePageLanguageCard() { }} > { window.location.href = getLanguageUrl("java-serialization"); }} > Java logo - Java + Java { window.location.href = getLanguageUrl("python"); }} > Python logo - Python + Python { window.location.href = getLanguageUrl("golang"); }} > Golang logo - Golang + Golang { window.location.href = getLanguageUrl("javascript"); @@ -79,18 +84,20 @@ export default function HomePageLanguageCard() { style={imageStyle} alt="JavaScript logo" /> - JavaScript + JavaScript { window.location.href = getLanguageUrl("rust"); }} > Rust logo - Rust + Rust { window.location.href = getLanguageUrl( @@ -99,7 +106,7 @@ export default function HomePageLanguageCard() { }} > More languages - More + More
@@ -117,7 +124,25 @@ const gridStyle: React.CSSProperties = { borderRadius: "10px", fontWeight: "bold", fontSize: "18px", + cursor: "pointer", }; + +//媒体查询 +const mediaQueryStyles = ` + @media (max-width: 768px) { + .grid-item { + width: 100% !important; + } + .grid-item img { + width: 28px !important; + height: 28px !important; + } + .grid-item span { + display: none !important; + } + } +`; + const imageStyle: React.CSSProperties = { width: "38px", height: "38px", diff --git a/src/pages/home/components/HomepageCodeDisplay.tsx b/src/pages/home/components/HomepageCodeDisplay.tsx index 529472ae3b3..85f2c9eee81 100644 --- a/src/pages/home/components/HomepageCodeDisplay.tsx +++ b/src/pages/home/components/HomepageCodeDisplay.tsx @@ -47,27 +47,46 @@ public class Example { }; const programmingImageUrl = useBaseUrl("/home/programming.svg"); - + + //媒体查询 + const mediaQueryStyles = ` + @media (max-width: 768px) { + .desktop-only { + display: none !important; + } + .code-display { + width: 100% !important; + } + .code-display pre { + font-size: 8px !important; + } + } + `; return ( <> +
programming-coding
{/* 复制按钮 */}