Skip to content

Commit

Permalink
feat(plugin): add cookie consent plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ppoffice committed Oct 4, 2020
1 parent 1b1ed45 commit 7c16ad6
Show file tree
Hide file tree
Showing 17 changed files with 166 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/schema/common/plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"cnzz": {
"$ref": "/plugin/cnzz.json"
},
"cookie_consent": {
"$ref": "/plugin/cookie_consent.json"
},
"gallery": {
"$ref": "/plugin/gallery.json"
},
Expand Down
48 changes: 47 additions & 1 deletion include/style/plugin.styl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@

.katex-html
padding-top: 1em

.tag
align-items: unset
background-color: unset
Expand All @@ -108,4 +109,49 @@
line-height: unset
padding-left: unset
padding-right: unset
white-space: unset
white-space: unset

/* ---------------------------------
* Cookie Consent
* --------------------------------- */
.cc-window, .cc-revoke
font-size: 1.1rem !important
font-family: $family-sans-serif !important

.cc-window
color: $text !important
background-color: $scheme-main !important

&.cc-floating
border-radius: $card-radius
box-shadow: $card-shadow

&.cc-banner
background-color: darken($scheme-main, 2.5%) !important

&.cc-theme-block, &.cc-theme-classic
.cc-compliance > .cc-btn
border-radius: $radius-rounded

.cc-compliance > .cc-btn
font-weight: 400
border: none
color: $primary-invert
background-color: $primary

&:hover, &:focus
background-color: darken($primary, 2.5%)

&.cc-deny
&:hover
color: $primary
text-decoration: none

.cc-revoke
padding: .5rem 1rem !important
color: $primary-invert !important
background-color: $primary !important

