├── .editorconfig ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── stale.yml └── workflows │ └── test.yml ├── .gitignore ├── .npmignore ├── .travis.yml ├── CONTRIBUTING ├── LICENSE ├── README.md ├── config ├── banner.js ├── build-css.js ├── changelog.js ├── commit.template ├── uglify.js └── validate-commit-msg.js ├── css ├── arrow.css └── pagination.css ├── jsdoc.json ├── karma.conf.js ├── mocha.opts ├── package-lock.json ├── package.json ├── rollup.config.dev.js ├── rollup.config.js ├── src ├── Arrow.ts ├── AutoPlay.ts ├── Fade.ts ├── Parallax.ts ├── Perspective.ts ├── Sync.ts ├── const.ts ├── event.ts ├── index.ts ├── pagination │ ├── Pagination.ts │ ├── index.ts │ └── renderer │ │ ├── BulletRenderer.ts │ │ ├── FractionRenderer.ts │ │ ├── Renderer.ts │ │ └── ScrollBulletRenderer.ts ├── type.ts └── utils.ts ├── test ├── hammer-simulator.run.js ├── manual │ ├── arrow.html │ ├── autoplay.html │ ├── css │ │ ├── arrow.css │ │ ├── common.css │ │ ├── pagination.css │ │ └── sync.css │ ├── img │ │ ├── bg01.jpg │ │ ├── bg02.jpg │ │ └── bg03.jpg │ ├── js │ │ ├── arrow.js │ │ ├── autoplay.js │ │ ├── pagination.js │ │ ├── perspective.js │ │ └── sync.js │ ├── pagination.html │ ├── perspective.html │ └── sync.html ├── setup.js └── unit │ ├── .eslintrc.js │ ├── Arrow.spec.ts │ ├── AutoPlay.spec.ts │ ├── Fade.spec.ts │ ├── Pagination.spec.ts │ ├── Parallax.spec.ts │ ├── Perspective.spec.ts │ ├── Sync.spec.ts │ └── utils.ts ├── tsconfig.declaration.json ├── tsconfig.eslint.json ├── tsconfig.json └── tsconfig.test.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | charset = utf-8 8 | end_of_line = lf 9 | indent_style = space 10 | indent_size = 2 11 | max_line_length = 80 12 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/naming-convention */ 2 | 3 | module.exports = { 4 | "env": { 5 | "browser": true 6 | }, 7 | "parser": "@typescript-eslint/parser", 8 | "parserOptions": { 9 | "project": "tsconfig.eslint.json", 10 | "sourceType": "module" 11 | }, 12 | "plugins": [ 13 | "eslint-plugin-import", 14 | "eslint-plugin-jsdoc", 15 | "eslint-plugin-prefer-arrow", 16 | "@typescript-eslint", 17 | "@typescript-eslint/tslint" 18 | ], 19 | "overrides": [ 20 | { 21 | "files": [ 22 | "./**/*.{ts,tsx}" 23 | ], 24 | "extends": [ 25 | "plugin:@typescript-eslint/recommended", 26 | "plugin:@typescript-eslint/recommended-requiring-type-checking", 27 | "plugin:import/typescript" 28 | ], 29 | "rules": { 30 | "@typescript-eslint/adjacent-overload-signatures": "off", 31 | "@typescript-eslint/array-type": [ 32 | "error", 33 | { 34 | "default": "array-simple" 35 | } 36 | ], 37 | "@typescript-eslint/ban-types": [ 38 | "error", 39 | { 40 | "types": { 41 | "Object": { 42 | "message": "Avoid using the `Object` type. Did you mean `object`?" 43 | }, 44 | "Function": { 45 | "message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." 46 | }, 47 | "Boolean": { 48 | "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" 49 | }, 50 | "Number": { 51 | "message": "Avoid using the `Number` type. Did you mean `number`?" 52 | }, 53 | "String": { 54 | "message": "Avoid using the `String` type. Did you mean `string`?" 55 | }, 56 | "Symbol": { 57 | "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" 58 | } 59 | } 60 | } 61 | ], 62 | "@typescript-eslint/consistent-type-assertions": "error", 63 | "@typescript-eslint/consistent-type-definitions": "error", 64 | "@typescript-eslint/dot-notation": "error", 65 | "@typescript-eslint/explicit-member-accessibility": [ 66 | "error", 67 | { 68 | "accessibility": "explicit" 69 | } 70 | ], 71 | "@typescript-eslint/indent": [ 72 | "error", 73 | 2, 74 | { 75 | "FunctionDeclaration": { 76 | "parameters": "first" 77 | }, 78 | "FunctionExpression": { 79 | "parameters": "first" 80 | }, 81 | "SwitchCase": 1 82 | } 83 | ], 84 | "@typescript-eslint/member-delimiter-style": [ 85 | "error", 86 | { 87 | "multiline": { 88 | "delimiter": "semi", 89 | "requireLast": true 90 | }, 91 | "singleline": { 92 | "delimiter": "semi", 93 | "requireLast": false 94 | } 95 | } 96 | ], 97 | "@typescript-eslint/no-non-null-assertion": "off", 98 | "@typescript-eslint/member-ordering": ["error", { 99 | "default": [ 100 | // Index signature 101 | "signature", 102 | 103 | // Static 104 | "public-static-method", 105 | "protected-static-method", 106 | "private-static-method", 107 | 108 | "public-static-field", 109 | "protected-static-field", 110 | "private-static-field", 111 | 112 | "public-abstract-field", 113 | "protected-abstract-field", 114 | "private-abstract-field", 115 | 116 | "public-instance-field", 117 | "protected-instance-field", 118 | "private-instance-field", 119 | 120 | "constructor", 121 | 122 | // Methods 123 | "public-abstract-method", 124 | "protected-abstract-method", 125 | "private-abstract-method", 126 | 127 | "public-instance-method", 128 | "protected-instance-method", 129 | "private-instance-method" 130 | ] 131 | }], 132 | "@typescript-eslint/no-empty-function": "error", 133 | "@typescript-eslint/no-empty-interface": "warn", 134 | "@typescript-eslint/no-explicit-any": "off", 135 | "@typescript-eslint/no-misused-new": "off", 136 | "@typescript-eslint/no-namespace": "error", 137 | "@typescript-eslint/no-parameter-properties": "off", 138 | "@typescript-eslint/no-unused-expressions": "error", 139 | "@typescript-eslint/no-use-before-define": "off", 140 | "@typescript-eslint/no-var-requires": "error", 141 | "@typescript-eslint/no-inferrable-types": "off", 142 | "@typescript-eslint/prefer-for-of": "error", 143 | "@typescript-eslint/prefer-function-type": "error", 144 | "@typescript-eslint/prefer-namespace-keyword": "error", 145 | "@typescript-eslint/explicit-module-boundary-types": "off", 146 | "@typescript-eslint/restrict-template-expressions": "off", 147 | "@typescript-eslint/quotes": [ 148 | "error", 149 | "double" 150 | ], 151 | "@typescript-eslint/semi": [ 152 | "error", 153 | "always" 154 | ], 155 | "@typescript-eslint/triple-slash-reference": [ 156 | "error", 157 | { 158 | "path": "always", 159 | "types": "prefer-import", 160 | "lib": "always" 161 | } 162 | ], 163 | "@typescript-eslint/type-annotation-spacing": "error", 164 | "@typescript-eslint/unified-signatures": "error", 165 | "@typescript-eslint/no-shadow": ["error"], 166 | "@typescript-eslint/naming-convention": [ 167 | "error", 168 | { 169 | "selector": "variableLike", 170 | "format": ["camelCase"], 171 | "leadingUnderscore": "forbid", 172 | "trailingUnderscore": "forbid" 173 | }, 174 | { 175 | "selector": "variable", 176 | "format": ["camelCase", "UPPER_CASE"], 177 | "modifiers": ["exported", "const"] 178 | }, 179 | { 180 | "selector": "memberLike", 181 | "modifiers": ["public"], 182 | "format": ["camelCase"], 183 | "leadingUnderscore": "forbid", 184 | "trailingUnderscore": "forbid" 185 | }, 186 | { 187 | "selector": "memberLike", 188 | "modifiers": ["protected"], 189 | "format": ["camelCase"], 190 | "leadingUnderscore": "require", 191 | "trailingUnderscore": "forbid" 192 | }, 193 | { 194 | "selector": "memberLike", 195 | "modifiers": ["private"], 196 | "format": ["camelCase"], 197 | "leadingUnderscore": "require", 198 | "trailingUnderscore": "forbid" 199 | }, 200 | { 201 | "selector": "classProperty", 202 | "modifiers": ["static"], 203 | "format": ["camelCase", "UPPER_CASE"] 204 | }, 205 | { 206 | "selector": "classMethod", 207 | "modifiers": ["static"], 208 | "format": ["camelCase", "UPPER_CASE"] 209 | }, 210 | { 211 | "selector": "property", 212 | "modifiers": ["static"], 213 | "format": ["UPPER_CASE"] 214 | }, 215 | { 216 | "selector": "objectLiteralProperty", 217 | "format": ["camelCase", "UPPER_CASE"] 218 | }, 219 | { 220 | "selector": "objectLiteralMethod", 221 | "format": ["camelCase", "UPPER_CASE"] 222 | }, 223 | { 224 | "selector": "parameter", 225 | "modifiers": ["unused"], 226 | "format": ["camelCase"], 227 | "leadingUnderscore": "allow" 228 | }, 229 | { 230 | "selector": "typeLike", 231 | "format": ["PascalCase", "UPPER_CASE"], 232 | "leadingUnderscore": "allow" 233 | }, 234 | { 235 | "selector": "typeProperty", 236 | "format": ["camelCase", "UPPER_CASE"], 237 | "leadingUnderscore": "allow" 238 | } 239 | ], 240 | "@typescript-eslint/tslint/config": [ 241 | "error", 242 | { 243 | "rules": { 244 | "import-spacing": true, 245 | "whitespace": [ 246 | true, 247 | "check-decl", 248 | "check-operator", 249 | "check-module", 250 | "check-separator", 251 | "check-rest-spread", 252 | "check-branch", 253 | "check-type-operator", 254 | "check-type", 255 | "check-typecast", 256 | "check-preblock" 257 | ] 258 | } 259 | } 260 | ] 261 | } 262 | } 263 | ], 264 | "rules": { 265 | "arrow-body-style": "error", 266 | "arrow-parens": [ 267 | "off", 268 | "always" 269 | ], 270 | "brace-style": [ 271 | "error", 272 | "1tbs", 273 | { "allowSingleLine": true } 274 | ], 275 | "comma-dangle": [ 276 | "error", 277 | "never" 278 | ], 279 | "complexity": "off", 280 | "constructor-super": "error", 281 | "curly": "off", 282 | "eol-last": "error", 283 | "eqeqeq": [ 284 | "error", 285 | "smart" 286 | ], 287 | "guard-for-in": "off", 288 | "id-blacklist": "off", 289 | "id-match": "off", 290 | "import/order": "off", 291 | "jsdoc/check-alignment": "error", 292 | "jsdoc/check-indentation": "off", 293 | "jsdoc/newline-after-description": ["error", "never"], 294 | "max-classes-per-file": [ 295 | "error", 296 | 1 297 | ], 298 | "max-len": "off", 299 | "new-parens": "error", 300 | "no-bitwise": "off", 301 | "no-caller": "error", 302 | "no-cond-assign": "error", 303 | "no-console": "warn", 304 | "no-debugger": "error", 305 | "no-empty": "error", 306 | "no-eval": "error", 307 | "no-fallthrough": "off", 308 | "no-invalid-this": "off", 309 | "no-multiple-empty-lines": "error", 310 | "no-new-wrappers": "error", 311 | "no-shadow": "off", 312 | "no-throw-literal": "error", 313 | "no-trailing-spaces": "error", 314 | "no-undef-init": "error", 315 | "no-underscore-dangle": "off", 316 | "no-unsafe-finally": "error", 317 | "no-unsafe-member-access": "off", 318 | "no-unused-labels": "error", 319 | "no-var": "error", 320 | "object-shorthand": "off", 321 | "one-var": [ 322 | "error", 323 | "never" 324 | ], 325 | "prefer-arrow/prefer-arrow-functions": "error", 326 | "prefer-const": "error", 327 | "quote-props": "off", 328 | "radix": "error", 329 | "space-before-function-paren": [ 330 | "error", 331 | { 332 | "anonymous": "never", 333 | "asyncArrow": "always", 334 | "named": "never" 335 | } 336 | ], 337 | "spaced-comment": [ 338 | "error", 339 | "always", 340 | { 341 | "markers": [ 342 | "/" 343 | ] 344 | } 345 | ], 346 | "use-isnan": "error", 347 | "valid-typeof": "off", 348 | "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], 349 | "import/order": ["error", {"newlines-between": "always"}] 350 | } 351 | }; 352 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 4 | ## Steps to check or reproduce 5 | 6 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Issue 2 | 3 | 4 | ## Details 5 | 6 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 30 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - wontstale 8 | # Label to use when marking an issue as stale 9 | staleLabel: stale 10 | # Comment to post when marking an issue as stale. Set to `false` to disable 11 | markComment: > 12 | This issue/PR has been automatically marked as stale because it has not had any update (including 13 | commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no 14 | further update occurs in 7 day. Thank you for your contributions! 15 |
한글 16 | 이 이슈/PR은 commits, comments, labels, milestones 등 30일간 활동이 없어 자동으로 stale 상태로 전환되었습니다. 이후 7일간 활동이 없다면 자동으로 닫힐 예정입니다. 프로젝트 개선에 기여해주셔서 감사합니다. 17 |
18 | # Comment to post when closing a stale issue. Set to `false` to disable 19 | closeComment: false 20 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Run tests 3 | on: [push, pull_request] 4 | jobs: 5 | unit: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v2 9 | - uses: actions/setup-node@v2.1.5 10 | with: 11 | node-version: 14.15.4 12 | - name: install 13 | run: npm install 14 | - name: lint 15 | run: npm run lint 16 | - name: test 17 | run: npm run coverage 18 | - name: Coveralls GitHub Action 19 | uses: coverallsapp/github-action@v1.1.2 20 | with: 21 | github-token: ${{ secrets.GITHUB_TOKEN }} 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/node,bower,osx,windows,webstorm,jekyll,sublimetext,visualstudiocode 2 | 3 | ### Node ### 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | 9 | # Runtime data 10 | pids 11 | *.pid 12 | *.seed 13 | *.pid.lock 14 | 15 | # Directory for instrumented libs generated by jscoverage/JSCover 16 | lib-cov 17 | 18 | # Coverage directory used by tools like istanbul 19 | coverage 20 | 21 | # nyc test coverage 22 | .nyc_output 23 | 24 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 25 | .grunt 26 | 27 | # node-waf configuration 28 | .lock-wscript 29 | # Compiled binary addons (http://nodejs.org/api/addons.html) 30 | build/Release 31 | 32 | # Dependency directories 33 | node_modules 34 | jspm_packages 35 | 36 | # Optional npm cache directory 37 | .npm 38 | 39 | # Optional eslint cache 40 | .eslintcache 41 | 42 | # Optional REPL history 43 | .node_repl_history 44 | 45 | # Output of 'npm pack' 46 | *.tgz 47 | 48 | # Yarn Integrity file 49 | .yarn-integrity 50 | 51 | 52 | 53 | ### Bower ### 54 | bower_components 55 | .bower-cache 56 | .bower-registry 57 | .bower-tmp 58 | 59 | 60 | ### OSX ### 61 | *.DS_Store 62 | .AppleDouble 63 | .LSOverride 64 | 65 | # Icon must end with two \r 66 | Icon 67 | # Thumbnails 68 | ._* 69 | # Files that might appear in the root of a volume 70 | .DocumentRevisions-V100 71 | .fseventsd 72 | .Spotlight-V100 73 | .TemporaryItems 74 | .Trashes 75 | .VolumeIcon.icns 76 | .com.apple.timemachine.donotpresent 77 | # Directories potentially created on remote AFP share 78 | .AppleDB 79 | .AppleDesktop 80 | Network Trash Folder 81 | Temporary Items 82 | .apdisk 83 | 84 | 85 | ### Windows ### 86 | # Windows image file caches 87 | Thumbs.db 88 | ehthumbs.db 89 | 90 | # Folder config file 91 | Desktop.ini 92 | 93 | # Recycle Bin used on file shares 94 | $RECYCLE.BIN/ 95 | 96 | # Windows Installer files 97 | *.cab 98 | *.msi 99 | *.msm 100 | *.msp 101 | 102 | # Windows shortcuts 103 | *.lnk 104 | 105 | 106 | ### WebStorm ### 107 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 108 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 109 | 110 | # User-specific stuff: 111 | .idea/ 112 | .idea/workspace.xml 113 | .idea/tasks.xml 114 | 115 | # Sensitive or high-churn files: 116 | .idea/dataSources/ 117 | .idea/dataSources.ids 118 | .idea/dataSources.xml 119 | .idea/dataSources.local.xml 120 | .idea/sqlDataSources.xml 121 | .idea/dynamic.xml 122 | .idea/uiDesigner.xml 123 | 124 | # Gradle: 125 | .idea/gradle.xml 126 | .idea/libraries 127 | 128 | # Mongo Explorer plugin: 129 | .idea/mongoSettings.xml 130 | 131 | ## File-based project format: 132 | *.iws 133 | 134 | ## Plugin-specific files: 135 | 136 | # IntelliJ 137 | /out/ 138 | 139 | # mpeltonen/sbt-idea plugin 140 | .idea_modules/ 141 | 142 | # JIRA plugin 143 | atlassian-ide-plugin.xml 144 | 145 | # Crashlytics plugin (for Android Studio and IntelliJ) 146 | com_crashlytics_export_strings.xml 147 | crashlytics.properties 148 | crashlytics-build.properties 149 | fabric.properties 150 | 151 | ### WebStorm Patch ### 152 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 153 | 154 | # *.iml 155 | # modules.xml 156 | # .idea/misc.xml 157 | # *.ipr 158 | 159 | 160 | ### Jekyll ### 161 | _site/ 162 | .sass-cache/ 163 | .jekyll-metadata 164 | 165 | 166 | ### SublimeText ### 167 | # cache files for sublime text 168 | *.tmlanguage.cache 169 | *.tmPreferences.cache 170 | *.stTheme.cache 171 | 172 | # workspace files are user-specific 173 | *.sublime-workspace 174 | 175 | # project files should be checked into the repository, unless a significant 176 | # proportion of contributors will probably not be using SublimeText 177 | # *.sublime-project 178 | 179 | # sftp configuration file 180 | sftp-config.json 181 | 182 | # Package control specific files 183 | Package Control.last-run 184 | Package Control.ca-list 185 | Package Control.ca-bundle 186 | Package Control.system-ca-bundle 187 | Package Control.cache/ 188 | Package Control.ca-certs/ 189 | bh_unicode_properties.cache 190 | 191 | # Sublime-github package stores a github token in this file 192 | # https://packagecontrol.io/packages/sublime-github 193 | GitHub.sublime-settings 194 | 195 | 196 | ### VisualStudioCode ### 197 | .vscode/* 198 | !.vscode/settings.json 199 | !.vscode/tasks.json 200 | !.vscode/launch.json 201 | !.vscode/extensions.json 202 | 203 | ### Custom ### 204 | doc/ 205 | report/ 206 | temp/ 207 | demo/release 208 | demo/_data/version.yml 209 | 210 | outjs/ 211 | declaration/ 212 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | #configs 2 | config 3 | bower.json 4 | 5 | #tests 6 | test 7 | karma.conf.js 8 | 9 | #build tools 10 | webpack.*.js 11 | .travis.yml 12 | .codeclimate.yml 13 | 14 | #linters 15 | .eslintrc* 16 | 17 | #docs 18 | demo 19 | jsdoc.json 20 | 21 | #editor settings 22 | .idea 23 | .editorconfig 24 | 25 | coverage/ 26 | node_modules/ 27 | .github 28 | .babelrc 29 | mocha.opts 30 | jsdoc.json 31 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "10" 4 | dist: trusty # needs Ubuntu Trusty 5 | sudo: required 6 | before_install: 7 | - npm install -g npm@latest 8 | install: 9 | - npm ci 10 | addons: 11 | chrome: stable # install chrome stable 12 | cache: 13 | yarn: true 14 | directories: 15 | - $HOME/.npm 16 | before_script: 17 | - npm run lint 18 | script: 19 | - npm run coverage 20 | after_success: 21 | - npm run coveralls 22 | -------------------------------------------------------------------------------- /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | # How to contribute to egjs-flicking 2 | egjs-flicking is opened to everyone and we're welcoming for any kind of contribution. 3 | We believe that our project can grow with your interests helping others' necessities. 4 | 5 | ## Style Guide 6 | 7 | egjs-flicking has several style guidelines to follow. 8 | Before your start, please read attentively below instructions. 9 | 10 | ### Linting and Code Conventions 11 | We adopted [ESLint](http://eslint.org/) to maintain our code quality. The [rules](https://github.com/naver/eslint-config-naver/tree/master/rules) are modified version based on [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript). 12 | All rules are described at [.eslintrc](.eslintrc) file. 13 | 14 | ### Commit Log Guidelines 15 | egjs-flicking use commit logs in many different purposes (like creating CHANGELOG, ease history searching, etc.). 16 | To not break, you'll be forced to follow our commit log guidelines. 17 | Before your commit/push, make sure following our commit log guidelines. 18 | 19 | The outline is as below: 20 | ``` 21 | (): 22 | 23 | 24 | 25 |