Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main with changes from staging #204

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// cSpell:disable (don't complain about the words we listed here)
"flagWords": ["hte"]
"flagWords": ["hte", "comunity"]
}
9 changes: 9 additions & 0 deletions src/gql/mods/versions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ query GetModVersions($mod: ModID!, $limit: Int!, $offset: Int!) {
hash
size
}
virustotal_results {
created_at
file_name
hash
id
safe
updated_at
version_id
}
}
}
}
9 changes: 9 additions & 0 deletions src/gql/versions/mod_version.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,14 @@ query GetModVersion($version: VersionID!) {
optional
condition
}
virustotal_results {
created_at
file_name
hash
id
safe
updated_at
version_id
}
}
}
2 changes: 1 addition & 1 deletion src/lib/components/general/FicsitCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<div class="logo max-h-full min-h-full min-w-full max-w-full bg-neutral-500" />
{:else}
<img
class="logo absolute max-h-full min-h-full min-w-full max-w-full transition-opacity delay-100 duration-200 ease-linear"
class="logo absolute max-h-full min-h-full min-w-full max-w-full object-contain transition-opacity delay-100 duration-200 ease-linear"
class:invisible={!imageLoaded}
class:opacity-0={!imageLoaded}
src={renderedLogo}
Expand Down
37 changes: 32 additions & 5 deletions src/lib/components/general/TranslationDropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,45 @@

export const { t } = getTranslate();

const languages = {
type language = {
name: string;
flag: string;
style?: string;
};

const defaultFlagTextStyle = 'text-white';

// cspell:disable
const languages: Record<string, language> = {
en: {
name: 'English',
flag: '🇺🇳'
},
de: {
name: 'Deutsch',
flag: '🇩🇪'
flag: '🇩🇪',
style: 'text-black' // Bug in something? text color affects the top stripe of the DE flag
},
es: {
name: 'Español',
flag: '🇪🇸'
},
fr: {
name: 'Français',
flag: '🇫🇷'
},
hu: {
name: 'Magyar',
flag: '🇭🇺'
},
it: {
name: 'Italiano',
flag: '🇮🇹'
},
ko: {
name: '한국어',
flag: '🇰🇷'
},
lv: {
name: 'Latviešu',
flag: '🇱🇻'
Expand All @@ -37,6 +59,10 @@
name: 'Nederlands',
flag: '🇳🇱'
},
'pt-BR': {
name: 'Português (Brasil)',
flag: '🇧🇷'
},
pl: {
name: 'Polski',
flag: '🇵🇱'
Expand All @@ -54,6 +80,7 @@
flag: '🇹🇼'
}
} as const;
// cspell:enable

const lang = writable<string>((browser && localStorage.getItem('language')) || $tolgee.getLanguage());
lang.subscribe((l) => {
Expand All @@ -73,17 +100,17 @@

<button class="variant-ghost-primary btn btn-sm grid grid-flow-col" use:popup={languageMenuBox}>
<span>{languages[$lang].name}</span>
<span class="text-xl">{languages[$lang].flag}</span>
<span class={`text-xl ${languages[$lang]?.style ?? defaultFlagTextStyle}`}>{languages[$lang].flag}</span>
</button>

<div class="card w-48 py-2 shadow-xl" data-popup="languageMenuBox">
<div class="card w-56 overflow-y-auto scroll-smooth py-2 shadow-xl" data-popup="languageMenuBox">
<nav class="list-nav">
<ul>
{#each Object.entries(languages) as [k, v]}
<li class:bg-primary-active-token={$lang === k}>
<button class="w-full" on:click={() => lang.set(k)}>
<span>{v.name}</span>
<span class="text-xl text-white">{v.flag}</span>
<span class="text-xl {v?.style ?? defaultFlagTextStyle}">{v.flag}</span>
</button>
</li>
{/each}
Expand Down
55 changes: 55 additions & 0 deletions src/lib/components/versions/VirustotalResults.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<script lang="ts">
import type { VirustotalResult } from '$lib/generated';
import { getTranslate } from '@tolgee/svelte';

export let results!: Array<VirustotalResult>;
export const { t } = getTranslate();
</script>

<div class="grid grid-flow-row">
<h3 class="my-4 text-2xl font-bold">{$t('virustotal.table.title')}</h3>
<table aria-label={$t('virustotal.table.title')} class="max-w-auto table table-hover !overflow-visible">
<tbody>
<tr class="rounded border !border-surface-500">
<td style="width: 25%;"
><div title={$t('virustotal.table.file_name')}>
{$t('virustotal.table.file_name')}
</div></td>
<td style="width: 25%;"
><div class="text-center" title={$t('virustotal.table.results')}>{$t('virustotal.table.results')}</div></td>
<td style="width: 25%;"
><div class="text-center" title={$t('virustotal.table.safe')}>{$t('virustotal.table.safe')}</div></td>
</tr>
{#each results as result}
<tr class="rounded border !border-surface-500">
<td>
<div>{result.file_name}</div>
</td>
<td>
<div class="text-center">
<a
title={$t('version.virustotal.result')}
href={`https://www.virustotal.com/gui/file/${result.hash}`}
target="_blank"
class="text-white">
<span class="material-icons text-center" style="width: 20px" title={$t('version.virustotal.result')}>
policy
</span>
</a>
</div>
</td>
<td
><div class="text-center">
<span
class="material-icons text-center"
style="width: 20px"
title={result.safe ? $t('version.virustotal.safe') : $t('version.virustotal.not_safe')}>
{result.safe ? 'checkmark' : 'cancel'}
</span>
</div>
</td>
</tr>
{/each}
</tbody>
</table>
</div>
4 changes: 2 additions & 2 deletions src/routes/community/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
<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." />
defaultValue="Welcome to the Satisfactory Modding community! Click here for a guide to help you get started playing with
mods. Currently only available in English." />
</p>
<LinkButton
url="https://docs.ficsit.app/satisfactory-modding/latest/ForUsers/Welcome.html"
Expand Down
4 changes: 4 additions & 0 deletions src/routes/mod/[modId]/version/[versionId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import { getModalStore, getToastStore, type ModalSettings, popup } from '@skeletonlabs/skeleton';
import Page404 from '$lib/components/general/Page404.svelte';
import { getTranslate } from '@tolgee/svelte';
import VirustotalResults from '$lib/components/versions/VirustotalResults.svelte';

export const { t } = getTranslate();

Expand Down Expand Up @@ -164,6 +165,9 @@
<VersionInfo version={$version.data.getVersion} />
<VersionTargetSupportGrid targets={$version.data.getVersion.targets} />
<VersionDependenciesGrid dependencies={$version.data.getVersion.dependencies} />
{#if $version.data.getVersion.virustotal_results.length != 0}
<VirustotalResults results={$version.data.getVersion.virustotal_results} />
{/if}
</div>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/routes/sml-versions/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { redirect } from '@sveltejs/kit';

// SML as a mod migration for 1.0 release
export function load() {
redirect(302, '/mod/SML');
}
8 changes: 8 additions & 0 deletions src/routes/tools/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@

// cspell:ignore SatisGraphtory tehalexf thinkaliker Moritz
const tools: Tool[] = [
{
name: 'Satisfactory Interactive Map',
author: 'DevLeon',
logo: 'https://www.th.gl/satisfactory.jpg',
description:
'Explore Satisfactory 1.0 with this Interactive Map and In-Game App! Minimap, real-Time position tracking, full-text search, custom drawings, and more!',
link: 'https://satisfactory.th.gl/'
},
{
name: 'Satisfactory Calculator Interactive Map (SCIM)',
author: 'Anthor',
Expand Down
Loading