Skip to content

Commit c4fb039

Browse files
committed
feat: improve layout shifting
1 parent c71ad23 commit c4fb039

3 files changed

Lines changed: 22 additions & 19 deletions

File tree

src/components/general/CommonIssues.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function extractID(input: string): string {
2626
<template>
2727
<div class="mx-auto my-12 max-w-240 flex flex-col gap-4 px-4">
2828
<template v-for="issue in FreesmIssues" :key="issue.Name">
29-
<a :id="extractID(issue.Name)" :href="`#${extractID(issue.Name)}`" class="select-text text-xl text-white font-semibold before:absolute before:left-0 sm:text-3xl before:text-gray-300 before:opacity-0 before:content-['#'] hover:before:opacity-100 before:transition-[opacity]">
29+
<a :id="extractID(issue.Name)" :href="`#${extractID(issue.Name)}`" class="select-text text-xl text-white font-semibold before:absolute before:left-0 sm:text-3xl before:text-gray-300 before:opacity-0 before:transition-[opacity] before:content-['#'] hover:before:opacity-100">
3030
{{ translations?.Messages?.[issue.Name] }}
3131
</a>
3232
<div
@@ -39,6 +39,9 @@ function extractID(input: string): string {
3939
:key="image.Text"
4040
:src="image.Link"
4141
:alt="image.Text"
42+
:style="{
43+
aspectRatio: image.Ratio,
44+
}"
4245
class-names="h-full object-cover rounded-md cursor-zoom-in !transition-[opacity,filter] hover:brightness-70"
4346
/>
4447
</div>

src/constants/application.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,19 @@ export const FallbackLauncherData: GithubReleasesType = {
7272
export const FreesmIssues: Array<{
7373
"Name" : TranslationsKeyType;
7474
"Images": Array<{
75-
"Link": string;
76-
"Text": string;
75+
"Link" : string;
76+
"Text" : string;
77+
"Ratio": number;
7778
}>;
7879
"Description": TranslationsKeyType;
7980
}> = [
8081
{
8182
"Name" : "pages.faq.issues.long-launch.title",
8283
"Images": [
8384
{
84-
"Link": "/issues/freesm-long-launch.webp",
85-
"Text": "Long instance launch problem",
85+
"Link" : "/issues/freesm-long-launch.webp",
86+
"Text" : "Long instance launch problem",
87+
"Ratio": 1009 / 626,
8688
},
8789
],
8890
"Description": "pages.faq.issues.long-launch.description",
@@ -91,8 +93,9 @@ export const FreesmIssues: Array<{
9193
"Name" : "pages.faq.issues.no-versions-available.title",
9294
"Images": [
9395
{
94-
"Link": "/issues/freesm-no-available-versions.webp",
95-
"Text": "No available versions problem",
96+
"Link" : "/issues/freesm-no-available-versions.webp",
97+
"Text" : "No available versions problem",
98+
"Ratio": 1211 / 561,
9699
},
97100
],
98101
"Description": "pages.faq.issues.no-versions-available.description",
@@ -101,8 +104,9 @@ export const FreesmIssues: Array<{
101104
"Name" : "pages.faq.issues.portable-zip.title",
102105
"Images": [
103106
{
104-
"Link": "/issues/freesm-java-checker.webp",
105-
"Text": "Java checker problem",
107+
"Link" : "/issues/freesm-java-checker.webp",
108+
"Text" : "Java checker problem",
109+
"Ratio": 667 / 539,
106110
},
107111
],
108112
"Description": "pages.faq.issues.portable-zip.description",
@@ -121,8 +125,9 @@ export const FreesmIssues: Array<{
121125
"Name" : "pages.faq.issues.microsoft-invalid-login.title",
122126
"Images": [
123127
{
124-
"Link": "/issues/freesm-not-entitled.webp",
125-
"Text": "Not entitled account problem",
128+
"Link" : "/issues/freesm-not-entitled.webp",
129+
"Text" : "Not entitled account problem",
130+
"Ratio": 537 / 196,
126131
},
127132
],
128133
"Description": "pages.faq.issues.microsoft-invalid-login.description",
@@ -132,14 +137,9 @@ export const FreesmIssues: Array<{
132137
"Images" : [],
133138
"Description": "pages.faq.issues.no-languages.description",
134139
},
135-
{
136-
"Name" : "pages.faq.issues.cat-pack-quality.title",
137-
"Images" : [],
138-
"Description": "pages.faq.issues.cat-pack-quality.description",
139-
},
140140
{
141141
"Name" : "pages.faq.issues.other.title",
142142
"Images" : [],
143143
"Description": "pages.faq.issues.other.description",
144144
},
145-
];
145+
];

src/locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"pages.faq.issues.portable-zip.title": "'Java checker could not be found. Please check your installation'",
4646
"pages.faq.issues.portable-zip.description": "You probably downloaded a portable version of the launcher and didn't unzip/unarchive it.",
4747
"pages.faq.issues.optifine.title": "How to install OptiFine without a mod loader?",
48-
"pages.faq.issues.optifine.description": "<a class='text-sm underline' target='_blank' href='https://www.reddit.com/r/Optifine/comments/jekh7u/comment/ipjqm5o/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button'>Original</a>\n\nExample for 1.8.9:\n* Go into <span class='bg-catppuccin-800 text-sm p-2 rounded-md'>\\FreesmLauncher\\libraries\\com\\mojang\\minecraft\\1.8.9\\</span><span class='select-none'> </span>and copy the minecraft jar file\n* Make a new folder directory <span class='bg-catppuccin-800 text-sm p-2 rounded-md'>%appdata%\\.minecraft\\versions\\1.8.9\\</span><span class='select-none'> </span>and paste the jar in there\n* Then rename the jar you just pasted to 1.8.9.jar\n* Try extracting it and put the extracted file into <span class='bg-catppuccin-800 text-sm p-2 rounded-md'>\\FreesmLauncher\\libraries\\com\\mojang\\minecraft\\1.8.9\\</span>\n",
48+
"pages.faq.issues.optifine.description": "<a class='text-sm underline' target='_blank' href='https://www.reddit.com/r/Optifine/comments/jekh7u/comment/ipjqm5o/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button'>Original</a>\n\nExample for 1.8.9:\n* Go into <span class='bg-catppuccin-800 text-sm p-2 rounded-md'>\\FreesmLauncher\\libraries\\com\\mojang\\minecraft\\1.8.9\\</span><span class='select-none'> </span>and copy the minecraft jar file\n* Make a new folder directory <span class='bg-catppuccin-800 text-sm p-2 rounded-md'>%appdata%\\.minecraft\\versions\\1.8.9\\</span><span class='select-none'> </span>and paste the jar in there\n* Then rename the jar you just pasted to 1.8.9.jar\n* Try installing OptiFine and put the extracted file into <span class='bg-catppuccin-800 text-sm p-2 rounded-md'>\\FreesmLauncher\\libraries\\com\\mojang\\minecraft\\1.8.9\\</span>\n",
4949
"pages.faq.issues.skins.title": "How to set a skin?",
5050
"pages.faq.issues.skins.description": "Try using an <a class='underline' target='_blank' href='https://ely.by/'>Ely.by</a> skins system, or install a mod that allows you to change in-game skins.",
5151
"pages.faq.issues.microsoft-invalid-login.title": "'status': 'NOT_ENTITLED'",
@@ -113,4 +113,4 @@
113113
"users.kaeeraa": "kaeeraa",
114114
"users.so5iso4ka": "so5iso4ka"
115115
}
116-
}
116+
}

0 commit comments

Comments
 (0)