هشدارهای شیرین

هشدارهای شیرین


<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_1">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_2">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_3">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_4">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_5">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_6">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_7">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_8">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_9">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_10">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_11">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_12">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_13">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_14">تلاش کنید</button>
<button type="button" class="btn btn-primary text-white fs-16 fw-semibol py-2 px-3 mt-2 me-2" id="sweetalert_15">تلاش کنید</button>
<script>
document.getElementById("sweetalert_1").addEventListener("click", function(e) {
    Swal.fire("شغل خوب!");
});

document.getElementById('sweetalert_2').addEventListener('click', function(e) {
    Swal.fire("عنوان اینجاست!", "...و متنش اینجاست!");
});

document.getElementById('sweetalert_3').addEventListener('click', function(e) {
    Swal.fire("شغل خوب!", "دکمه را زدی!", "warning");
});

document.getElementById('sweetalert_4').addEventListener('click', function(e) {
    Swal.fire("شغل خوب!", "دکمه را زدی!", "error");
});

document.getElementById('sweetalert_5').addEventListener('click', function(e) {
    Swal.fire("شغل خوب!", "دکمه را زدی!", "success");
});

document.getElementById('sweetalert_6').addEventListener('click', function(e) {
    Swal.fire("شغل خوب!", "دکمه را زدی!", "info");
});

document.getElementById('sweetalert_7').addEventListener('click', function(e) {
    Swal.fire("شغل خوب!", "دکمه را زدی!", "question");
});

document.getElementById('sweetalert_8').addEventListener('click', function(e) {
    Swal.fire({
        title: "شغل خوب!",
        text: "دکمه را زدی!",
        icon: "success",
        buttonsStyling: false,
        confirmButtonText: "منو تایید کن!",
        customClass: {
            confirmButton: "btn btn-primary"
        }
    });
});

document.getElementById('sweetalert_9').addEventListener('click', function(e) {
    Swal.fire({
        title: "شغل خوب!",
        text: "دکمه را زدی!",
        icon: "success",
        buttonsStyling: false,
        confirmButtonText: " من بازی هستم!",
        showCancelButton: true,
        cancelButtonText: " نه ممنون",
        customClass: {
            confirmButton: "btn btn-danger",
            cancelButton: "btn btn-default"
        }
    });
});

document.getElementById('sweetalert_10').addEventListener('click', function(e) {
    Swal.fire({
        position: "top-right",
        icon: "success",
        title: "کار شما ذخیره شده است",
        showConfirmButton: false,
        timer: 1500
    });
});

document.getElementById('sweetalert_11').addEventListener('click', function(e) {
    Swal.fire({
        title: 'مثال jQuery HTML',
        showClass: {
            popup: 'animate__animated animate__fadeInDown'
        },
        hideClass: {
            popup: 'animate__animated animate__fadeOutUp'
        }
    });
});

document.getElementById('sweetalert_12').addEventListener('click', function(e) {
    Swal.fire({
        title: "مطمئنی؟",
        text: "شما برنده شدید تا بتوانید این را برگردانید!",
        icon: "warning",
        showCancelButton: true,
        confirmButtonText: "بله حذفش کن!"
    }).then(function(result) {
        if (result.value) {
            Swal.fire(
                "حذف!",
                "فایل شما حذف شده است",
                "success"
            );
        }
    });
});

document.getElementById('sweetalert_13').addEventListener('click', function(e) {
    Swal.fire({
        title: "مطمئنی؟",
        text: "شما برنده شدید تا بتوانید این را برگردانید!",
        icon: "warning",
        showCancelButton: true,
        confirmButtonText: "بله حذفش کن!",
        cancelButtonText: "نه، لغو!",
        reverseButtons: true
    }).then(function(result) {
        if (result.value) {
            Swal.fire(
                "حذف!",
                "فایل شما حذف شده است",
                "success"
            );
        } else if (result.dismiss === "cancel") {
            Swal.fire(
                "لغو شد",
                "فایل خیالی شما امن است :)",
                "error"
            );
        }
    });
});

document.getElementById('sweetalert_14').addEventListener('click', function(e) {
    Swal.fire({
        title: "شیرین!",
        text: "مدال با تصویر سفارشی.",
        imageUrl: "https://camo.envatousercontent.com/5b57b814db32f74f4ce750680390a407898cc665/68747470733a2f2f696d616765732e656e76797468656d652e636f6d2f72656163742d76657273696f6e2d617661696c61626c652e6a7067",
        imageWidth: 400,
        imageHeight: 200,
        imageAlt: "Custom image",
        animation: false
    });
});

document.getElementById('sweetalert_15').addEventListener('click', function(e) {
    Swal.fire({
        title: "هشدار بسته خودکار!",
        text: "5 ثانیه دیگه میبندم",
        timer: 5000,
        onOpen: function() {
            Swal.showLoading();
        }
    }).then(function(result) {
        if (result.dismiss === "timer") {
            console.log("I was closed by the timer");
        }
    });
});
</script>