&:hover
text-decoration: none !important
background-color: darken($primary, 2.5%)
7 changes: 7 additions & 0 deletions languages/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'Zurück nach oben'
visit_count: '%s Besuche'
visitor_count: 'Von %s Nutzern besucht'
cookie_consent:
message: Diese Website verwendet Cookies, um Ihre Erfahrung zu verbessern.
dismiss: Verstanden!
allow: Cookies zulassen
deny: Ablehnen
link: Mehr erfahren
policy: Cookie-Richtlinie
search:
search: 'Suche'
hint: 'Tippen Sie etwas...'
Expand Down
7 changes: 7 additions & 0 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'Back to top'
visit_count: '%s visits'
visitor_count: 'Visited by %s users'
cookie_consent:
message: This website uses cookies to improve your experience.
dismiss: Got it!
allow: Allow cookies
deny: Decline
link: Learn more
policy: Cookie Policy
search:
search: 'Search'
hint: 'Type something...'
Expand Down
7 changes: 7 additions & 0 deletions languages/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ plugin:
backtotop: 'Volver arriba'
visit_count: '%s visitas'
visitor_count: 'Visitado por %s usuarios'
cookie_consent:
message: Este sitio web utiliza cookies para mejorar su experiencia.
dismiss: ¡Entendido!
allow: Permitir cookies
deny: Descenso
link: Aprende más
policy: Política de cookies
search:
search: 'Buscar'
hint: 'Teclea algo...'
Expand Down
7 changes: 7 additions & 0 deletions languages/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'Retour au sommet'
visit_count: '%s visites'
visitor_count: 'Visité par %s utilisateurs'
cookie_consent:
message: Ce site Web utilise des cookies pour améliorer votre expérience.
dismiss: Je l'ai!
allow: Autorise les cookies
deny: Déclin
link: Apprendre encore plus
policy: Politique relative aux cookies
search:
search: 'Search'
hint: 'Type something...'
Expand Down
7 changes: 7 additions & 0 deletions languages/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'Kembali ke atas'
visit_count: '%s kunjungan'
visitor_count: 'Dikunjungi oleh %s pengguna'
cookie_consent:
message: Situs web ini menggunakan cookie untuk meningkatkan pengalaman Anda.
dismiss: Mengerti!
allow: Izinkan cookie
deny: Menolak
link: Belajarlah lagi
policy: Kebijakan Cookie
search:
search: 'Pencarian'
hint: 'Tulis Sesuatu..'
Expand Down
7 changes: 7 additions & 0 deletions languages/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'トップに戻る'
visit_count: '%s回の訪問'
visitor_count: '%s人のユーザーがアクセス'
cookie_consent:
message: このウェブサイトはあなたの経験を改善するためにCookieを使用しています。
dismiss: 了解しました
allow: Cookiesを許可する
deny: 拒否する
link: もっと詳しく知る
policy: Cookieポリシー
search:
search: '検索'
hint: '何かを入力してください...'
Expand Down
7 changes: 7 additions & 0 deletions languages/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: '맨 위로'
visit_count: '%s회 방문'
visitor_count: '%s명의 사용자가 방문 함'
cookie_consent:
message: 이 웹 사이트는 귀하의 경험을 향상시키기 위해 Cookie를 사용합니다.
dismiss: 알았다!
allow: Cookie 허용
deny: 거부
link: 더 알아보기
policy: Cookie 정책
search:
search: '검색'
hint: '입력 하세요...'
Expand Down
7 changes: 7 additions & 0 deletions languages/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'Powrót do góry'
visit_count: '%s wizyty'
visitor_count: 'Odwiedzone przez %s użytkowników'
cookie_consent:
message: Ta strona korzysta z plików cookie, aby poprawić Twoje doświadczenia.
dismiss: Rozumiem!
allow: Zezwól na pliki cookie
deny: Odrzucać
link: Ucz się więcej
policy: Polityka Cookie
search:
search: 'szukaj'
hint: 'Wpisz coś...'
Expand Down
7 changes: 7 additions & 0 deletions languages/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'De volta ao topo'
visit_count: '%s visitas'
visitor_count: 'Visitado por %s usuários'
cookie_consent:
message: Este site usa cookies para melhorar sua experiência.
dismiss: Entendi!
allow: Permitir cookies
deny: Declínio
link: Saber mais
policy: Política de Cookies
search:
search: 'Procurar'
hint: 'Digite alguma coisa...'
Expand Down
7 changes: 7 additions & 0 deletions languages/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'Вернуться наверх'
visit_count: '%s посещения'
visitor_count: 'Посетили %s пользователя'
cookie_consent:
message: Этот веб-сайт использует файлы cookie для улучшения вашего опыта.
dismiss: Понял!
allow: Разрешить cookies
deny: Отказаться
link: Учить больше
policy: Политика Cookie
search:
search: 'Поиск'
hint: 'Введите что-нибудь...'
Expand Down
7 changes: 7 additions & 0 deletions languages/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'Başa dönüş'
visit_count: '%s ziyaret'
visitor_count: '%s kullanıcı tarafından ziyaret edildi'
cookie_consent:
message: Bu web sitesi, deneyiminizi geliştirmek için çerezler kullanır.
dismiss: Anladım!
allow: Çerezlere izin ver
deny: Reddet
link: Daha fazla bilgi edin
policy: Çerez politikası
search:
search: 'Search'
hint: 'Bir şeyler yaz...'
Expand Down
7 changes: 7 additions & 0 deletions languages/vn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: 'Trở lai đầu trang'
visit_count: '%s Bạn đọc'
visitor_count: 'Thăm bởi %s bạn đọc'
cookie_consent:
message: Trang web này sử dụng cookie để cải thiện trải nghiệm của bạn.
dismiss: Hiểu rồi!
allow: Cho phép cookie
deny: Từ chối
link: Tìm hiểu thêm
policy: Chính sách Cookie
search:
search: 'Tìm kiếm'
hint: 'Gõ gì đó...'
Expand Down
7 changes: 7 additions & 0 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: '回到顶端'
visit_count: '%s次访问'
visitor_count: '共%s个访客'
cookie_consent:
message: 此网站使用Cookie来改善您的体验。
dismiss: 知道了!
allow: 允许使用Cookie
deny: 拒绝
link: 了解更多
policy: Cookie政策
search:
search: '搜索'
hint: '想要查找什么...'
Expand Down
7 changes: 7 additions & 0 deletions languages/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ plugin:
backtotop: '回到頁首'
visit_count: '%s次訪問'
visitor_count: '共%s個訪客'
cookie_consent:
message: 此網站使用Cookie來改善您的體驗。
dismiss: 知道了!
allow: 允許使用Cookie
deny: 拒絕
link: 了解更多
policy: Cookie政策
search:
search: '搜尋'
hint: '請輸入關鍵字...'
Expand Down
18 changes: 18 additions & 0 deletions source/css/cyberpunk.styl
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,21 @@ article.article
background: $blue
margin-top: 45px
cut-corner(8px)

.cc-window, .cc-revoke
border-radius: 0 !important

.cc-window
&:not(.cc-banner)
border: 1px solid $blue

&.cc-theme-classic, &.cc-theme-block
.cc-compliance > .cc-btn
border-radius: 0

&.cc-banner
.cc-compliance > .cc-btn
background-color: $blue

&:hover, &:focus
background-color: darken($blue, 2.5%)

0 comments on commit 7c16ad6

Please sign in to comment.