diff --git a/static/bundle/main.js b/static/bundle/main.js index f27174ac..fed3d5a6 100644 --- a/static/bundle/main.js +++ b/static/bundle/main.js @@ -97,6 +97,17 @@ eval("exports = module.exports = __webpack_require__(/*! ../../node_modules/css- /***/ }), +/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./templates/panel/main.scss": +/*!****************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./templates/panel/main.scss ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("exports = module.exports = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.i, \"* {\\n margin: 0;\\n padding: 0; }\\n\\na {\\n text-decoration: none; }\\n\\nli {\\n list-style: none; }\\n\\n:root {\\n --green: #5cad66;\\n --violet: #800080;\\n --backdrop: #f0f0f0;\\n --light-text: rgba(255, 255, 255, 0.87);\\n --secondary-backdrop: #2b2c30;\\n --light-grey: rgba(0, 0, 0, 0.125); }\\n\\n.secondary-menu {\\n position: fixed;\\n width: 14%;\\n left: 0;\\n bottom: 0;\\n top: 0;\\n right: 0;\\n height: 100%;\\n overflow: auto;\\n background-color: var(--secondary-backdrop);\\n color: var(--light-text); }\\n\\n.secondary-menu__heading {\\n margin: auto;\\n padding: 20px 5px;\\n display: flex; }\\n\\n.secondary-menu__heading:hover {\\n color: var(--green);\\n cursor: grab; }\\n\\n.secondary-menu__logo {\\n width: 70px;\\n display: inline-block; }\\n\\n.secondary-menu__brand-name {\\n display: inline-block;\\n margin: auto;\\n font-size: 1.5rem; }\\n\\n.secondary-menu__item {\\n margin: auto;\\n padding: 20px 25px;\\n display: flex; }\\n\\n.secondary-menu__icon {\\n filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(93deg) brightness(103%) contrast(103%);\\n opacity: 0.8;\\n width: 1rem;\\n margin: auto;\\n margin-right: 10px; }\\n\\n.secondary-menu__item-name {\\n display: inline-block;\\n margin: auto;\\n font-size: 1rem; }\\n\\n/*\\n .secondary-menu__section-partition {\\n border-bottom: 1px solid var(--light-text);\\n margin: auto;\\n max-width: 70%;\\n list-style: none;\\n margin: 20px;\\n }\\n */\\n.secondary-menu__item-link:hover {\\n color: var(--green);\\n cursor: grab;\\n filter: invert(58%) sepia(60%) saturate(331%) hue-rotate(76deg) brightness(91%) contrast(92%); }\\n\\n.secondary-menu__item-link {\\n color: inherit;\\n width: 100%;\\n height: 100%; }\\n\\nmain {\\n position: fixed;\\n top: 0;\\n right: 0;\\n left: 14%;\\n bottom: 0;\\n background-color: var(--backdrop); }\\n\\n.task-bar {\\n display: flex;\\n padding: 0px;\\n margin: 0px;\\n background-color: #fff; }\\n\\n.task-bar__action {\\n display: inline-block;\\n padding: 10px 0px;\\n margin: auto; }\\n\\n.task-bar__spacer {\\n min-width: 250px;\\n flex: 6; }\\n\\n.task-bar__icon {\\n opacity: 0.8;\\n width: 1.5rem;\\n margin: auto 20px; }\\n\\n.task-bar__icon:hover {\\n cursor: grab; }\\n\\n.main-menu {\\n display: flex;\\n flex-grow: 0;\\n padding-top: 20px;\\n padding-left: 10px; }\\n\\n.main-menu__item {\\n list-style: none;\\n background-color: #c3c3c3;\\n flex: 2;\\n text-align: center;\\n vertical-align: middle;\\n margin: auto 20px;\\n padding: 10px 0; }\\n\\n.main-menu__item--spacer {\\n list-style: none;\\n flex: 3;\\n text-align: center; }\\n\\n.main-menu__item:hover {\\n background-color: grey;\\n cursor: grab; }\\n\\n.main-menu__item:last-child {\\n padding: 0;\\n display: flex;\\n flex: 2;\\n border: none;\\n background-color: unset; }\\n\\n.main-menu__item:last-child:hover {\\n cursor: unset;\\n background-color: unset; }\\n\\n.main-menu__add-site {\\n display: inline-block;\\n background-color: var(--violet);\\n color: white;\\n font-weight: 500;\\n font-size: 16px;\\n padding: 10px 15px;\\n border-radius: 5px;\\n border: 1px grey solid;\\n min-height: 45px;\\n margin: auto; }\\n\\n.main-menu__add-site:hover {\\n background-color: var(--violet);\\n cursor: grab;\\n transform: translateY(-5px); }\\n\\n.help-text {\\n border-radius: 4px;\\n box-shadow: var(--secondary-backdrop) 0px 2px 6px 0px;\\n min-width: 70%;\\n max-width: 80%;\\n min-height: 70px;\\n display: flex;\\n margin-left: 15px;\\n margin-top: 40px; }\\n\\n.help-text__serial-num {\\n display: inline-flex;\\n background-color: var(--violet);\\n color: var(--light-text);\\n width: 30px;\\n height: 30px;\\n border-radius: 50%;\\n align-items: center;\\n justify-content: center; }\\n\\n.help-text__instructions {\\n display: inline-block;\\n list-style: none;\\n font-size: 19px;\\n font-weight: 500;\\n padding: 10px;\\n margin: auto; }\\n\\n.inner-container {\\n display: flex;\\n box-sizing: border-box;\\n max-width: 50%;\\n margin: 50px auto;\\n border-radius: 5px;\\n display: flex; }\\n\\n.sitekey-form {\\n display: flex;\\n flex-direction: column;\\n width: 90%;\\n justify-content: center;\\n align-items: center;\\n box-sizing: content-box;\\n background-color: #fff;\\n margin: auto;\\n padding-bottom: 30px; }\\n\\n.sitekey-form__title-flex-container {\\n display: flex;\\n width: 100%;\\n border-bottom: 0.1px solid var(--light-grey); }\\n\\n.sitekey-form__title {\\n padding-left: 10px;\\n font-size: 1rem;\\n padding: 0.75rem 1.25rem; }\\n\\n.sitekey-form__label {\\n display: block;\\n margin: 10px 0;\\n box-sizing: inherit;\\n justify-self: left; }\\n\\n.sitekey-form__input {\\n position: relative;\\n margin-top: 5px;\\n box-sizing: border-box;\\n height: 40px;\\n width: 90%; }\\n\\n.sitekey-form__input--add-level {\\n position: relative;\\n margin-top: 5px;\\n box-sizing: inherit;\\n flex: 3;\\n height: 40px;\\n margin-right: 20px; }\\n\\n.sitekey-form__add-level-flex-container {\\n display: flex;\\n box-sizing: border-box;\\n width: 90%;\\n margin-top: 10px; }\\n\\n.sitekey-form__add-level-spacer {\\n flex: 3; }\\n\\n.sitekey-form__add-level {\\n background-color: var(--violet);\\n color: white;\\n padding: 5px;\\n font-size: 16px;\\n border-radius: 5px;\\n border: 1px var(--light-grey) solid;\\n height: 40px;\\n min-width: 125px;\\n margin: auto; }\\n\\n.sitekey-form__submit {\\n margin-top: 50px;\\n display: block;\\n background-color: var(--violet);\\n color: white;\\n padding: 5px;\\n font-size: 20px;\\n border-radius: 5px;\\n border: 1px var(--light-grey) solid;\\n min-height: 45px;\\n width: 125px;\\n width: 90%; }\\n\", \"\"]);\n\n\n\n//# sourceURL=webpack:///./templates/panel/main.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js"); + +/***/ }), + /***/ "./node_modules/css-loader/dist/runtime/api.js": /*!*****************************************************!*\ !*** ./node_modules/css-loader/dist/runtime/api.js ***! @@ -162,7 +173,7 @@ eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dis /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"index\", function() { return index; });\n/* harmony import */ var _api_v1_routes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../api/v1/routes */ \"./templates/api/v1/routes.js\");\n/* harmony import */ var _utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/genJsonPayload */ \"./templates/utils/genJsonPayload.js\");\n/* harmony import */ var _forms_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../forms.scss */ \"./templates/auth/forms.scss\");\n/* harmony import */ var _forms_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_forms_scss__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\n\n\n\n\nconst login = e => {\n e.preventDefault();\n let username = document.getElementById('username').value;\n Object(_utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(e, username, 'username');\n\n let password = document.getElementById('password').value;\n let payload = {\n username,\n password,\n };\n\n fetch(_api_v1_routes__WEBPACK_IMPORTED_MODULE_0__[\"default\"].loginUser, Object(_utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(payload)).then(res => {\n if (res.ok) {\n alert('success');\n } else {\n res.json().then(err => alert(`error: ${err.error}`));\n }\n });\n};\n\nconst index = () => {\n let form = document.getElementById('form');\n form.addEventListener('submit', login, true);\n};\n\n\n//# sourceURL=webpack:///./templates/auth/login/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"index\", function() { return index; });\n/* harmony import */ var _api_v1_routes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../api/v1/routes */ \"./templates/api/v1/routes.js\");\n/* harmony import */ var _views_v1_routes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../views/v1/routes */ \"./templates/views/v1/routes.js\");\n/* harmony import */ var _utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/genJsonPayload */ \"./templates/utils/genJsonPayload.js\");\n/* harmony import */ var _forms_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../forms.scss */ \"./templates/auth/forms.scss\");\n/* harmony import */ var _forms_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_forms_scss__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n\n\n\n\nconst login = e => {\n e.preventDefault();\n let username = document.getElementById('username').value;\n Object(_utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e, username, 'username');\n\n let password = document.getElementById('password').value;\n let payload = {\n username,\n password,\n };\n\n fetch(_api_v1_routes__WEBPACK_IMPORTED_MODULE_0__[\"default\"].loginUser, Object(_utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(payload)).then(res => {\n if (res.ok) {\n alert('success');\n window.location.assign(_views_v1_routes__WEBPACK_IMPORTED_MODULE_1__[\"default\"].panelHome);\n } else {\n res.json().then(err => alert(`error: ${err.error}`));\n }\n });\n};\n\nconst index = () => {\n let form = document.getElementById('form');\n form.addEventListener('submit', login, true);\n};\n\n\n//# sourceURL=webpack:///./templates/auth/login/index.js?"); /***/ }), @@ -186,7 +197,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"index\", function() { return index; });\n/* harmony import */ var _api_v1_routes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../api/v1/routes */ \"./templates/api/v1/routes.js\");\n/* harmony import */ var _utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/genJsonPayload */ \"./templates/utils/genJsonPayload.js\");\n/* harmony import */ var _userExists__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./userExists */ \"./templates/auth/register/userExists.js\");\n/* harmony import */ var _emailExists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./emailExists */ \"./templates/auth/register/emailExists.js\");\n/* harmony import */ var _forms_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../forms.scss */ \"./templates/auth/forms.scss\");\n/* harmony import */ var _forms_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_forms_scss__WEBPACK_IMPORTED_MODULE_4__);\n\n\n\n\n\n\n\n\n\n\nconst registerUser = async e => {\n e.preventDefault();\n\n let username = document.getElementById('username').value;\n Object(_utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(e, username, 'username');\n\n let password = document.getElementById('password').value;\n let passwordCheck = document.getElementById('password-check').value;\n if (password != passwordCheck) {\n return alert(\"passwords don't match, check again!\");\n }\n\n let exists = await Object(_userExists__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n if (exists) {\n return;\n }\n\n let email = document.getElementById('email').value;\n if (!email.replace(/\\s/g, '').length) {\n email = null;\n } else {\n exists = await Object(_emailExists__WEBPACK_IMPORTED_MODULE_3__[\"checkEmailExists\"])();\n if (exists) {\n return;\n }\n }\n\n let payload = {\n username,\n password,\n email,\n };\n\n let res = await fetch(_api_v1_routes__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerUser, Object(_utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(payload));\n if (res.ok) {\n alert('success');\n } else {\n let err = await res.json();\n alert(`error: ${err.error}`);\n }\n};\n\nconst index = () => {\n let form = document.getElementById('form');\n form.addEventListener('submit', registerUser, true);\n\n let username = document.getElementById('username');\n username.addEventListener('input', _userExists__WEBPACK_IMPORTED_MODULE_2__[\"default\"], false);\n};\n\n\n//# sourceURL=webpack:///./templates/auth/register/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"index\", function() { return index; });\n/* harmony import */ var _api_v1_routes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../api/v1/routes */ \"./templates/api/v1/routes.js\");\n/* harmony import */ var _views_v1_routes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../views/v1/routes */ \"./templates/views/v1/routes.js\");\n/* harmony import */ var _utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/genJsonPayload */ \"./templates/utils/genJsonPayload.js\");\n/* harmony import */ var _userExists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./userExists */ \"./templates/auth/register/userExists.js\");\n/* harmony import */ var _emailExists__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emailExists */ \"./templates/auth/register/emailExists.js\");\n/* harmony import */ var _forms_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../forms.scss */ \"./templates/auth/forms.scss\");\n/* harmony import */ var _forms_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_forms_scss__WEBPACK_IMPORTED_MODULE_5__);\n\n\n\n\n\n\n\n\n\n\n\nconst registerUser = async e => {\n e.preventDefault();\n\n let username = document.getElementById('username').value;\n Object(_utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e, username, 'username');\n\n let password = document.getElementById('password').value;\n let passwordCheck = document.getElementById('password-check').value;\n if (password != passwordCheck) {\n return alert(\"passwords don't match, check again!\");\n }\n\n let exists = await Object(_userExists__WEBPACK_IMPORTED_MODULE_3__[\"default\"])();\n if (exists) {\n return;\n }\n\n let email = document.getElementById('email').value;\n if (!email.replace(/\\s/g, '').length) {\n email = null;\n } else {\n exists = await Object(_emailExists__WEBPACK_IMPORTED_MODULE_4__[\"checkEmailExists\"])();\n if (exists) {\n return;\n }\n }\n\n let payload = {\n username,\n password,\n email,\n };\n\n let res = await fetch(_api_v1_routes__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerUser, Object(_utils_genJsonPayload__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(payload));\n if (res.ok) {\n alert('success');\n window.location.assign(_views_v1_routes__WEBPACK_IMPORTED_MODULE_1__[\"default\"].loginUser);\n } else {\n let err = await res.json();\n alert(`error: ${err.error}`);\n }\n};\n\nconst index = () => {\n let form = document.getElementById('form');\n form.addEventListener('submit', registerUser, true);\n\n let username = document.getElementById('username');\n username.addEventListener('input', _userExists__WEBPACK_IMPORTED_MODULE_3__[\"default\"], false);\n};\n\n\n//# sourceURL=webpack:///./templates/auth/register/index.js?"); /***/ }), @@ -222,7 +233,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _rou /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"index\", function() { return index; });\n/*\nimport './main.scss';\nimport './nav/main.scss';\n*/\n\nconst index = () => {\n // const html = document.documentElement;\n // const body = document.body;\n // const menuLinks = document.querySelectorAll('.admin-menu a');\n // const collapseBtn = document.querySelector('.admin-menu .collapse-btn');\n // const toggleMobileMenu = document.querySelector('.toggle-mob-menu');\n // const switchInput = document.querySelector('.switch input');\n // const switchLabel = document.querySelector('.switch label');\n // const switchLabelText = switchLabel.querySelector('span:last-child');\n // const collapsedClass = 'collapsed';\n // const lightModeClass = 'light-mode';\n //\n // /*TOGGLE HEADER STATE*/\n // collapseBtn.addEventListener('click', function() {\n // body.classList.toggle(collapsedClass);\n // this.getAttribute('aria-expanded') == 'true'\n // ? this.setAttribute('aria-expanded', 'false')\n // : this.setAttribute('aria-expanded', 'true');\n // this.getAttribute('aria-label') == 'collapse menu'\n // ? this.setAttribute('aria-label', 'expand menu')\n // : this.setAttribute('aria-label', 'collapse menu');\n // });\n //\n // /*TOGGLE MOBILE MENU*/\n // toggleMobileMenu.addEventListener('click', function() {\n // body.classList.toggle('mob-menu-opened');\n // this.getAttribute('aria-expanded') == 'true'\n // ? this.setAttribute('aria-expanded', 'false')\n // : this.setAttribute('aria-expanded', 'true');\n // this.getAttribute('aria-label') == 'open menu'\n // ? this.setAttribute('aria-label', 'close menu')\n // : this.setAttribute('aria-label', 'open menu');\n // });\n //\n // /*SHOW TOOLTIP ON MENU LINK HOVER*/\n // for (const link of menuLinks) {\n // link.addEventListener('mouseenter', function() {\n // if (\n // body.classList.contains(collapsedClass) &&\n // window.matchMedia('(min-width: 768px)').matches\n // ) {\n // const tooltip = this.querySelector('span').textContent;\n // this.setAttribute('title', tooltip);\n // } else {\n // this.removeAttribute('title');\n // }\n // });\n // }\n //\n // /*TOGGLE LIGHT/DARK MODE*/\n // if (localStorage.getItem('dark-mode') === 'false') {\n // html.classList.add(lightModeClass);\n // switchInput.checked = false;\n // switchLabelText.textContent = 'Light';\n // }\n //\n // switchInput.addEventListener('input', function() {\n // html.classList.toggle(lightModeClass);\n // if (html.classList.contains(lightModeClass)) {\n // switchLabelText.textContent = 'Light';\n // localStorage.setItem('dark-mode', 'false');\n // } else {\n // switchLabelText.textContent = 'Dark';\n // localStorage.setItem('dark-mode', 'true');\n // }\n // });\n //\n let a;\n};\n\n\n//# sourceURL=webpack:///./templates/panel/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"index\", function() { return index; });\n/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./main.scss */ \"./templates/panel/main.scss\");\n/* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_main_scss__WEBPACK_IMPORTED_MODULE_0__);\n/*\nimport './main.scss';\nimport './nav/main.scss';\n*/\n\n\n\n\nconst index = () => {\n // const html = document.documentElement;\n // const body = document.body;\n // const menuLinks = document.querySelectorAll('.admin-menu a');\n // const collapseBtn = document.querySelector('.admin-menu .collapse-btn');\n // const toggleMobileMenu = document.querySelector('.toggle-mob-menu');\n // const switchInput = document.querySelector('.switch input');\n // const switchLabel = document.querySelector('.switch label');\n // const switchLabelText = switchLabel.querySelector('span:last-child');\n // const collapsedClass = 'collapsed';\n // const lightModeClass = 'light-mode';\n //\n // /*TOGGLE HEADER STATE*/\n // collapseBtn.addEventListener('click', function() {\n // body.classList.toggle(collapsedClass);\n // this.getAttribute('aria-expanded') == 'true'\n // ? this.setAttribute('aria-expanded', 'false')\n // : this.setAttribute('aria-expanded', 'true');\n // this.getAttribute('aria-label') == 'collapse menu'\n // ? this.setAttribute('aria-label', 'expand menu')\n // : this.setAttribute('aria-label', 'collapse menu');\n // });\n //\n // /*TOGGLE MOBILE MENU*/\n // toggleMobileMenu.addEventListener('click', function() {\n // body.classList.toggle('mob-menu-opened');\n // this.getAttribute('aria-expanded') == 'true'\n // ? this.setAttribute('aria-expanded', 'false')\n // : this.setAttribute('aria-expanded', 'true');\n // this.getAttribute('aria-label') == 'open menu'\n // ? this.setAttribute('aria-label', 'close menu')\n // : this.setAttribute('aria-label', 'open menu');\n // });\n //\n // /*SHOW TOOLTIP ON MENU LINK HOVER*/\n // for (const link of menuLinks) {\n // link.addEventListener('mouseenter', function() {\n // if (\n // body.classList.contains(collapsedClass) &&\n // window.matchMedia('(min-width: 768px)').matches\n // ) {\n // const tooltip = this.querySelector('span').textContent;\n // this.setAttribute('title', tooltip);\n // } else {\n // this.removeAttribute('title');\n // }\n // });\n // }\n //\n // /*TOGGLE LIGHT/DARK MODE*/\n // if (localStorage.getItem('dark-mode') === 'false') {\n // html.classList.add(lightModeClass);\n // switchInput.checked = false;\n // switchLabelText.textContent = 'Light';\n // }\n //\n // switchInput.addEventListener('input', function() {\n // html.classList.toggle(lightModeClass);\n // if (html.classList.contains(lightModeClass)) {\n // switchLabelText.textContent = 'Light';\n // localStorage.setItem('dark-mode', 'false');\n // } else {\n // switchLabelText.textContent = 'Dark';\n // localStorage.setItem('dark-mode', 'true');\n // }\n // });\n //\n let a;\n};\n\n\n//# sourceURL=webpack:///./templates/panel/index.js?"); + +/***/ }), + +/***/ "./templates/panel/main.scss": +/*!***********************************!*\ + !*** ./templates/panel/main.scss ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\nvar content = __webpack_require__(/*! !../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./main.scss */ \"./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./templates/panel/main.scss\");\n\nif(typeof content === 'string') content = [[module.i, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = __webpack_require__(/*! ../../node_modules/style-loader/lib/addStyles.js */ \"./node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(false) {}\n\n//# sourceURL=webpack:///./templates/panel/main.scss?"); /***/ }), @@ -248,6 +270,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * "use strict"; eval("__webpack_require__.r(__webpack_exports__);\nconst genJsonPayload = payload => {\n let value = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(payload),\n };\n return value;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (genJsonPayload);\n\n\n//# sourceURL=webpack:///./templates/utils/genJsonPayload.js?"); +/***/ }), + +/***/ "./templates/views/v1/routes.js": +/*!**************************************!*\ + !*** ./templates/views/v1/routes.js ***! + \**************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nconst ROUTES = {\n registerUser: '/join/',\n\n loginUser: '/',\n\n signoutUser: '/api/v1/signout',\n\n panelHome: '/panel/',\n\n docsHome: '/docs/',\n\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ROUTES);\n\n\n// deleteAccount: '/api/v1/account/delete',\n//\n// usernameExists: '/api/v1/account/username/exists',\n//\n// emailExists: '/api/v1/account/email/exists',\n//\n// healthCheck: '/api/v1/meta/health',\n//\n// buildDetails: '/api/v1/meta/build',\n//\n// addDomain: '/api/v1/mcaptcha/domain/add',\n//\n// challengeDomain: '/api/v1/mcaptcha/domain/domain/verify/challenge/get',\n//\n// proveDomain: '/api/v1/mcaptcha/domain/domain/verify/challenge/prove',\n//\n// deleteDomain: '/api/v1/mcaptcha/domain/delete',\n//\n// addToken: '/api/v1/mcaptcha/domain/token/add',\n//\n// updateTokenKey: '/api/v1/mcaptcha/domain/token/update',\n//\n// getTokenKey: '/api/v1/mcaptcha/domain/token/get',\n//\n// deleteToken: '/api/v1/mcaptcha/domain/token/delete',\n//\n// addTokenLevels: '/api/v1/mcaptcha/domain/token/levels/add',\n//\n// updateTokenLevels: '/api/v1/mcaptcha/domain/token/levels/update',\n//\n// deleteTokenLevels: '/api/v1/mcaptcha/domain/token/levels/delete',\n//\n// getTokenLevels: '/api/v1/mcaptcha/domain/token/levels/get',\n//\n// getTokenDuration: '/api/v1/mcaptcha/domain/token/token/get',\n//\n// updateTokenDuration: '/api/v1/mcaptcha/domain/token/token/update',\n//\n\n\n//# sourceURL=webpack:///./templates/views/v1/routes.js?"); + /***/ }) /******/ }); \ No newline at end of file diff --git a/templates/auth/login/index.js b/templates/auth/login/index.js index 5d5b557e..5eb02929 100644 --- a/templates/auth/login/index.js +++ b/templates/auth/login/index.js @@ -1,4 +1,5 @@ import ROUTES from '../../api/v1/routes'; +import VIEWS from '../../views/v1/routes'; import isBlankString from '../../utils/genJsonPayload'; import genJsonPayload from '../../utils/genJsonPayload'; @@ -19,6 +20,7 @@ const login = e => { fetch(ROUTES.loginUser, genJsonPayload(payload)).then(res => { if (res.ok) { alert('success'); + window.location.assign(VIEWS.panelHome); } else { res.json().then(err => alert(`error: ${err.error}`)); } diff --git a/templates/auth/register/index.js b/templates/auth/register/index.js index e69ef479..ae0d6bce 100644 --- a/templates/auth/register/index.js +++ b/templates/auth/register/index.js @@ -1,4 +1,5 @@ import ROUTES from '../../api/v1/routes'; +import VIEWS from '../../views/v1/routes'; import isBlankString from '../../utils/genJsonPayload'; import genJsonPayload from '../../utils/genJsonPayload'; @@ -44,6 +45,7 @@ const registerUser = async e => { let res = await fetch(ROUTES.registerUser, genJsonPayload(payload)); if (res.ok) { alert('success'); + window.location.assign(VIEWS.loginUser); } else { let err = await res.json(); alert(`error: ${err.error}`); diff --git a/templates/components/headers.html b/templates/components/headers.html index e45ef921..de90f5fa 100644 --- a/templates/components/headers.html +++ b/templates/components/headers.html @@ -1,3 +1,4 @@ + diff --git a/templates/panel/index.html b/templates/panel/index.html index 63e45bd8..38882f3e 100644 --- a/templates/panel/index.html +++ b/templates/panel/index.html @@ -1,356 +1,15 @@ - - - - - - <.= TITLE .> - - +<. include!("../components/headers.html"); .> <. include!("./header/index.html"); +.> - <. include!("./header/index.html"); .> +
+ <. include!("./taskbar/index.html"); .> <. + include!("./help-banner/index.html"); .> + +
+ -
- - <. include!("./taskbar/index.html"); .> - - <. include!("./help-banner/index.html"); .> - -
- - - <. include!("./add-site-key/index.html"); .> -
- -
- - - + <. include!("./add-site-key/index.html"); .> +
+ +
+<. include!("../components/footers.html"); .> diff --git a/templates/panel/index.js b/templates/panel/index.js index 7f38d3cb..5d77f489 100644 --- a/templates/panel/index.js +++ b/templates/panel/index.js @@ -3,6 +3,9 @@ import './main.scss'; import './nav/main.scss'; */ + +import './main.scss'; + export const index = () => { // const html = document.documentElement; // const body = document.body; diff --git a/templates/panel/main.scss b/templates/panel/main.scss new file mode 100644 index 00000000..d981067c --- /dev/null +++ b/templates/panel/main.scss @@ -0,0 +1,325 @@ +* { + margin: 0; + padding: 0; +} + +a { + text-decoration: none; +} + +li { + list-style: none; +} + +:root { + --green: #5cad66; + --violet: #800080; + --backdrop: #f0f0f0; + --light-text: rgba(255, 255, 255, 0.87); + --secondary-backdrop: #2b2c30; + --light-grey: rgba(0, 0, 0, 0.125); +} + +.secondary-menu { + position: fixed; + width: 14%; + left: 0; + bottom: 0; + top: 0; + right: 0; + height: 100%; + overflow: auto; + + background-color: var(--secondary-backdrop); + color: var(--light-text); +} + +.secondary-menu__heading { + margin: auto; + padding: 20px 5px; + display: flex; +} +.secondary-menu__heading:hover { + color: var(--green); + cursor: grab; +} + +.secondary-menu__logo { + width: 70px; + display: inline-block; +} + +.secondary-menu__brand-name { + display: inline-block; + margin: auto; + font-size: 1.5rem; +} + +.secondary-menu__item { + margin: auto; + padding: 20px 25px; + display: flex; +} + +.secondary-menu__icon { + filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(93deg) brightness(103%) + contrast(103%); + opacity: 0.8; + width: 1rem; + margin: auto; + margin-right: 10px; +} + +.secondary-menu__item-name { + display: inline-block; + margin: auto; + font-size: 1rem; +} + +/* + .secondary-menu__section-partition { + border-bottom: 1px solid var(--light-text); + margin: auto; + max-width: 70%; + list-style: none; + margin: 20px; + } + */ + +.secondary-menu__item-link:hover { + color: var(--green); + cursor: grab; + filter: invert(58%) sepia(60%) saturate(331%) hue-rotate(76deg) + brightness(91%) contrast(92%); +} + +.secondary-menu__item-link { + color: inherit; + width: 100%; + height: 100%; +} + +main { + position: fixed; + top: 0; + right: 0; + left: 14%; + bottom: 0; + background-color: var(--backdrop); +} + +.task-bar { + display: flex; + padding: 0px; + margin: 0px; + background-color: #fff; +} + +.task-bar__action { + display: inline-block; + padding: 10px 0px; + margin: auto; +} + +.task-bar__spacer { + min-width: 250px; + flex: 6; +} + +.task-bar__icon { + opacity: 0.8; + width: 1.5rem; + margin: auto 20px; +} + +.task-bar__icon:hover { + cursor: grab; +} + +.main-menu { + display: flex; + flex-grow: 0; + padding-top: 20px; + padding-left: 10px; +} + +.main-menu__item { + list-style: none; + background-color: #c3c3c3; + flex: 2; + text-align: center; + vertical-align: middle; + margin: auto 20px; + padding: 10px 0; +} + +.main-menu__item--spacer { + list-style: none; + flex: 3; + text-align: center; +} + +.main-menu__item:hover { + background-color: grey; + cursor: grab; +} + +.main-menu__item:last-child { + padding: 0; + display: flex; + flex: 2; + border: none; + background-color: unset; +} + +.main-menu__item:last-child:hover { + cursor: unset; + background-color: unset; +} + +.main-menu__add-site { + display: inline-block; + background-color: var(--violet); + color: white; + font-weight: 500; + font-size: 16px; + padding: 10px 15px; + + border-radius: 5px; + border: 1px grey solid; + min-height: 45px; + margin: auto; +} + +.main-menu__add-site:hover { + background-color: var(--violet); + cursor: grab; + transform: translateY(-5px); +} + +.help-text { + border-radius: 4px; + box-shadow: var(--secondary-backdrop) 0px 2px 6px 0px; + min-width: 70%; + max-width: 80%; + min-height: 70px; + display: flex; + margin-left: 15px; + margin-top: 40px; +} + +.help-text__serial-num { + display: inline-flex; + background-color: var(--violet); + color: var(--light-text); + width: 30px; + height: 30px; + border-radius: 50%; + align-items: center; + justify-content: center; +} + +.help-text__instructions { + display: inline-block; + list-style: none; + font-size: 19px; + font-weight: 500; + padding: 10px; + margin: auto; +} + +.inner-container { + display: flex; + box-sizing: border-box; + max-width: 50%; + margin: 50px auto; + border-radius: 5px; + display: flex; +} + +.sitekey-form { + display: flex; + flex-direction: column; + width: 90%; + justify-content: center; + align-items: center; + box-sizing: content-box; + background-color: #fff; + margin: auto; + padding-bottom: 30px; +} + +.sitekey-form__title-flex-container { + display: flex; + width: 100%; + border-bottom: 0.1px solid var(--light-grey); +} + +.sitekey-form__title { + padding-left: 10px; + font-size: 1rem; + padding: 0.75rem 1.25rem; +} + +.sitekey-form__label { + display: block; + margin: 10px 0; + box-sizing: inherit; + justify-self: left; +} + +.sitekey-form__input { + position: relative; + margin-top: 5px; + box-sizing: border-box; + height: 40px; + width: 90%; +} + +.sitekey-form__input--add-level { + position: relative; + margin-top: 5px; + box-sizing: inherit; + flex: 3; + height: 40px; + margin-right: 20px; +} + +.sitekey-form__add-level-flex-container { + display: flex; + box-sizing: border-box; + width: 90%; + margin-top: 10px; +} + +.sitekey-form__add-level-spacer { + flex: 3; +} + +.sitekey-form__add-level { + background-color: var(--violet); + color: white; + padding: 5px; + font-size: 16px; + + border-radius: 5px; + border: 1px var(--light-grey) solid; + height: 40px; + min-width: 125px; + margin: auto; +} + +.sitekey-form__submit { + margin-top: 50px; + display: block; + background-color: var(--violet); + color: white; + padding: 5px; + font-size: 20px; + + border-radius: 5px; + border: 1px var(--light-grey) solid; + min-height: 45px; + width: 125px; + width: 90%; +} diff --git a/templates/views/v1/routes.js b/templates/views/v1/routes.js new file mode 100644 index 00000000..a6395f52 --- /dev/null +++ b/templates/views/v1/routes.js @@ -0,0 +1,54 @@ +const ROUTES = { + registerUser: '/join/', + + loginUser: '/', + + signoutUser: '/api/v1/signout', + + panelHome: '/panel/', + + docsHome: '/docs/', + +}; + +export default ROUTES; + + +// deleteAccount: '/api/v1/account/delete', +// +// usernameExists: '/api/v1/account/username/exists', +// +// emailExists: '/api/v1/account/email/exists', +// +// healthCheck: '/api/v1/meta/health', +// +// buildDetails: '/api/v1/meta/build', +// +// addDomain: '/api/v1/mcaptcha/domain/add', +// +// challengeDomain: '/api/v1/mcaptcha/domain/domain/verify/challenge/get', +// +// proveDomain: '/api/v1/mcaptcha/domain/domain/verify/challenge/prove', +// +// deleteDomain: '/api/v1/mcaptcha/domain/delete', +// +// addToken: '/api/v1/mcaptcha/domain/token/add', +// +// updateTokenKey: '/api/v1/mcaptcha/domain/token/update', +// +// getTokenKey: '/api/v1/mcaptcha/domain/token/get', +// +// deleteToken: '/api/v1/mcaptcha/domain/token/delete', +// +// addTokenLevels: '/api/v1/mcaptcha/domain/token/levels/add', +// +// updateTokenLevels: '/api/v1/mcaptcha/domain/token/levels/update', +// +// deleteTokenLevels: '/api/v1/mcaptcha/domain/token/levels/delete', +// +// getTokenLevels: '/api/v1/mcaptcha/domain/token/levels/get', +// +// getTokenDuration: '/api/v1/mcaptcha/domain/token/token/get', +// +// updateTokenDuration: '/api/v1/mcaptcha/domain/token/token/update', +//