Spaces:
Running
Running
Download static/scripts/notification.js from MsChabane/SmartDoc: direct link, hf CLI and curl.
- Browser
- Download file 633 Bytes
-
https://huggingface.co/spaces/MsChabane/SmartDoc/resolve/73a4eaeb9ee07c818e5cfb394ce57f6eadfaced7/static/scripts/notification.js
- Command line
-
hf download hf://spaces/MsChabane/SmartDoc@73a4eaeb9ee07c818e5cfb394ce57f6eadfaced7/static/scripts/notification.js
-
curl -L -o notification.js https://huggingface.co/spaces/MsChabane/SmartDoc/resolve/73a4eaeb9ee07c818e5cfb394ce57f6eadfaced7/static/scripts/notification.js
633 Bytes
| const wrapper = document.querySelector(".notifications"); | |
| const toast = (message, type) => { | |
| const notification = document.createElement("div"); | |
| notification.innerHTML = ` | |
| <i class="fa fa-xmark close" onclick="this.parentNode.remove()"></i> | |
| <i class="fa-solid ${ | |
| type === "error" ? "fa-circle-xmark" : "fa-triangle-exclamation" | |
| } icon"></i> | |
| <div class="notification-content"> | |
| <h3>${type}</h3> | |
| <p>${message}</p> | |
| </div> | |
| `; | |
| notification.classList.add(...["notification", type]); | |
| wrapper.appendChild(notification); | |
| setTimeout(() => { | |
| notification.remove(); | |
| }, 10000); | |
| }; | |