Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions assets/css/font-awesome.min.css

Large diffs are not rendered by default.

Binary file added assets/fonts/fontello.woff
Binary file not shown.
Binary file added assets/fonts/fontello.woff2
Binary file not shown.
Binary file added assets/fonts/sora-latin-ext.woff2
Binary file not shown.
Binary file added assets/fonts/sora-latin.woff2
Binary file not shown.
12 changes: 12 additions & 0 deletions assets/images/calmkernel-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions assets/js/cookie-consent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
(function () {
'use strict';
if (localStorage.getItem('ck_cookie_consent')) return;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Directly accessing localStorage can throw a SecurityError or ReferenceError in certain browser configurations, such as when cookies are blocked or in restricted private browsing modes. It is safer to wrap this check in a try...catch block to prevent the script from crashing and ensuring the rest of the page logic remains functional.

Suggested change
if (localStorage.getItem('ck_cookie_consent')) return;
try {
if (localStorage.getItem('ck_cookie_consent')) return;
} catch (e) {}


var lang = document.documentElement.lang || 'tr';
var isTR = lang.startsWith('tr');

var banner = document.createElement('div');
banner.id = 'cookieConsent';
banner.setAttribute('role', 'alert');
banner.setAttribute('aria-live', 'polite');

var inner = document.createElement('div');
inner.className = 'cc-inner';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This script relies on the cc-inner class for layout and cc-hidden for the dismissal animation. However, the corresponding stylesheet /assets/css/cookie-consent.css referenced in index.html is not included in the list of restored assets. Without this CSS file, the banner will appear unstyled and the dismissal transition will not work as intended.


var p = document.createElement('p');
p.textContent = isTR
? 'Bu site yalnızca güvenlik amaçlı teknik çerezler (Cloudflare) kullanmaktadır. Analiz veya izleme çerezi kullanılmamaktadır. '
: 'This site only uses technical cookies (Cloudflare) for security purposes. No analytics or tracking cookies are used. ';

var link = document.createElement('a');
link.href = isTR ? '/privacy-policy.html' : '/en/privacy-policy.html';
link.textContent = isTR ? 'Gizlilik Politikası' : 'Privacy Policy';
p.appendChild(link);

var btn = document.createElement('button');
btn.id = 'ccAccept';
btn.type = 'button';
btn.textContent = isTR ? 'Anladım' : 'Got it';

inner.appendChild(p);
inner.appendChild(btn);
banner.appendChild(inner);
document.body.appendChild(banner);

btn.addEventListener('click', function () {
localStorage.setItem('ck_cookie_consent', '1');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the initial check, setting a value in localStorage can fail if storage is restricted or full. Wrapping this in a try...catch block improves the script's robustness against runtime errors.

    try {
      localStorage.setItem('ck_cookie_consent', '1');
    } catch (e) {}

banner.classList.add('cc-hidden');
setTimeout(function () { banner.remove(); }, 400);
});
})();
Binary file added assets/webfonts/fa-brands-400.woff2
Binary file not shown.
Binary file added assets/webfonts/fa-regular-400.woff2
Binary file not shown.
Binary file added assets/webfonts/fa-solid-900.woff2
Binary file not shown.
Loading