Skip to content

Commit

Permalink
feat: Community page, friendlier home page, help page (#195)
Browse files Browse the repository at this point in the history
* feat: add link to welcome guide on help page

* fix: help page on mobile

* feat: wip community page replaces forums in sidebar

* feat: link button component, unban form link, layout work

* feat: translated community page

* feat: remove confusing "featured mods" section from homepage

* feat: fake buttons on homepage to convey section clickablity

* chore: cleanup comment

* feat: add AnswerOverflow entry to community page

* feat: improved homepage styles from feedback on discord
  • Loading branch information
budak7273 authored Oct 9, 2024
1 parent a8a80fa commit f5023f6
Show file tree
Hide file tree
Showing 5 changed files with 155 additions and 34 deletions.
10 changes: 10 additions & 0 deletions src/lib/components/general/LinkButton.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
export let url: string;
export let icon: string;
export let extraCss = '';
</script>

<a href={url} target="_blank" rel="noopener" class={`variant-ghost-primary btn btn-sm ${extraCss}`}>
<span><slot>Unset button text!</slot></span>
<span class="material-icons">{icon}</span>
</a>
13 changes: 6 additions & 7 deletions src/lib/components/general/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,20 @@
},
{
url: 'https://discord.ficsit.app',
icon: 'people',
icon: 'forum',
label: $t('discord'),
external: true
},
{
url: '/community',
icon: 'people',
label: $t('sidebar.community', 'Community')
},
{
url: 'https://docs.ficsit.app/',
icon: 'find_in_page',
label: $t('sidebar.docs'),
external: true
},
{
url: 'https://forums.ficsit.app/',
icon: 'forum',
label: $t('sidebar.forums'),
external: true
}
];
Expand Down
45 changes: 20 additions & 25 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<script lang="ts">
import MetaDescriptors from '$lib/components/utils/MetaDescriptors.svelte';
import FicsitCard from '$lib/components/general/FicsitCard.svelte';
import ModCard from '$lib/components/mods/ModCard.svelte';
import Doggo from '$lib/components/general/Doggo.svelte';
import { assets } from '$app/paths';
import { onMobile, easterEgg, doggoNeedsPats } from '$lib/stores/global';
import type { PageData } from './$types';
import { getTranslate } from '@tolgee/svelte';
import { getTranslate, T } from '@tolgee/svelte';
export let data: PageData;
$: ({ mods } = data);
export const { t } = getTranslate();
const gridClasses = '3xl:grid-cols-4 lg:grid-cols-2 grid-cols-1';
</script>

<svelte:head>
Expand All @@ -24,7 +20,7 @@
<Doggo dogVisible={doggoNeedsPats} />

