Add core
This commit is contained in:
parent
4777f8dd9d
commit
bf1e55c0dc
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
test.html
|
29
dist/ffnm.min.js
vendored
29
dist/ffnm.min.js
vendored
@ -0,0 +1,29 @@
|
||||
//===
|
||||
// VARIABLES
|
||||
//===
|
||||
var EVENTS;
|
||||
(function (EVENTS) {
|
||||
EVENTS[EVENTS["i-click"] = 0] = "i-click";
|
||||
EVENTS[EVENTS["i-scroll-up"] = 1] = "i-scroll-up";
|
||||
EVENTS[EVENTS["i-scroll-down"] = 2] = "i-scroll-down";
|
||||
EVENTS[EVENTS["i-hover"] = 3] = "i-hover";
|
||||
})(EVENTS || (EVENTS = {}));
|
||||
//===
|
||||
// FUNCTIONS
|
||||
//===
|
||||
function validateSyntax() {
|
||||
// Check every event
|
||||
var eventsKeys = Object.keys(EVENTS).filter(function (key) { return !isNaN(Number(EVENTS[key])); });
|
||||
eventsKeys.forEach(function (event) {
|
||||
var ddd = document.querySelector("[" + event + "]").length;
|
||||
console.log(ddd);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
//===
|
||||
// LINTER
|
||||
//===
|
||||
//===
|
||||
// INIT
|
||||
//===
|
||||
validateSyntax();
|
29
src/core.ts
29
src/core.ts
@ -0,0 +1,29 @@
|
||||
//===
|
||||
// VARIABLES
|
||||
//===
|
||||
enum EVENTS {'i-click', 'i-scroll-up', 'i-scroll-down', 'i-hover'}
|
||||
|
||||
//===
|
||||
// FUNCTIONS
|
||||
//===
|
||||
function validateSyntax(): boolean {
|
||||
|
||||
// Check every event
|
||||
let eventsKeys = Object.keys(EVENTS).filter(key => !isNaN(Number(EVENTS[key])));
|
||||
eventsKeys.forEach((event) => {
|
||||
let ddd = document.querySelector(`[${event}]`).length
|
||||
console.log(ddd)
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
//===
|
||||
// LINTER
|
||||
//===
|
||||
|
||||
|
||||
//===
|
||||
// INIT
|
||||
//===
|
||||
validateSyntax()
|
Loading…
Reference in New Issue
Block a user