mirror of
https://github.com/picocss/pico.git
synced 2025-04-21 09:06:14 -04:00
Created build-dev script to only build 1 css file for quicker testing enviroment. Added accordion javascript for slide effect. modified the notification scss, and added more demos.
This commit is contained in:
parent
b1fcd44b73
commit
26e82a693d
246 changed files with 1716 additions and 2269 deletions
20
demo/js/notifications.js
Normal file
20
demo/js/notifications.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
function showNotification(options = {}) {
|
||||
const dialog = document.querySelector("dialog[role='alert']");
|
||||
|
||||
if (options.text || typeof options === "string") {
|
||||
dialog.innerText = options.text || options;
|
||||
} else if (options.html) {
|
||||
dialog.innerHTML = options.html;
|
||||
}
|
||||
|
||||
dialog.showModal();
|
||||
|
||||
setTimeout(() => {
|
||||
dialog.close();
|
||||
}, options.delay || 3000);
|
||||
}
|
||||
|
||||
function closeNotification() {
|
||||
const dialog = document.querySelector("dialog[role='alert']");
|
||||
dialog.close();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue