Skip to content

Commit

Permalink
Update main with changes from staging (#204)
Browse files Browse the repository at this point in the history
* feat: add more languages, fix DE flag discoloration, sml-versions redirect (#200)

* fix: language flag icons showing with incorrect colors
(ex. germany white instead of black)

* feat: add es, hu, ko, pt-BR, to language picker. widen dropdown, setup overflow scrolling

* fix: typo

* feat: redirect old /sml-versions page to /mod/SML

* Add virustotal results to version screen (#192)

* feat: added virustotal results to versions screen

* fix: remove canedit from vt results

* fix: update to virustotal_results

* fix: move thead to tbody/make text translatable

---------

Co-authored-by: Rob B <[email protected]>

* feat: add Satisfactory Interactive Map th.gl tool link (#211)

* Add Satisfactory Interactive Maps by TH.GL

* Contain images with different aspect ratio

* Prettify

---------

Co-authored-by: Zachary Knight <[email protected]>
Co-authored-by: DevLeon <[email protected]>
  • Loading branch information
3 people authored Jan 7, 2025
1 parent 0fe6243 commit 230252e
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 9 deletions.
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

0 comments on commit 230252e

Please sign in to comment.