Last active
June 26, 2025 06:06
-
-
Save cybertiwari/e3923a653a8846cad92a3e107547b0e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="mb-5"> | |
@if (session('success')) | |
<div x-data="{ show: true }" x-show="show" | |
class="relative flex items-center border p-3.5 rounded before:absolute before:top-1/2 ltr:before:left-0 rtl:before:right-0 rtl:before:rotate-180 before:-mt-2 before:border-l-8 before:border-t-8 before:border-b-8 before:border-t-transparent before:border-b-transparent before:border-l-inherit text-success bg-success-light !border-success ltr:border-l-[64px] rtl:border-r-[64px] dark:bg-success-dark-light"> | |
<span class="absolute ltr:-left-11 rtl:-right-11 inset-y-0 text-white w-6 h-6 m-auto"> | |
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" | |
xmlns="http://www.w3.org/2000/svg" class="w-6 h-6"> | |
<path | |
d="M19.0001 9.7041V9C19.0001 5.13401 15.8661 2 12.0001 2C8.13407 2 5.00006 5.13401 5.00006 9V9.7041C5.00006 10.5491 4.74995 11.3752 4.28123 12.0783L3.13263 13.8012C2.08349 15.3749 2.88442 17.5139 4.70913 18.0116C9.48258 19.3134 14.5175 19.3134 19.291 18.0116C21.1157 17.5139 21.9166 15.3749 20.8675 13.8012L19.7189 12.0783C19.2502 11.3752 19.0001 10.5491 19.0001 9.7041Z" | |
stroke="currentColor" stroke-width="1.5"></path> | |
<path d="M7.5 19C8.15503 20.7478 9.92246 22 12 22C14.0775 22 15.845 20.7478 16.5 19" | |
stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path> | |
<path d="M12 6V10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"> | |
</path> | |
</svg> | |
</span> | |
<span class="ltr:pr-2 rtl:pl-2"><strong | |
class="ltr:mr-1 rtl:ml-1">Success!</strong>{{ session('success') }}</span> | |
<button @click="show = false" type="button" | |
class="ltr:ml-auto rtl:mr-auto hover:opacity-80"> | |
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" | |
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" | |
stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5"> | |
<line x1="18" y1="6" x2="6" y2="18"></line> | |
<line x1="6" y1="6" x2="18" y2="18"></line> | |
</svg> | |
</button> | |
</div> | |
@endif | |
@if (session('error')) | |
<div x-data="{ show: true }" x-show="show" | |
class="relative flex items-center border p-3.5 rounded before:inline-block before:absolute before:top-1/2 ltr:before:right-0 rtl:before:left-0 rtl:before:rotate-180 before:-mt-2 before:border-r-8 before:border-t-8 before:border-b-8 before:border-t-transparent before:border-b-transparent before:border-r-inherit text-danger bg-danger-light border-danger ltr:border-r-[64px] rtl:border-l-[64px] dark:bg-danger-dark-light"> | |
<span class="absolute ltr:-right-11 rtl:-left-11 inset-y-0 text-white w-6 h-6 m-auto"> | |
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" | |
xmlns="http://www.w3.org/2000/svg" class="w-6 h-6"> | |
<circle opacity="0.5" cx="12" cy="12" r="10" | |
stroke="currentColor" stroke-width="1.5" /> | |
<path d="M12 7V13" stroke="currentColor" stroke-width="1.5" | |
stroke-linecap="round" /> | |
<circle cx="12" cy="16" r="1" fill="currentColor" /> | |
</svg> | |
</span> | |
<span class="ltr:pr-2 rtl:pl-2"><strong | |
class="ltr:mr-1 rtl:ml-1">Error!</strong>{{ session('error') }}</span> | |
<button @click="show = false" type="button" | |
class="ltr:ml-auto rtl:mr-auto hover:opacity-80"> | |
<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" | |
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" | |
stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5"> | |
<line x1="18" y1="6" x2="6" y2="18"></line> | |
<line x1="6" y1="6" x2="18" y2="18"></line> | |
</svg> | |
</button> | |
</div> | |
@endif | |
</div> | |
<script> | |
document.addEventListener("DOMContentLoaded", () => { | |
document.querySelectorAll(".delete-form").forEach((form) => { | |
form.addEventListener("submit", function(e) { | |
e.preventDefault(); | |
Swal.fire({ | |
icon: 'warning', | |
title: 'Are you sure?', | |
text: 'You won \'t be able to revert this!', | |
showCancelButton: true, | |
confirmButtonText: 'Delete', | |
padding: '2em', | |
customClass: 'sweet-alerts', | |
}).then((result) => { | |
if (result.isConfirmed) { | |
form.submit(); | |
new window.Swal({ | |
title: 'Deleted!', | |
text: 'Your file has been deleted.', | |
icon: 'success', | |
customClass: 'sweet-alerts' | |
}); | |
} | |
}); | |
}); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment