Testing js file handling

This commit is contained in:
Stephan Hagedorn 2021-03-09 13:33:39 +01:00
parent 731c19dd61
commit dd5ff43e16
5 changed files with 99 additions and 21 deletions

View file

@ -0,0 +1,22 @@
var hippie = {
brand: "|-| | |^ |^ | [- ",
screen: {
w: Math.max(document.documentElement.offsetWidth, document.documentElement.clientWidth, window.innerWidth, 0),
vh: Math.max(document.documentElement.clientHeight, window.innerHeight, 0),
dh: Math.max(document.documentElement.offsetHeight, document.documentElement.clientHeight, 0),
y: Math.min($(document).scrollTop(), document.documentElement.scrollTop)
// hippie.screen.y: document.documentElement.scrollTop
},
body: {
w: Math.max(document.body.offsetWidth, document.body.clientWidth, window.innerWidth, 0),
h: Math.max(document.body.offsetHeight, document.body.clientHeight, 0),
}
};
var viewHover = true;
var basicEase = 600;
var onerowAlphabet = "/\\ ]3 ( |) [- /= (_, |-| | _T /< |_ |\\/| |\\| () |^ ()_ /? _\\~ ~|~ |_| \\/ \\/\\/ >< `/ ~/_ ";
var onerowDigits = "\'| ^/_ -} +| ;~ (o \"/ {} \"| (\\) ";
export { hippie };

View file

@ -1,3 +1,3 @@
// Setup
// -----------------------------------------------------------------------------
setup();
// setup();

View file

@ -0,0 +1,29 @@
// Setup
// -----------------------------------------------------------------------------
import { hippie } from './config.js';
// This is called everytime
function setup() {
'use strict';
console.group('Document information');
console.info('\n', config.brand, '\n\n');
console.info('\n', hippie.brand, '\n\n');
console.info('HTML:', hippie.screen, '\nBODY:', hippie.body);
console.groupEnd();
if (debugOn) {
console.group('Debug information');
console.dir(hippie);
console.groupEnd();
}
// WANNABE MODULE Mouse over effect
// With CSS only
if ($('#js_mob').length && viewHover) {
$('#js_mob').addClass('mouse_over');
}
// if (viewHover) {
// $('body').prepend('<div id="js_mob" class="mouse_over"></div>');
// }
// With JS
}

View file

@ -60,7 +60,11 @@
{% block script %}
{{ super() }}
<script src="{{ pageBase }}js/{{ hippie.jsFile }}.min.js"></script>
<script src="{{ hippie.pageBase }}js/{{ hippie.jsFile }}.min.js"></script>
<!-- build:js js/main.concat.min.js -->
{# <script src="{{ hippie.pageBase }}js/config.min.js" type="module"></script> #}
{# <script src="{{ hippie.pageBase }}js/main.min.js"></script> #}
<!-- endbuild -->
<script>
// Page specific
// ------------------------------------------------------------------------------
@ -68,6 +72,7 @@
logPerf('BODY :: Assets loaded, running page specific script...');
$(document).ready(function () {
logPerf('EVENT :: jQuery \'ready\' event fired.');
setup();
logPerf('Application ready.');
});
</script>