Testing js file handling
This commit is contained in:
parent
731c19dd61
commit
dd5ff43e16
5 changed files with 99 additions and 21 deletions
22
source/code/hippie/config.js
Normal file
22
source/code/hippie/config.js
Normal 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 };
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
// Setup
|
||||
// -----------------------------------------------------------------------------
|
||||
setup();
|
||||
// setup();
|
||||
|
|
|
|||
29
source/code/hippie/main.js
Normal file
29
source/code/hippie/main.js
Normal 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
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue