feat: use blue favicon for dev/preview mode

This commit is contained in:
Daniel Roe 2022-11-27 23:09:18 +00:00
parent 834eca2ad2
commit d0ec3676b8
No known key found for this signature in database
GPG key ID: 22D5008E4F5D9B55
3 changed files with 6 additions and 5 deletions

View file

@ -1,12 +1,13 @@
<script setup>
import { APP_NAME } from './constants'
const isDev = process.dev
const isPreview = window.location.hostname.includes('deploy-preview')
useHead({
titleTemplate: title => `${title ? `${title} | ` : ''}${APP_NAME}${import.meta.env.DEV ? ' (dev)' : window.location.hostname.includes('deploy-preview') ? '(preview)' : ''}`,
titleTemplate: title => `${title ? `${title} | ` : ''}${APP_NAME}${isDev ? ' (dev)' : isPreview ? ' (preview)' : ''}`,
link: [
{
rel: 'icon', type: 'image/svg+png', href: '/favicon.png',
},
{ rel: 'icon', type: 'image/svg+png', href: isDev || isPreview ? '/favicon-dev.png' : '/favicon.png' },
],
})

View file

@ -1,5 +1,5 @@
<script setup>
const sub = import.meta.env.DEV ? 'dev' : window.location.hostname.includes('deploy-preview') ? 'preview' : 'alpha'
const sub = process.dev ? 'dev' : window.location.hostname.includes('deploy-preview') ? 'preview' : 'alpha'
</script>
<template>

BIN
public/favicon-dev.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB