Last active 1737603155

os.js Raw
1var htmlElement = document.documentElement;
2if (navigator.platform.match(/(Mac)/i)) {
3 htmlElement.className = 'Mac'
4}
5if (navigator.platform.match(/(Linux)/i)) {
6 htmlElement.className = 'Linux'
7} else {
8 htmlElement.className = 'Windows'
9}
10document.addEventListener('click', function(event) {
11 var target = event.target;
12 if (target.getAttribute && target.getAttribute('data-action') === 'switch-os') {
13 event.preventDefault();
14 htmlElement.className = target.getAttribute('data-os')
15 }
16})
17