Adding Astrojs sources.
This commit is contained in:
parent
2664e6d8fc
commit
e20f4f45de
169 changed files with 11389 additions and 0 deletions
39
public/resources/js/utilities/helpers/index.js
Normal file
39
public/resources/js/utilities/helpers/index.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import $$ from '@utilities/selectors'
|
||||
|
||||
/**
|
||||
* @description Test if the body id is something
|
||||
* @param {string}
|
||||
* @return {bool}
|
||||
*
|
||||
*/
|
||||
|
||||
const page = function(name) {
|
||||
|
||||
if (!name) {
|
||||
return $$.body.getAttribute('id')
|
||||
}
|
||||
|
||||
return ($$.body.getAttribute('id') == name)
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description Check if element exists the page
|
||||
* @param {string} Element selector
|
||||
* @param {string} Minimum number of elements
|
||||
* @return {bool}
|
||||
*/
|
||||
|
||||
const exists = function(el, limit) {
|
||||
|
||||
return (el.length > 0)
|
||||
|
||||
}
|
||||
|
||||
export {
|
||||
page,
|
||||
exists
|
||||
}
|
||||
|
||||
|
||||
30
public/resources/js/utilities/selectors/index.js
Normal file
30
public/resources/js/utilities/selectors/index.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
const $$ = {
|
||||
|
||||
body : document.querySelector('body'),
|
||||
|
||||
wrapper : document.getElementById('wrapper'),
|
||||
|
||||
header : document.getElementById('header'),
|
||||
|
||||
nav : document.getElementById('nav'),
|
||||
|
||||
hero : document.getElementById('hero'),
|
||||
|
||||
main : document.getElementById('main'),
|
||||
|
||||
containerCentre : document.getElementById('container-centre'),
|
||||
|
||||
containerRight : document.getElementById('container-right'),
|
||||
|
||||
preFooter : document.getElementById('pre-footer'),
|
||||
|
||||
footer : document.getElementById('footer'),
|
||||
|
||||
mobileNav : document.getElementById('mobile-nav'),
|
||||
|
||||
mobileNavToggle : document.getElementById('mobile-nav-toggle')
|
||||
|
||||
}
|
||||
|
||||
export default $$
|
||||
Loading…
Reference in a new issue