refactor:将 config_editor 页面中的提示(notification)样式完全统一为与 keys_status 页面一致的黑色半透明风格,无论提示类型均不会再出现绿色等色块。

This commit is contained in:
snaily
2025-04-17 09:19:41 +08:00
parent 6a59b4f847
commit 87d60117c5
2 changed files with 14 additions and 21 deletions

View File

@@ -680,29 +680,17 @@ async function executeReset() {
function showNotification(message, type = 'info') { function showNotification(message, type = 'info') {
const notification = document.getElementById('notification'); const notification = document.getElementById('notification');
notification.textContent = message; notification.textContent = message;
// 设置适当的样式 // 统一样式为黑色半透明,与 keys_status.js 保持一致
if (type === 'error') { notification.classList.remove('bg-danger-500');
notification.classList.add('bg-danger-500'); notification.classList.add('bg-black');
notification.classList.remove('bg-black'); notification.style.backgroundColor = 'rgba(0,0,0,0.8)';
} else { notification.style.color = '#fff';
notification.classList.remove('bg-danger-500');
notification.classList.add('bg-black'); // 应用过渡效果
// 可以为不同类型设置不同的颜色
if (type === 'success') {
notification.style.backgroundColor = '#22c55e'; // 绿色
} else if (type === 'info') {
notification.style.backgroundColor = '#3b82f6'; // 蓝色
} else if (type === 'warning') {
notification.style.backgroundColor = '#f59e0b'; // 橙色
}
}
// 应用过渡效果 - 与keys_status.js中一致
notification.style.opacity = "1"; notification.style.opacity = "1";
notification.style.transform = "translate(-50%, 0)"; notification.style.transform = "translate(-50%, 0)";
// 设置自动消失 // 设置自动消失
setTimeout(() => { setTimeout(() => {
notification.style.opacity = "0"; notification.style.opacity = "0";

View File

@@ -42,6 +42,11 @@
@apply: bg-primary-600; @apply: bg-primary-600;
background-color: #4F46E5; background-color: #4F46E5;
} }
/* 统一通知样式为黑色半透明,确保与 keys_status 一致 */
.notification {
background: rgba(0,0,0,0.8) !important;
color: #fff !important;
}
</style> </style>
{% endblock %} {% endblock %}