Add navbar
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 39 KiB |
BIN
public/gwaa_logo.png
Normal file
BIN
public/gwaa_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
13
src/App.vue
13
src/App.vue
@@ -1,5 +1,14 @@
|
|||||||
<script setup>
|
<script>
|
||||||
|
import { defineComponent } from "vue";
|
||||||
import { RouterView } from "vue-router";
|
import { RouterView } from "vue-router";
|
||||||
|
|
||||||
|
import NavBar from "@/components/NavBar.vue";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
components: {
|
||||||
|
NavBar,
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -8,6 +17,8 @@ import { RouterView } from "vue-router";
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<NavBar />
|
||||||
|
|
||||||
<RouterView />
|
<RouterView />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#app {
|
.mw-60 {
|
||||||
max-width: 60rem;
|
max-width: 60rem;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
@@ -8,8 +8,11 @@
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.block {
|
||||||
display: block;
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
22
src/components/GeneratorName.vue
Normal file
22
src/components/GeneratorName.vue
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<script>
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
|
||||||
|
import settingsDisplay from "@/data/settings-display.yaml";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
generator: "",
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
display() {
|
||||||
|
return settingsDisplay.randomizer_generator[this.generator];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<span v-if="display">
|
||||||
|
{{ display }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
@@ -109,7 +109,7 @@ export default defineComponent({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<img class="center" src="/bludormspinbig.gif" />
|
<img class="block center" src="/bludormspinbig.gif" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
99
src/components/NavBar.vue
Normal file
99
src/components/NavBar.vue
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
<script>
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import { Collapse } from "bootstrap";
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
navbar: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
this.navbar = Collapse.getOrCreateInstance(this.$refs.navbar, {toggle: false});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
collapse() {
|
||||||
|
this.navbar.hide();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<nav class="navbar navbar-expand-sm bg-dark-subtle pt-1 px-2">
|
||||||
|
<div class="container-fluid px-1">
|
||||||
|
<a class="navbar-brand ps-1 py-0 me-2">
|
||||||
|
<img class="brand-logo" src="/gwaa_logo.png" />
|
||||||
|
</a>
|
||||||
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle Navigation">
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<div id="navbar" class="collapse navbar-collapse" ref="navbar">
|
||||||
|
<ul class="navbar-nav center">
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
Seed
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<router-link to="/generate" class="dropdown-item" @click="collapse">
|
||||||
|
Base Randomizer
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<router-link to="/generate/beta" class="dropdown-item" @click="collapse">
|
||||||
|
Beta Randomizer
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<router-link to="/generate/apr2025" class="dropdown-item" @click="collapse">
|
||||||
|
April 2025 Randomizer
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
Multiworld
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<router-link to="/multiworld" class="dropdown-item" @click="collapse">
|
||||||
|
Base Randomizer
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<router-link to="/multiworld/beta" class="dropdown-item" @click="collapse">
|
||||||
|
Beta Randomizer
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
Mystery
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<router-link to="/mystery" class="dropdown-item" @click="collapse">
|
||||||
|
Base Randomizer
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<router-link to="/mystery/beta" class="dropdown-item" @click="collapse">
|
||||||
|
Beta Randomizer
|
||||||
|
</router-link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.brand-logo {
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -291,7 +291,7 @@ export default defineComponent({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<img class="center" src="/bludormspinbig.gif" />
|
<img class="block center" src="/bludormspinbig.gif" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="patch && spoiler && show_spoiler" class="mw-60">
|
<div v-if="patch && spoiler && show_spoiler" class="mw-60">
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ export default defineComponent({
|
|||||||
this.selected = newValue;
|
this.selected = newValue;
|
||||||
await this.updateLocalForage();
|
await this.updateLocalForage();
|
||||||
},
|
},
|
||||||
|
async generator(newValue, oldValue) {
|
||||||
|
await this.loadSaved(true);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
settings() {
|
settings() {
|
||||||
@@ -47,17 +50,7 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this.$refs.tips?.forEach(el => new Tooltip(el));
|
this.$refs.tips?.forEach(el => new Tooltip(el));
|
||||||
if (this.settings) {
|
await this.loadSaved(false);
|
||||||
const saved = await localforage.getItem(`${this.prefix}setting_${this.name}`) ?? this.settings.default;
|
|
||||||
if (this.modelValue) {
|
|
||||||
this.selected = this.modelValue;
|
|
||||||
} else if (this.settings.values[saved]) {
|
|
||||||
this.selected = saved;
|
|
||||||
} else {
|
|
||||||
this.selected = this.settings.default;
|
|
||||||
}
|
|
||||||
this.change();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async change() {
|
async change() {
|
||||||
@@ -67,6 +60,19 @@ export default defineComponent({
|
|||||||
async updateLocalForage() {
|
async updateLocalForage() {
|
||||||
await localforage.setItem(`${this.prefix}setting_${this.name}`, this.selected);
|
await localforage.setItem(`${this.prefix}setting_${this.name}`, this.selected);
|
||||||
},
|
},
|
||||||
|
async loadSaved(override) {
|
||||||
|
if (this.settings) {
|
||||||
|
const saved = await localforage.getItem(`${this.prefix}setting_${this.name}`) ?? this.settings.default;
|
||||||
|
if (this.modelValue && !override) {
|
||||||
|
this.selected = this.modelValue;
|
||||||
|
} else if (this.settings.values[saved]) {
|
||||||
|
this.selected = saved;
|
||||||
|
} else {
|
||||||
|
this.selected = this.settings.default;
|
||||||
|
}
|
||||||
|
this.change();
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -53,7 +53,19 @@ export default defineComponent({
|
|||||||
this.$emit("update:modelValue", this.set);
|
this.$emit("update:modelValue", this.set);
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
|
},
|
||||||
|
async generator(newValue, oldValue) {
|
||||||
|
for (const setting of Object.keys(this.set)) {
|
||||||
|
if (setting == "player_name") {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(setting in this.settings)) {
|
||||||
|
delete this.set[setting];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$refs.preset.settingChanged(this.set);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(usePresetStore, ["fetchLocalPresets"]),
|
...mapActions(usePresetStore, ["fetchLocalPresets"]),
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
randomizer_generator:
|
||||||
|
beta: Beta Randomizer
|
||||||
|
apr2025: April 2025 Special Randomizer
|
||||||
|
pikit: Special Pikit Randomizer
|
||||||
randomizer:
|
randomizer:
|
||||||
apr2025: April 2025 Special Randomizer
|
apr2025: April 2025 Special Randomizer
|
||||||
pikit: Special Pikit Randomizer
|
pikit: Special Pikit Randomizer
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ import { defineComponent } from "vue";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
import SettingPicker from "@/components/SettingPicker.vue";
|
import SettingPicker from "@/components/SettingPicker.vue";
|
||||||
|
import GeneratorName from "@/components/GeneratorName.vue";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
SettingPicker,
|
SettingPicker,
|
||||||
|
GeneratorName,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -41,9 +43,11 @@ export default defineComponent({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<div class="mw-60">
|
||||||
<div class="card content-div m-3">
|
<div class="card content-div m-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
Generate Seed
|
Generate Seed
|
||||||
|
<GeneratorName generator="apr2025" class="float-right" />
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
@@ -77,4 +81,5 @@ export default defineComponent({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ import localforage from "localforage";
|
|||||||
import { Tab } from "bootstrap";
|
import { Tab } from "bootstrap";
|
||||||
|
|
||||||
import SettingsPage from "@/components/SettingsPage.vue";
|
import SettingsPage from "@/components/SettingsPage.vue";
|
||||||
|
import GeneratorName from "@/components/GeneratorName.vue";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
SettingsPage,
|
SettingsPage,
|
||||||
|
GeneratorName,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
prefix: null,
|
prefix: null,
|
||||||
@@ -24,14 +26,25 @@ export default defineComponent({
|
|||||||
async mounted() {
|
async mounted() {
|
||||||
document.title = "ALttPR Multiworld"
|
document.title = "ALttPR Multiworld"
|
||||||
|
|
||||||
await new Promise(r => setTimeout(r, 100));
|
|
||||||
|
|
||||||
for (var i = 0; i < this.worldCount; i++) {
|
for (var i = 0; i < this.worldCount; i++) {
|
||||||
this.worlds[i].player_name = await localforage.getItem(`${this.prefix}world_${i + 1}_setting_player_name`);
|
|
||||||
new Tab(this.$refs.tabs[i]);
|
new Tab(this.$refs.tabs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await new Promise(r => setTimeout(r, 100));
|
||||||
|
|
||||||
|
await this.loadPlayerNames();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
async generator(oldValue, newValue) {
|
||||||
|
await this.loadPlayerNames();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async loadPlayerNames() {
|
||||||
|
for (var i = 0; i < this.worldCount; i++) {
|
||||||
|
this.worlds[i].player_name = await localforage.getItem(`${this.prefix}world_${i + 1}_setting_player_name`);
|
||||||
|
}
|
||||||
|
},
|
||||||
async addWorld() {
|
async addWorld() {
|
||||||
const newname = await localforage.getItem(`${this.prefix}world_${this.worldCount + 1}_setting_player_name`);
|
const newname = await localforage.getItem(`${this.prefix}world_${this.worldCount + 1}_setting_player_name`);
|
||||||
this.worlds.push({player_name: newname});
|
this.worlds.push({player_name: newname});
|
||||||
@@ -82,9 +95,11 @@ export default defineComponent({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<div class="mw-60">
|
||||||
<div class="card content-div m-3">
|
<div class="card content-div m-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
Generate Multiworld
|
Generate Multiworld
|
||||||
|
<GeneratorName :generator="generator" class="float-right" />
|
||||||
</div>
|
</div>
|
||||||
<ul class="nav nav-tabs ps-3 pt-3 pe-3">
|
<ul class="nav nav-tabs ps-3 pt-3 pe-3">
|
||||||
<li v-for="(n, idx) in worldCount" class="nav-item" role="presentation">
|
<li v-for="(n, idx) in worldCount" class="nav-item" role="presentation">
|
||||||
@@ -138,6 +153,7 @@ export default defineComponent({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -10,9 +10,12 @@ import generatorSettings from "@/data/generator-settings.yaml";
|
|||||||
|
|
||||||
import VueMarkdown from "vue-markdown-render";
|
import VueMarkdown from "vue-markdown-render";
|
||||||
|
|
||||||
|
import GeneratorName from "@/components/GeneratorName.vue";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
VueMarkdown,
|
VueMarkdown,
|
||||||
|
GeneratorName,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
prefix: null,
|
prefix: null,
|
||||||
@@ -135,11 +138,12 @@ export default defineComponent({
|
|||||||
<div class="card content-div m-3">
|
<div class="card content-div m-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
Generate Mystery Seed
|
Generate Mystery Seed
|
||||||
|
<GeneratorName :generator="generator" class="float-right" />
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
Upload Mystery YAML:
|
Upload Mystery YAML:
|
||||||
<a class="example-yaml-link" href="/sample_mystery.yaml">(example)</a>
|
<a class="float-right" href="/sample_mystery.yaml">(example)</a>
|
||||||
<div class="input-group mt-2 mb-2">
|
<div class="input-group mt-2 mb-2">
|
||||||
<input id="yaml-input" class="form-control" type="file" accept=".yaml,.yml" @change="uploadYaml($event.target.files[0], true)" />
|
<input id="yaml-input" class="form-control" type="file" accept=".yaml,.yml" @change="uploadYaml($event.target.files[0], true)" />
|
||||||
</div>
|
</div>
|
||||||
@@ -164,11 +168,3 @@ export default defineComponent({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
|
||||||
.example-yaml-link {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
padding-right: var(--bs-list-group-item-padding-x);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ import axios from "axios";
|
|||||||
import { Modal } from "bootstrap";
|
import { Modal } from "bootstrap";
|
||||||
|
|
||||||
import SettingsPage from "@/components/SettingsPage.vue";
|
import SettingsPage from "@/components/SettingsPage.vue";
|
||||||
|
import GeneratorName from "@/components/GeneratorName.vue";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
SettingsPage,
|
SettingsPage,
|
||||||
|
GeneratorName,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
prefix: null,
|
prefix: null,
|
||||||
@@ -45,9 +47,11 @@ export default defineComponent({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<div class="mw-60">
|
||||||
<div class="card content-div m-3">
|
<div class="card content-div m-3">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
Generate Seed
|
Generate Seed
|
||||||
|
<GeneratorName :generator="generator" class="float-right" />
|
||||||
</div>
|
</div>
|
||||||
<div id="settings" class="accordion accordion-flush">
|
<div id="settings" class="accordion accordion-flush">
|
||||||
<SettingsPage v-model="set" :generator="generator" :prefix="prefix" />
|
<SettingsPage v-model="set" :generator="generator" :prefix="prefix" />
|
||||||
@@ -65,4 +69,5 @@ export default defineComponent({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user