Move demo to separate file
Browse files- demo/demo.js +63 -0
- index.html +1 -65
- package.json +1 -0
- webpack.config.dev.js +4 -0
- yarn.lock +41 -4
demo/demo.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* eslint-disable */
|
| 2 |
+
const sholo = new Sholo({
|
| 3 |
+
animate: true,
|
| 4 |
+
opacity: 0.8,
|
| 5 |
+
padding: 5,
|
| 6 |
+
});
|
| 7 |
+
|
| 8 |
+
sholo.defineSteps([
|
| 9 |
+
{
|
| 10 |
+
element: '.section__header',
|
| 11 |
+
popover: {
|
| 12 |
+
title: 'Adding Introductions',
|
| 13 |
+
description: 'You can use it to add popovers on top of the website',
|
| 14 |
+
position: 'bottom',
|
| 15 |
+
},
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
element: '.btn__example',
|
| 19 |
+
popover: {
|
| 20 |
+
title: 'Adding Introductions',
|
| 21 |
+
description: 'You can use it to add popovers on top of the website',
|
| 22 |
+
position: 'left',
|
| 23 |
+
},
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
element: '.btn__light',
|
| 27 |
+
popover: {
|
| 28 |
+
title: 'Adding Introductions',
|
| 29 |
+
description: 'You can use it to add popovers on top of the website',
|
| 30 |
+
position: 'rig',
|
| 31 |
+
},
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
element: '.section__how',
|
| 35 |
+
popover: {
|
| 36 |
+
title: 'Just Specify the Item',
|
| 37 |
+
description: 'All you have to do is provide the query selector of element to highlight',
|
| 38 |
+
position: 'right',
|
| 39 |
+
},
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
element: '.section__purpose',
|
| 43 |
+
popover: {
|
| 44 |
+
title: 'Automatically Position',
|
| 45 |
+
description: 'It can automatically position too if you dont provide',
|
| 46 |
+
},
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
element: '.section__examples',
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
element: '.section__contributing',
|
| 53 |
+
popover: {
|
| 54 |
+
title: 'Automatically Position',
|
| 55 |
+
description: 'It can automatically position too if you dont provide',
|
| 56 |
+
},
|
| 57 |
+
},
|
| 58 |
+
]);
|
| 59 |
+
|
| 60 |
+
document.querySelector('.btn__example')
|
| 61 |
+
.addEventListener('click', () => {
|
| 62 |
+
sholo.start();
|
| 63 |
+
});
|
index.html
CHANGED
|
@@ -56,70 +56,6 @@
|
|
| 56 |
</div>
|
| 57 |
|
| 58 |
<script src="./dist/sholo.js"></script>
|
| 59 |
-
<script>
|
| 60 |
-
const sholo = new Sholo({
|
| 61 |
-
animate: true,
|
| 62 |
-
opacity: 0.8,
|
| 63 |
-
padding: 5
|
| 64 |
-
});
|
| 65 |
-
|
| 66 |
-
sholo.defineSteps([
|
| 67 |
-
{
|
| 68 |
-
element: '.section__header',
|
| 69 |
-
popover: {
|
| 70 |
-
title: 'Adding Introductions',
|
| 71 |
-
description: 'You can use it to add popovers on top of the website',
|
| 72 |
-
position: 'bottom',
|
| 73 |
-
},
|
| 74 |
-
},
|
| 75 |
-
{
|
| 76 |
-
element: '.btn__example',
|
| 77 |
-
popover: {
|
| 78 |
-
title: 'Adding Introductions',
|
| 79 |
-
description: 'You can use it to add popovers on top of the website',
|
| 80 |
-
position: 'left',
|
| 81 |
-
},
|
| 82 |
-
},
|
| 83 |
-
{
|
| 84 |
-
element: '.btn__light',
|
| 85 |
-
popover: {
|
| 86 |
-
title: 'Adding Introductions',
|
| 87 |
-
description: 'You can use it to add popovers on top of the website',
|
| 88 |
-
position: 'rig',
|
| 89 |
-
},
|
| 90 |
-
},
|
| 91 |
-
{
|
| 92 |
-
element: '.section__how',
|
| 93 |
-
popover: {
|
| 94 |
-
title: 'Just Specify the Item',
|
| 95 |
-
description: 'All you have to do is provide the query selector of element to highlight',
|
| 96 |
-
position: 'right'
|
| 97 |
-
},
|
| 98 |
-
},
|
| 99 |
-
{
|
| 100 |
-
element: '.section__purpose',
|
| 101 |
-
popover: {
|
| 102 |
-
title: 'Automatically Position',
|
| 103 |
-
description: 'It can automatically position too if you dont provide'
|
| 104 |
-
}
|
| 105 |
-
},
|
| 106 |
-
{
|
| 107 |
-
element: '.section__examples',
|
| 108 |
-
},
|
| 109 |
-
{
|
| 110 |
-
element: '.section__contributing',
|
| 111 |
-
popover: {
|
| 112 |
-
title: 'Automatically Position',
|
| 113 |
-
description: 'It can automatically position too if you dont provide'
|
| 114 |
-
}
|
| 115 |
-
},
|
| 116 |
-
]);
|
| 117 |
-
|
| 118 |
-
document.querySelector('.btn__example')
|
| 119 |
-
.addEventListener('click', function () {
|
| 120 |
-
sholo.start();
|
| 121 |
-
});
|
| 122 |
-
|
| 123 |
-
</script>
|
| 124 |
</body>
|
| 125 |
</html>
|
|
|
|
| 56 |
</div>
|
| 57 |
|
| 58 |
<script src="./dist/sholo.js"></script>
|
| 59 |
+
<script src="./dist/demo.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
</body>
|
| 61 |
</html>
|
package.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
| 16 |
"babel-loader": "^7.1.3",
|
| 17 |
"babel-plugin-add-module-exports": "^0.2.1",
|
| 18 |
"babel-preset-env": "^1.6.1",
|
|
|
|
| 19 |
"css-loader": "^0.28.10",
|
| 20 |
"eslint": "^4.18.2",
|
| 21 |
"eslint-config-airbnb-base": "^12.1.0",
|
|
|
|
| 16 |
"babel-loader": "^7.1.3",
|
| 17 |
"babel-plugin-add-module-exports": "^0.2.1",
|
| 18 |
"babel-preset-env": "^1.6.1",
|
| 19 |
+
"copy-webpack-plugin": "^4.5.1",
|
| 20 |
"css-loader": "^0.28.10",
|
| 21 |
"eslint": "^4.18.2",
|
| 22 |
"eslint-config-airbnb-base": "^12.1.0",
|
webpack.config.dev.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
const path = require('path');
|
|
|
|
| 2 |
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
| 3 |
|
| 4 |
module.exports = {
|
|
@@ -47,6 +48,9 @@ module.exports = {
|
|
| 47 |
filename: 'demo.css',
|
| 48 |
allChunks: true,
|
| 49 |
}),
|
|
|
|
|
|
|
|
|
|
| 50 |
],
|
| 51 |
stats: {
|
| 52 |
colors: true,
|
|
|
|
| 1 |
const path = require('path');
|
| 2 |
+
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
| 3 |
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
| 4 |
|
| 5 |
module.exports = {
|
|
|
|
| 48 |
filename: 'demo.css',
|
| 49 |
allChunks: true,
|
| 50 |
}),
|
| 51 |
+
new CopyWebpackPlugin([
|
| 52 |
+
'./demo/demo.js',
|
| 53 |
+
]),
|
| 54 |
],
|
| 55 |
stats: {
|
| 56 |
colors: true,
|
yarn.lock
CHANGED
|
@@ -271,7 +271,7 @@ array-unique@^0.3.2:
|
|
| 271 |
version "0.3.2"
|
| 272 |
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
|
| 273 |
|
| 274 |
-
arrify@^1.0.0:
|
| 275 |
version "1.0.1"
|
| 276 |
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
|
| 277 |
|
|
@@ -1226,7 +1226,7 @@ [email protected]:
|
|
| 1226 |
version "3.0.0"
|
| 1227 |
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
|
| 1228 |
|
| 1229 |
-
cacache@^10.0.1:
|
| 1230 |
version "10.0.4"
|
| 1231 |
resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460"
|
| 1232 |
dependencies:
|
|
@@ -1664,6 +1664,19 @@ copy-descriptor@^0.1.0:
|
|
| 1664 |
version "0.1.1"
|
| 1665 |
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
|
| 1666 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1667 |
core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0:
|
| 1668 |
version "2.5.3"
|
| 1669 |
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e"
|
|
@@ -2021,6 +2034,13 @@ diffie-hellman@^5.0.0:
|
|
| 2021 |
miller-rabin "^4.0.0"
|
| 2022 |
randombytes "^2.0.0"
|
| 2023 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2024 |
dns-equal@^1.0.0:
|
| 2025 |
version "1.0.0"
|
| 2026 |
resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d"
|
|
@@ -2928,6 +2948,17 @@ globby@^6.1.0:
|
|
| 2928 |
pify "^2.0.0"
|
| 2929 |
pinkie-promise "^2.0.0"
|
| 2930 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2931 |
globule@^1.0.0:
|
| 2932 |
version "1.2.0"
|
| 2933 |
resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.0.tgz#1dc49c6822dd9e8a2fa00ba2a295006e8664bd09"
|
|
@@ -3222,7 +3253,7 @@ iferr@^0.1.5:
|
|
| 3222 |
version "0.1.5"
|
| 3223 |
resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"
|
| 3224 |
|
| 3225 |
-
ignore@^3.3.3, ignore@^3.3.6:
|
| 3226 |
version "3.3.7"
|
| 3227 |
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021"
|
| 3228 |
|
|
@@ -4667,7 +4698,7 @@ p-lazy@^1.0.0:
|
|
| 4667 |
version "1.0.0"
|
| 4668 |
resolved "https://registry.yarnpkg.com/p-lazy/-/p-lazy-1.0.0.tgz#ec53c802f2ee3ac28f166cc82d0b2b02de27a835"
|
| 4669 |
|
| 4670 |
-
p-limit@^1.1.0:
|
| 4671 |
version "1.2.0"
|
| 4672 |
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c"
|
| 4673 |
dependencies:
|
|
@@ -4804,6 +4835,12 @@ path-type@^2.0.0:
|
|
| 4804 |
dependencies:
|
| 4805 |
pify "^2.0.0"
|
| 4806 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4807 |
pbkdf2@^3.0.3:
|
| 4808 |
version "3.0.14"
|
| 4809 |
resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade"
|
|
|
|
| 271 |
version "0.3.2"
|
| 272 |
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
|
| 273 |
|
| 274 |
+
arrify@^1.0.0, arrify@^1.0.1:
|
| 275 |
version "1.0.1"
|
| 276 |
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
|
| 277 |
|
|
|
|
| 1226 |
version "3.0.0"
|
| 1227 |
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
|
| 1228 |
|
| 1229 |
+
cacache@^10.0.1, cacache@^10.0.4:
|
| 1230 |
version "10.0.4"
|
| 1231 |
resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460"
|
| 1232 |
dependencies:
|
|
|
|
| 1664 |
version "0.1.1"
|
| 1665 |
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
|
| 1666 |
|
| 1667 |
+
copy-webpack-plugin@^4.5.1:
|
| 1668 |
+
version "4.5.1"
|
| 1669 |
+
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.5.1.tgz#fc4f68f4add837cc5e13d111b20715793225d29c"
|
| 1670 |
+
dependencies:
|
| 1671 |
+
cacache "^10.0.4"
|
| 1672 |
+
find-cache-dir "^1.0.0"
|
| 1673 |
+
globby "^7.1.1"
|
| 1674 |
+
is-glob "^4.0.0"
|
| 1675 |
+
loader-utils "^1.1.0"
|
| 1676 |
+
minimatch "^3.0.4"
|
| 1677 |
+
p-limit "^1.0.0"
|
| 1678 |
+
serialize-javascript "^1.4.0"
|
| 1679 |
+
|
| 1680 |
core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0:
|
| 1681 |
version "2.5.3"
|
| 1682 |
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e"
|
|
|
|
| 2034 |
miller-rabin "^4.0.0"
|
| 2035 |
randombytes "^2.0.0"
|
| 2036 |
|
| 2037 |
+
dir-glob@^2.0.0:
|
| 2038 |
+
version "2.0.0"
|
| 2039 |
+
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034"
|
| 2040 |
+
dependencies:
|
| 2041 |
+
arrify "^1.0.1"
|
| 2042 |
+
path-type "^3.0.0"
|
| 2043 |
+
|
| 2044 |
dns-equal@^1.0.0:
|
| 2045 |
version "1.0.0"
|
| 2046 |
resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d"
|
|
|
|
| 2948 |
pify "^2.0.0"
|
| 2949 |
pinkie-promise "^2.0.0"
|
| 2950 |
|
| 2951 |
+
globby@^7.1.1:
|
| 2952 |
+
version "7.1.1"
|
| 2953 |
+
resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680"
|
| 2954 |
+
dependencies:
|
| 2955 |
+
array-union "^1.0.1"
|
| 2956 |
+
dir-glob "^2.0.0"
|
| 2957 |
+
glob "^7.1.2"
|
| 2958 |
+
ignore "^3.3.5"
|
| 2959 |
+
pify "^3.0.0"
|
| 2960 |
+
slash "^1.0.0"
|
| 2961 |
+
|
| 2962 |
globule@^1.0.0:
|
| 2963 |
version "1.2.0"
|
| 2964 |
resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.0.tgz#1dc49c6822dd9e8a2fa00ba2a295006e8664bd09"
|
|
|
|
| 3253 |
version "0.1.5"
|
| 3254 |
resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"
|
| 3255 |
|
| 3256 |
+
ignore@^3.3.3, ignore@^3.3.5, ignore@^3.3.6:
|
| 3257 |
version "3.3.7"
|
| 3258 |
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021"
|
| 3259 |
|
|
|
|
| 4698 |
version "1.0.0"
|
| 4699 |
resolved "https://registry.yarnpkg.com/p-lazy/-/p-lazy-1.0.0.tgz#ec53c802f2ee3ac28f166cc82d0b2b02de27a835"
|
| 4700 |
|
| 4701 |
+
p-limit@^1.0.0, p-limit@^1.1.0:
|
| 4702 |
version "1.2.0"
|
| 4703 |
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c"
|
| 4704 |
dependencies:
|
|
|
|
| 4835 |
dependencies:
|
| 4836 |
pify "^2.0.0"
|
| 4837 |
|
| 4838 |
+
path-type@^3.0.0:
|
| 4839 |
+
version "3.0.0"
|
| 4840 |
+
resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f"
|
| 4841 |
+
dependencies:
|
| 4842 |
+
pify "^3.0.0"
|
| 4843 |
+
|
| 4844 |
pbkdf2@^3.0.3:
|
| 4845 |
version "3.0.14"
|
| 4846 |
resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade"
|