songtianlun
87e0c2eec6
- Implement theme switching functionality with a new ThemeController - Add ToastController for displaying notifications - Update various views for improved layout and styling - Introduce animations for toast notifications These changes enhance the user experience by allowing users to switch between light and dark themes and receive feedback through toast notifications. The UI has been improved for better accessibility and aesthetics.
15 lines
335 B
JavaScript
15 lines
335 B
JavaScript
import { Controller } from "@hotwired/stimulus"
|
|
|
|
// Connects to data-controller="toast"
|
|
export default class extends Controller {
|
|
connect() {
|
|
// 3秒后自动隐藏
|
|
setTimeout(() => {
|
|
this.element.classList.add('animate-fade-out')
|
|
setTimeout(() => {
|
|
this.element.remove()
|
|
}, 500)
|
|
}, 3000)
|
|
}
|
|
}
|