..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 | window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-72XTC500FR");
function changeLang(lang) {
var date = new Date();
date.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000)); // 30 days
var expires = "expires=" + date.toUTCString();
// Set the cookie
document.cookie = "site_language=" + lang + ";" + expires + ";path=/";
// Debugging: Print cookie value
console.log("Cookie set: site_language=" + lang);
// Reload the page to apply the new language
location.reload();
}
function copyToClipboard(text) {
$("body").append(
'<input type="text" value="' + text + '" id="copyToClipboard">'
);
const copyText = $("#copyToClipboard");
copyText.select();
copyText[0].setSelectionRange(0, 99999);
navigator.clipboard.writeText(copyText.val()).then(
function () {
alert("Copied to clipboard!");
},
function (err) {
alert("Failed to copy to clipboard!");
}
);
copyText.remove();
}
// Smooth scroll to anchor
$(document).ready(function () {
$('a[href^="#"]').on("click", function (e) {
e.preventDefault();
const target = $(this.getAttribute("href"));
if (target.length) {
$("html, body").stop().animate(
{
scrollTop: target.offset().top,
},
500
);
}
});
});
document.addEventListener("DOMContentLoaded", function () {
var equationElements = document.getElementsByTagName("*");
for (var i = 0; i < equationElements.length; i++) {
var element = equationElements[i];
if (
element.innerHTML.startsWith("$$") &&
element.innerHTML.endsWith("$$")
) {
element.style.overflowX = "scroll";
element.style.whiteSpace = "nowrap";
element.classList.add("equation-container");
}
}
});
|
|