| 1 |
import { scrollToActive } from 'js/helpers/index'; |
| 2 |
import { initColorScheme } from './alpinejs/stores/index'; |
| 3 |
|
| 4 |
(function () { |
| 5 |
// This allows us to initialize the color scheme before AlpineJS etc. is loaded. |
| 6 |
initColorScheme(); |
| 7 |
|
| 8 |
// Now we know that the browser has JS enabled. |
| 9 |
document.documentElement.classList.remove('no-js'); |
| 10 |
|
| 11 |
// Add os-macos class to body if user is using macOS. |
| 12 |
if (navigator.userAgent.indexOf('Mac') > -1) { |
| 13 |
document.documentElement.classList.add('os-macos'); |
| 14 |
} |
| 15 |
|
| 16 |
// Wait for the DOM to be ready. |
| 17 |
document.addEventListener('DOMContentLoaded', function () { |
| 18 |
scrollToActive('DOMContentLoaded'); |
| 19 |
}); |
| 20 |
})(); |