All is docusaurus
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
This commit is contained in:
22 files changed
+530
-41
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
|
||||
export const Columns = ({ children }) => {
|
||||
return <div className="columns">{children}</div>;
|
||||
};
|
||||
|
||||
interface ColumnProps {
|
||||
width?: number;
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export const Column: React.FC<ColumnProps> = ({ children, width = 1 }) => {
|
||||
const style = {
|
||||
flex: `${width} 1 0%`,
|
||||
};
|
||||
|
||||
return <div className="column" style={style}>{children}</div>;
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
import { faFileArrowDown } from '@fortawesome/free-solid-svg-icons';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
|
||||
export const APIDownloadButton = ({ projectId, platformId, header }) => {
|
||||
const [buildInfo, setBuildInfo] = useState({ buildNumber: '', versionString: '', date: '' });
|
||||
|
||||
useEffect(() => {
|
||||
const fetchBuildInfo = async () => {
|
||||
try {
|
||||
const response = await fetch(`https://download.geysermc.org/v2/projects/${projectId}/versions/latest/builds/latest`);
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
const data = await response.json();
|
||||
const { build, version } = data;
|
||||
|
||||
const response2 = await fetch(`https://download.geysermc.org/v2/projects/${projectId}/versions/${version}/builds/${build}`);
|
||||
if (!response2.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
const data2 = await response2.json();
|
||||
const { time } = data2;
|
||||
|
||||
const formattedDate = new Date(time).toLocaleDateString();
|
||||
|
||||
setBuildInfo({ buildNumber: build, versionString: version, date: formattedDate });
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch build info:', error);
|
||||
}
|
||||
};
|
||||
|
||||
fetchBuildInfo();
|
||||
}, [projectId]);
|
||||
|
||||
return (
|
||||
<a href={`https://download.geysermc.org/v2/projects/${projectId}/versions/latest/builds/latest/downloads/${platformId}`}>
|
||||
<div className='download-button'>
|
||||
<FontAwesomeIcon icon={faFileArrowDown}/> <b>{header}</b><br/>
|
||||
#{buildInfo.buildNumber} · {buildInfo.date}
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
const HeroBanner = ({ title, subheading, backgroundImage }) => {
|
||||
return (
|
||||
<div
|
||||
className={styles.heroBanner}
|
||||
style={{ backgroundImage: `url(${backgroundImage})` }}
|
||||
>
|
||||
<div className={styles.textSection}>
|
||||
<h1>{title}</h1>
|
||||
<p>{subheading}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default HeroBanner;
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
.heroBanner {
|
||||
width: 100%;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
height: 300px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.textSection {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.textSection::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: var(--ifm-background-color);
|
||||
z-index: -1;
|
||||
transform-origin: top right;
|
||||
transform: skewX(-16deg);
|
||||
overflow: hidden;
|
||||
width: 110%;
|
||||
}
|
||||
|
||||
[data-theme='light'] .textSection::after {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.heroBanner h1 {
|
||||
font-size: 2.5em;
|
||||
}
|
||||
|
||||
.heroBanner p {
|
||||
font-size: 1.2em;
|
||||
line-height: 1em;
|
||||
}
|
||||
Reference in new issue
Block a user