Initial Commit

This commit is contained in:
2026-02-27 11:39:29 +02:00
parent defa9dcd6f
commit 200058ba03
26 changed files with 1445 additions and 2 deletions

71
examples/generic.html Normal file
View File

@@ -0,0 +1,71 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Y2K Alerts - Generic</title>
<link rel="stylesheet" href="../dist/y2k-alerts-generic.css" />
<style>
body {
font-family: Tahoma, Verdana, sans-serif;
padding: 24px;
}
.controls {
display: flex;
gap: 12px;
}
</style>
</head>
<body>
<h1>Generic Theme</h1>
<div class="controls">
<button id="show-warning">Show Warning</button>
<button id="show-input">Show Input Alert</button>
</div>
<script src="../dist/y2k-alerts.js"></script>
<script>
var warningButton = document.getElementById("show-warning");
var inputButton = document.getElementById("show-input");
warningButton.addEventListener("click", function () {
var alertInstance = new y2kAlert(
"Storage Warning",
Y2K.TYPE_WARNING,
"Disk space is running low."
);
alertInstance.addEventListener("submit", function (event) {
console.log("submit", event.detail);
});
alertInstance.addEventListener("close", function (event) {
console.log("close", event.detail);
});
alertInstance.show();
});
inputButton.addEventListener("click", function () {
var alertInstance = new y2kAlert(
"Enter Name",
Y2K.TYPE_INFO,
"Please type your name:",
{
input: {
placeholder: "Name"
},
submitText: "Save"
}
);
alertInstance.addEventListener("submit", function (event) {
console.log("Input value:", event.detail.value);
});
alertInstance.show();
});
</script>
</body>
</html>