o1-preview-2024-09-12· OpenAI
WildChat-4.8M (AI2)
Write a demo log in form using "Material You" design (dark mode + in HTML)
- User
Write a demo log in form using "Material You" design (dark mode + in HTML)
- Assistant
Write a demo log in form using "Material You" design (dark mode + in HTML)
Certainly! Below is a demo login form crafted using the "Material You" design principles in dark mode. This implementation uses HTML and CSS to replicate the sleek and modern aesthetics of Material You.
You can copy the code and save it as an .html file to view it in your browser.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Material You Login Form</title>
<style>
/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap');
/* Root variables for theming */
:root {
--md-primary: #bb86fc;
--md-primary-variant: #3700b3;
--md-background: #121212;
--md-surface: #1e1e1e;
--md-error: #cf6679;
--md-on-primary: #000000;
--md-on-background: #ffffff;
--md-on-surface: #ffffff;
--md-on-error: #000000;
}
body {
margin: 0;
padding: 0;
background-color: var(--md-background);
color: var(--md-on-background);
font-family: 'Roboto', sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-container {
background-color: var(--md-surface);
padding: 2rem;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.7);
max-width: 400px;
width: 100%;
}
.login-container h2 {
margin-bottom: 1.5rem;
font-weight: 500;
color: var(--md-on-surface);
}
.input-field {
position: relative;
margin-bottom: 1.5rem;
}
.input-field input {
width: 100%;
padding: 1rem 0.5rem 0.5rem 0.5rem;
background: transparent;
border: none;
border-bottom: 1px solid var(--md-on-surface);
color: var(--md-on-surface);
font-size: 1rem;
}
.input-field label {
position: absolute;
top: 1rem;
left: 0.5rem;
font-size: 1rem;
color: var(--md-on-surface);
pointer-events: none;
transition: all 0.2s ease;
}
.input-field input:focus + label,
.input-field input:not(:placeholder-shown) + label {
top: 0.2rem;
font-size: 0.8rem;
color: var(--md-primary);
}
.input-field input:focus {
outline: none;
border-bottom: 2px solid var(--md-primary);
}
.login-button {
width: 100%;
padding: 0.75rem;
background-color: var(--md-primary);
color: var(--md-on-primary);
border: none;
border-radius: 6px;
font-size: 1rem;
font-weight: 500;
cursor: pointer;
transition: background-color 0.2s ease;
}
.login-button:hover {
background-color: var(--md-primary-variant);
}
.forgot-password {
margin-top: 1rem;
text-align: center;
}
.forgot-password a {
color: var(--md-primary);
text-decoration: none;
font-size: 0.9rem;
}
.forgot-password a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<form action="#" method="post">
<div class="input-field">
<input type="email" id="email" name="email" required placeholder=" " />
<label for="email">Email Address</label>
</div>
<div class="input-field">
<input type="password" id="password" name="password" required placeholder=" " />
<label for="password">Password</label>
</div>
<button type="submit" class="login-button">Sign In</button>
</form>
<div class="forgot-password">
<a href="#">Forgot Password?</a>
</div>
</div>
</body>
</html>
When you open this HTML file in your browser, you'll see a sleek login form that adapts to dark mode, consistent with Material You design principles.
.html extension, like login.html.:root to change the color scheme.<h2>, labels, and buttons to match your application's terminology.href attribute in the forgot password link to point to your actual recovery page.action="#" in the form tag indicates where the form data should be sent. Replace # with your server endpoint to process the login data.Feel free to ask if you need further assistance or additional features!
Not yet included in a published release.