new dev favicons + settings favicon (#7295)

* new dev favicons + settings favicon

* prepr
This commit is contained in:
Prospector
2026-08-24 22:54:34 -07:00
committed by GitHub
parent ad83117ebf
commit 80607c1963
41 changed files with 805 additions and 75 deletions
+7
View File
@@ -15,6 +15,13 @@ This includes, but may not be limited to, the following files:
- src/components/brand/\*
- src/public/favicon.ico
- src/public/favicon-light.ico
- src/public/favicon-settings.ico
- src/public/favicon-light-settings.ico
- src/public/favicon-32x32.png
- src/public/favicon-light-32x32.png
- src/public/favicon-settings-32x32.png
- src/public/favicon-light-settings-32x32.png
- src/public/dev-favicons/\*
- src/public/news/\*
## External logos
-12
View File
@@ -19,12 +19,6 @@ const preloadedFonts = [
'inter/Inter-Bold.woff2',
]
const favicons = {
'(prefers-color-scheme:no-preference)': '/favicon-light.ico',
'(prefers-color-scheme:light)': '/favicon-light.ico',
'(prefers-color-scheme:dark)': '/favicon.ico',
}
const PROD_MODRINTH_URL = 'https://modrinth.com'
const STAGING_MODRINTH_URL = 'https://staging.modrinth.com'
@@ -50,12 +44,6 @@ export default defineNuxtConfig({
crossorigin: 'anonymous',
}
}),
...Object.entries(favicons).map(([media, href]): object => {
return { rel: 'icon', type: 'image/x-icon', href, media }
}),
...Object.entries(favicons).map(([media, href]): object => {
return { rel: 'apple-touch-icon', type: 'image/x-icon', href, media, sizes: '64x64' }
}),
{
rel: 'search',
type: 'application/opensearchdescription+xml',
+22
View File
@@ -0,0 +1,22 @@
import { type MaybeRefOrGetter, toValue } from 'vue'
import {
type FaviconVariant,
getFaviconHeadLinks,
resolveFaviconEnvironment,
} from '~/utils/favicon.ts'
export function useFaviconEnvironment() {
const config = useRuntimeConfig()
const url = useRequestURL()
return computed(() => resolveFaviconEnvironment(config, url.hostname))
}
export function useFavicon(variant: MaybeRefOrGetter<FaviconVariant> = 'default') {
const environment = useFaviconEnvironment()
useHead({
link: () => getFaviconHeadLinks(toValue(variant), environment.value),
})
}
@@ -1,26 +1,10 @@
import {
defineMessages,
injectProjectPageContext,
type MessageDescriptor,
useVIntl,
} from '@modrinth/ui'
const messages = defineMessages({
headTitle: {
id: 'project.settings.head-title',
defaultMessage: '⚙️ {section} - {project}',
},
})
import { injectProjectPageContext, type MessageDescriptor, useVIntl } from '@modrinth/ui'
export function useProjectSettingsHeadTitle(section: MessageDescriptor) {
const { formatMessage } = useVIntl()
const { projectV2: project } = injectProjectPageContext()
useHead({
title: () =>
`${formatMessage(messages.headTitle, {
section: formatMessage(section),
project: project.value.title,
})}`,
title: () => `${formatMessage(section)} - ${project.value.title}`,
})
}
+1
View File
@@ -1179,6 +1179,7 @@ const messages = defineMessages({
},
})
useFavicon()
useHead({
link: [
{
@@ -3554,9 +3554,6 @@
"project.settings.general.url.title": {
"message": "رابط"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.title": {
"message": "تمويل"
},
@@ -4028,9 +4028,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.description": {
"message": "Projekte auf Modrinth nehmen automatisch am <rewards-program-link>Belohnungsprogramm</rewards-program-link> teil. Falls du mit diesem Projekt keine Einnahmen erzielen möchtest (oder aus rechtlichen Gründen nicht darfst), kannst du dies hier deaktivieren."
},
@@ -4028,9 +4028,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.description": {
"message": "Projekte auf Modrinth nehmen automatisch am <rewards-program-link>Belohnungsprogramm</rewards-program-link> teil. Falls du mit diesem Projekt keine Einnahmen erzielen möchtest (oder aus rechtlichen Gründen nicht darfst), kannst du dies hier deaktivieren."
},
@@ -4037,9 +4037,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.description": {
"message": "Projects on Modrinth are automatically enrolled in the <rewards-program-link>Rewards Program</rewards-program-link>. If you don't want to (or can't for legal reasons) earn revenue from this project, you can turn it off here."
},
@@ -4028,9 +4028,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.description": {
"message": "Los proyectos en Modrinth están inscritos automáticamente en el <rewards-program-link>Rewards Program</rewards-program-link>. Si usted no quiere (o no puede por razones legales) obtener ingresos de este proyecto, puede desactivarlo aquí."
},
@@ -3938,9 +3938,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.title": {
"message": "Monétisation"
},
@@ -4016,9 +4016,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.description": {
"message": "I progetti su Modrinth vengono automaticamente iscritti al <rewards-program-link>Programma Premi</rewards-program-link>. Se non vuoi guadagnare da questo progetto (o non puoi per motivi legali), puoi disattivarlo qui."
},
@@ -3854,9 +3854,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.title": {
"message": "Monetyzacja"
},
@@ -3962,9 +3962,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.permissions.attention-needed.description.proj-approved": {
"message": "Forneça a prova que possui permissão para redistribuir todos os seguintes arquivos. Após a conclusão, as versões retidas serão publicadas automaticamente."
},
@@ -4019,9 +4019,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} • {project}"
},
"project.settings.monetization.description": {
"message": "Проекты на Modrinth автоматически зачисляются в <rewards-program-link>программу наград</rewards-program-link>. Если вы не хотите (или не можете по юридическим причинам) получать доход от этого проекта, вы можете отключить его здесь."
},
@@ -3485,9 +3485,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} {project}"
},
"project.settings.permissions.attention-needed.title": {
"message": "Okänt externt innehåll"
},
@@ -3962,9 +3962,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.description": {
"message": "Modrinthteki projeler otomatik olarak <rewards-program-link>Ödül Programı</rewards-program-link>na kaydedilir. Bu projeden gelir elde etmek istemiyorsanız (veya yasal nedenlerle edemiyorsanız), buradan kapatabilirsiniz."
},
@@ -4025,9 +4025,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.description": {
"message": "Проєкти на Modrinth автоматично реєструються в <rewards-program-link>Програмі винагород</rewards-program-link>. Якщо ви не хочете (або не можете з юридичних причин) отримувати дохід від цього проєкту, ви можете вимкнути його тут."
},
@@ -4025,9 +4025,6 @@
"project.settings.general.url.title": {
"message": "URL"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.description": {
"message": "Modrints上的项目自动注册于 <rewards-program-link>奖励方案</rewards-program-link>如果你不想(或由于法律原因不能)从这个项目赚取收入,你可以在这里关闭它。"
},
@@ -4025,9 +4025,6 @@
"project.settings.general.url.title": {
"message": "網址"
},
"project.settings.head-title": {
"message": "⚙️ {section} - {project}"
},
"project.settings.monetization.description": {
"message": "Modrinth 上的專案會自動加入<rewards-program-link>獎勵計畫</rewards-program-link>。如果你不想(或因法律原因無法)從專案獲取收益,可在這裡關閉營利功能。"
},
@@ -1272,6 +1272,7 @@ const { data: thread } = useQuery({
})
const isSettings = computed(() => route.name.startsWith('type-project-settings'))
useFavicon(() => (isSettings.value ? 'settings' : 'default'))
// Jank modpack loaders fix
const versionsRaw = computed(() => {
@@ -233,6 +233,7 @@ if (route.path.includes('settings')) {
// hacky way to show the edit button on the corner of the card.
const routeHasSettings = computed(() => route.path.includes('settings'))
useFavicon(() => (routeHasSettings.value ? 'settings' : 'default'))
const client = injectModrinthClient()
const queryClient = useQueryClient()
+1
View File
@@ -149,6 +149,7 @@ const route = useNativeRoute()
const auth = await useAuth()
const flags = useFeatureFlags()
useFavicon('settings')
useSeoMeta({
robots: 'noindex',
})
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,68 @@
<svg width="74" height="74" viewBox="0 0 74 74" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_13353_29235)">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M50.6676 70.5612C63.9702 65.0597 73.33 51.9554 73.33 36.665C73.33 20.2485 62.5408 6.35189 47.6665 1.67917L45.977 11.2114C51.0017 13.0559 55.3686 16.3456 58.5279 20.6663C61.6873 24.9871 63.498 30.1458 63.7322 35.4933C63.9663 40.8408 62.6135 46.1381 59.8439 50.7185C57.0742 55.2988 53.0116 58.9576 48.1674 61.2343L50.6676 70.5612ZM41.352 73.0332C39.8173 73.229 38.2529 73.33 36.665 73.33C16.4155 73.33 0 56.9145 0 36.665C0 16.4155 16.4155 0 36.665 0C37.1784 0 37.6893 0.010553 38.1976 0.0314522L36.498 9.53211C32.3432 9.55104 28.248 10.522 24.5269 12.3705C20.8059 14.219 17.5581 16.8957 15.0329 20.1952C12.5077 23.4946 10.7724 27.329 9.96025 31.4037C9.14808 35.4784 9.28065 39.685 10.3478 43.7005C10.5929 44.594 10.8539 45.4797 11.1939 46.2704L21.9956 39.7942L18.7614 31.1908L28.9621 20.7133L41.8593 17.9378L45.5679 22.5479L39.6214 28.5655L34.442 30.1944L30.7334 34.0059L32.5521 39.0509C32.5521 39.0509 36.2212 42.9572 36.2291 42.9572L41.4243 41.5813L45.1172 37.5247L53.1828 34.9627L55.5551 40.3714L47.268 50.5642L33.3191 54.9687L27.0564 48.0022L16.1519 54.5575C18.9589 57.7523 22.4751 60.2452 26.4188 61.8367C30.3625 63.4282 34.6242 64.074 38.8623 63.7223L41.352 73.0332Z"
fill="#D9D9D9"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M50.6676 70.5612C63.9702 65.0597 73.33 51.9554 73.33 36.665C73.33 20.2485 62.5408 6.35189 47.6665 1.67917L45.977 11.2114C51.0017 13.0559 55.3686 16.3456 58.5279 20.6663C61.6873 24.9871 63.498 30.1458 63.7322 35.4933C63.9663 40.8408 62.6135 46.1381 59.8439 50.7185C57.0742 55.2988 53.0116 58.9576 48.1674 61.2343L50.6676 70.5612Z"
fill="url(#paint0_linear_13353_29235)"
fill-opacity="0.5"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M41.352 73.0332C39.8173 73.229 38.2529 73.33 36.665 73.33C16.4155 73.33 0 56.9145 0 36.665C0 16.4155 16.4155 0 36.665 0C37.1784 0 37.6893 0.010553 38.1976 0.0314522L36.498 9.53211C32.3432 9.55104 28.248 10.522 24.5269 12.3705C20.8059 14.219 17.5581 16.8957 15.0329 20.1952C12.5077 23.4946 10.7724 27.329 9.96025 31.4037C9.14808 35.4784 9.28065 39.685 10.3478 43.7005C10.5929 44.594 10.8539 45.4797 11.1939 46.2704L21.9956 39.7942L18.7614 31.1908L28.9621 20.7133L41.8593 17.9378L45.5679 22.5479L39.6214 28.5655L34.442 30.1944L30.7334 34.0059L32.5521 39.0509C32.5521 39.0509 36.2212 42.9572 36.2291 42.9572L41.4243 41.5813L45.1172 37.5247L53.1828 34.9627L55.5551 40.3714L47.268 50.5642L33.3191 54.9687L27.0564 48.0022L16.1519 54.5575C18.9589 57.7523 22.4751 60.2452 26.4188 61.8367C30.3625 63.4282 34.6242 64.074 38.8623 63.7223L41.352 73.0332Z"
fill="url(#paint1_linear_13353_29235)"
fill-opacity="0.5"
/>
<path
d="M50.6676 70.5612C63.9702 65.0597 73.33 51.9554 73.33 36.665C73.33 20.2485 62.5408 6.35189 47.6665 1.67917L45.977 11.2114C51.0017 13.0559 55.3686 16.3456 58.5279 20.6663C61.6873 24.9871 63.498 30.1458 63.7322 35.4933C63.9663 40.8408 62.6135 46.1381 59.8439 50.7185C57.0742 55.2988 53.0116 58.9576 48.1674 61.2343L50.6676 70.5612ZM41.352 73.0332C39.8173 73.229 38.2529 73.33 36.665 73.33C16.4155 73.33 0 56.9145 0 36.665C0 16.4155 16.4155 0 36.665 0C37.1784 0 37.6893 0.010553 38.1976 0.0314522L36.498 9.53211C32.3432 9.55104 28.248 10.522 24.5269 12.3705C20.8059 14.219 17.5581 16.8957 15.0329 20.1952C12.5077 23.4946 10.7724 27.329 9.96025 31.4037C9.14808 35.4784 9.28065 39.685 10.3478 43.7005C10.5929 44.594 10.8539 45.4797 11.1939 46.2704L21.9956 39.7942L18.7614 31.1908L28.9621 20.7133L41.8593 17.9378L45.5679 22.5479L39.6214 28.5655L34.442 30.1944L30.7334 34.0059L32.5521 39.0509C32.5521 39.0509 36.2212 42.9572 36.2291 42.9572L41.4243 41.5813L45.1172 37.5247L53.1828 34.9627L55.5551 40.3714L47.268 50.5642L33.3191 54.9687L27.0564 48.0022L16.1519 54.5575C18.9589 57.7523 22.4751 60.2452 26.4188 61.8367C30.3625 63.4282 34.6242 64.074 38.8623 63.7223L41.352 73.0332Z"
stroke="url(#paint2_linear_13353_29235)"
stroke-opacity="0.7"
stroke-width="2"
/>
</g>
<defs>
<linearGradient
id="paint0_linear_13353_29235"
x1="20.5946"
y1="-24.6981"
x2="42.747"
y2="97.2053"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#BE4AFD" />
<stop offset="1" stop-color="#5E1BD9" />
</linearGradient>
<linearGradient
id="paint1_linear_13353_29235"
x1="20.5946"
y1="-24.6981"
x2="42.747"
y2="97.2053"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#BE4AFD" />
<stop offset="1" stop-color="#5E1BD9" />
</linearGradient>
<linearGradient
id="paint2_linear_13353_29235"
x1="34.0545"
y1="-0.0937502"
x2="34.0545"
y2="92.7063"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="white" />
<stop offset="1" stop-color="white" stop-opacity="0.4" />
</linearGradient>
<clipPath id="clip0_13353_29235">
<rect width="73.33" height="73.33" fill="white" />
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,66 @@
<svg width="74" height="74" viewBox="0 0 74 74" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_13353_29153)">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M50.6676 70.5612C63.9702 65.0597 73.33 51.9554 73.33 36.665C73.33 20.2485 62.5408 6.35189 47.6665 1.67917L45.977 11.2114C51.0017 13.0559 55.3686 16.3456 58.5279 20.6663C61.6873 24.9871 63.498 30.1458 63.7322 35.4933C63.9663 40.8408 62.6135 46.1381 59.8439 50.7185C57.0742 55.2988 53.0116 58.9576 48.1674 61.2343L50.6676 70.5612ZM41.352 73.0332C39.8173 73.229 38.2529 73.33 36.665 73.33C16.4155 73.33 0 56.9145 0 36.665C0 16.4155 16.4155 0 36.665 0C37.1784 0 37.6893 0.010553 38.1976 0.0314522L36.498 9.53211C32.3432 9.55104 28.248 10.522 24.5269 12.3705C20.8059 14.219 17.5581 16.8957 15.0329 20.1952C12.5077 23.4946 10.7724 27.329 9.96025 31.4037C9.14808 35.4784 9.28065 39.685 10.3478 43.7005C10.5929 44.594 10.8539 45.4797 11.1939 46.2704L21.9956 39.7942L18.7614 31.1908L28.9621 20.7133L41.8593 17.9378L45.5679 22.5479L39.6214 28.5655L34.442 30.1944L30.7334 34.0059L32.5521 39.0509C32.5521 39.0509 36.2212 42.9572 36.2291 42.9572L41.4243 41.5813L45.1172 37.5247L53.1828 34.9627L55.5551 40.3714L47.268 50.5642L33.3191 54.9687L27.0564 48.0022L16.1519 54.5575C18.9589 57.7523 22.4751 60.2452 26.4188 61.8367C30.3625 63.4282 34.6242 64.074 38.8623 63.7223L41.352 73.0332Z"
fill="#D9D9D9"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M50.6676 70.5612C63.9702 65.0597 73.33 51.9554 73.33 36.665C73.33 20.2485 62.5408 6.35189 47.6665 1.67917L45.977 11.2114C51.0017 13.0559 55.3686 16.3456 58.5279 20.6663C61.6873 24.9871 63.498 30.1458 63.7322 35.4933C63.9663 40.8408 62.6135 46.1381 59.8439 50.7185C57.0742 55.2988 53.0116 58.9576 48.1674 61.2343L50.6676 70.5612Z"
fill="url(#paint0_linear_13353_29153)"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M41.352 73.0332C39.8173 73.229 38.2529 73.33 36.665 73.33C16.4155 73.33 0 56.9145 0 36.665C0 16.4155 16.4155 0 36.665 0C37.1784 0 37.6893 0.010553 38.1976 0.0314522L36.498 9.53211C32.3432 9.55104 28.248 10.522 24.5269 12.3705C20.8059 14.219 17.5581 16.8957 15.0329 20.1952C12.5077 23.4946 10.7724 27.329 9.96025 31.4037C9.14808 35.4784 9.28065 39.685 10.3478 43.7005C10.5929 44.594 10.8539 45.4797 11.1939 46.2704L21.9956 39.7942L18.7614 31.1908L28.9621 20.7133L41.8593 17.9378L45.5679 22.5479L39.6214 28.5655L34.442 30.1944L30.7334 34.0059L32.5521 39.0509C32.5521 39.0509 36.2212 42.9572 36.2291 42.9572L41.4243 41.5813L45.1172 37.5247L53.1828 34.9627L55.5551 40.3714L47.268 50.5642L33.3191 54.9687L27.0564 48.0022L16.1519 54.5575C18.9589 57.7523 22.4751 60.2452 26.4188 61.8367C30.3625 63.4282 34.6242 64.074 38.8623 63.7223L41.352 73.0332Z"
fill="url(#paint1_linear_13353_29153)"
/>
<path
d="M50.6676 70.5612C63.9702 65.0597 73.33 51.9554 73.33 36.665C73.33 20.2485 62.5408 6.35189 47.6665 1.67917L45.977 11.2114C51.0017 13.0559 55.3686 16.3456 58.5279 20.6663C61.6873 24.9871 63.498 30.1458 63.7322 35.4933C63.9663 40.8408 62.6135 46.1381 59.8439 50.7185C57.0742 55.2988 53.0116 58.9576 48.1674 61.2343L50.6676 70.5612ZM41.352 73.0332C39.8173 73.229 38.2529 73.33 36.665 73.33C16.4155 73.33 0 56.9145 0 36.665C0 16.4155 16.4155 0 36.665 0C37.1784 0 37.6893 0.010553 38.1976 0.0314522L36.498 9.53211C32.3432 9.55104 28.248 10.522 24.5269 12.3705C20.8059 14.219 17.5581 16.8957 15.0329 20.1952C12.5077 23.4946 10.7724 27.329 9.96025 31.4037C9.14808 35.4784 9.28065 39.685 10.3478 43.7005C10.5929 44.594 10.8539 45.4797 11.1939 46.2704L21.9956 39.7942L18.7614 31.1908L28.9621 20.7133L41.8593 17.9378L45.5679 22.5479L39.6214 28.5655L34.442 30.1944L30.7334 34.0059L32.5521 39.0509C32.5521 39.0509 36.2212 42.9572 36.2291 42.9572L41.4243 41.5813L45.1172 37.5247L53.1828 34.9627L55.5551 40.3714L47.268 50.5642L33.3191 54.9687L27.0564 48.0022L16.1519 54.5575C18.9589 57.7523 22.4751 60.2452 26.4188 61.8367C30.3625 63.4282 34.6242 64.074 38.8623 63.7223L41.352 73.0332Z"
stroke="url(#paint2_linear_13353_29153)"
stroke-opacity="0.4"
stroke-width="2"
/>
</g>
<defs>
<linearGradient
id="paint0_linear_13353_29153"
x1="20.5946"
y1="-24.6981"
x2="42.747"
y2="97.2053"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#4ADCFD" />
<stop offset="1" stop-color="#1B47D9" />
</linearGradient>
<linearGradient
id="paint1_linear_13353_29153"
x1="20.5946"
y1="-24.6981"
x2="42.747"
y2="97.2053"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#4ADCFD" />
<stop offset="1" stop-color="#1B47D9" />
</linearGradient>
<linearGradient
id="paint2_linear_13353_29153"
x1="34.0545"
y1="-0.0937502"
x2="34.0545"
y2="92.7063"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="white" />
<stop offset="1" stop-color="white" stop-opacity="0.4" />
</linearGradient>
<clipPath id="clip0_13353_29153">
<rect width="73.33" height="73.33" fill="white" />
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

@@ -0,0 +1,66 @@
<svg width="74" height="74" viewBox="0 0 74 74" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_13353_29173)">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M50.6676 70.5612C63.9702 65.0597 73.33 51.9554 73.33 36.665C73.33 20.2485 62.5408 6.35189 47.6665 1.67917L45.977 11.2114C51.0017 13.0559 55.3686 16.3456 58.5279 20.6663C61.6873 24.9871 63.498 30.1458 63.7322 35.4933C63.9663 40.8408 62.6135 46.1381 59.8439 50.7185C57.0742 55.2988 53.0116 58.9576 48.1674 61.2343L50.6676 70.5612ZM41.352 73.0332C39.8173 73.229 38.2529 73.33 36.665 73.33C16.4155 73.33 0 56.9145 0 36.665C0 16.4155 16.4155 0 36.665 0C37.1784 0 37.6893 0.010553 38.1976 0.0314522L36.498 9.53211C32.3432 9.55104 28.248 10.522 24.5269 12.3705C20.8059 14.219 17.5581 16.8957 15.0329 20.1952C12.5077 23.4946 10.7724 27.329 9.96025 31.4037C9.14808 35.4784 9.28065 39.685 10.3478 43.7005C10.5929 44.594 10.8539 45.4797 11.1939 46.2704L21.9956 39.7942L18.7614 31.1908L28.9621 20.7133L41.8593 17.9378L45.5679 22.5479L39.6214 28.5655L34.442 30.1944L30.7334 34.0059L32.5521 39.0509C32.5521 39.0509 36.2212 42.9572 36.2291 42.9572L41.4243 41.5813L45.1172 37.5247L53.1828 34.9627L55.5551 40.3714L47.268 50.5642L33.3191 54.9687L27.0564 48.0022L16.1519 54.5575C18.9589 57.7523 22.4751 60.2452 26.4188 61.8367C30.3625 63.4282 34.6242 64.074 38.8623 63.7223L41.352 73.0332Z"
fill="#D9D9D9"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M50.6676 70.5612C63.9702 65.0597 73.33 51.9554 73.33 36.665C73.33 20.2485 62.5408 6.35189 47.6665 1.67917L45.977 11.2114C51.0017 13.0559 55.3686 16.3456 58.5279 20.6663C61.6873 24.9871 63.498 30.1458 63.7322 35.4933C63.9663 40.8408 62.6135 46.1381 59.8439 50.7185C57.0742 55.2988 53.0116 58.9576 48.1674 61.2343L50.6676 70.5612Z"
fill="url(#paint0_linear_13353_29173)"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M41.352 73.0332C39.8173 73.229 38.2529 73.33 36.665 73.33C16.4155 73.33 0 56.9145 0 36.665C0 16.4155 16.4155 0 36.665 0C37.1784 0 37.6893 0.010553 38.1976 0.0314522L36.498 9.53211C32.3432 9.55104 28.248 10.522 24.5269 12.3705C20.8059 14.219 17.5581 16.8957 15.0329 20.1952C12.5077 23.4946 10.7724 27.329 9.96025 31.4037C9.14808 35.4784 9.28065 39.685 10.3478 43.7005C10.5929 44.594 10.8539 45.4797 11.1939 46.2704L21.9956 39.7942L18.7614 31.1908L28.9621 20.7133L41.8593 17.9378L45.5679 22.5479L39.6214 28.5655L34.442 30.1944L30.7334 34.0059L32.5521 39.0509C32.5521 39.0509 36.2212 42.9572 36.2291 42.9572L41.4243 41.5813L45.1172 37.5247L53.1828 34.9627L55.5551 40.3714L47.268 50.5642L33.3191 54.9687L27.0564 48.0022L16.1519 54.5575C18.9589 57.7523 22.4751 60.2452 26.4188 61.8367C30.3625 63.4282 34.6242 64.074 38.8623 63.7223L41.352 73.0332Z"
fill="url(#paint1_linear_13353_29173)"
/>
<path
d="M50.6676 70.5612C63.9702 65.0597 73.33 51.9554 73.33 36.665C73.33 20.2485 62.5408 6.35189 47.6665 1.67917L45.977 11.2114C51.0017 13.0559 55.3686 16.3456 58.5279 20.6663C61.6873 24.9871 63.498 30.1458 63.7322 35.4933C63.9663 40.8408 62.6135 46.1381 59.8439 50.7185C57.0742 55.2988 53.0116 58.9576 48.1674 61.2343L50.6676 70.5612ZM41.352 73.0332C39.8173 73.229 38.2529 73.33 36.665 73.33C16.4155 73.33 0 56.9145 0 36.665C0 16.4155 16.4155 0 36.665 0C37.1784 0 37.6893 0.010553 38.1976 0.0314522L36.498 9.53211C32.3432 9.55104 28.248 10.522 24.5269 12.3705C20.8059 14.219 17.5581 16.8957 15.0329 20.1952C12.5077 23.4946 10.7724 27.329 9.96025 31.4037C9.14808 35.4784 9.28065 39.685 10.3478 43.7005C10.5929 44.594 10.8539 45.4797 11.1939 46.2704L21.9956 39.7942L18.7614 31.1908L28.9621 20.7133L41.8593 17.9378L45.5679 22.5479L39.6214 28.5655L34.442 30.1944L30.7334 34.0059L32.5521 39.0509C32.5521 39.0509 36.2212 42.9572 36.2291 42.9572L41.4243 41.5813L45.1172 37.5247L53.1828 34.9627L55.5551 40.3714L47.268 50.5642L33.3191 54.9687L27.0564 48.0022L16.1519 54.5575C18.9589 57.7523 22.4751 60.2452 26.4188 61.8367C30.3625 63.4282 34.6242 64.074 38.8623 63.7223L41.352 73.0332Z"
stroke="url(#paint2_linear_13353_29173)"
stroke-opacity="0.4"
stroke-width="2"
/>
</g>
<defs>
<linearGradient
id="paint0_linear_13353_29173"
x1="20.5946"
y1="-24.6981"
x2="42.747"
y2="97.2053"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#FDE24A" />
<stop offset="1" stop-color="#D9771B" />
</linearGradient>
<linearGradient
id="paint1_linear_13353_29173"
x1="20.5946"
y1="-24.6981"
x2="42.747"
y2="97.2053"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="#FDE24A" />
<stop offset="1" stop-color="#D9771B" />
</linearGradient>
<linearGradient
id="paint2_linear_13353_29173"
x1="34.0545"
y1="-0.0937502"
x2="34.0545"
y2="92.7063"
gradientUnits="userSpaceOnUse"
>
<stop stop-color="white" />
<stop offset="1" stop-color="white" stop-opacity="0.4" />
</linearGradient>
<clipPath id="clip0_13353_29173">
<rect width="73.33" height="73.33" fill="white" />
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+110
View File
@@ -0,0 +1,110 @@
export type FaviconVariant = 'default' | 'settings'
export type FaviconEnvironment = 'local' | 'preview' | 'staging'
const PRODUCTION_FAVICON_HREFS = {
default: {
light: '/favicon-light-32x32.png',
dark: '/favicon-32x32.png',
},
settings: {
light: '/favicon-light-settings-32x32.png',
dark: '/favicon-settings-32x32.png',
},
} as const
const FAVICON_MEDIA = [
'(prefers-color-scheme:no-preference)',
'(prefers-color-scheme:light)',
'(prefers-color-scheme:dark)',
] as const
const STAGING_API_PREFIX = 'https://staging-api.modrinth.com'
export function resolveFaviconEnvironment(
config: {
public: {
production?: boolean
preview?: boolean
apiBaseUrl?: string
}
},
hostname: string,
): FaviconEnvironment | null {
if (!config.public.production || hostname === 'localhost' || hostname === '127.0.0.1') {
return 'local'
}
if (String(config.public.apiBaseUrl).startsWith(STAGING_API_PREFIX)) {
return 'staging'
}
if (config.public.preview) {
return 'preview'
}
return null
}
function getFaviconHrefs(variant: FaviconVariant, environment: FaviconEnvironment | null) {
if (!environment) {
return {
...PRODUCTION_FAVICON_HREFS[variant],
type: 'image/png',
sizes: '32x32',
}
}
if (variant === 'settings') {
return {
light: `/dev-favicons/favicon-${environment}-light-settings.svg`,
dark: `/dev-favicons/favicon-${environment}-settings.svg`,
type: 'image/svg+xml',
sizes: 'any',
}
}
const href = `/dev-favicons/favicon-${environment}.svg`
return {
light: href,
dark: href,
type: 'image/svg+xml',
sizes: 'any',
}
}
export function getFaviconHeadLinks(
variant: FaviconVariant = 'default',
environment: FaviconEnvironment | null = null,
) {
const icons = getFaviconHrefs(variant, environment)
const appleTouchIcons = getFaviconHrefs(variant, null)
const hrefByMedia = {
'(prefers-color-scheme:no-preference)': icons.light,
'(prefers-color-scheme:light)': icons.light,
'(prefers-color-scheme:dark)': icons.dark,
}
const appleHrefByMedia = {
'(prefers-color-scheme:no-preference)': appleTouchIcons.light,
'(prefers-color-scheme:light)': appleTouchIcons.light,
'(prefers-color-scheme:dark)': appleTouchIcons.dark,
}
return FAVICON_MEDIA.flatMap((media) => [
{
rel: 'icon',
type: icons.type,
sizes: icons.sizes,
href: hrefByMedia[media],
media,
key: `favicon-${media}`,
},
{
rel: 'apple-touch-icon',
type: appleTouchIcons.type,
href: appleHrefByMedia[media],
media,
sizes: appleTouchIcons.sizes,
key: `apple-touch-icon-${media}`,
},
])
}