Skip to content

Commit 2e46e55

Browse files
committed
Gui generator first commit
WIP
1 parent 4f4e20b commit 2e46e55

File tree

11 files changed

+3711
-666
lines changed

11 files changed

+3711
-666
lines changed

components/datapack.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -228,22 +228,6 @@ export default function Datapack({ data, minHeight }: any) {
228228
</Box>
229229
</CardContent>
230230
</Card>
231-
<Card>
232-
<CardContent>
233-
<Typography variant="h3" gutterBottom>{'Téléchargements'}</Typography>
234-
<Box sx={{ mt: 2, display: 'flex', flexWrap: 'wrap', '& > *': { mr: "8px!important" as "8px", mb: "8px!important" as "8px" } }}>
235-
<Typography variant="body1" color="text.secondary">
236-
<CountUp
237-
start={0}
238-
end={downloadNumber}
239-
duration={2.75}
240-
separator=" "
241-
suffix=" downloads"
242-
/>
243-
</Typography>
244-
</Box>
245-
</CardContent>
246-
</Card>
247231
<Card>
248232
<CardContent>
249233
<Typography variant="h3" gutterBottom>{t('datapack.contributors')}</Typography>
@@ -266,13 +250,29 @@ export default function Datapack({ data, minHeight }: any) {
266250
</Box>
267251
</CardContent>
268252
</Card>
253+
{/* <Card>
254+
<CardContent>
255+
<Typography variant="h3" gutterBottom>{'Téléchargements'}</Typography>
256+
<Box sx={{ mt: 2, display: 'flex', flexWrap: 'wrap', '& > *': { mr: "8px!important" as "8px", mb: "8px!important" as "8px" } }}>
257+
<Typography variant="body1" color="text.secondary">
258+
<CountUp
259+
start={0}
260+
end={downloadNumber}
261+
duration={2.75}
262+
separator=" "
263+
suffix=" downloads"
264+
/>
265+
</Typography>
266+
</Box>
267+
</CardContent>
268+
</Card> */}
269269
<Card>
270-
<Box sx={{ display: 'flex', flexWrap: 'wrap', '& > *': { mr: 1 } }}>
270+
<Box sx={{ display: 'flex', flexWrap: 'wrap', '& > *': { mr: 1, mb: 1 } }}>
271271
<a href="https://mtxserv.com/fr/?utm_source=altearn_website&utm_medium=website&utm_campaign=altearn" title="Louez votre serveur haute qualité, profitez pleinement de vos jeux préférés">
272272
<img src="https://mtxserv.com/build/img/banners/serveur_minecraft.png" height="80" alt='MTxServ' />
273273
</a>
274-
<Box sx={{ display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
275-
<p>Merci à notre partenaire <a style={{ textDecoration: 'underline' }} href="https://mtxserv.com/fr/?utm_source=altearn_website&utm_medium=website&utm_campaign=altearn">mTxServ</a> !</p>
274+
<Box sx={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', ml: 1 }}>
275+
<Typography variant="body1" color="text.secondary">Merci à notre partenaire <Link style={{ textDecoration: 'underline' }} href="https://mtxserv.com/fr/?utm_source=altearn_website&utm_medium=website&utm_campaign=altearn">mTxServ</Link> !</Typography>
276276
</Box>
277277
</Box>
278278
</Card>

components/layout.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,29 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
33
import { AppBar, Stack, Toolbar, Typography } from "@mui/material";
44
import { Box } from "@mui/system";
55
import Head from "next/head";
6-
import { useRef } from "react";
6+
import { useEffect, useRef, useState } from "react";
77
import Link from 'next/link'
88
import useTranslation from "next-translate/useTranslation";
99
import useResizeObserver from "@react-hook/resize-observer";
10-
10+
import CountUp, { useCountUp } from "react-countup"
1111

1212
export default function Layout({ children, bg, getHeightViewport }: any) {
1313

1414
const { t, lang } = useTranslation('common')
1515

1616
const NavBar = useRef<HTMLDivElement>(null);
1717
useResizeObserver(NavBar, (entry) => getHeightViewport(`(100vh - ${entry.contentRect.height}px)`));
18+
const countUpRef = useRef(null);
19+
let stupidEnd = Math.floor(Math.random() * 1000)
20+
let [stupidCounter, setStupidCounter] = useState<number>(0);
21+
const [renderClientSideComponent, setRenderClientSideComponent] = useState(false);
22+
23+
// useEffect(() => {
24+
// setInterval(() => {
25+
// if(stupidEnd > stupidCounter) setStupidCounter(stupidCounter+1);
26+
// if(stupidEnd < stupidCounter) setStupidCounter(stupidCounter-1);
27+
// }, 100)
28+
// }, [renderClientSideComponent]);
1829

1930
return (
2031
<>
@@ -26,6 +37,11 @@ export default function Layout({ children, bg, getHeightViewport }: any) {
2637
<Typography variant="h4" noWrap sx={{ flexGrow: 1 }}>
2738
{t('site.name')}
2839
</Typography>
40+
41+
{/* <Typography variant="h3" sx={{ mx: 'auto' }}>
42+
{stupidEnd}
43+
</Typography> */}
44+
<Box sx={{ flexGrow: 1 }} />
2945
<Stack direction="row" spacing={3}>
3046
<Link href="https://discord.gg/E8qq6tN">
3147
<a>

lib/getItemList.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { readFile, writeFileSync } from 'fs'
2+
3+
4+
export async function getItemsList():Promise<Array<string>> {
5+
console.log('2')
6+
7+
return new Promise(resolve => {
8+
console.log('1')
9+
10+
const file = readFile('./public/items.txt', 'utf8', ((err, data) => {
11+
if (!err) {
12+
console.log('returned')
13+
14+
return data.split('\n').slice(1);
15+
} else {
16+
console.log('error')
17+
}
18+
}))
19+
})
20+
}

0 commit comments

Comments
 (0)