PHP Classes

File: resources/views/index/cookie18.blade.php

Recommend this page to a friend!
  Classes of adam berger   Laravel Cookie 18   resources/views/index/cookie18.blade.php   Download  
File: resources/views/index/cookie18.blade.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Laravel Cookie 18
Ask the users to confirm they are adults
Author: By
Last change:
Date: 1 year ago
Size: 2,528 bytes
 

Contents

Class file image Download
<style>
.cookis-box {

  background: #000000;
  opacity: 0.9;
  z-index: 9999;
  position: fixed; /* Stoi w jednym miejscu niezaleznie od strony */
}
.cookis-box .container {
  text-align: center;
  margin-top: 30px;
  padding-top: 30px;
  padding-bottom: 20px;
}
</style>

<div class="cookis-box">
    <div class="cookis-history">
        <i class="bi bi-clock-history"></i>
    </div>
    <div class="container">
        <div class="modal bg-dark text-black-50" id="box18Input" tabindex="-1" aria-labelledby="titleModalLabel" aria-hidden="true" >
          <div class="modal-dialog">
            <div class="modal-content bg-secondary">
              <div class="modal-header">
                <h5 class="modal-title" id="titleModalLabel">Informacja Strony</h5>
                <button type="button" class="btn-close close-cookis" data-bs-dismiss="modal" aria-label="Close"></button>
              </div>
              <div class="modal-body">
                  <p>Ta strona ma tre?ci przeznaczone tylko dla osób które uko?czy?y <b class="text-danger">18 lat</b></p>
                <p>Je?eli nie masz tyle lat to opu?? t? stron? poprzez naci?ni?cie przycisku Zamknij</p>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-warning close-cookis" data-bs-dismiss="modal">Zamknij</button>
                <button type="button" class="btn btn-success accept-cookis">Wchodz? na stron?</button>
              </div>
            </div>
          </div>
        </div>
    </div>
</div>

<script>
$(document).ready(function(){
        // otwieramy box
       $("#box18Input").modal('show');
       // blokujemy t?o na klikanie
       $("#box18Input").off('click');

    const nameCookis = '{{ $cookis[1] }}';
    const coc = '{{ $cookis[0] }}';
   
    // przekierowanie po klikni?ciu Zamknij
    $(".close-cookis").click(function(){
        location.href='http://google.pl';
    });

    $(".accept-cookis").click(function(){
          // Zapisz cookie
          setCookis(nameCookis);
          // wy??cz box
          $("#box18Input").modal('hide');
          $(".cookis-box").hide();
    });
     
    function setCookis(name) {
                const value = '{{ $cookis[2] }}';
              // Save
                document.cookie = name + '=' + value
                    + '; max-age='+(360 * 24 * 60 * 60)
                    + '; path=/'
                    + '; samesite= Lax';
    }
});
</script>