Skip to content

Commit

Permalink
Merge pull request #12 from Fabulously-Optimized/new-pages
Browse files Browse the repository at this point in the history
New pages
  • Loading branch information
Madis0 authored Feb 18, 2024
2 parents 165a07f + cb8b70b commit 33f3e25
Show file tree
Hide file tree
Showing 13 changed files with 681 additions and 4 deletions.
3 changes: 3 additions & 0 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ console.log(languageOptionFilter.value);
<NuxtLink to="/github" :external="true" class="side__link"
>GitHub</NuxtLink
>
<NuxtLink to="/thanks" class="side__link">{{
$t("navbar.links.thanks")
}}</NuxtLink>
<NuxtLink to="/wiki" :external="true" class="side__link">{{
$t("navbar.links.wiki")
}}</NuxtLink>
Expand Down
41 changes: 40 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"navbar.links.home": "Home",
"navbar.links.wiki": "Wiki",
"navbar.links.thanks": "Support us",
"navbar.action.language": "Help us Translate!",
"footer.header.contribute": "Contribute",
"footer.header.discuss": "Discuss",
Expand Down Expand Up @@ -41,5 +42,43 @@
"feature.open-development.desc": "Fabulously Optimized [is open-source][9], and so are most of its mods. We welcome user suggestions and collaborate with mod developers to create a better user experience for everyone.",
"feature.open-development.btn": "View Contributors",
"feature.helpful-community.title": "Helpful community",
"feature.helpful-community.desc": "We have a growing community of friendly members who enjoy discussing the pack, [translating its content][10], and helping each other. [Join us today!][11]"
"feature.helpful-community.desc": "We have a growing community of friendly members who enjoy discussing the pack, [translating its content][10], and helping each other. [Join us today!][11]",
"content.vanilla.title": "Download for Minecraft Launcher",
"content.vanilla.title.installer": "Automatic installer",
"content.vanilla.title.manual": "Manual ZIP-archive",
"content.vanilla.button.windows": "Installer for Windows",
"content.vanilla.button.macos": "Installer for macOS",
"content.vanilla.button.linux": "Installer for Linux",
"content.vanilla.button.linuxManual": "Installer for Linux (tar.gz)",
"content.vanilla.button.howto": "How to install",
"content.vanilla.button.disclaimer.important": "Important:",
"content.vanilla.button.disclaimer.text": "Please allow popups and multiple downloads when asked - sometimes mods must be downloaded separately and placed to the mods folder manually.",
"content.thanks.title": "Give thanks to Fabulously Optimized",
"content.thanks.supportMessage": "So you like the modpack and want to support it? Thank you!",
"content.thanks.modsTitle": "The mods",
"content.thanks.modsDescription": "While Fabulously Optimized itself does not take direct donations, there are many mods in it that do. Here's a list of mods that take donations, click to redirect to the donation page.",
"content.thanks.modsLink": "What do each of the mods do?",
"content.thanks.modsAutomaticListFetch": "Modders: this list is automatically fetched from Modrinth for the latest stable version of the modpack. All you have to do is add a donation link to your project!",
"content.thanks.modpackTitle": "The modpack",
"content.thanks.modpackSupportWays": "There are also several ways you can support the modpack:",
"content.thanks.modpackLaunchersTitle": "▶️ Play using the",
"content.thanks.modpackLaunchersCurseforge": "CurseForge App",
"content.thanks.modpackLaunchersOr": "or",
"content.thanks.modpackLaunchersModrinth": "Modrinth App",
"content.thanks.modpackLaunchersMoneyInfo": "Using either of these launchers gives the pack and mod devs money, other launchers currently do not.",
"content.thanks.modpackLaunchersInstallInstructions": "How to install?",
"content.thanks.modpackAltToHeartTitle": "❤️ Heart and comment on AlternativeTo",
"content.thanks.modpackAltToHeartSignupInfo": "Please sign up before doing it, otherwise it will not count ☹️",
"content.thanks.modpackFreeCapeTitle": "🦸 Get a free FO cape",
"content.thanks.modpackAdBlockerTitle": "🛑 Disable ad blocker on Modrinth",
"content.thanks.modpackAdBlockerAnd": "and",
"content.thanks.modpackAdBlockerCheckOutProjects": "check out my other projects",
"content.thanks.modpackMinecraftServer": "🗄️ Create a Minecraft server (25% off first month!)",
"content.thanks.modpackShare": "🔗 Tell your friends to download.fo by sharing the link!",
"content.thanks.contributeTitle": "Contribute",
"content.thanks.contributeAdditionalSupportMessage": "And if you'd like to do even more, you can always test, write and translate!",
"content.thanks.contributeTestModsTitle": "🧪 Test mods that are planned to be included",
"content.thanks.contributeTranslateTitle": "🌐 Translate the modpack and mods",
"content.thanks.contributeWikiTitle": "📝 Contribute to the wiki",
"content.thanks.contributeProgrammingTitle": "🧑‍💻 Help with programming things"
}
134 changes: 134 additions & 0 deletions pages/thanks.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import {
Button,
DownloadIcon,
ClientIcon,
UsersIcon,
ChartIcon,
LightBulbIcon,
VersionIcon,
PaintBrushIcon,
renderHighlightedString,
UpdatedIcon,
DiscordIcon,
} from "omorphia";
// Define projectDetails as a reactive reference
const projectDetails = ref([]);
// Fetches the latest release version of the project
async function fetchProjectVersions() {
const response = await fetch(`https://api.modrinth.com/v2/project/1KVo5zza/version?featured=true`);
const versions = await response.json();
return versions.find(version => version.version_type === "release");
}
// Fetches project details based on project IDs
async function fetchProjectDetails(projectIds) {
const response = await fetch(`https://api.modrinth.com/v2/projects?ids=[${projectIds.map(id => `"${id}"`).join(',')}]`);
return response.json();
}
// Displays projects by fetching their versions and details, then sorting and filtering them
async function displayProjects() {
const version = await fetchProjectVersions();
if (!version || !version.dependencies) return; // Exit if no version or dependencies found
const projectIds = version.dependencies.map(dep => dep.project_id).filter(id => id);
let projects = await fetchProjectDetails(projectIds);
projects = projects
.filter(project => project.donation_urls && project.donation_urls.length > 0) // Filter projects with at least one donation link
.sort((a, b) => a.title.localeCompare(b.title)); // Sort projects by title
// Transform project details for rendering
projectDetails.value = projects.map(project => ({
iconUrl: project.icon_url,
title: project.title,
donationUrls: project.donation_urls
}));
}
// Use onMounted to ensure displayProjects is called after the component is mounted
onMounted(() => {
displayProjects().catch(console.error);
});
</script>

