feat: add theme previews
This commit is contained in:
parent
94fee82893
commit
768b011961
7 changed files with 96 additions and 6 deletions
|
@ -1,12 +1,66 @@
|
|||
<template>
|
||||
<div>
|
||||
<h1>hi</h1>
|
||||
<h1>Appearance</h1>
|
||||
|
||||
<p class="subtitle">THEMES</p>
|
||||
<div class="themes">
|
||||
<p v-for="theme of themes">
|
||||
<span class="theme-preview" :title="theme.displayName" :style="{background:`linear-gradient(${theme.previewGradient})`}">
|
||||
<span class="theme-title" :style="{color:`${theme.complementaryColor}`}">
|
||||
{{ theme.displayName }}
|
||||
</span>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p class="subtitle">ICONS</p>
|
||||
<div class="themes">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const runtimeConfig = useRuntimeConfig()
|
||||
const defaultThemes = runtimeConfig.public.defaultThemes
|
||||
const baseURL = runtimeConfig.app.baseURL;
|
||||
|
||||
const themes: Array<Theme> = []
|
||||
|
||||
interface Theme {
|
||||
displayName: string
|
||||
previewGradient: string
|
||||
complementaryColor: string
|
||||
themeURL: string
|
||||
}
|
||||
|
||||
|
||||
const fetchThemes = async () => {
|
||||
for (const theme of defaultThemes) {
|
||||
const themeConfig = await fetch(`${baseURL}themes/${theme}.json`)
|
||||
const themeConfigJson = await themeConfig.json() as Theme
|
||||
themes.push(themeConfigJson)
|
||||
}
|
||||
}
|
||||
|
||||
await fetchThemes()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.theme-preview {
|
||||
min-width: 6em;
|
||||
min-height: 6em;
|
||||
border-radius: 100%;
|
||||
border: .1em solid var(--primary-color);
|
||||
|
||||
</style>
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.theme-title {
|
||||
font-size: .8em;
|
||||
line-height: 6em; /* same height as the parent to centre it vertically */
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -30,6 +30,9 @@ export default defineNuxtConfig({
|
|||
messageGroupingMaxDifference: 300000,
|
||||
buildTimeString: new Date().toISOString(),
|
||||
gitHash: process.env.GIT_SHORT_REV || "N/A",
|
||||
defaultThemes: [
|
||||
"light", "ash", "dark"
|
||||
]
|
||||
}
|
||||
},
|
||||
/* nitro: {
|
||||
|
|
19
public/themes/ash.css
Normal file
19
public/themes/ash.css
Normal file
|
@ -0,0 +1,19 @@
|
|||
:root {
|
||||
--text-color: #f0e5e0;
|
||||
--secondary-text-color: #e8e0db;
|
||||
|
||||
--chat-background-color: #2f2e2d;
|
||||
--chat-highlighted-background-color: #3f3b38;
|
||||
--sidebar-background-color: #3e3a37;
|
||||
--sidebar-highlighted-background-color: #46423b;
|
||||
--topbar-background-color: #3a3733;
|
||||
|
||||
--padding-color: #e0e0e0;
|
||||
|
||||
--primary-color: #f07028;
|
||||
--primary-highlighted-color: #f28f4b;
|
||||
--secondary-color: #683820;
|
||||
--secondary-highlighted-color: #885830;
|
||||
--accent-color: #a04b24;
|
||||
--accent-highlighted-color: #b86038;
|
||||
}
|
6
public/themes/ash.json
Normal file
6
public/themes/ash.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"displayName": "Ash",
|
||||
"previewGradient": "45deg, #2f2e2d, #46423b",
|
||||
"complementaryColor": "white",
|
||||
"themeData": "ash.css"
|
||||
}
|
6
public/themes/dark.json
Normal file
6
public/themes/dark.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"displayName": "Dark",
|
||||
"previewGradient": "45deg, #1f1e1d, #36322b",
|
||||
"complementaryColor": "white",
|
||||
"themeData": "dark.css"
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
[
|
||||
"dark.css",
|
||||
"light.css"
|
||||
]
|
6
public/themes/light.json
Normal file
6
public/themes/light.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"displayName": "Light",
|
||||
"previewGradient": "45deg, #f0ebe8, #d4d0ca",
|
||||
"complementaryColor": "black",
|
||||
"themeData": "light.css"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue