Skip to content

Commit

Permalink
Implement custom logo support
Browse files Browse the repository at this point in the history
  • Loading branch information
man90es committed Apr 9, 2024
1 parent ae51abd commit ff31212
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Multiple APIs can be defined using a comma separated list
#VUE_APP_API_ENDPOINT=http://127.0.0.1:6749,http://192.168.0.100:6749
VUE_APP_API_ENDPOINT=http://127.0.0.1:6749
VUE_APP_TITLE=Kumori

# Website locale
VUE_APP_LOCALE=en

# Website title
VUE_APP_TITLE=Kumori

# Website logo (custom logos can be placed in public/custom)
#VUE_APP_LOGO=custom/logo.png
VUE_APP_LOGO=logo.png
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ yarn-error.log*
*.njsproj
*.sln
*.sw?

/public/custom/*
!.gitkeep
Empty file added public/custom/.gitkeep
Empty file.
6 changes: 4 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<html lang="<%= VUE_APP_LOCALE %>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="stylesheet" href="/index.css">
<title>kumori</title>
<title>
<%= VUE_APP_TITLE %>
</title>

<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="app"></div>
Expand Down
4 changes: 3 additions & 1 deletion src/views/HomeView.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="home">
<div id="background-layer" :style="backgroundStyle" />
<img v-if="loggedOn || 0 === loginPhase" src="logo.svg" @click="() => loggedOn || ++loginPhase" />
<img v-if="loggedOn || 0 === loginPhase" :src="logoURI" @click="() => loggedOn || ++loginPhase" />
<form v-else-if="1 === loginPhase">
<input :disabled="formValues.invite.length" placeholder="Username" type="text" v-model="formValues.name" />
or
Expand Down Expand Up @@ -36,6 +36,8 @@
const loggedOn = computed(() => Boolean(user.id))
const user = useUserStore()
const logoURI = process.env.VUE_APP_LOGO || 'logo.svg'
const loginPhase = ref(0)
const formValues = reactive({
email: "",
Expand Down

0 comments on commit ff31212

Please sign in to comment.