<template>
<h1>{{ $t("content.thanks.title") }}</h1>
<p>{{ $t("content.thanks.supportMessage") }}</p>

<h2>{{ $t("content.thanks.modsTitle") }}</h2>
<p>{{ $t("content.thanks.modsDescription") }}</p>
<ul id="projects">
<li v-for="project in projectDetails" :key="project.title">
<img v-if="project.iconUrl" :src="project.iconUrl" :alt="`${project.title} icon`" />
<a v-if="project.donationUrls.length === 1" :href="project.donationUrls[0].url" target="_blank">
{{ project.title }}
</a>
<span v-else>
{{ project.title }}:
<a v-for="(donation, index) in project.donationUrls" :key="index" :href="donation.url" target="_blank">{{ donation.platform }}</a>
</span>
</li>
</ul>
<p><a href="https://download.fo/mods">{{ $t("content.thanks.modsLink") }}</a></p>
<p>{{ $t("content.thanks.modsAutomaticListFetch") }}</p>

<h2>{{ $t("content.thanks.modpackTitle") }}</h2>
<p>{{ $t("content.thanks.modpackSupportWays") }}</p>

<ul>
<li>
<strong>{{ $t("content.thanks.modpackLaunchersTitle") }} <a href="https://download.fo/curseforge">{{ $t("content.thanks.modpackLaunchersCurseforge") }}</a> {{ $t("content.thanks.modpackLaunchersOr") }} <a href="https://download.fo/modrinth">{{ $t("content.thanks.modpackLaunchersModrinth") }}</a></strong>
<ul>
<li>{{ $t("content.thanks.modpackLaunchersMoneyInfo") }}</li>
<li><a href="https://download.fo/install">{{ $t("content.thanks.modpackLaunchersInstallInstructions") }}</a></li>
</ul>
</li>
<li>
<strong><a href="https://download.fo/rate">{{ $t("content.thanks.modpackAltToHeartTitle") }}</a></strong>
<ul>
<li>{{ $t("content.thanks.modpackAltToHeartSignupInfo") }}</li>
</ul>
</li>
<li>
<strong><a href="https://wiki.download.fo/readme/free-cape">{{ $t("content.thanks.modpackFreeCapeTitle") }}</a></strong>
</li>
<li>
<strong><a href="https://docs.modrinth.com/docs/details/ads/#browser-extensions">{{ $t("content.thanks.modpackAdBlockerTitle") }}</a> {{ $t("content.thanks.modpackAdBlockerAnd") }} <a href="https://modrinth.com/user/robotkoer">{{ $t("content.thanks.modpackAdBlockerCheckOutProjects") }}</a></strong>
</li>
<li>
<strong><a href="https://download.fo/host">{{ $t("content.thanks.modpackMinecraftServer") }}</a></strong>
</li>
<li>
<strong><a href="https://download.fo">{{ $t("content.thanks.modpackShare") }}</a></strong>
</li>
</ul>

<h2>{{ $t("content.thanks.contributeTitle") }}</h2>
<p>{{ $t("content.thanks.contributeAdditionalSupportMessage") }}</p>
<ul>
<li>
<strong><a href="https://github.com/Fabulously-Optimized/fabulously-optimized/issues?q=is%3Aissue+is%3Aopen+label%3A%22feedback%2Ftesters+wanted%22">{{ $t("content.thanks.contributeTestModsTitle") }}</a></strong>
</li>
<li>
<strong><a href="https://download.fo/translate">{{ $t("content.thanks.contributeTranslateTitle") }}</a></strong>
</li>
<li>
<strong><a href="https://github.com/Fabulously-Optimized/wiki/issues">{{ $t("content.thanks.contributeWikiTitle") }}</a></strong>
</li>
<li>
<strong><a href="https://github.com/Fabulously-Optimized/fabulously-optimized/labels/help%20wanted">{{ $t("content.thanks.contributeProgrammingTitle") }}</a></strong>
</li>
</ul>
</template>


<style>
body { font-family: BlinkMacSystemFont,-apple-system,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Helvetica,Arial,sans-serif; }
li img { width: 1em; height: 1em; margin-right: 0.5em; }
a { color: blue; text-decoration: none; }
a:hover { text-decoration: underline; }
</style>
72 changes: 72 additions & 0 deletions pages/vanilla.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<script setup lang="ts">
import {
Button,
DownloadIcon,
ClientIcon,
UsersIcon,
ChartIcon,
LightBulbIcon,
VersionIcon,
PaintBrushIcon,
renderHighlightedString,
UpdatedIcon,
DiscordIcon,
} from "omorphia";
</script>
<script lang="ts">
export default {
methods: {
todo() {
alert("Soon!");
},
updateIframeUrl() {
const iframe = document.getElementById('vanilla-embed') as HTMLIFrameElement;
if (!iframe) return; // Exit if the iframe is not found
const currentSearchParams = new URLSearchParams(window.location.search);
const iframeUrl = new URL(iframe.src, window.location.origin);
currentSearchParams.forEach((value, key) => {
iframeUrl.searchParams.set(key, value); // Append or overwrite existing search parameters
});
iframe.src = iframeUrl.toString(); // Update the iframe src with new parameters
}
}
}
</script>


<template>
<h1 id="title">{{ $t("content.vanilla.title") }}</h1>
<!--
<h2>{{ $t("content.vanilla.title.installer") }}</h2>
<Button color="green" @click="todo">
<DownloadIcon />{{ $t("content.vanilla.button.windows") }}
</Button>
<Button color="gray" @click="todo">
<DownloadIcon />{{ $t("content.vanilla.button.macos") }}
</Button>
<Button color="gray" @click="todo">
<DownloadIcon />{{ $t("content.vanilla.button.linux") }}
</Button>
<Button color="gray" @click="todo">
<DownloadIcon />{{ $t("content.vanilla.button.linuxManual") }}
</Button>
<h2>{{ $t("content.vanilla.title.manual") }}</h2>
-->
<div class="iframe-container">
<iframe id="vanilla-embed" src="./vanilla.html" frameborder="0" width="50%" height="100em"></iframe>
</div>
<br>
<Button color="blue" @click="navigateTo(`https://wiki.download.fo/readme/install-instructions#minecraft-launcher-vanilla`, { external: true })">
<DownloadIcon />{{ $t("content.vanilla.button.howto") }}
</Button>
<p><b>{{ $t("content.vanilla.button.disclaimer.important") }}</b> {{ $t("content.vanilla.button.disclaimer.text") }}</p>
</template>


<style>
.iframe-container {
align-self: center;
}
</style>
1 change: 1 addition & 0 deletions public/assets/css/bulma.css.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/assets/css/bulma.min.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions public/assets/js/FileSaver.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 33f3e25

Please sign in to comment.