|
|
@ -1,41 +1,50 @@ |
|
|
|
<tiny-consent> |
|
|
|
<div id="tiny-consent" class="tiny-consent"> |
|
|
|
<div class="tiny-consent__banner"> |
|
|
|
<div class={ state.isOpen === true ? 'tiny-consent__content show' : 'tiny-consent__content' }> |
|
|
|
<p> |
|
|
|
{ state.options.messages.content } |
|
|
|
</p> |
|
|
|
<ul class="tiny-consent__cookies"> |
|
|
|
<li class={ state.hasChanged && cookie.hasConsent === true ? 'tiny-consent__cookie' : 'tiny-consent__cookie show' } each={ (cookie, index) in props.cookies }> |
|
|
|
<div class="tiny-consent__cookie-content"> |
|
|
|
<p> |
|
|
|
<span if={ cookie.title } class="tiny-consent__cookie.title">{ cookie.title } - </span> |
|
|
|
{ cookie.content } |
|
|
|
</p> |
|
|
|
<p if={ cookie.name } class="tiny-consent__cookie-name"> |
|
|
|
{ cookie.name } |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
<div class="tiny-consent__cookie-decision"> |
|
|
|
<button if={ !cookie.essential } class={ getAgreeClasses(cookie) } onclick={ (event) => { handleAgree(event, cookie, index) }}> |
|
|
|
{ state.options.messages.yes } |
|
|
|
</button> |
|
|
|
<button if={ !cookie.essential } class={ getRejectClasses(cookie) } onclick={ (event) => { handleReject(event, cookie, index) }}> |
|
|
|
{ state.options.messages.no } |
|
|
|
</button> |
|
|
|
<button if={ cookie.essentialLast === true } disabled={ isOk() } class="button button--ok tiny-consent__button" onclick={ (event) => { handleOk(event, cookies) }}> |
|
|
|
{ state.options.messages.ok } |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
<div if={ state.hasChanged === false } class="tiny-consent__close"> |
|
|
|
<button class="button button--submit tiny-consent__button" onclick={ handleClose }> |
|
|
|
{ state.options.messages.close } |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
<div id="tiny-consent" class={ state.isOpen === true ? 'tiny-consent show' : 'tiny-consent' }> |
|
|
|
<div class="tiny-consent__inner"> |
|
|
|
<div class="tiny-consent__header"> |
|
|
|
<h3 class="tiny_consent__title"> |
|
|
|
{ state.options.text.title } |
|
|
|
</h3> |
|
|
|
<p> |
|
|
|
{ state.options.text.content } |
|
|
|
</p> |
|
|
|
<div class="tiny-consent__close"> |
|
|
|
<button class="button button--submit tiny-consent__button" onclick={ handleClose }> |
|
|
|
{ state.options.text.button__close } |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="tiny-consent__main"> |
|
|
|
<ul class="tiny-consent__cookies"> |
|
|
|
<li class={ state.hasChanged && cookie.hasConsent === true ? 'tiny-consent__cookie' : 'tiny-consent__cookie show' } each={ (cookie, index) in props.cookies }> |
|
|
|
<div class="tiny-consent__cookie-content"> |
|
|
|
<p> |
|
|
|
<span if={ cookie.title } class="tiny-consent__cookie-title">{ cookie.title }</span> |
|
|
|
{ cookie.content } |
|
|
|
</p> |
|
|
|
<div class="tiny-consent__cookie-footer"> |
|
|
|
<ul> |
|
|
|
<li if={ cookie.provider }><span>{ state.options.text.footer__provider }</span> { cookie.provider }</li> |
|
|
|
<li if={ cookie.name }><span>{ state.options.text.footer__name }</span> { cookie.name }</li> |
|
|
|
<li if={ cookie.duration }><span>{ state.options.text.footer__duration }</span> { cookie.duration }</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="tiny-consent__cookie-decision"> |
|
|
|
<button if={ !cookie.essential } class={ getAgreeClasses(cookie) } onclick={ (event) => { handleAgree(event, cookie, index) }}> |
|
|
|
{ state.options.text.button__agree } |
|
|
|
</button> |
|
|
|
<button if={ !cookie.essential } class={ getRejectClasses(cookie) } onclick={ (event) => { handleReject(event, cookie, index) }}> |
|
|
|
{ state.options.text.button__reject } |
|
|
|
</button> |
|
|
|
<button if={ cookie.essentialLast === true } disabled={ isOk() } class="button button--ok tiny-consent__button" onclick={ (event) => { handleOk(event, cookies) }}> |
|
|
|
{ state.options.text.button__ok } |
|
|
|
</button> |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<script> |
|
|
@ -61,13 +70,16 @@ |
|
|
|
{ |
|
|
|
options: { |
|
|
|
cookie_name: 'tiny_consent', |
|
|
|
messages: { |
|
|
|
'session': 'LALAL', |
|
|
|
'content': 'TTATA', |
|
|
|
'yes': 'Yes', |
|
|
|
'no': 'No', |
|
|
|
'ok': 'Ok', |
|
|
|
'close': 'Close' |
|
|
|
text: { |
|
|
|
title : 'Cookies', |
|
|
|
content : 'We are using Cookies and display that was we use, also there are cookies you can accept or reject', |
|
|
|
button__agree : 'Yes', |
|
|
|
button__reject : 'No', |
|
|
|
button__ok : 'Ok', |
|
|
|
button__close : 'Close', |
|
|
|
footer__name: 'Cookie Name', |
|
|
|
footer__provider: 'Provider', |
|
|
|
footer__duration: 'Cookie Duration' |
|
|
|
} |
|
|
|
}, |
|
|
|
isOpen: false, |
|
|
|