Files
AstralRinth/theseus_gui/src/App.vue
Zach Baird 8169d3ad49 Starts adding search pages to launcher. (#49)
* launcher base gui initial

* Bootstraps router, Omorphia, and prettier.

* Adds pages. Adds Vuex. SideBar nav contains user section and pages section.

* Adds Instance markup. Instances added to Home page.

* Adds News to home page.

* Adds settings to nav. Other touches.

* Polishing initial base GUI.

* Moves some styling to assets. Changes px values to rem.

* Removes pointless border-radius CSS.

* Implements Omorphia vars.

* Adds trending mods section.

* Updates home page.

* Swaps Vuex implementation for Pinia.

* Fixes invalid CSS on instance list item hover.

* Adds @ path resolve for imports.

* First pass on search page.

* Fix some styling of row display

* Cleaning up styles and markup.

* Fixes overall layout issues.

* Cleans up more styling. Modifies AppBar coloring.

* Allows pagination arrows to conditionally appear in RowDisplay.

* Adds paging behavior in RowDisplay.

* Updates nav and settings button styling.

* Brings in Knossos style for trending mods. Polishes News CSS.

* Updates Omorphia. Starts addressing PR comments.

* Addresses some more PR comments.

* Changes side navigation styling. Active route class implemented.

* Combines trending and popular row.

* Makes images more realistic. Adds CTA to instances.

* Converts all instances to card style. Converts more styles to rem.

* Moves Navigation and UserSection into App.vue

* Adds Modrinth favicon.

* Cleans up branch after merge.

* Removes unused styling.

* Adds transition to news card.

* Adds ofetch. Separates stores. More logic moved to instance store. Browse hits API.

* Modifies Browse instance styling. Moves Browse results out of Instance.vue.

* First pass on filtering.

* Points search at prod API.

* Updates Omorphia package. Adds index sorting.

* Fills out search functionality.

* Renames state files. Moves SearchPanel into Browse. Fixes checkbox styling.

* Changes how facets are composed. Dynamically sets loaders and categories.

* Moves search state to searchStore. Cleans up some code.

* Ups h2 font-size. Wraps search panel in Card.

* Cleans up branch after merge. Fixes some Browse styling.

* Search store produces query string. API call made in Browse.

* Changes filter-panel styling.

* Uses client and server icons directly. Removes dead code from search store.

* Clear button disabled on initial state. Accesses store directly, removes some dead code. Fixes search panel styling.

* Generates proj tags in Browse. Removes getter in search store.

* Removes unnecessary code.

* Reworks facet management. Fixes some styling.

* Relabels Tauri calls in tags.js. Attempts to call helper in Browse.

* fixed win10 stack overflow

* cargo fmt

* Makes computed value. Gets tags from Tauri. Overrides Omorphia style. Fixes dropdown width.

---------

Co-authored-by: Jai A <jaiagr+gpg@pm.me>
Co-authored-by: CodexAdrian <83074853+CodexAdrian@users.noreply.github.com>
Co-authored-by: Wyatt Verchere <wverchere@gmail.com>
2023-04-05 07:18:04 -07:00

310 lines
6.1 KiB
Vue

<script setup>
import { watch } from 'vue'
import { RouterView, useRoute, useRouter, RouterLink } from 'vue-router'
import {
ChevronLeftIcon,
ChevronRightIcon,
SearchIcon,
BookIcon,
ClientIcon,
PlusIcon,
SettingsIcon,
Avatar,
} from 'omorphia'
import { useTheming } from '@/store/state'
import { toggleTheme } from '@/helpers/theme'
const route = useRoute()
const router = useRouter()
const themeStore = useTheming()
toggleTheme(themeStore.darkTheme)
watch(themeStore, (newState) => {
toggleTheme(newState.darkTheme)
})
</script>
<template>
<div class="container">
<div class="nav-container">
<div class="nav-section">
<Avatar size="sm" src="https://cdn.modrinth.com/data/AANobbMI/icon.png" />
<div class="pages-list">
<RouterLink to="/" class="button-base nav-button"><ClientIcon /></RouterLink>
<RouterLink to="/browse" class="button-base nav-button"> <SearchIcon /></RouterLink>
<RouterLink to="/library" class="button-base nav-button"> <BookIcon /></RouterLink>
<button color="primary" class="button-base primary nav-button" icon-only>
<PlusIcon />
</button>
</div>
</div>
<div class="settings pages-list">
<RouterLink to="/settings" class="button-base nav-button"><SettingsIcon /></RouterLink>
</div>
</div>
<div class="view">
<div class="appbar">
<section class="navigation-controls">
<ChevronLeftIcon @click="router.back()" />
<ChevronRightIcon @click="router.forward()" />
<p>{{ route.name }}</p>
</section>
<section class="mod-stats">
<p>Updating 2 mods...</p>
<p>123 mods installed</p>
</section>
</div>
<div class="router-view">
<Suspense>
<RouterView />
</Suspense>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.container {
height: 100vh;
display: flex;
flex-direction: row;
overflow: hidden;
.router-view {
width: 100%;
height: calc(100% - 2rem);
overflow: auto;
overflow-x: hidden;
margin-top: 2rem;
}
.view {
margin-left: 5rem;
width: calc(100% - 5rem);
height: calc(100%);
.appbar {
position: absolute;
display: flex;
justify-content: space-between;
align-items: center;
height: 2rem;
width: calc(100% - 5rem);
border-bottom: 1px solid rgba(64, 67, 74, 0.2);
background: var(--color-button-bg);
text-align: center;
.navigation-controls {
display: inherit;
align-items: inherit;
justify-content: stretch;
width: 30%;
font-size: 0.9rem;
svg {
width: 18px;
transition: all ease-in-out 0.1s;
&:hover {
filter: brightness(150%);
}
}
p {
margin-left: 0.3rem;
}
svg {
margin: auto 0.1rem;
transition: all ease-in-out 0.1s;
cursor: pointer;
&:hover {
font-weight: bolder;
}
}
}
.mod-stats {
display: inherit;
align-items: inherit;
justify-content: flex-end;
width: 50%;
font-size: 0.8rem;
margin-right: 1rem;
p:nth-child(1) {
margin-right: 0.55rem;
}
}
}
}
}
.nav-container {
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
height: 100%;
box-shadow: var(--shadow-inset-sm), var(--shadow-floating);
padding: 1rem;
}
.dark-mode {
.nav-container {
background: var(--color-bg);
}
}
.pages-list {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
width: 100%;
gap: 0.5rem;
a {
display: flex;
align-items: center;
font-size: 0.9rem;
font-weight: 400;
word-spacing: 3px;
background: inherit;
transition: all ease-in-out 0.1s;
color: var(--color-base);
&.router-link-active {
color: var(--color-accent-contrast);
background: var(--color-button-bg);
}
&:hover {
background-color: var(--color-button-bg);
color: var(--color-contrast);
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
text-decoration: none;
}
}
}
.nav-button {
height: 3rem;
width: 3rem;
padding: 0.75rem;
border-radius: var(--radius-md);
svg {
width: 1.5rem;
height: 1.5rem;
max-width: 1.5rem;
max-height: 1.5rem;
}
&.primary {
color: var(--color-accent-contrast);
background-color: var(--color-brand);
}
}
.dark-mode {
.pages-list {
a.router-link-active {
color: #fff;
}
}
}
.instance-list {
display: flex;
flex-direction: column;
justify-content: center;
width: 70%;
margin: 0.4rem;
p:nth-child(1) {
font-size: 0.6rem;
}
& > p {
color: var(--color-base);
margin: 0.8rem 0;
font-size: 0.7rem;
line-height: 0.8125rem;
font-weight: 500;
text-transform: uppercase;
}
}
.add-instance-btn {
background-color: var(--color-bg);
font-size: 0.9rem;
margin-right: 0.6rem;
svg {
background-color: var(--color-green);
width: 1.5rem;
height: 1.5rem;
color: var(--color-accent-contrast);
border-radius: var(--radius-xs);
}
}
.settings {
a {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
gap: 1rem;
&:hover {
text-decoration: none;
}
}
}
.user-section {
display: flex;
justify-content: flex-start;
align-items: center;
width: 100%;
height: 4.375rem;
section {
display: flex;
flex-direction: column;
justify-content: flex-start;
text-align: left;
margin-left: 0.5rem;
}
.username {
margin-bottom: 0.3rem;
font-size: 1.1rem;
font-weight: 400;
line-height: 1.25rem;
color: var(--color-contrast);
}
a {
font-size: 0.75rem;
font-weight: 400;
color: var(--color-secondary);
}
}
.nav-section {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
width: 100%;
height: 100%;
gap: 1rem;
}
</style>