🔐 style: update auth and loading screen (#3875)

* style: improve auth UI

* style(SocialButton): fix hover style

* remove testing files

* fix: package-lock

* feat: loading screen color based on theme

* fix: handle `system` style on loading screen

* fix(ThemeSelector): Correct icon and text color handling for `system` theme

* remove test file
This commit is contained in:
Marco Beretta 2024-09-11 04:20:19 -09:00 committed by GitHub
parent 020995514e
commit 35a89bfa99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 144 additions and 110 deletions

View file

@ -2,47 +2,57 @@
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="theme-color" content="#171717">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#171717" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>LibreChat</title>
<link
rel="shortcut icon"
href="#"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/assets/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/assets/favicon-16x16.png"
/>
<link
rel="apple-touch-icon"
href="/assets/apple-touch-icon-180x180.png"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1"
/>
<script
defer
type="module"
src="/src/main.jsx"
></script>
<link rel="shortcut icon" href="#" />
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png" />
<link rel="apple-touch-icon" href="/assets/apple-touch-icon-180x180.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
</style>
<script>
const theme = localStorage.getItem('color-theme');
const loadingContainerStyle = document.createElement('style');
let backgroundColor;
if (theme === 'dark') {
backgroundColor = '#0d0d0d';
} else if (theme === 'light') {
backgroundColor = '#ffffff';
} else if (theme === 'system') {
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)').matches;
backgroundColor = prefersDarkScheme ? '#0d0d0d' : '#ffffff';
} else {
backgroundColor = '#ffffff';
}
loadingContainerStyle.innerHTML = `
#loading-container {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background-color: ${backgroundColor};
}
`;
document.head.appendChild(loadingContainerStyle);
</script>
<script defer type="module" src="/src/main.jsx"></script>
</head>
<body>
<div id="root"></div>
<script
type="module"
src="/src/main.jsx"
></script>
<div id="root">
<div id="loading-container"></div>
</div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>