mirror of
https://github.com/lrsjng/pagemap.git
synced 2025-08-17 18:26:43 +02:00
Initial commit.
This commit is contained in:
24
.editorconfig
Normal file
24
.editorconfig
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# editorconfig.org
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
|
||||||
|
[{package.json,.eslintrc,.travis.yml}]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
|
||||||
|
[{*.md,*.pug}]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
|
||||||
|
[*.svg]
|
||||||
|
insert_final_newline = false
|
6
.eslintignore
Normal file
6
.eslintignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
build
|
||||||
|
coverage
|
||||||
|
dist
|
||||||
|
es5
|
||||||
|
local
|
||||||
|
node_modules
|
182
.eslintrc
Normal file
182
.eslintrc
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
---
|
||||||
|
root: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
es6: true
|
||||||
|
node: true
|
||||||
|
|
||||||
|
ecmaFeatures:
|
||||||
|
ecmaVersion: 6
|
||||||
|
|
||||||
|
rules:
|
||||||
|
array-bracket-spacing: [2, never]
|
||||||
|
arrow-parens: [2, as-needed]
|
||||||
|
arrow-spacing: 2
|
||||||
|
block-scoped-var: 2
|
||||||
|
brace-style: [2, 1tbs, {allowSingleLine: true}]
|
||||||
|
camelcase: 0
|
||||||
|
comma-dangle: [2, never]
|
||||||
|
comma-spacing: [2, {before: false, after: true}]
|
||||||
|
comma-style: [2, last]
|
||||||
|
complexity: [1, 16] ###
|
||||||
|
computed-property-spacing: [2, never]
|
||||||
|
consistent-return: 2
|
||||||
|
consistent-this: [2, self]
|
||||||
|
constructor-super: 2
|
||||||
|
curly: [2, multi-line]
|
||||||
|
default-case: 2
|
||||||
|
dot-location: [2, property]
|
||||||
|
dot-notation: [2, {allowKeywords: true}]
|
||||||
|
eol-last: 2
|
||||||
|
eqeqeq: 2
|
||||||
|
func-names: 2
|
||||||
|
func-style: [2, declaration, {allowArrowFunctions: true}]
|
||||||
|
generator-star-spacing: [2, after]
|
||||||
|
guard-for-in: 2
|
||||||
|
handle-callback-err: 2
|
||||||
|
indent: [2, 4]
|
||||||
|
key-spacing: [2, {beforeColon: false, afterColon: true}]
|
||||||
|
keyword-spacing: [2, {before: true, after: true}]
|
||||||
|
linebreak-style: [2, unix]
|
||||||
|
max-depth: [1, 4]
|
||||||
|
max-len: [0, 80, 4]
|
||||||
|
max-nested-callbacks: [1, 3]
|
||||||
|
max-params: [1, 5] ###
|
||||||
|
max-statements: [1, 32] ###
|
||||||
|
new-cap: 0
|
||||||
|
new-parens: 2
|
||||||
|
newline-after-var: 0
|
||||||
|
no-alert: 2
|
||||||
|
no-array-constructor: 2
|
||||||
|
no-bitwise: 2
|
||||||
|
no-caller: 2
|
||||||
|
no-catch-shadow: 2
|
||||||
|
no-class-assign: 2
|
||||||
|
no-cond-assign: 2
|
||||||
|
no-console: 0 ###
|
||||||
|
no-const-assign: 2
|
||||||
|
no-constant-condition: 1
|
||||||
|
no-continue: 0
|
||||||
|
no-control-regex: 2
|
||||||
|
no-debugger: 2
|
||||||
|
no-delete-var: 2
|
||||||
|
no-div-regex: 2
|
||||||
|
no-dupe-args: 2
|
||||||
|
no-dupe-class-members: 2
|
||||||
|
no-dupe-keys: 2
|
||||||
|
no-duplicate-case: 2
|
||||||
|
no-else-return: 1
|
||||||
|
no-empty: 2
|
||||||
|
no-empty-character-class: 2
|
||||||
|
no-empty-pattern: 2
|
||||||
|
no-eq-null: 2
|
||||||
|
no-eval: 2
|
||||||
|
no-ex-assign: 2
|
||||||
|
no-extend-native: 1
|
||||||
|
no-extra-bind: 2
|
||||||
|
no-extra-boolean-cast: 2
|
||||||
|
no-extra-parens: 1
|
||||||
|
no-extra-semi: 2
|
||||||
|
no-fallthrough: 2
|
||||||
|
no-floating-decimal: 2
|
||||||
|
no-func-assign: 2
|
||||||
|
no-implicit-coercion: [2, {boolean: false, number: true, string: true}]
|
||||||
|
no-implied-eval: 2
|
||||||
|
no-inline-comments: 0
|
||||||
|
no-inner-declarations: [2, functions]
|
||||||
|
no-invalid-regexp: 2
|
||||||
|
no-invalid-this: 2
|
||||||
|
no-irregular-whitespace: 2
|
||||||
|
no-iterator: 2
|
||||||
|
no-label-var: 2
|
||||||
|
no-labels: 2
|
||||||
|
no-lone-blocks: 2
|
||||||
|
no-lonely-if: 2
|
||||||
|
no-loop-func: 1
|
||||||
|
no-magic-numbers: 0
|
||||||
|
no-mixed-requires: [2, false]
|
||||||
|
no-mixed-spaces-and-tabs: [2, false]
|
||||||
|
no-multi-spaces: 2
|
||||||
|
no-multi-str: 2
|
||||||
|
no-multiple-empty-lines: [2, {max: 4}]
|
||||||
|
no-native-reassign: 1
|
||||||
|
no-negated-in-lhs: 2
|
||||||
|
no-nested-ternary: 0
|
||||||
|
no-new: 2
|
||||||
|
no-new-func: 2
|
||||||
|
no-new-object: 2
|
||||||
|
no-new-require: 2
|
||||||
|
no-new-wrappers: 2
|
||||||
|
no-obj-calls: 2
|
||||||
|
no-octal: 2
|
||||||
|
no-octal-escape: 2
|
||||||
|
no-param-reassign: 0
|
||||||
|
no-path-concat: 2
|
||||||
|
no-plusplus: 2
|
||||||
|
no-process-env: 2
|
||||||
|
no-process-exit: 2
|
||||||
|
no-proto: 2
|
||||||
|
no-redeclare: 2
|
||||||
|
no-regex-spaces: 2
|
||||||
|
no-restricted-modules: 2
|
||||||
|
no-return-assign: 2
|
||||||
|
no-script-url: 2
|
||||||
|
no-self-compare: 2
|
||||||
|
no-sequences: 2
|
||||||
|
no-shadow: 2
|
||||||
|
no-shadow-restricted-names: 2
|
||||||
|
no-spaced-func: 2
|
||||||
|
no-sparse-arrays: 2
|
||||||
|
no-sync: 0
|
||||||
|
no-ternary: 0
|
||||||
|
no-this-before-super: 2
|
||||||
|
no-throw-literal: 1
|
||||||
|
no-trailing-spaces: 2
|
||||||
|
no-undef: 2
|
||||||
|
no-undef-init: 2
|
||||||
|
no-undefined: 0
|
||||||
|
no-underscore-dangle: 0
|
||||||
|
no-unexpected-multiline: 2
|
||||||
|
no-unneeded-ternary: 2
|
||||||
|
no-unreachable: 2
|
||||||
|
no-useless-call: 2
|
||||||
|
no-useless-concat: 2
|
||||||
|
no-unused-expressions: 2
|
||||||
|
no-unused-vars: [1, {vars: all, args: after-used}]
|
||||||
|
no-use-before-define: 2
|
||||||
|
no-var: 2
|
||||||
|
no-void: 2
|
||||||
|
no-warning-comments: [1, {terms: [todo, fixme, xxx], location: start}]
|
||||||
|
no-with: 2
|
||||||
|
object-curly-spacing: [2, never]
|
||||||
|
object-shorthand: [2, always]
|
||||||
|
one-var: [2, never]
|
||||||
|
operator-assignment: [2, always]
|
||||||
|
operator-linebreak: [2, after]
|
||||||
|
padded-blocks: [2, never]
|
||||||
|
prefer-arrow-callback: 2
|
||||||
|
prefer-const: 1
|
||||||
|
prefer-reflect: 1
|
||||||
|
prefer-spread: 2
|
||||||
|
prefer-template: 0 ###
|
||||||
|
quote-props: [2, as-needed]
|
||||||
|
quotes: [2, single, avoid-escape]
|
||||||
|
radix: 2
|
||||||
|
require-yield: 2
|
||||||
|
semi: 2
|
||||||
|
semi-spacing: [2, {before: false, after: true}]
|
||||||
|
sort-vars: 0
|
||||||
|
space-before-blocks: [2, always]
|
||||||
|
space-before-function-paren: [2, {anonymous: always, named: never}]
|
||||||
|
space-in-parens: [2, never]
|
||||||
|
space-infix-ops: 2
|
||||||
|
space-unary-ops: [2, {words: true, nonwords: false}]
|
||||||
|
spaced-comment: [2, always]
|
||||||
|
strict: [2, never]
|
||||||
|
use-isnan: 2
|
||||||
|
valid-jsdoc: 2
|
||||||
|
valid-typeof: 2
|
||||||
|
vars-on-top: 0
|
||||||
|
wrap-iife: [2, outside]
|
||||||
|
wrap-regex: 2
|
||||||
|
yoda: [2, never, {exceptRange: true}]
|
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
build
|
||||||
|
coverage
|
||||||
|
local
|
||||||
|
node_modules
|
||||||
|
npm-debug.log
|
81
README.md
Normal file
81
README.md
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
# pagemap
|
||||||
|
|
||||||
|
[![license][license-img]][github] [![web][web-img]][web] [![github][github-img]][github] [![npm][npm-img]][npm]
|
||||||
|
[![version][npm-v-img]][npm] [![downloads][npm-dm-img]][npm] [![dependencies status][gemnasium-img]][gemnasium]
|
||||||
|
|
||||||
|
Mini map for web pages.
|
||||||
|
|
||||||
|
|
||||||
|
## Example usage
|
||||||
|
|
||||||
|
add a `canvas` tag to your HTML page:
|
||||||
|
```html
|
||||||
|
<canvas id='#map'></canvas>
|
||||||
|
```
|
||||||
|
|
||||||
|
fix it's position on the screen:
|
||||||
|
```css
|
||||||
|
#map {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 200px;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
init and style the mini map:
|
||||||
|
```js
|
||||||
|
pagemap(document.querySelector('#map'), {
|
||||||
|
viewport: null,
|
||||||
|
styles: {
|
||||||
|
'header,footer,section,article': rgba(0,0,0,0.08),
|
||||||
|
'h1,a': rgba(0,0,0,0.10),
|
||||||
|
'h2,h3,h4': rgba(0,0,0,0.08)
|
||||||
|
},
|
||||||
|
back: rgba(0,0,0,0.02),
|
||||||
|
view: rgba(0,0,0,0.05),
|
||||||
|
drag: rgba(0,0,0,0.10),
|
||||||
|
interval: null
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2016 Lars Jung (https://larsjung.de)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
[web]: https://larsjung.de/pagemap/
|
||||||
|
[github]: https://github.com/lrsjng/pagemap
|
||||||
|
[npm]: https://www.npmjs.org/package/pagemap
|
||||||
|
[gemnasium]: https://gemnasium.com/lrsjng/pagemap
|
||||||
|
|
||||||
|
[license-img]: https://img.shields.io/badge/license-MIT-a0a060.svg?style=flat-square
|
||||||
|
[web-img]: https://img.shields.io/badge/web-larsjung.de/pagemap-a0a060.svg?style=flat-square
|
||||||
|
[github-img]: https://img.shields.io/badge/github-lrsjng/pagemap-a0a060.svg?style=flat-square
|
||||||
|
[npm-img]: https://img.shields.io/badge/npm-pagemap-a0a060.svg?style=flat-square
|
||||||
|
|
||||||
|
[npm-v-img]: https://img.shields.io/npm/v/pagemap.svg?style=flat-square
|
||||||
|
[npm-dm-img]: https://img.shields.io/npm/dm/pagemap.svg?style=flat-square
|
||||||
|
[gemnasium-img]: https://img.shields.io/gemnasium/lrsjng/pagemap.svg?style=flat-square
|
84
demo/boxes.html
Normal file
84
demo/boxes.html
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>pagemap boxes demo</title>
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
width: 2000px;
|
||||||
|
height: 2000px;
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
#map {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 120px;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
#container {
|
||||||
|
position: relative;
|
||||||
|
left: 100px;
|
||||||
|
top: 100px;
|
||||||
|
width: 600px;
|
||||||
|
height: 600px;
|
||||||
|
outline: 4px solid #222;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
#content {
|
||||||
|
width: 800px;
|
||||||
|
height: 1000px;
|
||||||
|
background-color: #ccc;
|
||||||
|
}
|
||||||
|
#container2 {
|
||||||
|
position: relative;
|
||||||
|
left: 100px;
|
||||||
|
top: 100px;
|
||||||
|
width: 300px;
|
||||||
|
height: 400px;
|
||||||
|
outline: 4px solid #222;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
#content2 {
|
||||||
|
width: 500px;
|
||||||
|
height: 600px;
|
||||||
|
background-color: #aaa;
|
||||||
|
}
|
||||||
|
.checkers {
|
||||||
|
background-image:
|
||||||
|
linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff),
|
||||||
|
linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%, #fff);
|
||||||
|
background-size: 100px 100px;
|
||||||
|
background-position: 0 0, 50px 50px
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="checkers">
|
||||||
|
<div id="container">
|
||||||
|
<div id="content" class="checkers">
|
||||||
|
<div id="container2">
|
||||||
|
<div id="content2" class="checkers"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<canvas id="map"></canvas>
|
||||||
|
|
||||||
|
<script src="../dist/pagemap.js"></script>
|
||||||
|
<script>
|
||||||
|
pagemap(document.querySelector('#map'), {
|
||||||
|
// viewport: document.querySelector('#container'),
|
||||||
|
interval: 50,
|
||||||
|
styles: {
|
||||||
|
div: 'rgba(0,0,0,0.1)'
|
||||||
|
},
|
||||||
|
back: 'rgba(255,255,255,1)'
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
88
demo/text.html
Normal file
88
demo/text.html
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>pagemap text demo</title>
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
#map {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 200px;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
font-family: Bitter, Ubuntu, Arial, sans;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
margin: 3em auto 6em auto;
|
||||||
|
max-width: 800px;
|
||||||
|
line-height: 1.6em;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 3em;
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 0 0 1em;
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
font-size: 1.8em;
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 3em 0 1em;
|
||||||
|
}
|
||||||
|
h3 {
|
||||||
|
font-size: 1.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 2em 0 1em;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #1E88E5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<header>
|
||||||
|
<h1>At Eos Accusamu</h1>
|
||||||
|
</header>
|
||||||
|
<section>
|
||||||
|
<h2>Et harum quidem rerum</h2>
|
||||||
|
|
||||||
|
<h3>Nemo enim ipsam voluptatem</h3>
|
||||||
|
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio <a href="?">dignissimos</a> ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
|
||||||
|
|
||||||
|
<h3>Nemo enim ipsam voluptatem</h3>
|
||||||
|
<p> Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid <a href="?">ex ea commodi</a> consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p>
|
||||||
|
|
||||||
|
<h3>Nemo enim ipsam voluptatem</h3>
|
||||||
|
<p> Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>Et harum quidem rerum</h2>
|
||||||
|
|
||||||
|
<h3>Nemo enim ipsam voluptatem</h3>
|
||||||
|
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p>
|
||||||
|
|
||||||
|
<h3>Nemo enim ipsam voluptatem</h3>
|
||||||
|
<p> Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, <a href="?">totam rem aperiam</a>, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.</p>
|
||||||
|
|
||||||
|
<h3>Nemo enim ipsam voluptatem</h3>
|
||||||
|
<p> Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, <a href="?">eaque veritatis</a> et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<canvas id="map"></canvas>
|
||||||
|
|
||||||
|
<script src="../dist/pagemap.js"></script>
|
||||||
|
<script>
|
||||||
|
pagemap(document.querySelector('#map'));
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
2
dist/pagemap.js
vendored
Normal file
2
dist/pagemap.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/*! pagemap v0.1.0 - https://larsjung.de/pagemap/ */
|
||||||
|
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.pagemap=e():t.pagemap=e()}(this,function(){return function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var o={};return e.m=t,e.c=o,e.p="",e(0)}([function(t,e,o){(function(e){"use strict";var n=o(1),r=e.window,i=r.document,c=i.querySelector("body"),u=function(t){return"rgba(0,0,0,"+t/100+")"},f={viewport:null,styles:{"header,footer,section,article":u(8),"h1,a":u(10),"h2,h3,h4":u(8)},back:u(2),view:u(5),drag:u(10),interval:null},l=function(t,e,o,n){return o.split(/\s+/).forEach(function(o){return t[e](o,n)})},s=function(t,e,o){return l(t,"addEventListener",e,o)},a=function(t,e,o){return l(t,"removeEventListener",e,o)};t.exports=function(t,e){var o=Object.assign({},f,e),u=t.getContext("2d"),l=function(){var e=t.clientWidth,o=t.clientHeight;return function(t,n){return Math.min(e/t,o/n)}}(),p=function(e,o){t.width=e,t.height=o,t.style.width=e+"px",t.style.height=o+"px"},h=o.viewport,d=function(t){return Array.from((h||i).querySelectorAll(t))},v=!1,y=void 0,g=void 0,w=void 0,x=void 0,m=void 0,b=function(t,e){e&&(u.beginPath(),u.rect(t.x,t.y,t.w,t.h),u.fillStyle=e,u.fill())},T=function(t){Object.keys(t).forEach(function(e){var o=t[e];d(e).forEach(function(t){b(n.ofElement(t).relativeTo(y),o)})})},E=function(){y=h?n.ofContent(h):n.ofDocument(),g=h?n.ofViewport(h):n.ofWindow(),w=l(y.w,y.h),p(y.w*w,y.h*w),u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,t.width,t.height),u.scale(w,w),b(y.relativeTo(y),o.back),T(o.styles),b(g.relativeTo(y),v?o.drag:o.view)},O=function(e){e.preventDefault();var o=n.ofViewport(t),i=(e.pageX-o.x)/w-g.w*x,c=(e.pageY-o.y)/w-g.h*m;h?(h.scrollLeft=i,h.scrollTop=c):r.scrollTo(i,c),E()},W=function L(e){v=!1,t.style.cursor="pointer",c.style.cursor="auto",a(r,"mousemove",O),a(r,"mouseup",L),O(e)},j=function(e){v=!0;var o=n.ofViewport(t),i=g.relativeTo(y);x=((e.pageX-o.x)/w-i.x)/i.w,m=((e.pageY-o.y)/w-i.y)/i.h,(0>x||x>1||0>m||m>1)&&(x=.5,m=.5),t.style.cursor="crosshair",c.style.cursor="crosshair",s(r,"mousemove",O),s(r,"mouseup",W),O(e)},H=function(){t.style.cursor="pointer",s(t,"mousedown",j),s(h||r,"load resize scroll",E),o.interval>0&&setInterval(function(){return E()},o.interval),E()};return H(),{redraw:E}}}).call(e,function(){return this}())},function(t,e){(function(e){"use strict";var o=e.window,n=o.document.documentElement,r=t.exports=function(t,e,o,n){return Object.assign(Object.create(r.prototype),{x:t,y:e,w:o,h:n})};r.prototype={constructor:r,relativeTo:function(){var t=arguments.length<=0||void 0===arguments[0]?{x:0,y:0}:arguments[0];return r(this.x-t.x,this.y-t.y,this.w,this.h)}},r.ofDocument=function(){return r(0,0,n.scrollWidth,n.scrollHeight)},r.ofWindow=function(){return r(o.pageXOffset,o.pageYOffset,n.clientWidth,n.clientHeight)};var i=function(t){var e=t.getBoundingClientRect();return{x:e.left+o.pageXOffset,y:e.top+o.pageYOffset}};r.ofElement=function(t){var e=i(t),o=e.x,n=e.y;return r(o,n,t.offsetWidth,t.offsetHeight)},r.ofViewport=function(t){var e=i(t),o=e.x,n=e.y;return r(o+t.clientLeft,n+t.clientTop,t.clientWidth,t.clientHeight)},r.ofContent=function(t){var e=i(t),o=e.x,n=e.y;return r(o+t.clientLeft-t.scrollLeft,n+t.clientTop-t.scrollTop,t.scrollWidth,t.scrollHeight)}}).call(e,function(){return this}())}])});
|
148
lib/pagemap.js
Normal file
148
lib/pagemap.js
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
const Rect = require('./rect');
|
||||||
|
|
||||||
|
const win = global.window;
|
||||||
|
const doc = win.document;
|
||||||
|
const body = doc.querySelector('body');
|
||||||
|
|
||||||
|
const black = pc => `rgba(0,0,0,${pc / 100})`;
|
||||||
|
const defaults = {
|
||||||
|
viewport: null,
|
||||||
|
styles: {
|
||||||
|
'header,footer,section,article': black(8),
|
||||||
|
'h1,a': black(10),
|
||||||
|
'h2,h3,h4': black(8)
|
||||||
|
},
|
||||||
|
back: black(2),
|
||||||
|
view: black(5),
|
||||||
|
drag: black(10),
|
||||||
|
interval: null
|
||||||
|
};
|
||||||
|
|
||||||
|
const _listener = (el, method, types, fn) => types.split(/\s+/).forEach(type => el[method](type, fn));
|
||||||
|
const on = (el, types, fn) => _listener(el, 'addEventListener', types, fn);
|
||||||
|
const off = (el, types, fn) => _listener(el, 'removeEventListener', types, fn);
|
||||||
|
|
||||||
|
module.exports = (canvas, options) => {
|
||||||
|
const settings = Object.assign({}, defaults, options);
|
||||||
|
|
||||||
|
const context = canvas.getContext('2d');
|
||||||
|
|
||||||
|
const calcScale = (() => {
|
||||||
|
const width = canvas.clientWidth;
|
||||||
|
const height = canvas.clientHeight;
|
||||||
|
return (w, h) => Math.min(width / w, height / h);
|
||||||
|
})();
|
||||||
|
|
||||||
|
const resizeCanvas = (w, h) => {
|
||||||
|
canvas.width = w;
|
||||||
|
canvas.height = h;
|
||||||
|
canvas.style.width = `${w}px`;
|
||||||
|
canvas.style.height = `${h}px`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const viewport = settings.viewport;
|
||||||
|
const find = sel => Array.from((viewport || doc).querySelectorAll(sel));
|
||||||
|
|
||||||
|
let drag = false;
|
||||||
|
|
||||||
|
let rootRect;
|
||||||
|
let viewRect;
|
||||||
|
let scale;
|
||||||
|
let dragRx;
|
||||||
|
let dragRy;
|
||||||
|
|
||||||
|
const drawRect = (rect, col) => {
|
||||||
|
if (!col) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
context.beginPath();
|
||||||
|
context.rect(rect.x, rect.y, rect.w, rect.h);
|
||||||
|
context.fillStyle = col;
|
||||||
|
context.fill();
|
||||||
|
};
|
||||||
|
|
||||||
|
const applyStyles = styles => {
|
||||||
|
Object.keys(styles).forEach(sel => {
|
||||||
|
const col = styles[sel];
|
||||||
|
find(sel).forEach(el => {
|
||||||
|
drawRect(Rect.ofElement(el).relativeTo(rootRect), col);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const draw = () => {
|
||||||
|
rootRect = viewport ? Rect.ofContent(viewport) : Rect.ofDocument();
|
||||||
|
viewRect = viewport ? Rect.ofViewport(viewport) : Rect.ofWindow();
|
||||||
|
scale = calcScale(rootRect.w, rootRect.h);
|
||||||
|
|
||||||
|
resizeCanvas(rootRect.w * scale, rootRect.h * scale);
|
||||||
|
|
||||||
|
context.setTransform(1, 0, 0, 1, 0, 0);
|
||||||
|
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
context.scale(scale, scale);
|
||||||
|
|
||||||
|
drawRect(rootRect.relativeTo(rootRect), settings.back);
|
||||||
|
applyStyles(settings.styles);
|
||||||
|
drawRect(viewRect.relativeTo(rootRect), drag ? settings.drag : settings.view);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDrag = ev => {
|
||||||
|
ev.preventDefault();
|
||||||
|
const cr = Rect.ofViewport(canvas);
|
||||||
|
const x = (ev.pageX - cr.x) / scale - viewRect.w * dragRx;
|
||||||
|
const y = (ev.pageY - cr.y) / scale - viewRect.h * dragRy;
|
||||||
|
|
||||||
|
if (viewport) {
|
||||||
|
viewport.scrollLeft = x;
|
||||||
|
viewport.scrollTop = y;
|
||||||
|
} else {
|
||||||
|
win.scrollTo(x, y);
|
||||||
|
}
|
||||||
|
draw();
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDragEnd = ev => {
|
||||||
|
drag = false;
|
||||||
|
|
||||||
|
canvas.style.cursor = 'pointer';
|
||||||
|
body.style.cursor = 'auto';
|
||||||
|
off(win, 'mousemove', onDrag);
|
||||||
|
off(win, 'mouseup', onDragEnd);
|
||||||
|
onDrag(ev);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDragStart = ev => {
|
||||||
|
drag = true;
|
||||||
|
|
||||||
|
const cr = Rect.ofViewport(canvas);
|
||||||
|
const vr = viewRect.relativeTo(rootRect);
|
||||||
|
dragRx = ((ev.pageX - cr.x) / scale - vr.x) / vr.w;
|
||||||
|
dragRy = ((ev.pageY - cr.y) / scale - vr.y) / vr.h;
|
||||||
|
if (dragRx < 0 || dragRx > 1 || dragRy < 0 || dragRy > 1) {
|
||||||
|
dragRx = 0.5;
|
||||||
|
dragRy = 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
canvas.style.cursor = 'crosshair';
|
||||||
|
body.style.cursor = 'crosshair';
|
||||||
|
on(win, 'mousemove', onDrag);
|
||||||
|
on(win, 'mouseup', onDragEnd);
|
||||||
|
onDrag(ev);
|
||||||
|
};
|
||||||
|
|
||||||
|
const init = () => {
|
||||||
|
canvas.style.cursor = 'pointer';
|
||||||
|
on(canvas, 'mousedown', onDragStart);
|
||||||
|
on(viewport || win, 'load resize scroll', draw);
|
||||||
|
if (settings.interval > 0) {
|
||||||
|
setInterval(() => draw(), settings.interval);
|
||||||
|
}
|
||||||
|
draw();
|
||||||
|
};
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
|
return {
|
||||||
|
redraw: draw
|
||||||
|
};
|
||||||
|
};
|
67
lib/rect.js
Normal file
67
lib/rect.js
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
const win = global.window;
|
||||||
|
const docEl = win.document.documentElement;
|
||||||
|
|
||||||
|
const Rect = module.exports = (x, y, w, h) => {
|
||||||
|
return Object.assign(Object.create(Rect.prototype), {
|
||||||
|
x, y, w, h
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Rect.prototype = {
|
||||||
|
constructor: Rect,
|
||||||
|
|
||||||
|
relativeTo(pos = {x: 0, y: 0}) {
|
||||||
|
return Rect(this.x - pos.x, this.y - pos.y, this.w, this.h);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Rect.ofDocument = () => {
|
||||||
|
return Rect(0, 0, docEl.scrollWidth, docEl.scrollHeight);
|
||||||
|
};
|
||||||
|
|
||||||
|
Rect.ofWindow = () => {
|
||||||
|
return Rect(
|
||||||
|
win.pageXOffset,
|
||||||
|
win.pageYOffset,
|
||||||
|
docEl.clientWidth,
|
||||||
|
docEl.clientHeight
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getOffset = el => {
|
||||||
|
const br = el.getBoundingClientRect();
|
||||||
|
return {
|
||||||
|
x: br.left + win.pageXOffset,
|
||||||
|
y: br.top + win.pageYOffset
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
Rect.ofElement = el => {
|
||||||
|
const {x, y} = getOffset(el);
|
||||||
|
return Rect(
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
el.offsetWidth,
|
||||||
|
el.offsetHeight
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
Rect.ofViewport = el => {
|
||||||
|
const {x, y} = getOffset(el);
|
||||||
|
return Rect(
|
||||||
|
x + el.clientLeft,
|
||||||
|
y + el.clientTop,
|
||||||
|
el.clientWidth,
|
||||||
|
el.clientHeight
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
Rect.ofContent = el => {
|
||||||
|
const {x, y} = getOffset(el);
|
||||||
|
return Rect(
|
||||||
|
x + el.clientLeft - el.scrollLeft,
|
||||||
|
y + el.clientTop - el.scrollTop,
|
||||||
|
el.scrollWidth,
|
||||||
|
el.scrollHeight
|
||||||
|
);
|
||||||
|
};
|
29
package.json
Normal file
29
package.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"name": "pagemap",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "Mini map for web pages.",
|
||||||
|
"homepage": "https://larsjung.de/pagemap/",
|
||||||
|
"bugs": "https://github.com/lrsjng/pagemap/issues",
|
||||||
|
"author": "Lars Jung <lrsjng@gmail.com> (https://larsjung.de)",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/lrsjng/pagemap.git"
|
||||||
|
},
|
||||||
|
"main": "dist/pagemap",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint .",
|
||||||
|
"build": "rimraf dist && webpack",
|
||||||
|
"precommit": "npm run -s lint && npm run -s build"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-loader": "6.2.4",
|
||||||
|
"babel-preset-es2015": "6.9.0",
|
||||||
|
"eslint": "2.12.0",
|
||||||
|
"rimraf": "2.5.2",
|
||||||
|
"webpack": "1.13.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.0.0"
|
||||||
|
}
|
||||||
|
}
|
28
webpack.config.js
Normal file
28
webpack.config.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
const webpack = require('webpack');
|
||||||
|
const pkg = require('./package.json');
|
||||||
|
const banner = `${pkg.name} v${pkg.version} - ${pkg.homepage}`;
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
entry: './lib/pagemap.js',
|
||||||
|
output: {
|
||||||
|
path: './dist',
|
||||||
|
filename: 'pagemap.js',
|
||||||
|
library: 'pagemap',
|
||||||
|
libraryTarget: 'umd'
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
loaders: [{
|
||||||
|
test: /\.js$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
loader: 'babel-loader',
|
||||||
|
query: {
|
||||||
|
cacheDirectory: true,
|
||||||
|
presets: ['es2015']
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.BannerPlugin(banner),
|
||||||
|
new webpack.optimize.UglifyJsPlugin()
|
||||||
|
]
|
||||||
|
};
|
Reference in New Issue
Block a user