Skip to content

Commit

Permalink
Improve navigation on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Dec 13, 2022
1 parent ac3ae1c commit 4d77454
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
1 change: 0 additions & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<meta name="apple-mobile-web-app-title" content="Linkie">
<meta name="application-name" content="Linkie">
<meta name="msapplication-TileColor" content="#2a1414">
<meta name="theme-color" content="#333333">

<meta property="og:title" content="Linkie">
<meta property="og:description" content="View mod dependencies; Search up mappings; All on your web browser instead!">
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export default defineComponent({
currentView() {
return routes[this.current || "/"] || NotFound
},
theme() {
return localStorage.getItem("theme")
},
},
mounted() {
let theme = localStorage.getItem("theme")
Expand All @@ -44,14 +47,16 @@ export default defineComponent({
</script>

<template>
<div class="w-screen h-screen overflow-x-hidden">
<Navbar :class="`navbar-${current}`"/>
<meta name="theme-color" :key="theme" :content="theme === 'cupcake' ? '#efeae6' : '#242933'">
<div class="w-screen overflow-x-hidden">
<Navbar class="top-0 fixed z-10" :class="`navbar-${current}`"/>

<Alerts/>
<div class="min-h-full flex flex-col justify-between">
<div class="w-screen min-h-screen flex flex-col justify-between bg-base-200">
<component :is="currentView"/>
<Footer/>
</div>

<Alerts/>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="flex justify-center px-2 py-1 min-h-16 top-0 absolute z-10 w-full backdrop-blur-md">
<div class="flex justify-center px-2 py-1 min-h-16 w-full backdrop-blur-md">
<div class="max-w-[78rem] mx-auto w-full flex justify-between min-h-16">
<div class="flex overflow-x-auto">
<NavbarButton href="/" :bold="true">Linkie</NavbarButton>
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/home/HomeDependencies.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="flex gap-x-4 gap-y-2 flex-wrap">
<div class="p-4 cursor-pointer bg-base-content text-base-100 rounded-lg whitespace-nowrap hover:scale-110 transition-all"
v-for="version in versions.slice(0, 16)" @click="select(version[0], version[1])">{{ version[0] }} {{ version[1] }}</div>
<div class="flex gap-x-4 gap-y-3 flex-wrap">
<a class="px-4 py-2 cursor-pointer border-2 border-base-content font-medium rounded-xl whitespace-nowrap hover:scale-110 transition-all"
v-for="version in versions.slice(0, 16)" :href="select(version[0], version[1])">{{ version[0] }} {{ version[1] }}</a>
</div>
</template>

Expand All @@ -15,8 +15,8 @@ export default defineComponent({
name: "HomeDependencies",
components: {Block},
methods: {
select(loader: string, version: string) {
location.href = `/dependencies?loader=${loader.toLowerCase()}&version=${version}`
select(loader: string, version: string): string {
return `/dependencies?loader=${loader.toLowerCase()}&version=${version}`
},
},
computed: {
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/home/HomeMappings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div class="flex flex-col gap-4">
<div v-for="vers in versions">
<div class="font-bold text-xl mb-2">{{ namespaceLocalizations[vers[0][0]] ?? vers[0][0] }}</div>
<div class="flex gap-x-4 gap-y-2 flex-wrap">
<div class="p-4 cursor-pointer bg-base-content text-base-100 rounded-lg whitespace-nowrap hover:scale-110 transition-all"
v-for="version in vers.slice(0, 16)" @click="select(version[0], version[1])">{{ version[1] }}
</div>
<div class="flex gap-x-4 gap-y-3 flex-wrap">
<a class="px-4 py-2 cursor-pointer border-2 border-base-content font-medium rounded-xl whitespace-nowrap hover:scale-110 transition-all"
v-for="version in vers.slice(0, 16)" :href="select(version[0], version[1])">{{ version[1] }}
</a>
</div>
</div>
</div>
Expand All @@ -27,8 +27,8 @@ export default defineComponent({
}
},
methods: {
select(namespace: string, version: string) {
location.href = `/mappings?namespace=${namespace.toLowerCase()}&version=${version}`
select(namespace: string, version: string): string {
return `/mappings?namespace=${namespace.toLowerCase()}&version=${version}`
},
},
computed: {
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/routes/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ export default defineComponent({
}
</style>
<style>
.navbar-\/ {
background: linear-gradient(135deg, #1f005c, #5b0060, #870160, #ac255e, #ca485c, #e16b5c, #f39060, #ffb56b) fixed;
}
.navbar-\/ {
color: white !important;
}
Expand Down

0 comments on commit 4d77454

Please sign in to comment.