Initial Commit
This commit is contained in:
71
examples/generic.html
Normal file
71
examples/generic.html
Normal 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>
|
||||
Reference in New Issue
Block a user