Notifier.js 376 B

12345678910111213141516
  1. import Elem from "./Elem.js";
  2. export default class Notifier{
  3. constructor(type, message){
  4. this.elem = new Elem("p")
  5. .addClass("notifier")
  6. .addClass(type)
  7. .text(message)
  8. .appendTo(document.body)
  9. .get();
  10. setTimeout(()=>{
  11. document.body.removeChild(this.elem);
  12. }, 7500);
  13. }
  14. }