mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 12:52:19 +01:00
Update veutify and use v-virtual-scroll
This commit is contained in:
@@ -17,9 +17,9 @@ HIGH_PRIO_STRUCTURE_PATH: str = f"{LIBRARY_BASE_PATH}/roms"
|
||||
|
||||
# DEFAULT RESOURCES
|
||||
DEFAULT_URL_COVER_L: str = "https://images.igdb.com/igdb/image/upload/t_cover_big/nocover.png"
|
||||
DEFAULT_PATH_COVER_L: str = f"default/default/cover/big.png"
|
||||
DEFAULT_PATH_COVER_L: str = "default/default/cover/big.png"
|
||||
DEFAULT_URL_COVER_S: str = "https://images.igdb.com/igdb/image/upload/t_cover_small/nocover.png"
|
||||
DEFAULT_PATH_COVER_S: str = f"default/default/cover/small.png"
|
||||
DEFAULT_PATH_COVER_S: str = "default/default/cover/small.png"
|
||||
|
||||
# IGDB
|
||||
CLIENT_ID: str = os.environ.get('CLIENT_ID')
|
||||
|
||||
12
frontend/package-lock.json
generated
12
frontend/package-lock.json
generated
@@ -21,7 +21,7 @@
|
||||
"socket.io-client": "^4.6.1",
|
||||
"vue": "^3.2.13",
|
||||
"vue-router": "^4.0.0",
|
||||
"vuetify": "^3.1.15",
|
||||
"vuetify": "^3.3.3",
|
||||
"webfontloader": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -6171,9 +6171,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vuetify": {
|
||||
"version": "3.1.15",
|
||||
"resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.1.15.tgz",
|
||||
"integrity": "sha512-uxB4UCrP+hFyJaoSsVObAGBRD73qq5ga7HULepzGoMeUWap2H99mcqmMdN/a/Yp4ODK3gT8EcUeph3EgEcsArQ==",
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/vuetify/-/vuetify-3.3.3.tgz",
|
||||
"integrity": "sha512-oLpm6L6Zvf4b7Ua8V3INnUkGoxbi04O68ymEbBDLrPFzmIkzAcwd9L/2Ega582PRJnjTBBZapa6KdmosvhVvgA==",
|
||||
"engines": {
|
||||
"node": "^12.20 || >=14.13"
|
||||
},
|
||||
@@ -6182,12 +6182,16 @@
|
||||
"url": "https://github.com/sponsors/johnleider"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.7",
|
||||
"vite-plugin-vuetify": "^1.0.0-alpha.12",
|
||||
"vue": "^3.2.0",
|
||||
"vue-i18n": "^9.0.0",
|
||||
"webpack-plugin-vuetify": "^2.0.0-alpha.11"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
},
|
||||
"vite-plugin-vuetify": {
|
||||
"optional": true
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"socket.io-client": "^4.6.1",
|
||||
"vue": "^3.2.13",
|
||||
"vue-router": "^4.0.0",
|
||||
"vuetify": "^3.1.15",
|
||||
"vuetify": "^3.3.3",
|
||||
"webfontloader": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
// Components
|
||||
import App from './App.vue'
|
||||
import { createApp } from "vue";
|
||||
import { registerPlugins } from "@/plugins";
|
||||
|
||||
// Composables
|
||||
import { createApp } from 'vue'
|
||||
|
||||
// Plugins
|
||||
import { registerPlugins } from '@/plugins'
|
||||
import App from "./App.vue";
|
||||
|
||||
// Event bus
|
||||
import mitt from 'mitt'
|
||||
const emitter = mitt()
|
||||
import mitt from "mitt";
|
||||
const emitter = mitt();
|
||||
|
||||
const app = createApp(App)
|
||||
const app = createApp(App);
|
||||
|
||||
registerPlugins(app)
|
||||
registerPlugins(app);
|
||||
|
||||
app.provide('emitter', emitter);
|
||||
app.mount('#app')
|
||||
app.provide("emitter", emitter);
|
||||
app.mount("#app");
|
||||
|
||||
@@ -1,7 +1,36 @@
|
||||
export const views = {
|
||||
0:{'view': 'small', 'icon': 'mdi-view-module', 'size-lg': 1, 'size-md': 2, 'size-sm': 2, 'size-xs': 3, 'size-cols': 4},
|
||||
1:{'view': 'big', 'icon': 'mdi-view-list', 'size-lg': 2, 'size-md': 3, 'size-sm': 3, 'size-xs': 6, 'size-cols': 6},
|
||||
2:{'view': 'list', 'icon': 'mdi-view-comfy', 'size-lg': 12, 'size-md': 12, 'size-sm': 12, 'size-xs': 12, 'size-cols': 12}
|
||||
}
|
||||
0: {
|
||||
view: "small",
|
||||
icon: "mdi-view-comfy",
|
||||
"size-lg": 1,
|
||||
"size-md": 2,
|
||||
"size-sm": 2,
|
||||
"size-xs": 3,
|
||||
"size-cols": 4,
|
||||
},
|
||||
1: {
|
||||
view: "big",
|
||||
icon: "mdi-view-module",
|
||||
"size-lg": 2,
|
||||
"size-md": 3,
|
||||
"size-sm": 3,
|
||||
"size-xs": 6,
|
||||
"size-cols": 6,
|
||||
},
|
||||
2: {
|
||||
view: "list",
|
||||
icon: "mdi-view-list",
|
||||
"size-lg": 12,
|
||||
"size-md": 12,
|
||||
"size-sm": 12,
|
||||
"size-xs": 12,
|
||||
"size-cols": 12,
|
||||
},
|
||||
};
|
||||
|
||||
export function normalizeString(s) { return s.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g,"") }
|
||||
export function normalizeString(s) {
|
||||
return s
|
||||
.toLowerCase()
|
||||
.normalize("NFD")
|
||||
.replace(/[\u0300-\u036f]/g, "");
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ onBeforeRouteUpdate(async (to, _) => {
|
||||
</v-app-bar>
|
||||
|
||||
<template v-if="filteredRoms.length > 0 || gettingRoms">
|
||||
<v-row v-show="galleryView.value != 2" id="card-view" no-gutters>
|
||||
<v-row v-show="galleryView.value != 2" no-gutters>
|
||||
<v-col v-for="rom in filteredRoms" class="pa-1" :key="rom.id" :cols="views[galleryView.value]['size-cols']"
|
||||
:xs="views[galleryView.value]['size-xs']" :sm="views[galleryView.value]['size-sm']"
|
||||
:md="views[galleryView.value]['size-md']" :lg="views[galleryView.value]['size-lg']">
|
||||
@@ -134,7 +134,7 @@ onBeforeRouteUpdate(async (to, _) => {
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row v-show="galleryView.value == 2" id="list-view" no-gutters>
|
||||
<v-row v-show="galleryView.value == 2" no-gutters>
|
||||
<v-col :cols="views[galleryView.value]['size-cols']" :xs="views[galleryView.value]['size-xs']"
|
||||
:sm="views[galleryView.value]['size-sm']" :md="views[galleryView.value]['size-md']"
|
||||
:lg="views[galleryView.value]['size-lg']">
|
||||
@@ -142,7 +142,13 @@ onBeforeRouteUpdate(async (to, _) => {
|
||||
<game-list-header />
|
||||
<v-divider class="border-opacity-100 mb-4 ml-2 mr-2" color="rommAccent1" :thickness="1" />
|
||||
<tbody>
|
||||
<game-list-item v-for="rom in filteredRoms" :key="rom.id" :rom="rom" />
|
||||
<v-virtual-scroll :items="filteredRoms" height="calc(100vh - 10.625em)">
|
||||
<template v-slot="{ item }">
|
||||
<v-list-item :key="item.id" :value="item.id">
|
||||
<game-list-item :rom="item" />
|
||||
</v-list-item>
|
||||
</template>
|
||||
</v-virtual-scroll>
|
||||
</tbody>
|
||||
</v-table>
|
||||
</v-col>
|
||||
@@ -155,7 +161,7 @@ onBeforeRouteUpdate(async (to, _) => {
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row class="justify-center align-center" no-gutters>
|
||||
<v-btn @click="fetchMoreRoms(route.params.platform)" :disabled="cursor.value === null || !!filter.value"
|
||||
<v-btn @click="fetchMoreRoms(route.params.platform)" :disabled="!!filter.value"
|
||||
rounded="0" variant="text" class="mr-0" icon>
|
||||
<v-icon>mdi-plus</v-icon>
|
||||
</v-btn>
|
||||
|
||||
Reference in New Issue
Block a user