Skip to content

Commit

Permalink
#changes: 2.4 mil
Browse files Browse the repository at this point in the history
  • Loading branch information
LieOnLion committed Nov 18, 2024
1 parent 0e6857d commit 44fd5a7
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
4 changes: 2 additions & 2 deletions public/assets/v1/logo/svg/lieonlion.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Home = () => {
<h4 className='text-2xl font-bold'>Solo Mod Dev</h4>
<h1 className='text-7xl font-bold text-colour-text-500'>LieOnLion</h1>
</div>
<p className='text-xl'>I'm a solo Mod Developer for the game Minecraft. My mods have generated over 2.2 million downloads across a number of platforms.</p>
<p className='text-xl'>I'm a solo Mod Developer for the game Minecraft. My mods have generated over 2.4 million downloads across a number of platforms.</p>
</div>
<div className='flex gap-4 sm:gap-6'>
<Link to='/projects'
Expand Down
82 changes: 41 additions & 41 deletions src/pages/Projects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,50 @@ import Mods from "../data/Mods";
import Headers from "../data/Headers";

const Projects = () => {
return (
<div className='grid justify-center justify-items-center py-8 gap-y-16 max-sm:gap-y-8 grid-cols-auto-fill-80'>
{Mods.map((mod) => {
const [downloads, setDownloads] = useState(0);
const [links, setLinks] = useState({modrinth: '', curseforge: ''});
return (
<div className='grid justify-center justify-items-center py-8 gap-y-16 max-sm:gap-y-8 grid-cols-auto-fill-80'>
{Mods.map((mod) => {
const [downloads, setDownloads] = useState(0);
const [links, setLinks] = useState({modrinth: '', curseforge: ''});

useEffect(() => {
const setInfo = async () => {
const modrinthData = await fetch(`https://api.modrinth.com/v2/project/${mod.modrinthId}`, {method: 'GET', headers: {}}).then(res => res.json()).catch(() => null);
const curseforgeData = (mod.curseforgeId ? await fetch(`https://api.curseforge.com/v1/mods/${mod.curseforgeId}`, {method: 'GET', headers: Headers.curseforge}).then(res => res.json()).catch(() => null) : null);
useEffect(() => {
const setInfo = async () => {
const modrinthData = await fetch(`https://api.modrinth.com/v2/project/${mod.modrinthId}`, {method: 'GET', headers: {}}).then(res => res.json()).catch(() => null);
const curseforgeData = (mod.curseforgeId ? await fetch(`https://api.curseforge.com/v1/mods/${mod.curseforgeId}`, {method: 'GET', headers: Headers.curseforge}).then(res => res.json()).catch(() => null) : null);

setDownloads((modrinthData ? modrinthData.downloads : 0) + (curseforgeData ? curseforgeData.data.downloadCount : 0));
setLinks({modrinth: (modrinthData ? `https://modrinth.com/mod/${modrinthData.slug}` : ''), curseforge: (curseforgeData ? curseforgeData.data.links.websiteUrl : '')})
}; setInfo();
}, []);
setDownloads((modrinthData ? modrinthData.downloads : 0) + (curseforgeData ? curseforgeData.data.downloadCount : 0));
setLinks({modrinth: (modrinthData ? `https://modrinth.com/mod/${modrinthData.slug}` : ''), curseforge: (curseforgeData ? curseforgeData.data.links.websiteUrl : '')})
}; setInfo();
}, []);

return (
<div className='flex flex-col w-80 card items-center gap-4 rounded-3xl border-16 bg-colour-primary-800 text-colour-text-400 border-colour-primary-900' key={mod.id}>
<div className='flex justify-between items-center p-2 w-full border rounded-lg bg-colour-bg-200 bg-opacity-50 border-colour-bg-100'>
<h5 className='font-bold'>{mod.name}</h5>
<div className='flex gap-3'>
{links.modrinth && <a href={links.modrinth}><svg className='w-6 h-6'><use href="/assets/v1/social/svg/round-solid.svg#modrinth"></use></svg></a>}
{links.curseforge && <a href={links.curseforge}><svg className='w-6 h-6'><use href="/assets/v1/social/svg/round-solid.svg#curseforge"></use></svg></a>}
</div>
</div>
<div className='w-40 h-40 bg-cover rounded-xl border-2 border-colour-primary-600' style={{backgroundImage: `url('https://lieonstudios.github.io/assets/v1/logo/png/project/mod/${mod.icon}')`}}></div>
<div className='flex flex-col flex-1 justify-between items-center w-full border rounded-lg bg-colour-bg-200 bg-opacity-50 border-colour-bg-100'>
<div className='flex justify-between items-center p-2 w-full-2 -m-1px border rounded-lg border-colour-bg-100'>
<p className='font-bold'>Minecraft Mod</p>
<Link className='flex gap-1 justify-center items-center uppercase text-xs font-bold'>More<TiChevronRight className='text-sm' /></Link>
</div>
<div className='flex flex-col flex-1 justify-between p-2 w-full-2 -m-1px'>
<p>{mod.summary}</p>
<div className='flex justify-between'>
<p className="text-xl">Downloads:</p>
<h4 className='text-xl font-bold'>{Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 2 }).format(downloads)}</h4>
</div>
</div>
</div>
</div>
);
})}
</div>
);
return (
<div className='flex flex-col w-80 card items-center gap-4 rounded-3xl border-16 bg-colour-primary-800 text-colour-text-400 border-colour-primary-900' key={mod.id}>
<div className='flex justify-between items-center p-2 w-full border rounded-lg bg-colour-bg-200 bg-opacity-50 border-colour-bg-100'>
<h5 className='font-bold'>{mod.name}</h5>
<div className='flex gap-3'>
{links.modrinth && <a href={links.modrinth}><svg className='w-6 h-6'><use href="/assets/v1/social/svg/round-solid.svg#modrinth"></use></svg></a>}
{links.curseforge && <a href={links.curseforge}><svg className='w-6 h-6'><use href="/assets/v1/social/svg/round-solid.svg#curseforge"></use></svg></a>}
</div>
</div>
<div className='w-40 h-40 bg-cover rounded-xl border-2 border-colour-primary-600' style={{backgroundImage: `url('https://lieonstudios.github.io/assets/v1/logo/png/project/mod/${mod.icon}')`}}></div>
<div className='flex flex-col flex-1 justify-between items-center w-full border rounded-lg bg-colour-bg-200 bg-opacity-50 border-colour-bg-100'>
<div className='flex justify-between items-center p-2 w-full-2 -m-1px border rounded-lg border-colour-bg-100'>
<p className='font-bold'>Minecraft Mod</p>
<Link className='flex gap-1 justify-center items-center uppercase text-xs font-bold'>More<TiChevronRight className='text-sm' /></Link>
</div>
<div className='flex flex-col flex-1 justify-between p-2 w-full-2 -m-1px'>
<p>{mod.summary}</p>
<div className='flex justify-between'>
<p className="text-xl">Downloads:</p>
<h4 className='text-xl font-bold'>{Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 2 }).format(downloads)}</h4>
</div>
</div>
</div>
</div>
);
})}
</div>
);
};

export default Projects;

0 comments on commit 44fd5a7

Please sign in to comment.