Skip to content

Commit

Permalink
⚡️ Toast (java)script
Browse files Browse the repository at this point in the history
  • Loading branch information
Funasitien committed Aug 31, 2024
1 parent 6c466e5 commit 935c7ff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,17 @@ import Form from "../components/Form.astro";
<div class="card" style="margin: 6rem;">
<div class="card-body"><Form /></div>
</div>

<script is:inline>
const toastTrigger = document.getElementById("liveToastBtn");
const toastLiveExample = document.getElementById("liveToast");

if (toastTrigger) {
const toastBootstrap =
bootstrap.Toast.getOrCreateInstance(toastLiveExample);
toastTrigger.addEventListener("click", () => {
toastBootstrap.show();
});
}
</script>
</Bootstrap>

0 comments on commit 935c7ff

Please sign in to comment.