From bf1e55c0dc6b21ef3801527161cc17e72653829d Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Tue, 30 Jun 2020 10:43:00 +0200 Subject: [PATCH] Add core --- .gitignore | 2 ++ dist/ffnm.min.js | 29 +++++++++++++++++++++++++++++ src/core.ts | 29 +++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c35f9d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +test.html diff --git a/dist/ffnm.min.js b/dist/ffnm.min.js index e69de29..d960636 100644 --- a/dist/ffnm.min.js +++ b/dist/ffnm.min.js @@ -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(); diff --git a/src/core.ts b/src/core.ts index e69de29..68008e0 100644 --- a/src/core.ts +++ b/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()