<div class="flex min-h-full flex-col" style="height: calc(100vh - 64px - 3rem)">
<div class="mb-4 min-h-[25vh] overflow-hidden">
<div class="mb-4 min-h-[35vh] overflow-hidden">
{#if !$onMobile}
<a href="https://smm.ficsit.app" rel="noopener" target="_blank">
<div class="card h-full">
Expand All @@ -44,7 +40,13 @@
{#if $easterEgg || $doggoNeedsPats}{' - Doggo'}{/if}
</div>
<div class="flex h-1/3 justify-center 2xl:h-1/2">
<img class="h-full" src={assets + '/images/smm_icon_white.webp'} alt="Satisfactory Mod Manager" />
<div class="variant-ringed-primary variant-glass-surface btn btn-lg m-6 text-3xl">
<span
><T
keyName="home.download-satisfactory-mod-manager"
defaultValue="Download the Mod Manager" /></span>
<img class="h-full" src={assets + '/images/smm_icon_white.webp'} alt="Satisfactory Mod Manager" />
</div>
</div>
</div>
{#if $easterEgg}
Expand Down Expand Up @@ -97,8 +99,12 @@
<div class="card h-full">
<div class="relative h-full w-full">
<div class="modding-banner banner" />
<div class="absolute top-0 flex h-full w-full items-center justify-center">
<div class="absolute top-0 flex h-full w-full flex-col items-center justify-center">
<img class="centered-logo" src={assets + '/images/sf_modding_logo.webp'} alt="Satisfactory Modding Logo" />
<div class="variant-ringed-secondary variant-glass-secondary btn btn-md m-6">
<span><T keyName="home.banner.join-discord" defaultValue="Join the Modding Discord" /></span>
<span class="material-icons">people</span>
</div>
</div>
<div class="absolute bottom-0 w-full px-4 pb-4 text-center text-neutral-400 xl:text-left">
<span>{$t('home.banner.community-run-discord')}</span>
Expand All @@ -110,11 +116,16 @@
<div class="card h-full">
<div class="relative h-full w-full">
<div class="css-banner banner" />
<div class="absolute top-0 flex h-full w-full items-center justify-center">
<div class="absolute top-0 flex h-full w-full flex-col items-center justify-center">
<img
class="centered-logo"
src={assets + '/images/satisfactory_logo_full_color_small.webp'}
alt="Satisfactory Logo" />
<div class="variant-ringed-surface variant-glass-surface btn btn-md m-6">
<span
><T keyName="home.banner.open-official-website" defaultValue="Visit the Satisfactory Website" /></span>
<span class="material-icons">launch</span>
</div>
</div>
<div class="absolute bottom-0 w-full px-4 pb-4 text-center text-neutral-300 xl:text-right">
<span>{$t('home.banner.official-website')}</span>
Expand All @@ -123,22 +134,6 @@
</div>
</a>
</div>

{#if $mods.fetching}
<div class="grid {gridClasses} gap-4">
{#each Array(4) as _}
<FicsitCard fake />
{/each}
</div>
{:else if $mods.error}
<p>{$t('error.oh-no')} {$mods.error.message}</p>
{:else}
<div class="grid {gridClasses} gap-4">
{#each $mods.data.getMods.mods as mod}
<ModCard {mod} />
{/each}
</div>
{/if}
</div>

<style lang="postcss">
Expand Down
103 changes: 103 additions & 0 deletions src/routes/community/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<script lang="ts">
import LinkButton from '$lib/components/general/LinkButton.svelte';
import MetaDescriptors from '$lib/components/utils/MetaDescriptors.svelte';
import { T } from '@tolgee/svelte';
</script>

<svelte:head>
<title>Community - SMR</title>
<MetaDescriptors
description="Information and links to get connected with the Satisfactory Mod Repository community"
title="Community" />
</svelte:head>

<div>
<div class="grid grid-flow-col grid-cols-1 grid-rows-2 gap-4 md:grid-cols-2 md:grid-rows-1">
<div class="card p-4">
<div
class="grid grid-flow-col grid-cols-1 grid-rows-2 justify-items-center gap-4 2xl:grid-cols-2 2xl:grid-rows-1">
<div>
<h2><T keyName="community.discord.header" defaultValue="Modding Community Discord" /></h2>
<p>
<T
keyName="community.discord.description"
defaultValue="The Satisfactory Modding Discord server is the primary place for modding discussion and support. Click the
button below to join the server." />
</p>
<LinkButton url="https://discord.ficsit.app/" icon="people">
<T keyName="community.discord.join-button" defaultValue="Join the Discord" />
</LinkButton>
<h2><T keyName="community.discord-bans.header" defaultValue="Ban Appeals" /></h2>
<p>
<T
keyName="community.discord-bans.description"
defaultValue="If you have been banned from the modding Discord server and would like to appeal, use the
form linked below. Note that our bans are separate from the official Satisfactory Discord - we can't assist you with bans there." />
</p>
<LinkButton url="https://dyno.gg/form/b3425ef2" icon="how_to_vote">
<T keyName="community.discord-bans.appeal-button" defaultValue="Submit an Appeal" />
</LinkButton>
</div>
<iframe
src="https://discord.com/widget?id=555424930502541343&theme=dark"
width="350"
height="500"
allowtransparency={true}
frameborder="0"
title="Discord Widget"
sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>
</div>
</div>

<div class="card p-4">
<section class="p-4">
<h1><T keyName="community.welcome.header" defaultValue="Welcome" /></h1>
<p>
<T
keyName="community.welcome.description"
defaultValue="Welcome to the Satisfactory Modding comunity! Click here for a guide to help you get started playing with
mods." />
</p>
<LinkButton
url="https://docs.ficsit.app/satisfactory-modding/latest/ForUsers/Welcome.html"
icon="waving_hand"
extraCss="text-2xl">
<T keyName="community.welcome.guide-button" defaultValue="Visit the Welcome Guide" />
</LinkButton>
<h2><T keyName="community.answer-overflow.header" defaultValue="Answer Overflow" /></h2>
<p>
<T
keyName="community.answer-overflow.description"
defaultValue="Certain channels in the Discord are indexed via Answer Overflow. This means search engines like Google can search their posts and you can read them without being a Discord member. You can also directly view these posts from the Answer Overflow site." />
</p>
<LinkButton url="https://www.answeroverflow.com/c/555424930502541343/1243688087578738770" icon="search">
<T keyName="community.answer-overflow.visit-button" defaultValue="Browse Answer Overflow" />
</LinkButton>
<h2><T keyName="community.forums.header" defaultValue="Archived Forums" /></h2>
<p>
<T
keyName="community.forums.description"
defaultValue="The community used to host a Discourse-powered forums website for modding discussion, but it has since been
archived due to low usage. You can find the archives here." />
</p>
<LinkButton url="https://forums.ficsit.app/" icon="forum">
<T keyName="community.forums.visit-button" defaultValue="View the Archived Forums" />
</LinkButton>
</section>
</div>
</div>
</div>

<style lang="postcss">
p {
@apply my-5 text-base;
}
h1 {
@apply my-4 text-4xl font-bold;
}
h2 {
@apply my-4 text-3xl font-bold;
}
</style>
18 changes: 16 additions & 2 deletions src/routes/help/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,25 @@ This line is way far down

<svelte:head>
<title>Help - SMR</title>
<MetaDescriptors description="Help for submitting modules to the Satsifactory Mod Repository" title="Help" />
<MetaDescriptors description="Help using the Satisfactory Mod Repository" title="Help" />
</svelte:head>

<div>
<div class="grid grid-flow-col grid-cols-2 gap-4">
<h1 class="my-4 text-4xl font-bold">Get Help Using Mods</h1>
<div class="card p-4">
<section class="p-4">
<button
class="variant-ghost-primary btn btn-sm text-2xl"
on:click={() =>
(window.location.href = 'https://docs.ficsit.app/satisfactory-modding/latest/ForUsers/Welcome.html')}>
<span>Visit the Welcome Guide</span>
<span class="material-icons">waving_hand</span>
</button>
</section>
</div>

<h1 class="my-4 text-4xl font-bold">Mod Developer Resources</h1>
<div class="grid grid-flow-row grid-cols-1 grid-rows-2 gap-4 md:grid-cols-2 md:grid-rows-1">
<div class="card p-4">
<section class="p-4">
<h3 class="my-4 text-2xl font-bold">&lt;mod&gt;.uplugin format</h3>
Expand Down

0 comments on commit f5023f6

Please sign in to comment.