Cookie message in SCA

Requirement is to show a cookie section in the website of SCA and to store the value for one day.

<div class="cms-content-cms-cookies-smiles">
  <div class= "cms-content-cms-cookies-smiles-horizontal-line">
  </div>
 <p class="cms-content-cms-cookies-para"> To provide a better shopping experience, our website uses cookies. Continuing use of the site implies consent.&nbsp<a class="hreftag" href="/privacy-statement"> Privacy Statement</a>
  </p>
  
   <img src="https://www.enlightenprofessional.tk/SSP Applications/NetSuite Inc. - SCA 2021.2.0/Development/img/cross image.png" class="cms-content-cms-cookies-close-image">
</div>

<style>
.cms-content-cms-cookies-smiles-horizontal-line{
  border-top:3px solid rgb(217, 217, 217);
}
.cms-content-cms-cookies-smiles{
  height:99px;
  width:100%;
  /*background-color: #000;*/
  z-index:999;
  animation: BottomAnimation 2s;
  animation-direction: alternate;
  
}
@keyframes BottomAnimation {
  0%   { bottom:-100px; }
  100% {  bottom:0px;}
}
.hreftag{
    color: #4397d8;
    /*color: white!important;*/
}
.cms-content-cms-cookies-para{
  color:white;
  height:20px;
  font-family:Roobert;
  padding-left: 41px;
  padding-top:44px;
  padding-bottom:45px;
  display:inline-block;
  font-size: 14px;
  font-weight: 300;
  word-break: break-word;
}


 }
 .cms-content-cms-cookies-para a{
   color:#0098a7;
 }
 .cms-content-cms-cookies-close-image{
   padding-right:25px;
   margin-top: 25px;
   float: right;
 }
 @media only screen and (max-width: 3000px) {
  .cms-content-cms-cookies-close-image{
    padding-right: 89px;
    /*margin-top: -25px;*/
   }
   .cms-content-cms-cookies-para{
     font-size: 16px;
   }
  div#cms .cms-content-cms-cookies-smiles{
    height:100px;
   position:fixed;
    bottom:0;
 
  }
 }
 @media only screen and (max-width: 1700px) {
   .cms-content-cms-cookies-close-image{
    padding-right: 25px;
    margin-top: 45px;
   }
   .cms-content-cms-cookies-para{
     font-size: 14px;
   }
   .cms-content-cms-cookies-smiles{
    height:99px;
    position:fixed;
    bottom:0;
  }
   div#cms .cms-content-cms-cookies-smiles{
        height:99px;
   }
 }
 
  @media only screen and (max-width: 767px) {
    .cms-content-cms-cookies-close-image{
     margin-top: -23px;
     padding-right:50px;
    }
    .cms-content-cms-cookies-smiles{
    height:140px;
    position:fixed;
   bottom:0;
    }
    
    .cms-content-cms-cookies-para {
    padding-bottom: 48px;
    padding-right: 2px;

    }
  }
  
  @media only screen and (max-width: 319px) {
    .cms-content-cms-cookies-close-image {
    margin-top: -23px;
    padding-right: 5px;
    }
    
    .cms-content-cms-cookies-smiles {
    height:130px;
    }
    
    .cms-content-cms-cookies-para {
    padding-bottom: 48px;
    padding-right: 4px;
    padding-left: 22px;
    padding-top: 30px;
    }
  }
  
  .a {
    color: #4397d8;
  }
.cms-content-cms-cookies-close-image{
  cursor: pointer;
}
@media only screen and (max-width: 1200px){

div#cms .cms-content-cms-cookies-para {
    padding-top: 28px;
    width: 84%;
}

}
@media only screen and (max-width: 767px){

div#cms .cms-content-cms-cookies-para {
    padding-top: 10px;
    width: 84%;
}


}


</style>
<script>
$( document ).ready(function() {
   var cookie=getCookie('Cokkies_EN2');
   if(cookie==='true'){
       $(".cms-content-cms-cookies-smiles").css("display", "none");
   }
   $(".cms-content-cms-cookies-close-image").click(function(){
            setCookie('Cokkies_EN', true, 1);
             $(".cms-content-cms-cookies-smiles").css("display", "none");
      });
    function setCookie(name, value, days) {
        var expires = "";
        if (days) {
            var date = new Date();
            date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
            expires = "; expires=" + date.toUTCString();
        }
        document.cookie = name + "=" + (value || "") + expires + "; path=/";
    };
       function getCookie(name) {
        var nameEQ = name + "=";
            var ca = document.cookie.split(';');
            for (var i = 0; i < ca.length; i++) {
                var c = ca[i];
                while (c.charAt(0) == ' ') c = c.substring(1, c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
            }
            return null;
            };
       
  });
 

</script>

Leave a comment

Your email address will not be published. Required fields are marked *