
<style>
    .modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 1rem 1.5rem;
    width: 24rem;
    border-radius: 0.5rem;
}

.close-button {
    float: right;
    width: 1.5rem;
    line-height: 1.5rem;
    text-align: center;
    cursor: pointer;
    border-radius: 0.25rem;
    background-color: lightgray;
}

.close-button:hover {
    background-color: darkgray;
}

.show-modal {
    opacity: 1;
    visibility: visible;
    transform: scale(1.0);
    transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
}

</style>

<div class="modal">
    <div class="modal-content">
        <span class="close-button">×</span>
        <h1>Hello, I am a modal!</h1>
    </div>
</div>
  <!-- <script src="assets/admin/js/model.js"></script> -->
  <script type="text/javascript" src="<?php echo base_url('assets/admin/js/model.js'); ?>"></script>
  <script>
    document.addEventListener('DOMContentLoaded', function() {
    const modal = document.getElementById('myModal');
    const trigger = document.querySelector('.trigger');
    const closeButton = modal.querySelector('.btn-close');

    function toggleModal() {
        modal.classList.toggle('show');
        modal.style.display = modal.style.display === 'block' ? 'none' : 'block';
    }

    trigger.addEventListener('click', toggleModal);
    closeButton.addEventListener('click', toggleModal);

    window.addEventListener('click', function(event) {
        if (event.target === modal) {
            toggleModal();
        }
    });
});
  </script>