Skip to content

Commit 230252e

Browse files
budak7273knightzac19lmachens
authored
Update main with changes from staging (#204)
* 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 <computerguy440+gh@gmail.com> * 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 <knightzac19@users.noreply.github.com> Co-authored-by: DevLeon <leon@machens.koeln>
1 parent 0fe6243 commit 230252e

File tree

10 files changed

+127
-9
lines changed

10 files changed

+127
-9
lines changed

cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
// flagWords - list of words to be always considered incorrect
2626
// This is useful for offensive words and common spelling errors.
2727
// cSpell:disable (don't complain about the words we listed here)
28-
"flagWords": ["hte"]
28+
"flagWords": ["hte", "comunity"]
2929
}

src/gql/mods/versions.graphql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ query GetModVersions($mod: ModID!, $limit: Int!, $offset: Int!) {
1919
hash
2020
size
2121
}
22+
virustotal_results {
23+
created_at
24+
file_name
25+
hash
26+
id
27+
safe
28+
updated_at
29+
version_id
30+
}
2231
}
2332
}
2433
}

src/gql/versions/mod_version.graphql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,14 @@ query GetModVersion($version: VersionID!) {
3131
optional
3232
condition
3333
}
34+
virustotal_results {
35+
created_at
36+
file_name
37+
hash
38+
id
39+
safe
40+
updated_at
41+
version_id
42+
}
3443
}
3544
}

src/lib/components/general/FicsitCard.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<div class="logo max-h-full min-h-full min-w-full max-w-full bg-neutral-500" />
8888
{:else}
8989
<img
90-
class="logo absolute max-h-full min-h-full min-w-full max-w-full transition-opacity delay-100 duration-200 ease-linear"
90+
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"
9191
class:invisible={!imageLoaded}
9292
class:opacity-0={!imageLoaded}
9393
src={renderedLogo}

