BirdNET-stream/www/assets/app.js

47 lines
1.4 KiB
JavaScript
Raw Normal View History

2022-08-13 07:46:56 +02:00
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/
// any CSS you import will output into a single css file (app.css in this case)
import './styles/app.css';
2022-08-15 11:42:28 +02:00
import './styles/menu.css';
2022-08-13 07:46:56 +02:00
// start the Stimulus application
import './bootstrap';
2022-08-16 19:28:19 +02:00
import feather from 'feather-icons';
import { version } from 'core-js';
2022-08-16 19:28:19 +02:00
feather.replace();
2022-08-16 07:05:49 +02:00
/** Update css variables --{header, footer}-height
* by querying elements real height */
(function () {
let css_root = document.querySelector(':root');
let header = document.getElementsByTagName('header')[0];
let header_height = header.clientHeight;
css_root.style.setProperty('--header-height', header_height + 'px');
let footer = document.getElementsByTagName('footer')[0];
let footer_height = footer.clientHeight;
css_root.style.setProperty('--footer-height', footer_height + 'px');
})();
/** Add git version in web interface
*/
(function () {
let version_span = document.querySelector('.version-number');
version_span.textContent = `${VERSION}`;
console.debug("Version: " + VERSION);
})();
2022-08-16 19:28:19 +02:00
try {
document.getElementsByClassName('prevent').map(
(e) => e.addEventListener('click', (e) => e.preventDefault())
);
} catch {
console.debug('no prevent class found');
}