Commit 8cb48e44 by Yutaka Kobayashi

Delete home.js

1 parent a3fc6b7b
Showing with 0 additions and 33 deletions
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (function() { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./src/assets/js/home.js":
/*!*******************************!*\
!*** ./src/assets/js/home.js ***!
\*******************************/
/***/ (function() {
eval("class Home {\n constructor() {\n this.modal();\n this.fadeIn();\n }\n\n modal() {\n const body = document.getElementsByTagName(\"body\")[0];\n const btn = document.querySelectorAll(\".novelList__button\");\n const modalBack = document.querySelector(\".modalBackground\");\n const modal = document.querySelectorAll(\".modal\");\n const closeBtn = document.querySelector(\".modal__button\");\n\n // モーダルを表示する\n for (let i = 0; i < btn.length; i++) {\n btn[i].addEventListener(\"click\", addOpen);\n function addOpen(e) {\n e.preventDefault();\n body.classList.add(\"open\");\n modalBack.classList.add(\"open\");\n modal[i].classList.add(\"open\");\n }\n }\n\n // モーダルを非表示にする\n closeBtn.addEventListener(\"click\", function () {\n body.classList.remove(\"open\");\n modalBack.classList.remove(\"open\");\n for (let i = 0; i < modal.length; i++) {\n modal[i].classList.remove(\"open\");\n }\n });\n\n function menuClick() {\n const menus = document.getElementsByClassName(\"close\");\n body.classList.remove(\"open\");\n modalBack.classList.remove(\"open\");\n const hogeElements = document.querySelectorAll(\".modal\");\n\n hogeElements.forEach((item) => {\n item.classList.remove(\"open\");\n });\n }\n\n const menus = document.getElementsByClassName(\"close\");\n for (let i = 0; i < menus.length; i++) {\n menus[i].addEventListener(\"click\", menuClick, false);\n }\n\n const menus02 = document.getElementsByClassName(\"modal__button\");\n for (let i = 0; i < menus.length; i++) {\n menus02[i].addEventListener(\"click\", menuClick, false);\n }\n }\n\n // フェードイン\n fadeIn() {\n function scroll_effect() {\n var element = document.getElementsByClassName(\"scrollUp\");\n if (!element) return;\n\n var scrollY = window.pageYOffset;\n var windowHeight = window.innerHeight;\n var showTiming = 200;\n for (var i = 0; i < element.length; i++) {\n var elementClientRect = element[i].getBoundingClientRect();\n var elementY = scrollY + elementClientRect.top;\n if (scrollY > elementY - windowHeight + showTiming) {\n element[i].classList.add(\"is-show\");\n }\n }\n }\n window.addEventListener(\"scroll\", scroll_effect);\n }\n}\n\nwindow.addEventListener(\"DOMContentLoaded\", () => {\n new Home();\n});\n\n\n//# sourceURL=webpack://static-boilerplate/./src/assets/js/home.js?");
/***/ })
/******/ });
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = {};
/******/ __webpack_modules__["./src/assets/js/home.js"]();
/******/
/******/ })()
;
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!