diff --git a/docs/base.css b/docs/base.css index 44307b2..af00521 100644 --- a/docs/base.css +++ b/docs/base.css @@ -9,12 +9,8 @@ } :root{ - --font-color-dark: rgb(218, 216, 216); --wrong-font-color: #ff324d; - --background-color-dark: rgb(34, 34, 34); --button-bg-color: rgb(255, 221, 70); - --font-color-light: rgb(17, 17, 17); - --background-color-light: rgb(230, 216, 216); --font-size-normal: 1.5rem; --font-size-small: 1rem; --font-size-heading: 2rem; @@ -23,9 +19,11 @@ } .light{ + --font-color: rgb(17, 17, 17); + --background-color: rgb(230, 216, 216); --logo-color: rgba(0, 0, 0, 0.658); - background-color: var(--background-color-light); - color: var(--font-color-light); + background-color: var(--background-color); + color: var(--font-color); --lb-header-bg-color: rgb(29, 29, 29); --lb-header-color: rgb(255, 237, 234); --lb-list-item-bg-color: var(--lb-header-color); @@ -34,14 +32,16 @@ } .dark{ + --font-color: rgb(218, 216, 216); + --background-color: rgb(34, 34, 34); --correct-word: rgb(255, 213, 73); --logo-color: rgba(255, 213, 73, 0.616); --lb-header-bg-color: rgb(255, 243, 230); --lb-header-color: rgb(24, 25, 26); --lb-list-item-bg-color: var(--lb-header-color); --lb-list-item-color: var(--lb-header-bg-color); - background-color: var(--background-color-dark); - color: var(--font-color-dark) + background-color: var(--background-color); + color: var(--font-color) } @media only screen and ( max-width: 500px) { diff --git a/docs/bundle.js b/docs/bundle.js index ca0ee2f..d68c135 100644 --- a/docs/bundle.js +++ b/docs/bundle.js @@ -288,7 +288,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"spanWrap\": () => (/* binding */ spanWrap),\n/* harmony export */ \"totalWords\": () => (/* binding */ totalWords),\n/* harmony export */ \"handleStats\": () => (/* binding */ handleStats)\n/* harmony export */ });\n/* harmony import */ var _functions_getText__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions/getText */ \"./src/functions/getText.js\");\n/* harmony import */ var _functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../functions/handleHiding */ \"./src/functions/handleHiding.js\");\n/* harmony import */ var _storage_localstorage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../storage/localstorage */ \"./src/storage/localstorage.js\");\n/* harmony import */ var _uiElements__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uiElements */ \"./src/ui/uiElements.js\");\n/* harmony import */ var _functions_saveStats__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/saveStats */ \"./src/functions/saveStats.js\");\n/* harmony import */ var _firebase_auth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../firebase/auth */ \"./src/firebase/auth.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nvar totalWords;\r\n\r\n//sets total word value\r\nconst words = document.querySelector(\".words\");\r\n\r\nconst setWords = (typedWords = 0) => {\r\n let whitespace = / /g, result, indices = [];\r\n while (result = whitespace.exec(_functions_getText__WEBPACK_IMPORTED_MODULE_0__.text)) {\r\n indices.push(result.index);\r\n }\r\n totalWords = indices.length + 1;\r\n words.innerText = `${totalWords}/${typedWords}`;\r\n}\r\n\r\n//wraps all words in a span tag\r\nconst spanWrap = (textContainer) => {\r\n let newArr = [];\r\n for (let i = 0; i < _functions_getText__WEBPACK_IMPORTED_MODULE_0__.text.length; i++) {\r\n newArr.push(`${_functions_getText__WEBPACK_IMPORTED_MODULE_0__.text[i]}`);\r\n };\r\n let newText = newArr.join('');\r\n textContainer.innerHTML = newText;\r\n}\r\n\r\n\r\n\r\n// to show and hide profile window \r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.profileButton.addEventListener('click', async () => {\r\n if (_uiElements__WEBPACK_IMPORTED_MODULE_3__.profile.classList.contains('hide')) {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.profile.classList.toggle('hide')\r\n let user = await (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.getUserData)();\r\n (0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__.handleMenu)(user);\r\n if (user && !(Object.entries(user).length === 0 && user.constructor === Object)) {\r\n handleStats(user);\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.updateBtn.classList.remove('hide');\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.signupBtn.classList.add('hide');\r\n } else {\r\n (0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.signUpinfo)\r\n }\r\n } else {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.profile.classList.add('hide')\r\n }\r\n})\r\n\r\n//for close button on the floating window\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.closeWinBtn.forEach((b) => {\r\n b.addEventListener('click', (e) => {\r\n let element = e.target.parentElement.parentElement.parentElement;\r\n (0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.loader);\r\n element.classList.toggle('hide');\r\n })\r\n})\r\n\r\n// for dragging elements \r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.drag.forEach((d) => {\r\n d.addEventListener('drag', (e) => {\r\n let element = e.target.parentElement.parentElement;\r\n element.style.filter = 'brightness(.7)';\r\n })\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.drag.forEach((d) => {\r\n d.addEventListener('dragend', (e) => {\r\n let element = e.target.parentElement.parentElement;\r\n element.style.filter = 'brightness(1)';\r\n moveElement(e, element);\r\n })\r\n}\r\n)\r\n\r\n\r\nconst moveElement = (e, element) => {\r\n element.style.left = (e.pageX - 20) + 'px';\r\n element.style.top = (e.pageY - 20) + 'px';\r\n}\r\n\r\n\r\n// for stats \r\n\r\nconst handleStats = async (user) => {\r\n // console.log(user)\r\n if (user && !(Object.entries(user).length === 0 && user.constructor === Object)) {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.stats.childNodes.forEach((element) => {\r\n if (!element.classList) {\r\n return\r\n } else if (element.classList.contains('name')) {\r\n element.innerText = user.userName;\r\n } else if (element.classList.contains('topSpeed')) {\r\n element.innerText = 'topspeed: ' + user.topSpeed;\r\n }\r\n })\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.stats, user)\r\n } else {\r\n (0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.signUpinfo)\r\n }\r\n return user;\r\n}\r\n\r\n\r\n// to show and hide settings window \r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.settingsBtn.addEventListener('click', () => {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.settings.classList.toggle('hide');\r\n})\r\n\r\n\r\n\r\n// for theme \r\n\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.theme.addEventListener('click', async (e) => {\r\n let user = await (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.getUserData)()\r\n if (e.target.classList.contains('themeLight')) {\r\n if (_uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.contains('light')) {\r\n return\r\n } else {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.remove('dark')\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.toggle('light')\r\n user ? (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.setUserData)({ ...user, theme: 'light' }) : (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.setUserTheme)({ theme: 'light' })\r\n }\r\n } else if (e.target.classList.contains('themeDark')) {\r\n if (_uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.contains('dark')) {\r\n return\r\n } else {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.remove('light')\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.toggle('dark')\r\n user ? (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.setUserData)({ ...user, theme: 'dark' }) : (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.setUserTheme)({ theme: 'dark' })\r\n }\r\n }\r\n})\r\n\r\n\r\n// save stats \r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.saveStatsBtn.addEventListener('click', () => {\r\n ;(0,_functions_saveStats__WEBPACK_IMPORTED_MODULE_4__[\"default\"])();\r\n})\r\n\r\n\r\n//signupform and signIn form handler\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.signupForm.addEventListener('submit', (e) => {\r\n e.preventDefault();\r\n (0,_firebase_auth__WEBPACK_IMPORTED_MODULE_5__.signUp)({ email: e.target.email.value, username: e.target.username.value, password: e.target.password.value })\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.loader);\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.signinForm.addEventListener('submit', (e) => {\r\n e.preventDefault();\r\n (0,_firebase_auth__WEBPACK_IMPORTED_MODULE_5__.signIn)({ email: e.target.email.value, password: e.target.password.value })\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.loader);\r\n})\r\n\r\n\r\n// to show signup and login window \r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.signupBtn.addEventListener('click', () => {\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.signupForm);\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.loginBtn.addEventListener('click', () => {\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.signinForm);\r\n})\r\n\r\n//for logging out\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.logoutBtn.addEventListener('click', () => {\r\n ;(0,_firebase_auth__WEBPACK_IMPORTED_MODULE_5__.logout)();\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.updateBtn.addEventListener('click', () => {\r\n // console.log('update btn clicked')\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.updateForm);\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.updateForm.addEventListener('submit', (e) => {\r\n e.preventDefault();\r\n let username = e.target.username.value;\r\n if (username && username[0] != ' ' && username.length > 0) { (0,_firebase_auth__WEBPACK_IMPORTED_MODULE_5__.updateUser)(username) } else {\r\n console.log('enter username', username)\r\n };\r\n})\r\n\r\n\r\n//handle leaderBoard\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoardBtn.addEventListener('click', () => {\r\n if (_uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.contains('hide')) {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.toggle('hide');\r\n setTimeout(() => {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.toggle('fadeOut');\r\n }, 200)\r\n } else {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.toggle('fadeOut');\r\n setTimeout(() => {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.toggle('hide');\r\n }, 500)\r\n }\r\n})\r\n\r\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setWords);\r\n\r\n\r\n\n\n//# sourceURL=webpack://type-master/./src/ui/uiListeners.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ \"spanWrap\": () => (/* binding */ spanWrap),\n/* harmony export */ \"totalWords\": () => (/* binding */ totalWords),\n/* harmony export */ \"handleStats\": () => (/* binding */ handleStats)\n/* harmony export */ });\n/* harmony import */ var _functions_getText__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions/getText */ \"./src/functions/getText.js\");\n/* harmony import */ var _functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../functions/handleHiding */ \"./src/functions/handleHiding.js\");\n/* harmony import */ var _storage_localstorage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../storage/localstorage */ \"./src/storage/localstorage.js\");\n/* harmony import */ var _uiElements__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uiElements */ \"./src/ui/uiElements.js\");\n/* harmony import */ var _functions_saveStats__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/saveStats */ \"./src/functions/saveStats.js\");\n/* harmony import */ var _firebase_auth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../firebase/auth */ \"./src/firebase/auth.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nvar totalWords;\r\n\r\n//sets total word value\r\nconst words = document.querySelector(\".words\");\r\n\r\nconst setWords = (typedWords = 0) => {\r\n let whitespace = / /g, result, indices = [];\r\n while (result = whitespace.exec(_functions_getText__WEBPACK_IMPORTED_MODULE_0__.text)) {\r\n indices.push(result.index);\r\n }\r\n totalWords = indices.length + 1;\r\n words.innerText = `${totalWords}/${typedWords}`;\r\n}\r\n\r\n//wraps all words in a span tag\r\nconst spanWrap = (textContainer) => {\r\n let newArr = [];\r\n for (let i = 0; i < _functions_getText__WEBPACK_IMPORTED_MODULE_0__.text.length; i++) {\r\n newArr.push(`${_functions_getText__WEBPACK_IMPORTED_MODULE_0__.text[i]}`);\r\n };\r\n let newText = newArr.join('');\r\n textContainer.innerHTML = newText;\r\n}\r\n\r\n\r\n\r\n// to show and hide profile window \r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.profileButton.addEventListener('click', async () => {\r\n if (_uiElements__WEBPACK_IMPORTED_MODULE_3__.profile.classList.contains('hide')) {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.profile.classList.toggle('hide')\r\n let user = await (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.getUserData)();\r\n (0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__.handleMenu)(user);\r\n if (user && !(Object.entries(user).length === 0 && user.constructor === Object)) {\r\n handleStats(user);\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.updateBtn.classList.remove('hide');\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.signupBtn.classList.add('hide');\r\n } else {\r\n (0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.signUpinfo)\r\n }\r\n } else {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.profile.classList.add('hide')\r\n }\r\n})\r\n\r\n//for close button on the floating window\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.closeWinBtn.forEach((b) => {\r\n b.addEventListener('click', (e) => {\r\n let element = e.target.parentElement.parentElement.parentElement;\r\n (0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.loader);\r\n element.classList.toggle('hide');\r\n })\r\n})\r\n\r\n// for dragging elements \r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.drag.forEach((d) => {\r\n d.addEventListener('drag', (e) => {\r\n let element = e.target.parentElement.parentElement;\r\n element.style.filter = 'brightness(.7)';\r\n })\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.drag.forEach((d) => {\r\n d.addEventListener('dragend', (e) => {\r\n let element = e.target.parentElement.parentElement;\r\n element.style.filter = 'brightness(1)';\r\n moveElement(e, element);\r\n })\r\n}\r\n)\r\n\r\n\r\nconst moveElement = (e, element) => {\r\n element.style.left = (e.pageX - 20) + 'px';\r\n element.style.top = (e.pageY - 20) + 'px';\r\n}\r\n\r\n\r\n// for stats \r\n\r\nconst handleStats = async (user) => {\r\n // console.log(user)\r\n if (user && !(Object.entries(user).length === 0 && user.constructor === Object)) {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.stats.lastElementChild.lastElementChild.childNodes.forEach((element) => {\r\n if (!element.classList) {\r\n return\r\n } else if (element.classList.contains('name')) {\r\n if (user.userName.length > 10) {\r\n element.style.fontSize = 20;\r\n } else if (\r\n user.userName.length > 20\r\n ) {\r\n element.style.fontSize = 15;\r\n\r\n }\r\n element.innerHTML = user.userName;\r\n } else if (element.classList.contains('speed')) {\r\n if (user.userName.length > 10) {\r\n element.style.fontSize = 30;\r\n }\r\n element.innerHTML = user.topSpeed;\r\n }\r\n })\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.stats, user)\r\n } else {\r\n (0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.signUpinfo)\r\n }\r\n return user;\r\n}\r\n\r\n\r\n// to show and hide settings window \r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.settingsBtn.addEventListener('click', () => {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.settings.classList.toggle('hide');\r\n})\r\n\r\n\r\n\r\n// for theme \r\n\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.theme.addEventListener('click', async (e) => {\r\n let user = await (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.getUserData)()\r\n if (e.target.classList.contains('themeLight')) {\r\n if (_uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.contains('light')) {\r\n return\r\n } else {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.remove('dark')\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.toggle('light')\r\n user ? (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.setUserData)({ ...user, theme: 'light' }) : (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.setUserTheme)({ theme: 'light' })\r\n }\r\n } else if (e.target.classList.contains('themeDark')) {\r\n if (_uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.contains('dark')) {\r\n return\r\n } else {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.remove('light')\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.body.classList.toggle('dark')\r\n user ? (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.setUserData)({ ...user, theme: 'dark' }) : (0,_storage_localstorage__WEBPACK_IMPORTED_MODULE_2__.setUserTheme)({ theme: 'dark' })\r\n }\r\n }\r\n})\r\n\r\n\r\n// save stats \r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.saveStatsBtn.addEventListener('click', () => {\r\n ;(0,_functions_saveStats__WEBPACK_IMPORTED_MODULE_4__[\"default\"])();\r\n})\r\n\r\n\r\n//signupform and signIn form handler\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.signupForm.addEventListener('submit', (e) => {\r\n e.preventDefault();\r\n (0,_firebase_auth__WEBPACK_IMPORTED_MODULE_5__.signUp)({ email: e.target.email.value, username: e.target.username.value, password: e.target.password.value })\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.loader);\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.signinForm.addEventListener('submit', (e) => {\r\n e.preventDefault();\r\n (0,_firebase_auth__WEBPACK_IMPORTED_MODULE_5__.signIn)({ email: e.target.email.value, password: e.target.password.value })\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.loader);\r\n})\r\n\r\n\r\n// to show signup and login window \r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.signupBtn.addEventListener('click', () => {\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.signupForm);\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.loginBtn.addEventListener('click', () => {\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.signinForm);\r\n})\r\n\r\n//for logging out\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.logoutBtn.addEventListener('click', () => {\r\n ;(0,_firebase_auth__WEBPACK_IMPORTED_MODULE_5__.logout)();\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.updateBtn.addEventListener('click', () => {\r\n // console.log('update btn clicked')\r\n ;(0,_functions_handleHiding__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_uiElements__WEBPACK_IMPORTED_MODULE_3__.updateForm);\r\n})\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.updateForm.addEventListener('submit', (e) => {\r\n e.preventDefault();\r\n let username = e.target.username.value;\r\n if (username && username[0] != ' ' && username.length > 0) { (0,_firebase_auth__WEBPACK_IMPORTED_MODULE_5__.updateUser)(username) } else {\r\n console.log('enter username', username)\r\n };\r\n})\r\n\r\n\r\n//handle leaderBoard\r\n\r\n_uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoardBtn.addEventListener('click', () => {\r\n if (_uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.contains('hide')) {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.toggle('hide');\r\n setTimeout(() => {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.toggle('fadeOut');\r\n }, 200)\r\n } else {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.toggle('fadeOut');\r\n setTimeout(() => {\r\n _uiElements__WEBPACK_IMPORTED_MODULE_3__.leaderBoard.parentElement.classList.toggle('hide');\r\n }, 500)\r\n }\r\n})\r\n\r\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setWords);\r\n\r\n\r\n\n\n//# sourceURL=webpack://type-master/./src/ui/uiListeners.js?"); /***/ }), diff --git a/docs/index.html b/docs/index.html index aeecd6f..e4ba6f6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,9 +24,33 @@