light theme added

This commit is contained in:
zurdi zurdo
2023-04-15 01:32:14 +02:00
parent 3926da01a7
commit fcacfe2897
17 changed files with 168 additions and 70 deletions

View File

@@ -16,7 +16,7 @@ emitter.on('refresh', () => { refresh.value = !refresh.value })
</script>
<template>
<v-app theme="rommDark">
<v-app>
<settings-drawer/>
@@ -58,4 +58,25 @@ emitter.on('refresh', () => { refresh.value = !refresh.value })
background-color: #808080;
border-radius: 5px;
}
rommDark {
primary: #161b22;
secondary: #a452fe;
background: #0d1117;
notification: #0d1117;
surface: #161b22;
tooltip: #161b22;
chip: #161b22;
rommAccent1: #a452fe;
rommAccent2: #9a00ea;
rommAccent3: #7b00e1;
rommAccent4: #702bcf;
rommAccent5: #3808a4;
rommWhite: #fefdfe;
rommBlack: #000000;
rommRed: #da3633;
}
</style>

View File

@@ -25,7 +25,7 @@ async function goHome(){
<v-app-bar class="elevation-3">
<v-progress-linear color="rommAccent" :active="scanning" :indeterminate="true" absolute/>
<v-progress-linear color="secondary" :active="scanning" :indeterminate="true" absolute/>
<v-avatar size="100" class="ml-3 home-btn hidden-sm-and-down" @click="goHome()"><v-img src="/assets/romm_complete.svg"></v-img></v-avatar>

View File

@@ -0,0 +1,22 @@
<script setup>
const props = defineProps(['rom'])
</script>
<template>
<v-card class="header-background" position="absolute" rounded="0" flat>
<v-img :src="'/assets'+rom.path_cover_l+'?reload='+Date.now()" class="header-background-img" cover/>
</v-card>
</template>
<style scoped>
.header-background {
top: 0px;
left: 0px;
width: 100%;
max-height: 330px;
}
.header-background-img {
-webkit-filter: blur(15px);
filter: blur(15px);
}
</style>

View File

@@ -22,7 +22,7 @@ const emitter = inject('emitter')
cover>
<template v-slot:placeholder>
<div class="d-flex align-center justify-center fill-height">
<v-progress-circular color="rommAccent" indeterminate/>
<v-progress-circular color="secondary" indeterminate/>
</div>
</template>
<v-expand-transition>

View File

@@ -0,0 +1,10 @@
<script setup>
// Props
const props = defineProps(['gettingRoms'])
</script>
<template>
<v-dialog v-model="gettingRoms" scroll-strategy="none" width="auto" :scrim="false" persistent>
<v-progress-circular color="secondary" :width="3" :size="70" indeterminate/>
</v-dialog>
</template>

View File

@@ -0,0 +1,10 @@
<script setup>
// Props
const props = defineProps(['noRoms'])
</script>
<template>
<v-row v-if="noRoms" class="d-flex justify-center align-center mt-16">
<div class="text-h6">Feels cold here... <v-icon>mdi-emoticon-sad</v-icon></div>
</v-row>
</template>

View File

@@ -48,6 +48,7 @@ emitter.emit('selectedPlatform', selectedPlatform.value)
</v-list>
<template v-slot:append>
<v-divider class="border-opacity-25" :thickness="1"/>
<rail-btn :rail="rail"/>
</template>

View File

@@ -61,7 +61,7 @@ async function scan() {
<v-progress-circular
v-show="scanning"
class="ml-2"
color="rommAccent"
color="secondary"
:width="2"
:size="20"
indeterminate/>

View File

@@ -3,15 +3,13 @@ import { ref } from "vue"
import { useTheme } from "vuetify"
// Props
// const theme = useTheme()
// const darkMode = (localStorage.getItem('theme') == 'light') ? ref(false) : ref(true)
const darkMode = ref(true)
const theme = useTheme()
const darkMode = (localStorage.getItem('theme') == 'rommLight') ? ref(false) : ref(true)
// Functions
function toggleTheme() {
console.log("changed theme")
// theme.global.name.value = darkMode.value ? "dark" : "light"
// darkMode.value ? localStorage.setItem('theme', 'dark') : localStorage.setItem('theme', 'light')
theme.global.name.value = darkMode.value ? "rommDark" : "rommLight"
darkMode.value ? localStorage.setItem('theme', 'rommDark') : localStorage.setItem('theme', 'rommLight')
}
</script>

View File

@@ -4,6 +4,6 @@ const ROMM_VERSION = import.meta.env.VITE_ROMM_VERSION
<template>
<v-list-item class="d-flex justify-center alignt-center text-body-2">
<span class="text-rommAccent">RomM</span><span> v{{ ROMM_VERSION }}</span>
<span class="text-secondary">RomM</span><span> v{{ ROMM_VERSION }}</span>
</v-list-item>
</template>

View File

@@ -14,19 +14,43 @@ import { createVuetify } from 'vuetify'
const rommDark = {
dark: true,
colors: {
primary: '#161B22',
secondary: '#424242',
background: '#0D1117',
rommAccent: '#A453FF',
notification: '#0D1117',
surface: '#161B22',
tooltip: '#161B22',
chip: '#161B22',
info: '#2196F3',
success: '#4CAF50',
warning: '#FB8C00',
error: '#B00020',
red: '#DA3633'
primary: '#161b22',
secondary: '#a452fe',
background: '#0d1117',
notification: '#0d1117',
surface: '#161b22',
tooltip: '#161b22',
chip: '#161b22',
rommAccent1: '#a452fe',
rommAccent2: '#c400f7',
rommAccent2: '#3808a4',
rommWhite: '#fefdfe',
rommBlack: '#000000',
rommRed: '#da3633',
rommGreen: '#3FB950'
}
}
const rommLight = {
dark: false,
colors: {
primary: '#fefdfe',
secondary: '#a452fe',
background: '#fefdfe',
notification: '#0d1117',
surface: '#fefdfe',
tooltip: '#fefdfe',
chip: '#161b22',
rommAccent1: '#a452fe',
rommAccent2: '#c400f7',
rommAccent2: '#3808a4',
rommWhite: '#fefdfe',
rommBlack: '#000000',
rommRed: '#da3633',
rommGreen: '#3FB950'
}
}
@@ -37,7 +61,8 @@ export default createVuetify({
theme: {
defaultTheme: 'rommDark',
themes: {
rommDark
rommDark,
rommLight
}
}
})

View File

@@ -4,6 +4,7 @@ import { ref, inject } from 'vue'
import { useRouter } from 'vue-router'
import { useDisplay } from "vuetify"
import { downloadRom, downloadSave } from '@/utils/utils.js'
import BackgroundHeader from '@/components/GameDetails/BackgroundHeader.vue'
// Props
const rom = ref(JSON.parse(localStorage.getItem('currentRom')) || '')
@@ -80,7 +81,7 @@ async function deleteRom() {
<template>
<v-card class="header-background" position="absolute" rounded="0" flat><v-img :src="'/assets'+rom.path_cover_l+'?reload='+Date.now()" class="header-background-img" cover/></v-card>
<background-header :rom="rom"/>
<div :class="{'content': mdAndUp, 'content-tablet': sm, 'content-mobile': xs}">
<v-row class="pt-8 justify-center">
@@ -92,7 +93,7 @@ async function deleteRom() {
<v-img :src="'/assets'+rom.path_cover_l+'?reload='+Date.now()" :lazy-src="'/assets'+rom.path_cover_s+'?reload='+Date.now()" cover>
<template v-slot:placeholder>
<div class="d-flex align-center justify-center fill-height">
<v-progress-circular color="rommAccent" :width="2" :size="20" indeterminate/>
<v-progress-circular color="secondary" :width="2" :size="20" indeterminate/>
</div>
</template>
</v-img>
@@ -101,7 +102,7 @@ async function deleteRom() {
<v-img :src="'/assets'+rom.path_cover_l+'?reload='+Date.now()" :lazy-src="'/assets'+rom.path_cover_s+'?reload='+Date.now()" cover>
<template v-slot:placeholder>
<div class="d-flex align-center justify-center fill-height">
<v-progress-circular color="rommAccent" :width="2" :size="20" indeterminate/>
<v-progress-circular color="secondary" :width="2" :size="20" indeterminate/>
</div>
</template>
</v-img>
@@ -145,21 +146,21 @@ async function deleteRom() {
<v-row no-gutters>
<p class="text-h4 font-weight-bold">{{ rom.name }}</p>
<v-chip-group class="ml-3 mt-1 hidden-xs">
<v-chip v-show="rom.region" size="x-small" class="bg-chip" label>{{ rom.region }}</v-chip>
<v-chip v-show="rom.revision" size="x-small" class="bg-chip" label>{{ rom.revision }}</v-chip>
<v-chip v-show="rom.region" size="x-small" class="bg-chip text-white" label>{{ rom.region }}</v-chip>
<v-chip v-show="rom.revision" size="x-small" class="bg-chip text-white" label>{{ rom.revision }}</v-chip>
</v-chip-group>
</v-row>
<v-row no-gutters class="align-center">
<p class="font-italic mt-1">{{ selectedPlatform['name'] }}</p>
<v-chip-group class="ml-3 mt-1 hidden-sm-and-up">
<v-chip v-show="rom.region" size="x-small" label>{{ rom.region }}</v-chip>
<v-chip v-show="rom.revision" size="x-small" label>{{ rom.revision }}</v-chip>
<v-chip v-show="rom.region" size="x-small" class="bg-chip text-white" label>{{ rom.region }}</v-chip>
<v-chip v-show="rom.revision" size="x-small" class="bg-chip text-white" label>{{ rom.revision }}</v-chip>
</v-chip-group>
</v-row>
</div>
<div class="mb-10" :class="{'info-content': mdAndUp, 'info-content-tablet': sm, 'info-content-mobile': xs}">
<v-tabs v-model="tab" slider-color="rommAccent">
<v-tabs v-model="tab" slider-color="secondary">
<v-tab value="info">Info</v-tab>
<v-tab value="saves" disabled>Saves</v-tab>
<v-tab value="screenshots" disabled>Screenshots</v-tab>
@@ -205,16 +206,18 @@ async function deleteRom() {
</v-col>
</v-row>
</div>
</div>
<v-dialog v-model="dialogSearchRom" scroll-strategy="none" width="auto" :scrim="false">
<v-card rounded="0" :class="{'search-content': mdAndUp, 'search-content-tablet': sm, 'search-content-mobile': xs}">
<v-card :class="{'search-content': mdAndUp, 'search-content-tablet': sm, 'search-content-mobile': xs}">
<v-toolbar class="bg-primary">
<v-toolbar-title v-show="searching"><span>Searching...</span></v-toolbar-title>
<v-toolbar class="bg-primary pl-1 pr-1">
<v-toolbar-title v-show="searching">Searching...</v-toolbar-title>
<v-toolbar-title v-show="!searching"><span>Results found</span></v-toolbar-title>
<v-btn icon @click="dialogSearchRom=false" class="ml-1" rounded="0"><v-icon>mdi-close</v-icon></v-btn>
</v-toolbar>
<v-divider class="border-opacity-25" :thickness="1"/>
<v-card-text class="pa-3 scroll justify-center align-center bg-background">
<v-row>
@@ -231,7 +234,7 @@ async function deleteRom() {
hide-details
clearable/>
</v-row>
<v-row class="justify-center align-center loader-searching" v-show="searching"><v-progress-circular :width="2" :size="40" class="pa-3 ma-3" color="rommAccent" indeterminate/></v-row>
<v-row class="justify-center align-center loader-searching" v-show="searching"><v-progress-circular :width="2" :size="40" class="pa-3 ma-3" color="secondary" indeterminate/></v-row>
<v-row class="justify-center align-center no-results-searching" v-show="!searching && matchedRoms.length==0" ><p>No results found</p></v-row>
<v-row class="pl-4 pr-4">
<v-col cols="6" xs="6" sm="4" md="3" lg="3" v-show="!searching" v-for="rom in matchedRoms">
@@ -249,40 +252,43 @@ async function deleteRom() {
</v-row>
</v-card-text>
<v-divider v-show="!searching" class="border-opacity-25" :thickness="1"/>
<v-card-actions v-show="!searching">
<v-checkbox v-model="renameAsIGDB" label="Rename file" class="pl-3" hide-details="true"/>
<v-checkbox v-model="renameAsIGDB" label="Rename file" class="ml-3" hide-details="true"/>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="updating" scroll-strategy="none" width="auto" persistent>
<v-progress-circular :width="3" :size="70" color="rommAccent" indeterminate/>
</v-dialog>
<v-dialog v-model="dialogEditRom" scroll-strategy="none" width="auto" :scrim="false">
<v-card rounded="0" max-width="600" min-width="340">
<v-toolbar class="bg-primary">
<v-card rounded="0" :class="{'edit-content': mdAndUp, 'edit-content-tablet': sm, 'edit-content-mobile': xs}">
<v-toolbar class="bg-primary pl-1 pr-1">
<v-toolbar-title><span>Editing {{ rom.file_name }}</span></v-toolbar-title>
<v-btn icon @click="dialogEditRom=false" class="ml-1" rounded="0"><v-icon>mdi-close</v-icon></v-btn>
</v-toolbar>
<v-divider class="border-opacity-25" :thickness="1"/>
<v-card-text class="pt-5 bg-background">
<v-form @submit.prevent class="ma-4">
<v-text-field @keyup.enter="updateRom()" v-model="editedRomName" label="File name" variant="outlined" required/>
<v-file-input @keyup.enter="updateRom()" label="Custom cover" prepend-inner-icon="mdi-image" prepend-icon="" variant="outlined" disabled/>
<v-btn type="submit" @click="updateRom(undefined, editedRomName)" class="mt-2" block>Apply</v-btn>
<v-btn type="submit" @click="updateRom(undefined, editedRomName)" class="mt-2 bg-rommGreen" block>Apply</v-btn>
</v-form>
</v-card-text>
</v-card>
</v-dialog>
<v-dialog v-model="dialogDeleteRom" width="auto">
<v-card rounded="0" max-width="600">
<v-toolbar class="bg-red">
<v-toolbar class="bg-red pl-1 pr-1">
<v-toolbar-title><span>Deleting {{ rom.file_name }}</span></v-toolbar-title>
<v-btn icon @click="dialogDeleteRom=false" class="ml-1" rounded="0"><v-icon>mdi-close</v-icon></v-btn>
</v-toolbar>
<v-divider class="border-opacity-25" :thickness="1"/>
<v-card-text class="bg-background">
<v-row class="justify-center ma-2">
<span>Deleting from RomM. Do you confirm?</span>
@@ -293,27 +299,23 @@ async function deleteRom() {
</v-row>
</v-card-text>
<v-divider class="border-opacity-25" :thickness="1"/>
<v-card-actions class="justify-center">
<v-checkbox v-model="deleteFromFs" label="Remove from filesystem" hide-details="true"/>
<v-checkbox v-model="deleteFromFs" label="Remove from filesystem" class="ml-3" hide-details="true"/>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="updating" scroll-strategy="none" width="auto" persistent>
<v-progress-circular :width="3" :size="70" color="secondary" indeterminate/>
</v-dialog>
</template>
<style scoped>
.scroll {
overflow-y: scroll
}
.header-background {
top: 0px;
left: 0px;
width: 100%;
max-height: 330px;
}
.header-background-img {
-webkit-filter: blur(15px);
filter: blur(15px);
overflow-y: scroll
}
.content, .content-tablet{
margin-left: 100px;
@@ -364,4 +366,16 @@ async function deleteRom() {
width: 310px;
height: 540px;
}
.edit-content{
width: 700px;
/* height: 540px; */
}
.edit-content-tablet{
width: 500px;
/* height: 540px; */
}
.edit-content-mobile{
width: 310px;
/* height: 540px; */
}
</style>

View File

@@ -2,9 +2,10 @@
import axios from 'axios'
import { ref, inject, onMounted } from 'vue'
import { normalizeString, views } from '@/utils/utils.js'
import GameCard from '@/components/GameEntry/Card/Base.vue'
import GameListHeader from '@/components/GameEntry/ListItem/Header.vue'
import GameListItem from '@/components/GameEntry/ListItem/Item.vue'
import GameCard from '@/components/GameGallery/Card/Base.vue'
import GameListHeader from '@/components/GameGallery/ListItem/Header.vue'
import GameListItem from '@/components/GameGallery/ListItem/Item.vue'
import NoRoms from '@/components/GameGallery/NoRoms.vue'
// Props
const roms = ref([])
@@ -64,17 +65,13 @@ onMounted(() => {
<v-list v-show="currentView == 2" class="bg-background">
<game-list-header/>
<v-divider class="border-opacity-100 ml-3 mb-4 mr-3" color="rommAccent" :thickness="1"/>
<v-divider class="border-opacity-100 ml-3 mb-4 mr-3" color="secondary" :thickness="1"/>
<game-list-item v-for="rom in romsFiltered" :rom="rom"/>
</v-list>
<v-row v-if="noRoms" class="d-flex justify-center align-center mt-16">
<div class="text-h6">Feels cold here... <v-icon>mdi-emoticon-sad</v-icon></div>
</v-row>
<no-roms :noRoms="noRoms" />
<v-dialog v-model="gettingRoms" scroll-strategy="none" width="auto" :scrim="false" persistent>
<v-progress-circular color="rommAccent" :width="3" :size="70" indeterminate/>
</v-dialog>
<getting-roms-loader :gettingRoms="gettingRoms"/>
</template>