avatar修改提示

整理代码
This commit is contained in:
Chenx221 2024-03-09 13:32:35 +08:00
parent 9fa6c68240
commit c94fff7b96
Signed by: chenx221
GPG Key ID: D7A9EC07024C3021
3 changed files with 33 additions and 7 deletions

View File

@ -293,6 +293,18 @@ $darkMode = Yii::$app->user->identity->dark_mode;
</div> </div>
</div> </div>
<?php <?php
Modal::begin([
'title' => '<h4>更改用户头像</h4>',
'id' => 'avatarModal',
// 'size' => 'modal-sm',
]);
echo Html::tag('div', '<i class="fa-solid fa-circle-info" id="info_icon"></i>
<p>要修改头像请前往Gravatar<a href="https://gravatar.com/" target=”_blank”><i class="fa-solid fa-arrow-up-right-from-square"></i></a>,使用相同的电子邮箱地址创建/登录账户后对头像进行管理</p>
<br>Q: 修改头像后不起作用?<br>A: 尝试ctrl+F5强制刷新或清除cache后刷新页面<br><a href="https://support.gravatar.com/" target=”_blank”>更多帮助</a>', ['class' => 'modal-body']);
Modal::end();
Modal::begin([ Modal::begin([
'title' => '<h4>确定?</h4>', 'title' => '<h4>确定?</h4>',
'id' => 'deleteAccountModal', 'id' => 'deleteAccountModal',

View File

@ -94,9 +94,11 @@
color: rgb(100, 96, 100); color: rgb(100, 96, 100);
font-size: 0.95rem; font-size: 0.95rem;
} }
html[data-bs-theme="dark"] .login-info-dv .user-login-info-content { html[data-bs-theme="dark"] .login-info-dv .user-login-info-content {
color: inherit; color: inherit;
} }
.accordion-item { .accordion-item {
margin-bottom: 5px; margin-bottom: 5px;
border-top: var(--bs-accordion-border-width) solid var(--bs-accordion-border-color) !important; border-top: var(--bs-accordion-border-width) solid var(--bs-accordion-border-color) !important;
@ -152,9 +154,11 @@ html[data-bs-theme="dark"] .login-info-dv .user-login-info-content {
font-size: 0.75rem; font-size: 0.75rem;
color: rgb(140, 139, 139); color: rgb(140, 139, 139);
} }
html[data-bs-theme="dark"] .storage-columns span, .storage-columns p { html[data-bs-theme="dark"] .storage-columns span, .storage-columns p {
color: inherit; color: inherit;
} }
.storage-columns p { .storage-columns p {
margin-bottom: 0.5rem !important; margin-bottom: 0.5rem !important;
} }
@ -187,12 +191,18 @@ html[data-bs-theme="dark"] .storage-columns span, .storage-columns p {
border-radius: 4px; border-radius: 4px;
} }
#current{ #current {
font-weight: 600; font-weight: 600;
font-size: 1.4rem; font-size: 1.4rem;
color: black; color: black;
padding-left: 2px; padding-left: 2px;
} }
html[data-bs-theme="dark"] #current{
html[data-bs-theme="dark"] #current {
color: inherit; color: inherit;
} }
#info_icon {
font-size: 2em;
line-height: 1.5;
}

View File

@ -9,7 +9,7 @@ $(document).ready(function () {
$('#totp-enabled').change(function () { $('#totp-enabled').change(function () {
if (this.checked) { if (this.checked) {
$('#totpSetupModal').modal('show'); $('#totpSetupModal').modal('show');
}else { } else {
$.post('index.php?r=user%2Fremove-two-factor', function () { $.post('index.php?r=user%2Fremove-two-factor', function () {
location.reload(); location.reload();
}); });
@ -18,18 +18,22 @@ $(document).ready(function () {
$('#totpSetupModal').on('hidden.bs.modal', function () { $('#totpSetupModal').on('hidden.bs.modal', function () {
$('#totp-enabled').prop('checked', false); $('#totp-enabled').prop('checked', false);
}); });
$('#useDarkTheme').change(function() { $('#useDarkTheme').change(function () {
var darkMode = this.checked ? 1 : 0; var darkMode = this.checked ? 1 : 0;
$.post('index.php?r=user%2Fset-theme', {dark_mode: darkMode}, function() { $.post('index.php?r=user%2Fset-theme', {dark_mode: darkMode}, function () {
location.reload(); location.reload();
}); });
}); });
$('#followSystemTheme').change(function() { $('#followSystemTheme').change(function () {
$('#useDarkTheme').prop('checked', false); $('#useDarkTheme').prop('checked', false);
var darkMode = this.checked ? 2 : 0; var darkMode = this.checked ? 2 : 0;
$.post('index.php?r=user%2Fset-theme', {dark_mode: darkMode}, function() { $.post('index.php?r=user%2Fset-theme', {dark_mode: darkMode}, function () {
location.reload(); location.reload();
}); });
}); });
}); });
document.querySelector('.avatar-container').addEventListener('click', function () {
$('#avatarModal').modal('show');
});