src/lib/components/general/TranslationDropdown.svelte

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,45 @@
88
99
export const { t } = getTranslate();
1010
11-
const languages = {
11+
type language = {
12+
name: string;
13+
flag: string;
14+
style?: string;
15+
};
16+
17+
const defaultFlagTextStyle = 'text-white';
18+
19+
// cspell:disable
20+
const languages: Record<string, language> = {
1221
en: {
1322
name: 'English',
1423
flag: '🇺🇳'
1524
},
1625
de: {
1726
name: 'Deutsch',
18-
flag: '🇩🇪'
27+
flag: '🇩🇪',
28+
style: 'text-black' // Bug in something? text color affects the top stripe of the DE flag
29+
},
30+
es: {
31+
name: 'Español',
32+
flag: '🇪🇸'
1933
},
2034
fr: {
2135
name: 'Français',
2236
flag: '🇫🇷'
2337
},
38+
hu: {
39+
name: 'Magyar',
40+
flag: '🇭🇺'
41+
},
2442
it: {
2543
name: 'Italiano',
2644
flag: '🇮🇹'
2745
},
46+
ko: {
47+
name: '한국어',
48+
flag: '🇰🇷'
49+
},
2850
lv: {
2951
name: 'Latviešu',
3052
flag: '🇱🇻'
@@ -37,6 +59,10 @@
3759
name: 'Nederlands',
3860
flag: '🇳🇱'
3961
},
62+
'pt-BR': {
63+
name: 'Português (Brasil)',
64+
flag: '🇧🇷'
65+
},
4066
pl: {
4167
name: 'Polski',
4268
flag: '🇵🇱'
@@ -54,6 +80,7 @@
5480
flag: '🇹🇼'
5581
}
5682
} as const;
83+
// cspell:enable
5784
5885
const lang = writable<string>((browser && localStorage.getItem('language')) || $tolgee.getLanguage());
5986
lang.subscribe((l) => {
@@ -73,17 +100,17 @@
73100

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

79-
<div class="card w-48 py-2 shadow-xl" data-popup="languageMenuBox">
106+
<div class="card w-56 overflow-y-auto scroll-smooth py-2 shadow-xl" data-popup="languageMenuBox">
80107
<nav class="list-nav">
81108
<ul>
82109
{#each Object.entries(languages) as [k, v]}
83110
<li class:bg-primary-active-token={$lang === k}>
84111
<button class="w-full" on:click={() => lang.set(k)}>
85112
<span>{v.name}</span>
86-
<span class="text-xl text-white">{v.flag}</span>
113+
<span class="text-xl {v?.style ?? defaultFlagTextStyle}">{v.flag}</span>
87114
</button>
88115
</li>
89116
{/each}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<script lang="ts">
2+
import type { VirustotalResult } from '$lib/generated';
3+
import { getTranslate } from '@tolgee/svelte';
4+
5+
export let results!: Array<VirustotalResult>;
6+
export const { t } = getTranslate();
7+
</script>
8+
9+
<div class="grid grid-flow-row">
10+
<h3 class="my-4 text-2xl font-bold">{$t('virustotal.table.title')}</h3>
11+
<table aria-label={$t('virustotal.table.title')} class="max-w-auto table table-hover !overflow-visible">
12+
<tbody>
13+
<tr class="rounded border !border-surface-500">
14+
<td style="width: 25%;"
15+
><div title={$t('virustotal.table.file_name')}>
16+
{$t('virustotal.table.file_name')}
17+
</div></td>
18+
<td style="width: 25%;"
19+
><div class="text-center" title={$t('virustotal.table.results')}>{$t('virustotal.table.results')}</div></td>
20+
<td style="width: 25%;"
21+
><div class="text-center" title={$t('virustotal.table.safe')}>{$t('virustotal.table.safe')}</div></td>
22+
</tr>
23+
{#each results as result}
24+
<tr class="rounded border !border-surface-500">
25+
<td>
26+
<div>{result.file_name}</div>
27+
</td>
28+
<td>
29+
<div class="text-center">
30+
<a
31+
title={$t('version.virustotal.result')}
32+
href={`https://www.virustotal.com/gui/file/${result.hash}`}
33+
target="_blank"
34+
class="text-white">
35+
<span class="material-icons text-center" style="width: 20px" title={$t('version.virustotal.result')}>
36+
policy
37+
</span>
38+
</a>
39+
</div>
40+
</td>
41+
<td
42+
><div class="text-center">
43+
<span
44+
class="material-icons text-center"
45+
style="width: 20px"
46+
title={result.safe ? $t('version.virustotal.safe') : $t('version.virustotal.not_safe')}>
47+
{result.safe ? 'checkmark' : 'cancel'}
48+
</span>
49+
</div>
50+
</td>
51+
</tr>
52+
{/each}
53+
</tbody>
54+
</table>
55+
</div>

src/routes/community/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
<p>
5656
<T
5757
keyName="community.welcome.description"
58-
defaultValue="Welcome to the Satisfactory Modding comunity! Click here for a guide to help you get started playing with
59-
mods." />
58+
defaultValue="Welcome to the Satisfactory Modding community! Click here for a guide to help you get started playing with
59+
mods. Currently only available in English." />
6060
</p>
6161
<LinkButton
6262
url="https://docs.ficsit.app/satisfactory-modding/latest/ForUsers/Welcome.html"

src/routes/mod/[modId]/version/[versionId]/+page.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import { getModalStore, getToastStore, type ModalSettings, popup } from '@skeletonlabs/skeleton';
1717
import Page404 from '$lib/components/general/Page404.svelte';
1818
import { getTranslate } from '@tolgee/svelte';
19+
import VirustotalResults from '$lib/components/versions/VirustotalResults.svelte';
1920
2021
export const { t } = getTranslate();
2122
@@ -164,6 +165,9 @@
164165
<VersionInfo version={$version.data.getVersion} />
165166
<VersionTargetSupportGrid targets={$version.data.getVersion.targets} />
166167
<VersionDependenciesGrid dependencies={$version.data.getVersion.dependencies} />
168+
{#if $version.data.getVersion.virustotal_results.length != 0}
169+
<VirustotalResults results={$version.data.getVersion.virustotal_results} />
170+
{/if}
167171
</div>
168172
</div>
169173
</div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { redirect } from '@sveltejs/kit';
2+
3+
// SML as a mod migration for 1.0 release
4+
export function load() {
5+
redirect(302, '/mod/SML');
6+
}

src/routes/tools/+page.svelte

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
66
// cspell:ignore SatisGraphtory tehalexf thinkaliker Moritz
77
const tools: Tool[] = [
8+
{
9+
name: 'Satisfactory Interactive Map',
10+
author: 'DevLeon',
11+
logo: 'https://www.th.gl/satisfactory.jpg',
12+
description:
13+
'Explore Satisfactory 1.0 with this Interactive Map and In-Game App! Minimap, real-Time position tracking, full-text search, custom drawings, and more!',
14+
link: 'https://satisfactory.th.gl/'
15+
},
816
{
917
name: 'Satisfactory Calculator Interactive Map (SCIM)',
1018
author: 'Anthor',

0 commit comments

Comments
 (0)