mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-05-07 04:42:42 +08:00
refactor:将 config_editor 页面中的提示(notification)样式完全统一为与 keys_status 页面一致的黑色半透明风格,无论提示类型均不会再出现绿色等色块。
This commit is contained in:
@@ -680,29 +680,17 @@ async function executeReset() {
|
||||
function showNotification(message, type = 'info') {
|
||||
const notification = document.getElementById('notification');
|
||||
notification.textContent = message;
|
||||
|
||||
// 设置适当的样式
|
||||
if (type === 'error') {
|
||||
notification.classList.add('bg-danger-500');
|
||||
notification.classList.remove('bg-black');
|
||||
} else {
|
||||
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中一致
|
||||
|
||||
// 统一样式为黑色半透明,与 keys_status.js 保持一致
|
||||
notification.classList.remove('bg-danger-500');
|
||||
notification.classList.add('bg-black');
|
||||
notification.style.backgroundColor = 'rgba(0,0,0,0.8)';
|
||||
notification.style.color = '#fff';
|
||||
|
||||
// 应用过渡效果
|
||||
notification.style.opacity = "1";
|
||||
notification.style.transform = "translate(-50%, 0)";
|
||||
|
||||
|
||||
// 设置自动消失
|
||||
setTimeout(() => {
|
||||
notification.style.opacity = "0";
|
||||
|
||||
@@ -42,6 +42,11 @@
|
||||
@apply: bg-primary-600;
|
||||
background-color: #4F46E5;
|
||||
}
|
||||
/* 统一通知样式为黑色半透明,确保与 keys_status 一致 */
|
||||
.notification {
|
||||
background: rgba(0,0,0,0.8) !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user