From 1930354d4667925e54b20068da0686bee299aea4 Mon Sep 17 00:00:00 2001 From: yama-dev Date: Tue, 17 Dec 2024 14:57:14 +0900 Subject: [PATCH 1/8] =?UTF-8?q?=E3=82=B9=E3=83=9E=E3=83=9B=E3=81=AA?= =?UTF-8?q?=E3=81=A9=E3=81=AE=E3=83=AA=E3=82=B5=E3=82=A4=E3=82=BA=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=83=90=E3=82=B0=E3=82=92=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/js-scroll-effect-module.js | 4 ++-- src/js-scroll-effect-module.js | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dist/js-scroll-effect-module.js b/dist/js-scroll-effect-module.js index 711b4e3..2c97545 100644 --- a/dist/js-scroll-effect-module.js +++ b/dist/js-scroll-effect-module.js @@ -1,2 +1,2 @@ -/*! @yama-dev/js-scroll-effect-module Version 0.13.3 Repository https://github.com/yama-dev/js-scroll-effect-module Copyright yama-dev Licensed MIT */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SCROLL_EFFECT_MODULE=e():t.SCROLL_EFFECT_MODULE=e()}(self,(function(){return function(){"use strict";var t={d:function(e,i){for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e={};function i(t){try{return t instanceof HTMLElement}catch(t){return!1}}function n(t,e){if(e){var o,r=n(t),a=[];return!!r&&(r.map((function(t){if(!(o=i(e)?Array.prototype.slice.call(t.querySelectorAll(e.tagName.toLowerCase())):Array.prototype.slice.call(t.querySelectorAll(e))))return!1;a=a.concat(o)})),a)}if(!t)return!1;var s;if(!Array.isArray(t)&&!t.length||function(t){try{return"string"==typeof t}catch(t){return!1}}(t))s=i(t)?Array(t):Array.prototype.slice.call(document.querySelectorAll(t));else{if(!i(t[0]))return!1;s=Array.prototype.slice.call(t)}return 0===s.length&&(s=null),s}function o(t,e){return i(t)?t.classList.contains(e):document.querySelector(t).classList.contains(e)}function r(t,e){var i=n(t);if(!i)return!1;i.map((function(t){t.classList.add(e)}))}function a(t,e){var i=n(t);if(!i)return!1;i.map((function(t){t.classList.remove(e)}))}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function l(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.state={NumScrolltopPre:0,NumScrolltop:0,NumWindowHeight:0,PosList:[],$targets:null,$parent:null,$body:null};this.config=l(l({},{target:"[data-scroll]",targetDataName:"[data-scroll-name]",parent:"window",body:"body",classNameInview:"is-active",ratio:.8,ratioReverse:null,reverse:!1,firstDelay:100,autoStart:!0,autoStartType:"ready",throttleInterval:5,customVarNameRatio:null,on:{Scroll:null,Change:null,In:null,Out:null}}),e),this.timer=null,this.timerScroll=null,this.config.ratioReverse?this.config.ratioReversee.pos?1:-1}))}},{key:"_StoreElementStateAtPosList",value:function(){if(!this.state.PosList.length)return!1;this.state.NumScrolltop="window"===this.config.parent?this.state.$parent.pageYOffset:this.state.$parent.scrollTop;for(var t=function(t,e){t.active!==e&&(t.changing=!0,t.active=e)},e=this.state.PosList.filter((function(t){return!0===t.active})).length,i=this.state.NumScrolltop>=this.state.$body.clientHeight-("window"===this.config.parent?this.state.$parent.innerHeight:this.state.$parent.clientHeight),n=0;no.pos?t(o,!0):t(o,!1):o.active?this.state.NumScrolltop+this.state.NumWindowHeight*this.config.ratioReverseo.pos&&t(o,!0)}var s=e1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.state={NumScrolltopPre:0,NumScrolltop:0,NumWindowHeight:0,PosList:[],$targets:null,$parent:null,$body:null},this.config=l(l({},{target:"[data-scroll]",targetDataName:"[data-scroll-name]",parent:"window",body:"body",classNameInview:"is-active",ratio:.8,ratioReverse:null,reverse:!1,firstDelay:100,autoStart:!0,autoStartType:"ready",throttleInterval:5,updateResizeAuto:!0,customVarNameRatio:null,on:{Scroll:null,Change:null,In:null,Out:null}}),e),this.timer=null,this.timerScroll=null,this.config.ratioReverse?this.config.ratioReversee.pos?1:-1}))}},{key:"_StoreElementStateAtPosList",value:function(){if(!this.state.PosList.length)return!1;this.state.NumScrolltop="window"===this.config.parent?this.state.$parent.pageYOffset:this.state.$parent.scrollTop;for(var t=function(t,e){t.active!==e&&(t.changing=!0,t.active=e)},e=this.state.PosList.filter((function(t){return!0===t.active})).length,i=this.state.NumScrolltop>=this.state.$body.clientHeight-("window"===this.config.parent?this.state.$parent.innerHeight:this.state.$parent.clientHeight),n=0;no.pos?t(o,!0):t(o,!1):o.active?this.state.NumScrolltop+this.state.NumWindowHeight*this.config.ratioReverseo.pos&&t(o,!0)}var s=e1?e-1:0),n=1;n { - this.Start(); + // not resize + if (currentWidth == window.innerWidth) { + return; + } + + // update window width + currentWidth = window.innerWidth; + + if(this.config.updateResizeAuto){ + this.Start(); + } }); if(this.config.autoStartType === 'ready'){ From fa1e71d2ed9c042d9ef59fb6721cba9582b47990 Mon Sep 17 00:00:00 2001 From: yama-dev Date: Tue, 17 Dec 2024 14:58:13 +0900 Subject: [PATCH 2/8] =?UTF-8?q?:up:=20=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E8=A8=98=E8=BF=B0=E3=82=A2=E3=83=83=E3=83=97=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 1ec5b8b..8c62503 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ SLUG=js-scroll-effect-module -VERSION=0.13.3 +VERSION=0.13.4 From 49dba8712216f1dd5ec151067c2ad9f10e5a2a99 Mon Sep 17 00:00:00 2001 From: yama-dev Date: Tue, 17 Dec 2024 14:59:03 +0900 Subject: [PATCH 3/8] =?UTF-8?q?:wrench:=20Makefile=E3=82=92=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9dc836c..81409d6 100755 --- a/Makefile +++ b/Makefile @@ -37,6 +37,6 @@ zip: $(CP) dist/js-scroll-effect-module.js examples/index.html $(ZIP_FOLDER)/ $(CP) examples/scroll-effect-module.css examples/scroll-effect-module.css $(ZIP_FOLDER)/ sed -i "" "s/..\/dist\//.\//g" "$(ZIP_FOLDER)/index.html" - $(ZIP) $(ZIP_FOLDER)/$(VERSION).zip -r $(ZIP_FOLDER)/* + $(ZIP) $(ZIP_FOLDER)/$(SLUG)_v$(VERSION).zip -r $(ZIP_FOLDER)/* .PHONY: all build serve clean prod zip install From bc6318848b40c4fc102798c150d066574776d5cb Mon Sep 17 00:00:00 2001 From: yama-dev Date: Tue, 17 Dec 2024 14:59:34 +0900 Subject: [PATCH 4/8] =?UTF-8?q?:wrench:=20=E9=96=8B=E7=99=BA=E7=92=B0?= =?UTF-8?q?=E5=A2=83=E3=82=92=E3=82=A2=E3=83=83=E3=83=97=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- webpack.config.js | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 126af5c..dcbc394 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "js-scroll-effect-module", - "version": "0.13.3", + "version": "0.13.5", "description": "Add effect at scroll.", "keywords": [ "scroll", @@ -40,8 +40,8 @@ "@babel/register": "^7.14.5", "babel-loader": "^8.2.2", "browser-sync": "^2.27.5", - "eslint": "^7.32.0", - "eslint-loader": "^2.1.1", + "eslint": "^8.57.0", + "eslint-webpack-plugin": "^4.1.0", "mocha": "^9.0.3", "npm-run-all": "^4.1.5", "webpack": "^5.48.0", diff --git a/webpack.config.js b/webpack.config.js index fb505f7..5976235 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,6 +8,7 @@ if(!env) process.exit(1); const webpack = require('webpack'); const TerserPlugin = require('terser-webpack-plugin'); +const ESLintPlugin = require('eslint-webpack-plugin'); const webpackPlugEnv = new webpack.EnvironmentPlugin({ DEBUG: false, @@ -28,12 +29,6 @@ const config = { }, module: { rules: [ - { - enforce: 'pre', - test: /\.(js)$/, - exclude: /node_modules/, - loader: 'eslint-loader', - }, { test: /\.js$/, exclude: /node_modules[///](?!(@yama-dev)\/).*/, @@ -56,6 +51,11 @@ const config = { target: ['web', 'es5'], plugins: [ webpackPlugEnv, + new ESLintPlugin({ + cache: true, + extensions: ['js'], + fix: false, + }), ], optimization: { minimizer: [ From 922cda6787b44ca3c0ef9f7dc4b7c75981f230d7 Mon Sep 17 00:00:00 2001 From: yama-dev Date: Tue, 17 Dec 2024 15:00:35 +0900 Subject: [PATCH 5/8] =?UTF-8?q?:memo:=20=E3=82=B5=E3=83=B3=E3=83=97?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E3=82=AF=E3=83=A9=E3=82=B9=E5=90=8D=E3=82=92?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- examples/index.html | 5 +++-- examples/scroll-effect-module.css | 14 +++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a9c8975..a2b4045 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ new SCROLL_EFFECT_MODULE({ + +
@@ -63,7 +63,7 @@ new SCROLL_EFFECT_MODULE({ ### Advanced Use ``` html - +
diff --git a/dist/js-scroll-effect-module.js b/dist/js-scroll-effect-module.js index 2c97545..e712d27 100644 --- a/dist/js-scroll-effect-module.js +++ b/dist/js-scroll-effect-module.js @@ -1,2 +1,2 @@ -/*! @yama-dev/js-scroll-effect-module Version 0.13.4 Repository https://github.com/yama-dev/js-scroll-effect-module Copyright yama-dev Licensed MIT */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SCROLL_EFFECT_MODULE=e():t.SCROLL_EFFECT_MODULE=e()}(self,(function(){return function(){"use strict";var t={d:function(e,i){for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e={};function i(t){try{return t instanceof HTMLElement}catch(t){return!1}}function n(t,e){if(e){var o,r=n(t),a=[];return!!r&&(r.map((function(t){if(!(o=i(e)?Array.prototype.slice.call(t.querySelectorAll(e.tagName.toLowerCase())):Array.prototype.slice.call(t.querySelectorAll(e))))return!1;a=a.concat(o)})),a)}if(!t)return!1;var s;if(!Array.isArray(t)&&!t.length||function(t){try{return"string"==typeof t}catch(t){return!1}}(t))s=i(t)?Array(t):Array.prototype.slice.call(document.querySelectorAll(t));else{if(!i(t[0]))return!1;s=Array.prototype.slice.call(t)}return 0===s.length&&(s=null),s}function o(t,e){return i(t)?t.classList.contains(e):document.querySelector(t).classList.contains(e)}function r(t,e){var i=n(t);if(!i)return!1;i.map((function(t){t.classList.add(e)}))}function a(t,e){var i=n(t);if(!i)return!1;i.map((function(t){t.classList.remove(e)}))}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function l(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.state={NumScrolltopPre:0,NumScrolltop:0,NumWindowHeight:0,PosList:[],$targets:null,$parent:null,$body:null},this.config=l(l({},{target:"[data-scroll]",targetDataName:"[data-scroll-name]",parent:"window",body:"body",classNameInview:"is-active",ratio:.8,ratioReverse:null,reverse:!1,firstDelay:100,autoStart:!0,autoStartType:"ready",throttleInterval:5,updateResizeAuto:!0,customVarNameRatio:null,on:{Scroll:null,Change:null,In:null,Out:null}}),e),this.timer=null,this.timerScroll=null,this.config.ratioReverse?this.config.ratioReversee.pos?1:-1}))}},{key:"_StoreElementStateAtPosList",value:function(){if(!this.state.PosList.length)return!1;this.state.NumScrolltop="window"===this.config.parent?this.state.$parent.pageYOffset:this.state.$parent.scrollTop;for(var t=function(t,e){t.active!==e&&(t.changing=!0,t.active=e)},e=this.state.PosList.filter((function(t){return!0===t.active})).length,i=this.state.NumScrolltop>=this.state.$body.clientHeight-("window"===this.config.parent?this.state.$parent.innerHeight:this.state.$parent.clientHeight),n=0;no.pos?t(o,!0):t(o,!1):o.active?this.state.NumScrolltop+this.state.NumWindowHeight*this.config.ratioReverseo.pos&&t(o,!0)}var s=e1?e-1:0),n=1;n0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.state={NumScrolltopPre:0,NumScrolltop:0,NumWindowHeight:0,PosList:[],$targets:null,$parent:null,$body:null},this.config=l(l({},{target:"[data-scroll]",targetDataName:"[data-scroll-name]",parent:"window",body:"body",classNameInview:"is-scroll-active",ratio:.8,ratioReverse:null,reverse:!1,firstDelay:100,autoStart:!0,autoStartType:"ready",throttleInterval:5,updateResizeAuto:!0,customVarNameRatio:null,on:{Scroll:null,Change:null,In:null,Out:null}}),e),this.timer=null,this.timerScroll=null,this.config.ratioReverse?this.config.ratioReversee.pos?1:-1}))}},{key:"_StoreElementStateAtPosList",value:function(){if(!this.state.PosList.length)return!1;this.state.NumScrolltop="window"===this.config.parent?this.state.$parent.pageYOffset:this.state.$parent.scrollTop;for(var t=function(t,e){t.active!==e&&(t.changing=!0,t.active=e)},e=this.state.PosList.filter((function(t){return!0===t.active})).length,i=this.state.NumScrolltop>=this.state.$body.clientHeight-("window"===this.config.parent?this.state.$parent.innerHeight:this.state.$parent.clientHeight),n=0;no.pos?t(o,!0):t(o,!1):o.active?this.state.NumScrolltop+this.state.NumWindowHeight*this.config.ratioReverseo.pos&&t(o,!0)}var s=e1?e-1:0),n=1;n