V0.27.2.250618_alpha:更新了登录界面的样式
This commit is contained in:
parent
03feef2300
commit
bd1c5ea1c7
Binary file not shown.
@ -19,207 +19,280 @@ class AuthComponent extends HTMLElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
background: #f5f7fa;
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
}
|
}
|
||||||
.container {
|
.container {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
max-width: 1200px;
|
max-width: 1000px;
|
||||||
min-height: 600px;
|
min-height: 600px;
|
||||||
background: white;
|
background: white;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
padding: 60px;
|
padding: 60px 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: white;
|
color: white;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.content::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: -50%;
|
||||||
|
left: -50%;
|
||||||
|
width: 200%;
|
||||||
|
height: 200%;
|
||||||
|
background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
|
||||||
|
animation: float 6s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
@keyframes float {
|
||||||
|
0%, 100% { transform: translateY(0px) rotate(0deg); }
|
||||||
|
50% { transform: translateY(-20px) rotate(180deg); }
|
||||||
}
|
}
|
||||||
.welcome-section {
|
.welcome-section {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
.welcome-section h1 {
|
.welcome-section h1 {
|
||||||
font-size: 3.5rem;
|
font-size: 4rem;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 1.5rem;
|
||||||
font-weight: 700;
|
font-weight: 800;
|
||||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
|
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
||||||
|
letter-spacing: 2px;
|
||||||
}
|
}
|
||||||
.welcome-text {
|
.welcome-text {
|
||||||
font-size: 1.2rem;
|
font-size: 1.3rem;
|
||||||
line-height: 1.8;
|
line-height: 1.8;
|
||||||
opacity: 0.9;
|
opacity: 0.95;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
.welcome-text p {
|
||||||
|
margin: 0.5rem 0;
|
||||||
}
|
}
|
||||||
.auth-container {
|
.auth-container {
|
||||||
width: 500px;
|
width: 450px;
|
||||||
background: white;
|
background: white;
|
||||||
padding: 40px;
|
padding: 50px 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.form-toggle {
|
.form-toggle {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 40px;
|
||||||
border-radius: 8px;
|
border-radius: 12px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
||||||
|
background: #f8f9fa;
|
||||||
|
padding: 4px;
|
||||||
}
|
}
|
||||||
.toggle-btn {
|
.toggle-btn {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 15px;
|
padding: 16px 20px;
|
||||||
border: none;
|
border: none;
|
||||||
background: #f0f0f0;
|
background: transparent;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 1rem;
|
font-size: 1.1rem;
|
||||||
font-weight: 500;
|
font-weight: 600;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
|
border-radius: 8px;
|
||||||
|
color: #6c757d;
|
||||||
}
|
}
|
||||||
.toggle-btn.active {
|
.toggle-btn.active {
|
||||||
background: #667eea;
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
color: white;
|
color: white;
|
||||||
|
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
|
||||||
}
|
}
|
||||||
.form-panel {
|
.form-panel {
|
||||||
display: none;
|
display: none;
|
||||||
animation: fadeIn 0.3s ease;
|
animation: slideIn 0.4s ease;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
@keyframes fadeIn {
|
@keyframes slideIn {
|
||||||
from { opacity: 0; transform: translateY(10px); }
|
from { opacity: 0; transform: translateY(20px); }
|
||||||
to { opacity: 1; transform: translateY(0); }
|
to { opacity: 1; transform: translateY(0); }
|
||||||
}
|
}
|
||||||
.form-panel.active {
|
.form-panel.active {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.form-group {
|
.form-group {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 25px;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.form-row {
|
.form-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 25px;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.form-row .form-group {
|
.form-row .form-group {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
label {
|
label {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 10px;
|
||||||
color: #555;
|
color: #495057;
|
||||||
font-weight: 500;
|
font-weight: 600;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
input {
|
input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 12px 15px;
|
padding: 15px 18px;
|
||||||
border: 2px solid #eee;
|
border: 2px solid #e9ecef;
|
||||||
border-radius: 8px;
|
border-radius: 12px;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
|
background: #f8f9fa;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 52px;
|
||||||
}
|
}
|
||||||
input:focus {
|
input:focus {
|
||||||
border-color: #667eea;
|
border-color: #667eea;
|
||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
|
||||||
|
background: white;
|
||||||
}
|
}
|
||||||
.password-input {
|
.password-input {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
.password-input input {
|
.password-input input {
|
||||||
padding-right: 40px;
|
padding-right: 50px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.toggle-password {
|
.toggle-password {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10px;
|
right: 15px;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 5px;
|
padding: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
transition: opacity 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
|
border-radius: 6px;
|
||||||
|
z-index: 2;
|
||||||
}
|
}
|
||||||
.toggle-password:hover {
|
.toggle-password:hover {
|
||||||
opacity: 0.7;
|
background: rgba(102, 126, 234, 0.1);
|
||||||
}
|
}
|
||||||
.toggle-password:focus {
|
.toggle-password:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
.visibility-icon {
|
.visibility-icon {
|
||||||
width: 20px;
|
width: 18px;
|
||||||
height: 20px;
|
height: 18px;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
opacity: 0.6;
|
||||||
.remember-me {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.remember-me input {
|
|
||||||
width: auto;
|
|
||||||
}
|
}
|
||||||
.submit-btn {
|
.submit-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 15px;
|
padding: 18px;
|
||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 8px;
|
border-radius: 12px;
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 1rem;
|
font-size: 1.1rem;
|
||||||
font-weight: 500;
|
font-weight: 600;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
|
margin-top: 10px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.submit-btn::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: -100%;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
|
||||||
|
transition: left 0.5s;
|
||||||
|
}
|
||||||
|
.submit-btn:hover::before {
|
||||||
|
left: 100%;
|
||||||
}
|
}
|
||||||
.submit-btn:hover {
|
.submit-btn:hover {
|
||||||
transform: translateY(-2px);
|
transform: translateY(-3px);
|
||||||
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
|
box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
|
||||||
|
}
|
||||||
|
.submit-btn:active {
|
||||||
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
.toast {
|
.toast {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
background: rgba(0, 0, 0, 0.8);
|
background: rgba(0, 0, 0, 0.9);
|
||||||
color: white;
|
color: white;
|
||||||
padding: 12px 24px;
|
padding: 15px 25px;
|
||||||
border-radius: 8px;
|
border-radius: 10px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
z-index: 10000;
|
z-index: 10000;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
}
|
}
|
||||||
.toast.show {
|
.toast.show {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
.required-field::after {
|
||||||
|
content: ' *';
|
||||||
|
color: #dc3545;
|
||||||
|
}
|
||||||
@media (max-width: 1024px) {
|
@media (max-width: 1024px) {
|
||||||
.container {
|
.container {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: auto;
|
min-height: auto;
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
|
max-width: 500px;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
padding: 40px;
|
padding: 40px 30px;
|
||||||
}
|
}
|
||||||
.auth-container {
|
.auth-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
padding: 40px 30px;
|
||||||
|
}
|
||||||
|
.welcome-section h1 {
|
||||||
|
font-size: 3rem;
|
||||||
|
}
|
||||||
|
.form-row {
|
||||||
|
gap: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@media (max-width: 480px) {
|
@media (max-width: 480px) {
|
||||||
.container {
|
.container {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
.auth-container {
|
.auth-container {
|
||||||
padding: 20px;
|
padding: 30px 20px;
|
||||||
}
|
}
|
||||||
.welcome-section h1 {
|
.welcome-section h1 {
|
||||||
font-size: 2.5rem;
|
font-size: 2.5rem;
|
||||||
@ -228,6 +301,32 @@ class AuthComponent extends HTMLElement {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
}
|
}
|
||||||
|
.form-row .form-group {
|
||||||
|
flex: none;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.form-toggle {
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
.toggle-btn {
|
||||||
|
padding: 14px 16px;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
height: 48px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
}
|
||||||
|
.password-input input {
|
||||||
|
padding-right: 45px;
|
||||||
|
}
|
||||||
|
.toggle-password {
|
||||||
|
right: 12px;
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
.visibility-icon {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@ -249,11 +348,11 @@ class AuthComponent extends HTMLElement {
|
|||||||
<div id="loginForm" class="form-panel active">
|
<div id="loginForm" class="form-panel active">
|
||||||
<form id="loginFormElement">
|
<form id="loginFormElement">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="loginUsername">用户名</label>
|
<label for="loginUsername" class="required-field">用户名</label>
|
||||||
<input type="text" id="loginUsername" name="username" placeholder="请输入用户名" required>
|
<input type="text" id="loginUsername" name="username" placeholder="请输入用户名" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="loginPassword">密码</label>
|
<label for="loginPassword" class="required-field">密码</label>
|
||||||
<div class="password-input">
|
<div class="password-input">
|
||||||
<input type="password" id="loginPassword" name="password" placeholder="请输入密码" required>
|
<input type="password" id="loginPassword" name="password" placeholder="请输入密码" required>
|
||||||
<button type="button" class="toggle-password">
|
<button type="button" class="toggle-password">
|
||||||
@ -261,10 +360,6 @@ class AuthComponent extends HTMLElement {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group remember-me">
|
|
||||||
<input type="checkbox" id="remember" name="remember">
|
|
||||||
<label for="remember">记住我</label>
|
|
||||||
</div>
|
|
||||||
<button type="submit" class="submit-btn">登录</button>
|
<button type="submit" class="submit-btn">登录</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -273,7 +368,7 @@ class AuthComponent extends HTMLElement {
|
|||||||
<form id="registerFormElement">
|
<form id="registerFormElement">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="regUsername">用户名 *</label>
|
<label for="regUsername" class="required-field">用户名</label>
|
||||||
<input type="text" id="regUsername" name="username" placeholder="请输入用户名" required>
|
<input type="text" id="regUsername" name="username" placeholder="请输入用户名" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -283,7 +378,7 @@ class AuthComponent extends HTMLElement {
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="regPassword">密码 *</label>
|
<label for="regPassword" class="required-field">密码</label>
|
||||||
<div class="password-input">
|
<div class="password-input">
|
||||||
<input type="password" id="regPassword" name="password" placeholder="请输入密码" required>
|
<input type="password" id="regPassword" name="password" placeholder="请输入密码" required>
|
||||||
<button type="button" class="toggle-password">
|
<button type="button" class="toggle-password">
|
||||||
@ -292,7 +387,7 @@ class AuthComponent extends HTMLElement {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="regConfirmPassword">确认密码 *</label>
|
<label for="regConfirmPassword" class="required-field">确认密码</label>
|
||||||
<div class="password-input">
|
<div class="password-input">
|
||||||
<input type="password" id="regConfirmPassword" name="confirmPassword" placeholder="请再次输入密码" required>
|
<input type="password" id="regConfirmPassword" name="confirmPassword" placeholder="请再次输入密码" required>
|
||||||
<button type="button" class="toggle-password">
|
<button type="button" class="toggle-password">
|
||||||
@ -388,7 +483,6 @@ class AuthComponent extends HTMLElement {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const username = this.shadowRoot.getElementById('loginUsername').value;
|
const username = this.shadowRoot.getElementById('loginUsername').value;
|
||||||
const password = this.shadowRoot.getElementById('loginPassword').value;
|
const password = this.shadowRoot.getElementById('loginPassword').value;
|
||||||
const remember = this.shadowRoot.getElementById('remember').checked;
|
|
||||||
|
|
||||||
if (!username || !password) {
|
if (!username || !password) {
|
||||||
showToast('请输入用户名和密码');
|
showToast('请输入用户名和密码');
|
||||||
@ -396,7 +490,7 @@ class AuthComponent extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.dispatchEvent(new CustomEvent('login', {
|
this.dispatchEvent(new CustomEvent('login', {
|
||||||
detail: { username, password, remember },
|
detail: { username, password },
|
||||||
bubbles: true,
|
bubbles: true,
|
||||||
composed: true
|
composed: true
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user