Replaced symlink with local version of Plugins

This commit is contained in:
Michał Gdula 2022-08-07 11:02:42 +01:00
parent 9fd86cb3fc
commit dba8379a0c
8 changed files with 265 additions and 8 deletions

52
Sniffle/sniffle.js Normal file
View file

@ -0,0 +1,52 @@
/*
Close notification
Used by the notifications themself, don't use in code
*/
function sniffleClose(a) {
a.closest(".sniffle-notification").style.transform="translateY(-20rem) scale(0.8)";
a.closest(".sniffle-notification").style.opacity="0";
setTimeout(function(){
a.closest(".sniffle-notification").style.display="none";
a.remove()
}, 200);
};
/*
Add notification
Header > Required
Takes in String input
Description > Required
Takes in String input
Img > Optional
Takes in String input
*/
function sniffleAdd(header, description, colour, img) {
// Colour is optional, so check if it was added or not
if (typeof colour === 'undefined') {
colour = '';
} else {
colour = `style="background-color:${colour};"`;
}
// Image is optional, so check if it was added or not
if (typeof img === 'undefined') {
img = '';
} else {
img = `<img class="sniffle-img" src="${img}">`;
}
var newSniffle = `<div class="sniffle-notification" onclick="sniffleClose(this)" ${colour}>\
${img}\
<div class="sniffle-content">\
<p class="sniffle-header">${header}</p>\
<p class="sniffle-description">${description}</p>\
</div>\
</div>`;
$(".sniffle").append(newSniffle);
};