webpack-bootstrap-ui-kit/src/js/layout/index.js

51 lines
1.5 KiB
JavaScript
Raw Normal View History

2022-05-03 20:50:57 +02:00
import Events from '../_events'
2021-08-09 18:04:09 +02:00
const LayoutUI = ((W) => {
2022-05-03 20:50:57 +02:00
const NAME = '_layout'
const D = document
2021-08-09 18:04:09 +02:00
2022-05-03 21:44:33 +02:00
const initFonts = () => {
console.log(`${NAME}: initFonts`)
2021-08-09 18:04:09 +02:00
2022-05-03 20:50:57 +02:00
const css = D.createElement('link')
css.rel = 'stylesheet'
css.type = 'text/css'
css.media = 'all'
2021-08-18 20:51:15 +02:00
css.href =
2022-05-03 20:50:57 +02:00
'https://fonts.googleapis.com/css?family=Roboto:ital,wght@0,400;0,700;1,400&display=swap'
D.getElementsByTagName('head')[0].appendChild(css)
}
2021-08-09 18:04:09 +02:00
2022-05-03 21:44:33 +02:00
const initAnalytics = () => {
console.log(`${NAME}: initAnalytics`)
2022-05-03 20:50:57 +02:00
/* google analytics */
/* (function(i, s, o, g, r, a, m) {
2021-08-09 18:04:09 +02:00
i['GoogleAnalyticsObject'] = r;
(i[r] =
i[r] ||
function() {
(i[r].q = i[r].q || []).push(arguments);
}),
(i[r].l = 1 * new Date());
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m);
})(
window,
document,
'script',
'//www.google-analytics.com/analytics.js',
'ga',
);
ga('create', 'UA-********-*', 'auto');
2022-05-03 20:50:57 +02:00
ga('send', 'pageview'); */
}
2021-08-09 18:04:09 +02:00
W.addEventListener(`${Events.LOADED}`, () => {
2022-05-03 21:44:33 +02:00
initFonts()
initAnalytics()
2022-05-03 20:50:57 +02:00
})
})(window)
export default LayoutUI