diff --git a/docs/floodgate/faq.mdx b/docs/floodgate/faq.mdx index 51a0009..3b15379 100644 --- a/docs/floodgate/faq.mdx +++ b/docs/floodgate/faq.mdx @@ -37,4 +37,4 @@ Here you can find answers to frequently asked questions about Floodgate - if you If you're using the Spigot version of Floodgate, there is an unofficial plugin that adds Skript support [here](https://github.com/kejonaMC/floodgate-skript). - + \ No newline at end of file diff --git a/src/components/Collapsibles.tsx b/src/components/Collapsibles.tsx new file mode 100644 index 0000000..328eb6c --- /dev/null +++ b/src/components/Collapsibles.tsx @@ -0,0 +1,49 @@ +import React, { useEffect, useRef, useState } from 'react'; + +export const Collapsibles = ({ children }) => { + return ( +
+ {children} +
+ ); +}; + +interface CollapsibleProps { + title: string; + subtitle?: string; + inner: React.ReactNode; +} + +export const Collapsible: React.FC = ({ title, subtitle, inner }) => { + const [isInnerVisible, setIsInnerVisible] = useState(false); + const innerRef = useRef(null); + const [innerHeight, setInnerHeight] = useState(0); + + useEffect(() => { + if (innerRef.current) { + setInnerHeight(isInnerVisible ? innerRef.current.scrollHeight : 0); + } + }, [isInnerVisible]); + + const toggleVisibility = () => { + setIsInnerVisible(!isInnerVisible); + }; + + return ( +
+
+

+ {title} + {subtitle &&
{subtitle}
} +

+ +
+
+
+
+ {inner} +
+
+
+ ); +}; \ No newline at end of file diff --git a/src/components/HomepageFeatures/index.tsx b/src/components/HomepageFeatures/index.tsx index 105148e..5f84770 100644 --- a/src/components/HomepageFeatures/index.tsx +++ b/src/components/HomepageFeatures/index.tsx @@ -3,6 +3,7 @@ import Heading from '@theme/Heading'; import styles from './styles.module.css'; import Crossplatform0Img from '@site/static/img/site/crossplatform_0.png'; import Crossplatform1Img from '@site/static/img/site/crossplatform_1.png'; +import Crossplatform2Img from '@site/static/img/site/crossplatform_2.png'; type FeatureItem = { title: string; @@ -14,7 +15,7 @@ type FeatureItem = { const FeatureList: FeatureItem[] = [ { title: 'What is Geyser?', - image: Crossplatform0Img, + image: Crossplatform2Img, description: ( <> Geyser is a program that allows Minecraft: Bedrock Edition clients to join Minecraft: Java Edition servers, allowing for true crossplay between both editions of the game. The ultimate goal of this project is to allow Minecraft: Bedrock Edition users to join Minecraft: Java Edition servers as seamlessly as possible. @@ -32,6 +33,7 @@ const FeatureList: FeatureItem[] = [ }, { title: 'Join from anywhere', + image: Crossplatform0Img, description: ( <> Geyser can be joined from Bedrock clients on Windows 10/11, iOS, Android, and even consoles (more info here). Geyser works with a wide array of hosting providers, but can also be used as its own standalone proxy to join any Minecraft server! diff --git a/src/components/ProjectDownload.tsx b/src/components/ProjectDownload.tsx index dee20a9..c01128d 100644 --- a/src/components/ProjectDownload.tsx +++ b/src/components/ProjectDownload.tsx @@ -74,7 +74,7 @@ export const ProjectDownload: React.FC = ({ projectId, des

{description}

-

Build #{latestBuild.build} · {new Date(latestBuild.time).toLocaleDateString()}:

+

Build #{latestBuild.build} · {new Date(latestBuild.time).toLocaleDateString()}:

{ setup && @@ -99,7 +99,7 @@ export const ProjectDownload: React.FC = ({ projectId, des
-

Recent Changes:

+

Recent Changes:

    { changes.map((change, i) => { diff --git a/src/components/Questions.tsx b/src/components/Questions.tsx index 48f7124..1182aba 100644 --- a/src/components/Questions.tsx +++ b/src/components/Questions.tsx @@ -22,16 +22,16 @@ export const Q = ({ children }) => { const questionText = children[0]; const answerComponent = React.Children.toArray(children)[1]; - const arrowClass = isAnswerVisible ? 'question-arrow expanded' : 'question-arrow'; + const arrowClass = isAnswerVisible ? 'collapsible-arrow expanded' : 'collapsible-arrow'; return ( -
    setIsAnswerVisible(!isAnswerVisible)}> -
    +
    setIsAnswerVisible(!isAnswerVisible)}> +
    {questionText}
    -
    -
    +
    +
    {answerComponent}
    diff --git a/src/css/custom.css b/src/css/custom.css index 510656e..126f306 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -78,9 +78,54 @@ background-color: var(--ifm-navbar-link-hover-color); } -.answer { - overflow: hidden; - transition: height 0.3s ease-out; +.collapsible-header { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + position: relative; +} + +.collapsible-header h3 { + margin: 0; +} + +.collapsible-header p { + margin-right: 18px; +} + +.collapsible-arrow { + display: inline-block; + width: 10px; + height: 10px; + border-right: 2px solid var(--ifm-color-primary); + border-bottom: 2px solid var(--ifm-color-primary); + transform: rotate(45deg); + transition: transform 0.3s ease; + position: absolute; + right: 0; + top: 50%; + margin-top: -20px; +} + +.collapsible-arrow.expanded { + transform: rotate(225deg); +} + + +.collapsible-line { + border-bottom: 1px solid var(--ifm-horizontal-line-color); + margin-top: -15px; + margin-bottom: 10px; +} + +.collapsible-subtitle { + font-size: 14px; +} + +.collapsible-title { + font-size: 20px; + margin-right: 20px; } .columns { @@ -142,51 +187,25 @@ } } -.question-header { - display: flex; - justify-content: space-between; - align-items: center; - width: 100%; - position: relative; /* Needed for absolute positioning of the arrow */ +.inner { + overflow: hidden; + transition: height 0.3s ease-out; } -.question-header h3 { - margin: 0; -} - -.question-arrow { - display: inline-block; - width: 10px; - height: 10px; - border-right: 2px solid var(--ifm-color-primary); - border-bottom: 2px solid var(--ifm-color-primary); - transform: rotate(45deg); - transition: transform 0.3s ease; - position: absolute; - right: 0; - top: 50%; +.inner-content { + margin-bottom: 20px; margin-top: -20px; } -.question-arrow.expanded { - transform: rotate(225deg); -} - - -.question-line { - border-bottom: 1px solid var(--ifm-horizontal-line-color); - margin-top: -15px; - margin-bottom: 10px; -} - -.question-text { - font-size: 18px; -} - .no-underline { text-decoration: transparent !important; } +.question-text p { + font-size: 18px; + margin-right: 18px; +} + .setup-button { width: 100%; outline: 3px solid var(--ifm-color-secondary); diff --git a/src/pages/download/index.mdx b/src/pages/download/index.mdx index 8010b12..c7ce7a8 100644 --- a/src/pages/download/index.mdx +++ b/src/pages/download/index.mdx @@ -32,6 +32,7 @@ import StandaloneIcon from '@site/static/img/icons/geyser.png'; import { Columns, Column } from '@site/src/components/Columns'; import { ProviderSelector } from '@site/src/components/Provider'; import { ProjectDownload } from '@site/src/components/ProjectDownload'; +import { Collapsibles, Collapsible } from '@site/src/components/Collapsibles'; - - - GeyserConnect, - }} - gridColumns={1} - /> - - - GeyserOptionalPack, - }} - gridColumns={1} - /> - - + + GeyserConnect, + }} + gridColumns={1} + /> + } + /> + GeyserOptionalPack, + }} + gridColumns={1} + /> + } + /> + - \ No newline at end of file + diff --git a/static/img/site/crossplatform_2.png b/static/img/site/crossplatform_2.png new file mode 100644 index 0000000..cef93d9 Binary files /dev/null and b/static/img/site/crossplatform_2.png differ