Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

DulliAG/Snackbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Snackbar

Simple & reliable snackbar used by dulliag.de


💡 How to use

  1. Import CSS-Stylesheet using <link rel="stylesheet" href="./snackbar.css" />
  2. Import JavaScript-File using <script src="./snackbar"></script>
  3. How to run an snackbar
// Run success-snackbar
new Snackbar("This is some dummy text", 3000).success();

// Run info-snackbar
new Snackbar("This is some dummy text", 3000).info();

// Run error-snackbar
new Snackbar("This is some dummy text", 3000).error();
  1. You can edit some settings in the constructor of the class
constructor(text, duration = 5000/* This is the default time in milliseconds the snackbar is visivle*/) {
  this.text = text;
  this.duration = duration;
  this.closeText = "Ok"; // Change the dismiss-button text
}
  1. The CSS-Stylesheet uses variables for colors & other snackbar-settings
:root {
  --maxWidth: 350px;
  --width: 350px;
  --backgroundColor: #333;
  --success: #28a745;
  --info: #007bff;
  --error: #dc3545;
  --borderRadius: 8px;
  --text: rgba(255, 255, 255, 0.8);
  --buttonHover: rgba(255, 255, 255, 0.15);
  --animationInName: fadeInToLeft;
  --animationOutName: fadeOutToRight;
  --animationFillMode: both;
  --animationDuration: 0.3s;
}

🔗 Ressourcen

FontAwesome

About

Simple & reliable snackbar used by dulliag.de

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published