feat: use blue favicon for dev/preview mode

zio/stable
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> <script setup>
import { APP_NAME } from './constants' import { APP_NAME } from './constants'
const isDev = process.dev
const isPreview = window.location.hostname.includes('deploy-preview')
useHead({ 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: [ link: [
{ { rel: 'icon', type: 'image/svg+png', href: isDev || isPreview ? '/favicon-dev.png' : '/favicon.png' },
rel: 'icon', type: 'image/svg+png', href: '/favicon.png',
},
], ],
}) })

View File

@ -1,5 +1,5 @@
<script setup> <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> </script>
<template> <template>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB