-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cookie notification): added the we use cookies banner (#180)
* feat(we use cookies): added the we use cookies banner BTCOM-2547 * feat(requested updates): used more global styles and put the javascript in it's own module BTCOM-2547 * fix(snippet placement): adjusted snippet placement * chore(requested changes): made the requested changes and added the learn more link * chore(console): got rid of console
- Loading branch information
Showing
8 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import $ from 'jquery'; | ||
|
||
var cookieNotification = { | ||
el: {}, | ||
init: () => { | ||
if (!$.cookie('acceptCookies')) { | ||
cookieNotification.cacheSelectors(); | ||
cookieNotification.showCookieBanner(); | ||
cookieNotification.el.$cookieButton.on('click', cookieNotification.hideCookieBanner); | ||
} | ||
}, | ||
cacheSelectors: () => { | ||
cookieNotification.el.$cookieWrapper = $('.cookie-wrapper'); | ||
cookieNotification.el.$cookieButton = $('.cookie-button'); | ||
}, | ||
showCookieBanner: () => { | ||
cookieNotification.el.$cookieWrapper.show(); | ||
cookieNotification.el.$cookieWrapper.animate({ | ||
bottom: '0px', | ||
}, 500, () => {}); | ||
}, | ||
hideCookieBanner: () => { | ||
cookieNotification.el.$cookieWrapper.animate({ | ||
bottom: '-200px', | ||
}, 100, () => { | ||
cookieNotification.el.$cookieWrapper.hide(); | ||
$.cookie("acceptCookies", 1, {expires: 14}); | ||
}); | ||
} | ||
}; | ||
|
||
|
||
export default cookieNotification; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.cookie-wrapper { | ||
position: fixed; | ||
bottom: -200px; | ||
display: none; | ||
z-index: 100; | ||
background-color: $colorHeaderBackground; | ||
width: 100%; | ||
padding-top: 10px; | ||
padding-bottom: 10px; | ||
padding-left: 30px; | ||
color: $colorBtnPrimaryText; | ||
} | ||
|
||
.cookie-text { | ||
padding-right: 20px; | ||
} | ||
|
||
.cookie-inner-wrapper { | ||
max-width: $siteWidth; | ||
margin: auto; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="cookie-wrapper"> | ||
<div class="cookie-inner-wrapper"> | ||
<span class="cookie-text"><span>{{ 'general.cookies.cookie_message' | t }}</span> <a href="{{ settings.privacy_page_link }}">{{ 'general.cookies.learn_more' | t }}</a></span> | ||
<button class="btn cookie-button">{{ 'general.cookies.accept' | t }}</button> | ||
</div> | ||
</div> |