├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .stylelintrc ├── CONTRIBUTING.md ├── LICENSE ├── build ├── build.js ├── utils │ ├── index.js │ ├── log.js │ ├── style.js │ └── write.js ├── webpack.config.base.js ├── webpack.config.browser.js ├── webpack.config.common.js ├── webpack.config.dev.js └── webpack.config.dll.js ├── dist ├── ks-vue-fullpage.common.js ├── ks-vue-fullpage.css ├── ks-vue-fullpage.js ├── ks-vue-fullpage.min.css └── ks-vue-fullpage.min.js ├── package.json ├── readme.md ├── src ├── components │ ├── ksvuefp-nav.vue │ ├── ksvuefp-preloader.vue │ ├── ksvuefp-section.vue │ └── ksvuefp.vue ├── defaultOptions.js ├── index.js ├── ksvuefp-animations.js └── utils.js └── test ├── .eslintrc ├── helpers ├── Test.vue ├── index.js ├── utils.js └── wait-for-update.js ├── index.js ├── karma.conf.js ├── specs ├── Hello-jsx.spec.js └── Hello.spec.js └── visual.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "env", 5 | { 6 | "targets": { 7 | "browsers": [ 8 | "last 2 versions" 9 | ] 10 | } 11 | } 12 | ] 13 | ], 14 | "plugins": [ 15 | "transform-object-rest-spread" 16 | ], 17 | "env": { 18 | "test": { 19 | "plugins": [ 20 | "istanbul" 21 | ] 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/*.js 2 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | parserOptions: { 5 | sourceType: 'module' 6 | }, 7 | extends: 'vue', 8 | // add your custom rules here 9 | 'rules': { 10 | // allow async-await 11 | 'generator-star-spacing': 0, 12 | // allow debugger during development 13 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 14 | }, 15 | globals: { 16 | requestAnimationFrame: true, 17 | performance: true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | npm-debug.log 4 | test/coverage 5 | yarn-error.log 6 | reports 7 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "processors": ["stylelint-processor-html"], 3 | "extends": "stylelint-config-standard", 4 | "rules": { 5 | "no-empty-source": null 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | We accept contributions via Pull Requests on [Github](https://github.com/{{ githubAccount }}/{{ name }}). 6 | 7 | 8 | ## Pull Requests 9 | 10 | - **Keep the same style** - eslint will automatically be ran before committing 11 | 12 | - **Tip** to pass lint tests easier use the `npm run lint:fix` command 13 | 14 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 15 | 16 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 17 | 18 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. 19 | 20 | - **Create feature branches** - Don't ask us to pull from your master branch. 21 | 22 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 23 | 24 | - **Send coherent history** - Make sure your commits message means something 25 | 26 | 27 | ## Running Tests 28 | 29 | Launch visual tests and watch the components at the same time 30 | 31 | ``` bash 32 | $ npm run dev 33 | ``` 34 | 35 | 36 | **Happy coding**! 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) {{ nowYear }} {{ authorFullNameFrom author }} 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | const mkdirp = require('mkdirp') 2 | const rollup = require('rollup').rollup 3 | const vue = require('rollup-plugin-vue') 4 | const jsx = require('rollup-plugin-jsx') 5 | const buble = require('rollup-plugin-buble') 6 | const replace = require('rollup-plugin-replace') 7 | const cjs = require('rollup-plugin-commonjs') 8 | const node = require('rollup-plugin-node-resolve') 9 | const uglify = require('uglify-js') 10 | const CleanCSS = require('clean-css') 11 | 12 | // Make sure dist dir exists 13 | mkdirp('dist') 14 | 15 | const { 16 | logError, 17 | write, 18 | banner, 19 | name, 20 | moduleName, 21 | version, 22 | processStyle 23 | } = require('./utils') 24 | 25 | function rollupBundle ({ env }) { 26 | return rollup({ 27 | entry: 'src/index.js', 28 | plugins: [ 29 | node({ 30 | extensions: ['.js', '.jsx', '.vue'] 31 | }), 32 | cjs(), 33 | vue({ 34 | compileTemplate: true, 35 | css (styles, stylesNodes) { 36 | // Only generate the styles once 37 | if (env['process.env.NODE_ENV'] === '"production"') { 38 | Promise.all( 39 | stylesNodes.map(processStyle) 40 | ).then(css => { 41 | const result = css.map(c => c.css).join('') 42 | // write the css for every component 43 | // TODO add it back if we extract all components to individual js 44 | // files too 45 | // css.forEach(writeCss) 46 | write(`dist/${name}.css`, result) 47 | write(`dist/${name}.min.css`, new CleanCSS().minify(result).styles) 48 | }).catch(logError) 49 | } 50 | } 51 | }), 52 | jsx({ factory: 'h' }), 53 | replace(Object.assign({ 54 | __VERSION__: version 55 | }, env)), 56 | buble({ 57 | objectAssign: 'Object.assign' 58 | }) 59 | ] 60 | }) 61 | } 62 | 63 | const bundleOptions = { 64 | banner, 65 | exports: 'named', 66 | format: 'umd', 67 | moduleName 68 | } 69 | 70 | function createBundle ({ name, env, format }) { 71 | return rollupBundle({ 72 | env 73 | }).then(function (bundle) { 74 | const options = Object.assign({}, bundleOptions) 75 | if (format) options.format = format 76 | const code = bundle.generate(options).code 77 | if (/min$/.test(name)) { 78 | const minified = uglify.minify(code, { 79 | output: { 80 | preamble: banner, 81 | ascii_only: true // eslint-disable-line camelcase 82 | } 83 | }).code 84 | return write(`dist/${name}.js`, minified) 85 | } else { 86 | return write(`dist/${name}.js`, code) 87 | } 88 | }).catch(logError) 89 | } 90 | 91 | // Browser bundle (can be used with script) 92 | createBundle({ 93 | name: `${name}`, 94 | env: { 95 | 'process.env.NODE_ENV': '"development"' 96 | } 97 | }) 98 | 99 | // Commonjs bundle (preserves process.env.NODE_ENV) so 100 | // the user can replace it in dev and prod mode 101 | createBundle({ 102 | name: `${name}.common`, 103 | env: {}, 104 | format: 'cjs' 105 | }) 106 | 107 | // uses export and import syntax. Should be used with modern bundlers 108 | // like rollup and webpack 2 109 | createBundle({ 110 | name: `${name}.esm`, 111 | env: {}, 112 | format: 'es' 113 | }) 114 | 115 | // Minified version for browser 116 | createBundle({ 117 | name: `${name}.min`, 118 | env: { 119 | 'process.env.NODE_ENV': '"production"' 120 | } 121 | }) 122 | -------------------------------------------------------------------------------- /build/utils/index.js: -------------------------------------------------------------------------------- 1 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 2 | const { join } = require('path') 3 | 4 | const { 5 | red, 6 | logError 7 | } = require('./log') 8 | 9 | const { 10 | processStyle 11 | } = require('./style') 12 | 13 | const uppercamelcase = require('uppercamelcase') 14 | 15 | exports.write = require('./write') 16 | 17 | const { 18 | author, 19 | name, 20 | version, 21 | dllPlugin 22 | } = require('../../package.json') 23 | 24 | const authorName = author.replace(/\s+<.*/, '') 25 | const minExt = process.env.NODE_ENV === 'production' ? '.min' : '' 26 | 27 | exports.author = authorName 28 | exports.version = version 29 | exports.dllName = dllPlugin.name 30 | exports.moduleName = uppercamelcase(name) 31 | exports.name = name 32 | exports.filename = name + minExt 33 | exports.banner = `/*! 34 | * ${name} v${version} 35 | * (c) ${new Date().getFullYear()} ${authorName} 36 | * Released under the MIT License. 37 | */ 38 | ` 39 | 40 | // log.js 41 | exports.red = red 42 | exports.logError = logError 43 | 44 | // It'd be better to add a sass property to the vue-loader options 45 | // but it simply don't work 46 | const sassOptions = { 47 | includePaths: [ 48 | join(__dirname, '../../node_modules') 49 | ] 50 | } 51 | 52 | // don't extract css in test mode 53 | const nullLoader = process.env.NODE_ENV === 'common' ? 'null-loader!' : '' 54 | exports.vueLoaders = 55 | process.env.BABEL_ENV === 'test' ? { 56 | css: 'css-loader', 57 | scss: `css-loader!sass-loader?${JSON.stringify(sassOptions)}` 58 | } : { 59 | css: ExtractTextPlugin.extract(`${nullLoader}css-loader`), 60 | scss: ExtractTextPlugin.extract( 61 | `${nullLoader}css-loader!sass-loader?${JSON.stringify(sassOptions)}` 62 | ) 63 | } 64 | 65 | // style.js 66 | exports.processStyle = processStyle 67 | -------------------------------------------------------------------------------- /build/utils/log.js: -------------------------------------------------------------------------------- 1 | function logError (e) { 2 | console.log(e) 3 | } 4 | 5 | function blue (str) { 6 | return `\x1b[1m\x1b[34m${str}\x1b[39m\x1b[22m` 7 | } 8 | 9 | function green (str) { 10 | return `\x1b[1m\x1b[32m${str}\x1b[39m\x1b[22m` 11 | } 12 | 13 | function red (str) { 14 | return `\x1b[1m\x1b[31m${str}\x1b[39m\x1b[22m` 15 | } 16 | 17 | function yellow (str) { 18 | return `\x1b[1m\x1b[33m${str}\x1b[39m\x1b[22m` 19 | } 20 | 21 | module.exports = { 22 | blue, 23 | green, 24 | red, 25 | yellow, 26 | logError 27 | } 28 | -------------------------------------------------------------------------------- /build/utils/style.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const postcss = require('postcss') 3 | const cssnext = require('postcss-cssnext') 4 | const CleanCSS = require('clean-css') 5 | const { logError } = require('./log.js') 6 | const write = require('./write.js') 7 | 8 | function processCss (style) { 9 | const componentName = path.basename(style.id, '.vue') 10 | return postcss([cssnext()]) 11 | .process(style.code, {}) 12 | .then(result => { 13 | return { 14 | name: componentName, 15 | css: result.css, 16 | map: result.map 17 | } 18 | }) 19 | } 20 | 21 | let stylus 22 | function processStylus (style) { 23 | try { 24 | stylus = stylus || require('stylus') 25 | } catch (e) { 26 | logError(e) 27 | } 28 | const componentName = path.basename(style.id, '.vue') 29 | return new Promise((resolve, reject) => { 30 | stylus.render(style.code, function (err, css) { 31 | if (err) return reject(err) 32 | resolve({ 33 | original: { 34 | code: style.code, 35 | ext: 'styl' 36 | }, 37 | name: componentName, 38 | css 39 | }) 40 | }) 41 | }) 42 | } 43 | 44 | function processStyle (style) { 45 | if (style.lang === 'css') { 46 | return processCss(style) 47 | } else if (style.lang === 'stylus') { 48 | return processStylus(style) 49 | } else { 50 | throw new Error(`Unknown style language '${style.lang}'`) 51 | } 52 | } 53 | 54 | function writeCss (style) { 55 | write(`dist/${style.name}.css`, style.css) 56 | if (style.original) { 57 | write(`dist/${style.name}.${style.original.ext}`, style.original.code) 58 | } 59 | if (style.map) write(`dist/${style.name}.css.map`, style.map) 60 | write(`dist/${style.name}.min.css`, new CleanCSS().minify(style.css).styles) 61 | } 62 | 63 | module.exports = { 64 | writeCss, 65 | processStyle 66 | } 67 | -------------------------------------------------------------------------------- /build/utils/write.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | 3 | const { blue } = require('./log.js') 4 | 5 | function write (dest, code) { 6 | return new Promise(function (resolve, reject) { 7 | fs.writeFile(dest, code, function (err) { 8 | if (err) return reject(err) 9 | console.log(blue(dest) + ' ' + getSize(code)) 10 | resolve(code) 11 | }) 12 | }) 13 | } 14 | 15 | function getSize (code) { 16 | return (code.length / 1024).toFixed(2) + 'kb' 17 | } 18 | 19 | module.exports = write 20 | -------------------------------------------------------------------------------- /build/webpack.config.base.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack') 2 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 3 | const { resolve } = require('path') 4 | 5 | const { 6 | banner, 7 | filename, 8 | version, 9 | vueLoaders 10 | } = require('./utils') 11 | 12 | const plugins = [ 13 | new webpack.DefinePlugin({ 14 | '__VERSION__': JSON.stringify(version), 15 | 'process.env.NODE_ENV': '"test"' 16 | }), 17 | new webpack.BannerPlugin({ banner, raw: true, entryOnly: true }), 18 | new ExtractTextPlugin({ 19 | filename: `${filename}.css`, 20 | // Don't extract css in test mode 21 | disable: /^(common|test)$/.test(process.env.NODE_ENV) 22 | }) 23 | ] 24 | 25 | module.exports = { 26 | output: { 27 | path: resolve(__dirname, '../dist'), 28 | filename: `${filename}.common.js` 29 | }, 30 | entry: './src/index.js', 31 | resolve: { 32 | extensions: ['.js', '.vue', '.jsx', 'css'], 33 | alias: { 34 | 'src': resolve(__dirname, '../src') 35 | } 36 | }, 37 | module: { 38 | rules: [ 39 | { 40 | test: /.jsx?$/, 41 | use: 'babel-loader', 42 | include: [ 43 | resolve(__dirname, '../node_modules/@material'), 44 | resolve(__dirname, '../src'), 45 | resolve(__dirname, '../test') 46 | ] 47 | }, 48 | { 49 | test: /\.vue$/, 50 | loader: 'vue-loader', 51 | options: { 52 | loaders: vueLoaders, 53 | postcss: [require('postcss-cssnext')()] 54 | } 55 | }, 56 | { 57 | test: require.resolve('velocity-animate'), 58 | use: [{ 59 | loader: 'expose-loader', 60 | options: 'Velocity' 61 | }] 62 | }, 63 | { 64 | test: require.resolve('hammerjs'), 65 | use: [{ 66 | loader: 'expose-loader', 67 | options: 'Hammer' 68 | }] 69 | } 70 | ] 71 | }, 72 | plugins 73 | } 74 | -------------------------------------------------------------------------------- /build/webpack.config.browser.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge') 2 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 3 | const base = require('./webpack.config.base') 4 | const { resolve } = require('path') 5 | const { 6 | filename, 7 | moduleName, 8 | vueLoaders 9 | } = require('./utils') 10 | 11 | module.exports = merge(base, { 12 | output: { 13 | filename: `${filename}.js`, 14 | library: moduleName, 15 | libraryTarget: 'umd' 16 | }, 17 | module: { 18 | rules: [ 19 | { 20 | test: /.scss$/, 21 | use: vueLoaders.scss, 22 | include: [ 23 | resolve(__dirname, '../node_modules/@material'), 24 | resolve(__dirname, '../src') 25 | ] 26 | } 27 | ] 28 | }, 29 | plugins: [ 30 | new BundleAnalyzerPlugin({ 31 | analyzerMode: 'static', 32 | openAnalyzer: false, 33 | reportFilename: resolve(__dirname, `../reports/${process.env.NODE_ENV}.html`) 34 | }) 35 | ] 36 | }) 37 | -------------------------------------------------------------------------------- /build/webpack.config.common.js: -------------------------------------------------------------------------------- 1 | const merge = require('webpack-merge') 2 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 3 | const base = require('./webpack.config.base') 4 | const { resolve } = require('path') 5 | const { vueLoaders } = require('./utils') 6 | 7 | module.exports = merge(base, { 8 | output: { 9 | libraryTarget: 'commonjs2' 10 | }, 11 | target: 'node', 12 | module: { 13 | rules: [ 14 | { 15 | test: /.scss$/, 16 | use: vueLoaders.scss, 17 | include: [ 18 | resolve(__dirname, '../node_modules/@material'), 19 | resolve(__dirname, '../src') 20 | ] 21 | } 22 | ] 23 | }, 24 | plugins: [ 25 | new BundleAnalyzerPlugin({ 26 | analyzerMode: 'static', 27 | openAnalyzer: false, 28 | reportFilename: resolve(__dirname, `../reports/${process.env.NODE_ENV}.html`) 29 | }) 30 | ] 31 | }) 32 | -------------------------------------------------------------------------------- /build/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack') 2 | const merge = require('webpack-merge') 3 | const HtmlWebpackPlugin = require('html-webpack-plugin') 4 | const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin') 5 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 6 | const DashboardPlugin = require('webpack-dashboard/plugin') 7 | const base = require('./webpack.config.base') 8 | const { resolve, join } = require('path') 9 | const { existsSync } = require('fs') 10 | const { 11 | dllName, 12 | logError, 13 | red, 14 | vueLoaders 15 | } = require('./utils') 16 | 17 | const rootDir = resolve(__dirname, '../test') 18 | const buildPath = resolve(rootDir, 'dist') 19 | 20 | if (!existsSync(join(buildPath, dllName) + '.dll.js')) { 21 | logError(red('The DLL manifest is missing. Please run `npm run build:dll` (Quit this with `q`)')) 22 | process.exit(1) 23 | } 24 | 25 | const dllManifest = require( 26 | join(buildPath, dllName) + '.json' 27 | ) 28 | 29 | module.exports = merge(base, { 30 | entry: { 31 | tests: resolve(rootDir, 'visual.js') 32 | }, 33 | output: { 34 | path: buildPath, 35 | filename: '[name].js', 36 | chunkFilename: '[id].js' 37 | }, 38 | module: { 39 | rules: [ 40 | { 41 | test: /.scss$/, 42 | loader: vueLoaders.scss, 43 | include: [ 44 | resolve(__dirname, '../node_modules/@material'), 45 | resolve(__dirname, '../src') 46 | ] 47 | } 48 | ] 49 | }, 50 | plugins: [ 51 | new webpack.DllReferencePlugin({ 52 | context: join(__dirname, '..'), 53 | manifest: dllManifest 54 | }), 55 | new HtmlWebpackPlugin({ 56 | chunkSortMode: 'dependency' 57 | }), 58 | new AddAssetHtmlPlugin({ 59 | filepath: require.resolve( 60 | join(buildPath, dllName) + '.dll.js' 61 | ) 62 | }), 63 | new webpack.optimize.CommonsChunkPlugin({ 64 | name: 'vendor', 65 | minChunks (module, count) { 66 | return ( 67 | module.resource && 68 | /\.js$/.test(module.resource) && 69 | module.resource.indexOf(join(__dirname, '../node_modules/')) === 0 70 | ) 71 | } 72 | }), 73 | new webpack.optimize.CommonsChunkPlugin({ 74 | name: 'manifest', 75 | chunks: ['vendor'] 76 | }), 77 | new DashboardPlugin(), 78 | new BundleAnalyzerPlugin({ 79 | analyzerMode: 'static', 80 | openAnalyzer: false, 81 | reportFilename: resolve(__dirname, `../reports/${process.env.NODE_ENV}.html`) 82 | }) 83 | ], 84 | devtool: '#eval-source-map', 85 | devServer: { 86 | inline: true, 87 | stats: { 88 | colors: true, 89 | chunks: false, 90 | cached: false 91 | }, 92 | contentBase: buildPath 93 | }, 94 | performance: { 95 | hints: false 96 | } 97 | }) 98 | -------------------------------------------------------------------------------- /build/webpack.config.dll.js: -------------------------------------------------------------------------------- 1 | const { resolve, join } = require('path') 2 | const webpack = require('webpack') 3 | const pkg = require('../package.json') 4 | 5 | const rootDir = resolve(__dirname, '../test') 6 | const buildPath = resolve(rootDir, 'dist') 7 | 8 | const entry = {} 9 | entry[pkg.dllPlugin.name] = pkg.dllPlugin.include 10 | 11 | module.exports = { 12 | devtool: '#source-map', 13 | entry, 14 | output: { 15 | path: buildPath, 16 | filename: '[name].dll.js', 17 | library: '[name]' 18 | }, 19 | plugins: [ 20 | new webpack.DllPlugin({ 21 | name: '[name]', 22 | path: join(buildPath, '[name].json') 23 | }) 24 | ], 25 | performance: { 26 | hints: false 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /dist/ks-vue-fullpage.common.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ks-vue-fullpage v1.2.8 3 | * (c) 2017 pirony 4 | * Released under the MIT License. 5 | */ 6 | 7 | module.exports = 8 | /******/ (function(modules) { // webpackBootstrap 9 | /******/ // The module cache 10 | /******/ var installedModules = {}; 11 | /******/ 12 | /******/ // The require function 13 | /******/ function __webpack_require__(moduleId) { 14 | /******/ 15 | /******/ // Check if module is in cache 16 | /******/ if(installedModules[moduleId]) { 17 | /******/ return installedModules[moduleId].exports; 18 | /******/ } 19 | /******/ // Create a new module (and put it into the cache) 20 | /******/ var module = installedModules[moduleId] = { 21 | /******/ i: moduleId, 22 | /******/ l: false, 23 | /******/ exports: {} 24 | /******/ }; 25 | /******/ 26 | /******/ // Execute the module function 27 | /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 28 | /******/ 29 | /******/ // Flag the module as loaded 30 | /******/ module.l = true; 31 | /******/ 32 | /******/ // Return the exports of the module 33 | /******/ return module.exports; 34 | /******/ } 35 | /******/ 36 | /******/ 37 | /******/ // expose the modules object (__webpack_modules__) 38 | /******/ __webpack_require__.m = modules; 39 | /******/ 40 | /******/ // expose the module cache 41 | /******/ __webpack_require__.c = installedModules; 42 | /******/ 43 | /******/ // identity function for calling harmony imports with the correct context 44 | /******/ __webpack_require__.i = function(value) { return value; }; 45 | /******/ 46 | /******/ // define getter function for harmony exports 47 | /******/ __webpack_require__.d = function(exports, name, getter) { 48 | /******/ if(!__webpack_require__.o(exports, name)) { 49 | /******/ Object.defineProperty(exports, name, { 50 | /******/ configurable: false, 51 | /******/ enumerable: true, 52 | /******/ get: getter 53 | /******/ }); 54 | /******/ } 55 | /******/ }; 56 | /******/ 57 | /******/ // getDefaultExport function for compatibility with non-harmony modules 58 | /******/ __webpack_require__.n = function(module) { 59 | /******/ var getter = module && module.__esModule ? 60 | /******/ function getDefault() { return module['default']; } : 61 | /******/ function getModuleExports() { return module; }; 62 | /******/ __webpack_require__.d(getter, 'a', getter); 63 | /******/ return getter; 64 | /******/ }; 65 | /******/ 66 | /******/ // Object.prototype.hasOwnProperty.call 67 | /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 68 | /******/ 69 | /******/ // __webpack_public_path__ 70 | /******/ __webpack_require__.p = ""; 71 | /******/ 72 | /******/ // Load entry module and return exports 73 | /******/ return __webpack_require__(__webpack_require__.s = 10); 74 | /******/ }) 75 | /************************************************************************/ 76 | /******/ ([ 77 | /* 0 */ 78 | /***/ (function(module, exports) { 79 | 80 | /* globals __VUE_SSR_CONTEXT__ */ 81 | 82 | // this module is a runtime utility for cleaner component module output and will 83 | // be included in the final webpack user bundle 84 | 85 | module.exports = function normalizeComponent ( 86 | rawScriptExports, 87 | compiledTemplate, 88 | injectStyles, 89 | scopeId, 90 | moduleIdentifier /* server only */ 91 | ) { 92 | var esModule 93 | var scriptExports = rawScriptExports = rawScriptExports || {} 94 | 95 | // ES6 modules interop 96 | var type = typeof rawScriptExports.default 97 | if (type === 'object' || type === 'function') { 98 | esModule = rawScriptExports 99 | scriptExports = rawScriptExports.default 100 | } 101 | 102 | // Vue.extend constructor export interop 103 | var options = typeof scriptExports === 'function' 104 | ? scriptExports.options 105 | : scriptExports 106 | 107 | // render functions 108 | if (compiledTemplate) { 109 | options.render = compiledTemplate.render 110 | options.staticRenderFns = compiledTemplate.staticRenderFns 111 | } 112 | 113 | // scopedId 114 | if (scopeId) { 115 | options._scopeId = scopeId 116 | } 117 | 118 | var hook 119 | if (moduleIdentifier) { // server build 120 | hook = function (context) { 121 | // 2.3 injection 122 | context = 123 | context || // cached call 124 | (this.$vnode && this.$vnode.ssrContext) || // stateful 125 | (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional 126 | // 2.2 with runInNewContext: true 127 | if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { 128 | context = __VUE_SSR_CONTEXT__ 129 | } 130 | // inject component styles 131 | if (injectStyles) { 132 | injectStyles.call(this, context) 133 | } 134 | // register component module identifier for async chunk inferrence 135 | if (context && context._registeredComponents) { 136 | context._registeredComponents.add(moduleIdentifier) 137 | } 138 | } 139 | // used by ssr in case component is cached and beforeCreate 140 | // never gets called 141 | options._ssrRegister = hook 142 | } else if (injectStyles) { 143 | hook = injectStyles 144 | } 145 | 146 | if (hook) { 147 | var functional = options.functional 148 | var existing = functional 149 | ? options.render 150 | : options.beforeCreate 151 | if (!functional) { 152 | // inject component registration as beforeCreate hook 153 | options.beforeCreate = existing 154 | ? [].concat(existing, hook) 155 | : [hook] 156 | } else { 157 | // register for functioal component in vue file 158 | options.render = function renderWithStyleInjection (h, context) { 159 | hook.call(context) 160 | return existing(h, context) 161 | } 162 | } 163 | } 164 | 165 | return { 166 | esModule: esModule, 167 | exports: scriptExports, 168 | options: options 169 | } 170 | } 171 | 172 | 173 | /***/ }), 174 | /* 1 */ 175 | /***/ (function(module, exports, __webpack_require__) { 176 | 177 | "use strict"; 178 | 179 | 180 | Object.defineProperty(exports, "__esModule", { 181 | value: true 182 | }); 183 | exports.default = { 184 | bgOffset: function bgOffset(action, direction, offset) { 185 | var res = void 0; 186 | switch (action) { 187 | case 'enter': 188 | res = direction === 'up' ? offset || '0.5' : offset * -1 || '-0.5'; 189 | break; 190 | case 'leave': 191 | res = direction === 'up' ? offset * -1 || '-0.5' : offset || '0.5'; 192 | break; 193 | } 194 | 195 | return res; 196 | }, 197 | getDirection: function getDirection(e, animType) { 198 | e = e || window.event; 199 | switch (e.type) { 200 | case 'mousewheel': 201 | case 'wheel': 202 | var delta = (e.deltaY || -e.wheelDelta || e.detail) >> 10 || 1; 203 | if (delta < 0) return 'up'; 204 | return 'down'; 205 | case 'keydown': 206 | switch (e.key) { 207 | case 'ArrowDown': 208 | if (animType !== 'slideY') return 'none'; 209 | return 'down'; 210 | case 'ArrowUp': 211 | if (animType !== 'slideY') return 'none'; 212 | return 'up'; 213 | case 'ArrowLeft': 214 | if (animType !== 'slideX') return 'none'; 215 | return 'up'; 216 | case 'ArrowRight': 217 | if (animType !== 'slideX') return 'none'; 218 | return 'down'; 219 | default: 220 | return 'none'; // Quit when this doesn't handle the key event. 221 | } 222 | case 'swipeup': 223 | if (animType === 'slideX') return 'none'; 224 | return 'down'; 225 | case 'swipeleft': 226 | if (animType !== 'slideX') return 'none'; 227 | return 'down'; 228 | case 'swipedown': 229 | if (animType === 'slideX') return 'none'; 230 | return 'up'; 231 | case 'swiperight': 232 | if (animType !== 'slideX') return 'none'; 233 | return 'up'; 234 | case 'navclick': 235 | if (e.oldIndex < e.nextIndex) { 236 | return 'down'; 237 | } else { 238 | return 'up'; 239 | } 240 | default: 241 | return 'none'; 242 | 243 | } 244 | }, 245 | getWindowDim: function getWindowDim() { 246 | if (typeof window === 'undefined') global.window = {}; 247 | return { 248 | wHeight: window.innerHeight, 249 | wWidth: window.innerWidth 250 | }; 251 | }, 252 | getNextIndex: function getNextIndex(i, direction, length, options) { 253 | switch (direction) { 254 | case 'down': 255 | if (i !== length - 1) { 256 | i++; 257 | } else { 258 | if (options.loopBottom) i = 0; 259 | if (!options.loopBottom) i = 'none'; 260 | } 261 | break; 262 | case 'up': 263 | if (i !== 0) { 264 | i--; 265 | } else { 266 | if (options.loopTop) i = length - 1; 267 | if (!options.loopTop) i = 'none'; 268 | } 269 | break; 270 | default: 271 | } 272 | return i; 273 | } 274 | }; 275 | 276 | /***/ }), 277 | /* 2 */ 278 | /***/ (function(module, exports, __webpack_require__) { 279 | 280 | "use strict"; 281 | 282 | 283 | Object.defineProperty(exports, "__esModule", { 284 | value: true 285 | }); 286 | exports.dotsAnim = exports.fade = exports.slideY = exports.slideX = undefined; 287 | 288 | var _utils = __webpack_require__(1); 289 | 290 | var _utils2 = _interopRequireDefault(_utils); 291 | 292 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 293 | 294 | /** 295 | * Get animation params and store it in a constant 296 | * @param {object} ctx - the context 297 | * @param el - the element 298 | * @param {function} done - function to trigger when animation is finished 299 | */ 300 | var getAnimParams = function getAnimParams(ctx, el, done) { 301 | return { 302 | easing: ctx.props.options.easing || 'linear', 303 | duration: ctx.props.options.duration || 1000, 304 | complete: function complete() { 305 | // Velocity.hook(el, 'translateX', '0%') 306 | // Velocity.hook(el, 'backgroundPosition', '0 50%') 307 | done(); 308 | } 309 | }; 310 | }; 311 | 312 | // component datas for slideX option 313 | var slideX = exports.slideX = { 314 | 315 | props: ['options', 'slidingActive', 'sliderDirection'], 316 | functional: true, 317 | render: function render(h, ctx) { 318 | if (!ctx.parent.$ksvuefp.fpLoaded) return h('transition', ctx.data, ctx.children); // don't animate until the plugin is fully loaded 319 | 320 | ctx.data.on = { 321 | enter: function enter(el, done) { 322 | var animObj = {}; // empty object where we'll push animations 323 | 324 | if (ctx.props.options.parallax) { 325 | // if parallax is activated 326 | /** 327 | * Get section background's offset and store it in a constant 328 | * @param {string} action - enter or leave 329 | * @param {string} direction - up or down 330 | * @param {float} offset - the parallax offset defined in options 331 | */ 332 | var bgOffset = _utils2.default.bgOffset('enter', ctx.parent.$ksvuefp.sliderDirection, ctx.props.options.parallaxOffset); 333 | 334 | Velocity.hook(el, 'backgroundPositionX', bgOffset * ctx.parent.$ksvuefp.wWidth + 'px'); // Positionate the background before triggering the animation 335 | 336 | animObj['backgroundPosition'] = '0% 50%'; // Push bgPosition animation to our empty object animObj 337 | } 338 | 339 | var start = ctx.parent.$ksvuefp.sliderDirection === 'up' ? '-100%' : '100%'; // Define the full section's translate animation starting offset 340 | Velocity.hook(el, 'translateX', start); // Positionate the full section before triggering the animation 341 | Velocity.hook(el, 'translateY', '0%'); // Positionate the full section before triggering the animation 342 | Velocity.hook(el, 'opacity', 1); 343 | 344 | animObj['translateX'] = '0%'; 345 | animObj['translateZ'] = 0; // Force 3d rendering 346 | 347 | /** 348 | * Get animations params 349 | * @param {object} ctx - the context 350 | * @param {object} animObj - the animObject 351 | * @param {function} animParams - Velocity's animation options 352 | */ 353 | var animParams = getAnimParams(ctx, el, done); 354 | 355 | /** 356 | * Velocity anim function 357 | * @param el - the element 358 | * @param {object} animObj - the animObject 359 | * @param {function} animParams - Velocity's animation options 360 | */ 361 | Velocity(el, animObj, animParams); 362 | }, 363 | leave: function leave(el, done) { 364 | var animObj = {}; // empty object where we'll push animations 365 | if (ctx.props.options.parallax) { 366 | // if parallax is activated 367 | /** 368 | * Get section background's offset and store it in a constant 369 | * @param {string} action - enter or leave 370 | * @param {string} direction - up or down 371 | * @param {float} offset - the parallax offset defined in options 372 | */ 373 | var bgOffset = _utils2.default.bgOffset('leave', ctx.parent.$ksvuefp.sliderDirection, ctx.props.options.parallaxOffset); 374 | 375 | animObj['backgroundPositionX'] = bgOffset * ctx.parent.$ksvuefp.wWidth + 'px'; // Push bgPosition animation to our empty object animObj 376 | } 377 | 378 | var end = ctx.parent.$ksvuefp.sliderDirection === 'up' ? '100%' : '-100%'; // Define the full section's translate animation starting offset 379 | Velocity.hook(el, 'translateX', '0%'); // Positionate the full section before triggering the animation 380 | Velocity.hook(el, 'translateY', '0%'); // Positionate the full section before triggering the animation 381 | Velocity.hook(el, 'opacity', 1); 382 | 383 | animObj['translateX'] = end; // Push translate animation to our object animObj 384 | animObj['translateZ'] = 0; // Force 3d rendering 385 | 386 | /** 387 | * Get animations params 388 | * @param {object} ctx - the context 389 | * @param {object} animObj - the animObject 390 | * @param {function} animParams - Velocity's animation options 391 | */ 392 | var animParams = getAnimParams(ctx, el, done); 393 | 394 | /** 395 | * Velocity anim function 396 | * @param el - the element 397 | * @param {object} animObj - the animObject 398 | * @param {function} animParams - Velocity's animation options 399 | */ 400 | Velocity(el, animObj, animParams); 401 | }, 402 | afterLeave: function afterLeave(el) { 403 | Velocity.hook(el, 'backgroundPosition', '50% 50%'); 404 | } 405 | }; 406 | 407 | return h('transition', ctx.data, ctx.children); 408 | } 409 | 410 | // component datas for slideY option 411 | };var slideY = exports.slideY = { 412 | props: ['options'], 413 | functional: true, 414 | render: function render(h, ctx) { 415 | if (!ctx.parent.$ksvuefp.fpLoaded) return h('transition', ctx.data, ctx.children); // If the plugin is not fully loaded, don't animate and return h() directly 416 | ctx.data.on = { 417 | enter: function enter(el, done) { 418 | var animObj = {}; 419 | 420 | if (ctx.props.options.parallax) { 421 | /** 422 | * Get section background's offset and store it in a constant 423 | * @param {string} action - enter or leave 424 | * @param {string} direction - up or down 425 | * @param {float} offset - the parallax offset defined in options 426 | */ 427 | var bgOffset = _utils2.default.bgOffset('enter', ctx.parent.$ksvuefp.sliderDirection, ctx.props.options.parallaxOffset); 428 | 429 | Velocity.hook(el, 'backgroundPositionY', bgOffset * ctx.parent.$ksvuefp.wHeight + 'px'); 430 | 431 | animObj['backgroundPositionY'] = '0%'; 432 | } 433 | 434 | var start = ctx.parent.$ksvuefp.sliderDirection === 'up' ? '-100%' : '100%'; 435 | Velocity.hook(el, 'translateY', start); 436 | Velocity.hook(el, 'translateX', '0%'); 437 | Velocity.hook(el, 'opacity', 1); 438 | 439 | animObj['translateY'] = '0%'; 440 | animObj['translateZ'] = 0; // Force 3d rendering 441 | 442 | /** 443 | * Get animations params 444 | * @param {object} ctx - the context 445 | * @param {object} animObj - the animObject 446 | * @param {function} animParams - Velocity's animation options 447 | */ 448 | var animParams = getAnimParams(ctx, el, done); 449 | 450 | /** 451 | * Velocity anim function 452 | * @param el - the element 453 | * @param {object} animObj - the animObject 454 | * @param {function} animParams - Velocity's animation options 455 | */ 456 | Velocity(el, animObj, animParams); 457 | }, 458 | leave: function leave(el, done) { 459 | var animObj = {}; 460 | 461 | if (ctx.props.options.parallax) { 462 | /** 463 | * Get section background's offset and store it in a constant 464 | * @param {string} action - enter or leave 465 | * @param {string} direction - up or down 466 | * @param {float} offset - the parallax offset defined in options 467 | */ 468 | var bgOffset = _utils2.default.bgOffset('leave', ctx.parent.$ksvuefp.sliderDirection, ctx.props.options.parallaxOffset); 469 | 470 | animObj['backgroundPositionY'] = bgOffset * ctx.parent.$ksvuefp.wHeight + 'px'; 471 | } 472 | 473 | var end = ctx.parent.$ksvuefp.sliderDirection === 'up' ? '100%' : '-100%'; 474 | Velocity.hook(el, 'translateY', '0%'); 475 | Velocity.hook(el, 'translateX', '0%'); 476 | Velocity.hook(el, 'opacity', 1); 477 | 478 | animObj['translateY'] = end; 479 | animObj['translateZ'] = 0; // Force 3d rendering 480 | 481 | /** 482 | * Get animations params 483 | * @param {object} ctx - the context 484 | * @param {object} animObj - the animObject 485 | * @param {function} animParams - Velocity's animation options 486 | */ 487 | var animParams = getAnimParams(ctx, el, done); 488 | /** 489 | * Velocity anim function 490 | * @param el - the element 491 | * @param {object} animObj - the animObject 492 | * @param {function} animParams - Velocity's animation options 493 | */ 494 | Velocity(el, animObj, animParams); 495 | }, 496 | afterLeave: function afterLeave(el) { 497 | Velocity.hook(el, 'backgroundPosition', '50% 50%'); 498 | } 499 | }; 500 | return h('transition', ctx.data, ctx.children); 501 | } 502 | 503 | // component datas for fade option 504 | };var fade = exports.fade = { 505 | props: ['options'], 506 | functional: true, 507 | render: function render(h, ctx) { 508 | ctx.data.on = { 509 | enter: function enter(el, done) { 510 | Velocity.hook(el, 'translateX', '0%'); // Positionate the full section before triggering the animation 511 | Velocity.hook(el, 'translateY', '0%'); // Positionate the full section before triggering the animation 512 | Velocity.hook(el, 'opacity', 0); 513 | 514 | /** 515 | * Get animations params 516 | * @param {object} ctx - the context 517 | * @param {object} animObj - the animObject 518 | * @param {function} animParams - Velocity's animation options 519 | */ 520 | var animParams = getAnimParams(ctx, el, done); 521 | 522 | /** 523 | * Velocity anim function 524 | * @param el - the element 525 | * @param {object} animObj - the animObject 526 | * @param {function} animParams - Velocity's animation options 527 | */ 528 | Velocity(el, { 529 | opacity: 1 530 | }, animParams); 531 | }, 532 | leave: function leave(el, done) { 533 | /** 534 | * Get animations params 535 | * @param {object} ctx - the context 536 | * @param {object} animObj - the animObject 537 | * @param {function} animParams - Velocity's animation options 538 | */ 539 | var animParams = getAnimParams(ctx, el, done); 540 | 541 | /** 542 | * Velocity anim function 543 | * @param el - the element 544 | * @param {object} - the animObject 545 | * @param {function} animParams - Velocity's animation options 546 | */ 547 | Velocity(el, { 548 | opacity: 0 549 | }, animParams); 550 | } 551 | }; 552 | 553 | return h('transition', ctx.data, ctx.children); 554 | } 555 | 556 | // component datas for slideX option 557 | };var dotsAnim = exports.dotsAnim = { 558 | functional: true, 559 | render: function render(h, ctx) { 560 | ctx.props.name = 'dots-anim'; 561 | ctx.data.attrs['appear'] = true; 562 | ctx.data.on = { 563 | enter: function enter(el, done) { 564 | var animObj = {}; 565 | switch (ctx.props.currentPos) { 566 | case 'top': 567 | Velocity.hook(el, 'translateY', '-200px'); 568 | animObj['translateY'] = '0px'; 569 | break; 570 | case 'bottom': 571 | Velocity.hook(el, 'translateY', '200px'); 572 | animObj['translateY'] = '0px'; 573 | break; 574 | case 'left': 575 | Velocity.hook(el, 'translateX', '-200px'); 576 | animObj['translateX'] = '0px'; 577 | break; 578 | case 'right': 579 | Velocity.hook(el, 'translateX', '200px'); 580 | animObj['translateX'] = '0px'; 581 | break; 582 | } 583 | Velocity(el, animObj, { 584 | delay: el.dataset.index * 40, 585 | complete: done 586 | }); 587 | }, 588 | leave: function leave(el, done) { 589 | done(); 590 | } 591 | }; 592 | return h('transition-group', ctx.data, ctx.children); 593 | } 594 | 595 | // TODO: add prismX and prismY transitions 596 | 597 | }; 598 | 599 | /***/ }), 600 | /* 3 */ 601 | /***/ (function(module, exports, __webpack_require__) { 602 | 603 | "use strict"; 604 | 605 | 606 | Object.defineProperty(exports, "__esModule", { 607 | value: true 608 | }); 609 | exports.default = { 610 | /** 611 | * Html params 612 | * @property {String} sectionTag - The tag used to wrap each vsvuefp-section component. 613 | */ 614 | sectionTag: 'div', 615 | /** 616 | * Animation params 617 | * @property {String} animationType - Transition effect between 2 screens. Should be one of 'slideY', 'slideX', or 'fade' 618 | * @property {Number} duration - Duration of transition between 2 screens, in ms 619 | * @property {String} easing - Easing of the transition between 2 screens. Can be all easings supported by Velocity, including bezier curves. ex: [0.2, 0.5, 0.2, 0.5] 620 | * @property {Number} animDelay - Content animation delay. Help you define timing between screens transition and content animations 621 | */ 622 | animationType: 'slideY', 623 | duration: 1000, 624 | easing: 'easeInOutQuad', 625 | animDelay: 0, 626 | /** 627 | * Preloading params 628 | * @property {Boolean} preloaderEnabled - Add a fullscreen preloading overlay with loading animation 629 | * @property {String} preloaderBgColor - Background color for the preloader overlay. 630 | * @property {String} preloaderColor - Preloader icon and text color 631 | * @property {String} preloaderText - The text that will appear under the icon animation during loading 632 | * @property {Boolean} waitForBackgrounds - Wait for sections background images to be fully loaded before triggering $ksvuefp-ready event 633 | */ 634 | preloaderEnabled: true, 635 | preloaderBgColor: '#fff', 636 | preloaderColor: '#212121', 637 | preloaderText: 'Loading...', 638 | waitForBackgrounds: true, 639 | /** 640 | * Navigation params 641 | * @property {Boolean} dotNavEnabled - Add a dot navigation 642 | * @property {String} dotNavPosition - Change dotNav position. Should be one of top, bottom, left or right 643 | * @property {String} dotNavColor - Change dotNav color 644 | * @property {Boolean} loopBottom - Go to first section on scroll down while watching last section 645 | * @property {Boolean} loopTop - Go to last section on scroll up while watching first section 646 | */ 647 | dotNavEnabled: true, 648 | dotNavColor: '#fff', 649 | loopBottom: false, 650 | loopTop: false, 651 | /** 652 | * Design params 653 | * @property {Boolean - String} overlay - Insert a fullsize div between background and content, and set its background property. Must be a valid css background rule 654 | * @property {Boolean} parallax - Enable parallax effect on section's background 655 | * @property {Float} parallaxOffset - Parallax offset amount, default to 0.5. Should be between 0 and 1. 0 gives no parallax effect, 1 gives a "stacking effect" (the old section remains fixed during transition while the next one slides above it). 656 | */ 657 | overlay: 'rgba(0, 0, 0, 0.2)', 658 | parallax: false, 659 | parallaxOffset: 0.5 660 | }; 661 | 662 | /***/ }), 663 | /* 4 */ 664 | /***/ (function(module, exports, __webpack_require__) { 665 | 666 | function injectStyle (ssrContext) { 667 | var i 668 | __webpack_require__(15) 669 | } 670 | var Component = __webpack_require__(0)( 671 | /* script */ 672 | __webpack_require__(8), 673 | /* template */ 674 | __webpack_require__(22), 675 | /* styles */ 676 | injectStyle, 677 | /* scopeId */ 678 | null, 679 | /* moduleIdentifier (server only) */ 680 | "70e5dbc2" 681 | ) 682 | Component.options.__file = "C:\\Users\\romai\\ks-node\\vue-plugins\\node_modules\\ks-vue-fullpage\\src\\components\\ksvuefp-section.vue" 683 | if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")} 684 | if (Component.options.functional) {console.error("[vue-loader] ksvuefp-section.vue: functional components are not supported with templates, they should use render functions.")} 685 | 686 | module.exports = Component.exports 687 | 688 | 689 | /***/ }), 690 | /* 5 */ 691 | /***/ (function(module, exports, __webpack_require__) { 692 | 693 | function injectStyle (ssrContext) { 694 | var i 695 | __webpack_require__(12) 696 | } 697 | var Component = __webpack_require__(0)( 698 | /* script */ 699 | __webpack_require__(9), 700 | /* template */ 701 | __webpack_require__(19), 702 | /* styles */ 703 | injectStyle, 704 | /* scopeId */ 705 | null, 706 | /* moduleIdentifier (server only) */ 707 | "075510ac" 708 | ) 709 | Component.options.__file = "C:\\Users\\romai\\ks-node\\vue-plugins\\node_modules\\ks-vue-fullpage\\src\\components\\ksvuefp.vue" 710 | if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")} 711 | if (Component.options.functional) {console.error("[vue-loader] ksvuefp.vue: functional components are not supported with templates, they should use render functions.")} 712 | 713 | module.exports = Component.exports 714 | 715 | 716 | /***/ }), 717 | /* 6 */ 718 | /***/ (function(module, exports, __webpack_require__) { 719 | 720 | "use strict"; 721 | 722 | 723 | Object.defineProperty(exports, "__esModule", { 724 | value: true 725 | }); 726 | 727 | var _ksvuefpAnimations = __webpack_require__(2); 728 | 729 | exports.default = { 730 | components: { 731 | dotsAnim: _ksvuefpAnimations.dotsAnim 732 | }, 733 | props: ['sections', 'options'], 734 | data: function data() { 735 | return { 736 | navPosList: ['top', 'left', 'right', 'bottom'], 737 | keys: [] 738 | }; 739 | }, 740 | 741 | computed: { 742 | currentPos: function currentPos() { 743 | if (this.options.dotNavPosition) return this.options.dotNavPosition; 744 | switch (this.options.animationType) { 745 | case 'slideX': 746 | return 'bottom'; 747 | default: 748 | return 'right'; 749 | } 750 | } 751 | }, 752 | methods: { 753 | click: function click(nextIndex) { 754 | if (nextIndex === this.$ksvuefp.currentIndex) return; 755 | this.$ksvuefp.$emit('ksvuefp-nav-click', { nextIndex: nextIndex }); 756 | } 757 | } 758 | }; // 759 | // 760 | // 761 | // 762 | // 763 | // 764 | // 765 | // 766 | // 767 | 768 | /***/ }), 769 | /* 7 */ 770 | /***/ (function(module, exports, __webpack_require__) { 771 | 772 | "use strict"; 773 | 774 | 775 | Object.defineProperty(exports, "__esModule", { 776 | value: true 777 | }); 778 | // 779 | // 780 | // 781 | // 782 | // 783 | // 784 | // 785 | // 786 | // 787 | // 788 | // 789 | 790 | exports.default = { 791 | name: 'ksvuefpPreloader', 792 | props: ['backgroundColor', 'preloaderColor', 'preloaderText'] 793 | }; 794 | 795 | /***/ }), 796 | /* 8 */ 797 | /***/ (function(module, exports, __webpack_require__) { 798 | 799 | "use strict"; 800 | 801 | 802 | Object.defineProperty(exports, "__esModule", { 803 | value: true 804 | }); 805 | 806 | var _ksvuefpAnimations = __webpack_require__(2); 807 | 808 | var _imagesloaded = __webpack_require__(16); 809 | 810 | var _imagesloaded2 = _interopRequireDefault(_imagesloaded); 811 | 812 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 813 | 814 | // 815 | // 816 | // 817 | // 818 | // 819 | // 820 | // 821 | // 822 | // 823 | // 824 | // 825 | 826 | exports.default = { 827 | components: { 828 | slideY: _ksvuefpAnimations.slideY, 829 | slideX: _ksvuefpAnimations.slideX, 830 | fade: _ksvuefpAnimations.fade, 831 | 'tagger': { 832 | props: ['options', 'sectionIndex'], 833 | render: function render(h) { 834 | return h(this.options.sectionTag || 'div', this.$slots.default); 835 | }, 836 | mounted: function mounted() { 837 | var vm = this; 838 | vm.$nextTick(function () { 839 | setTimeout(function () { 840 | (0, _imagesloaded2.default)(vm.$el, { background: true }, function () { 841 | vm.$ksvuefp.$emit('ksvuefp-section-loaded', vm.sectionIndex); 842 | }); 843 | }, 300); 844 | }); 845 | } 846 | } 847 | }, 848 | props: ['section', 'backgroundImage', 'backgroundColor', 'sectionIndex', 'sectionOverlay'], 849 | computed: { 850 | showSection: function showSection() { 851 | return this.sectionIndex === this.$ksvuefp.currentIndex; 852 | } 853 | } 854 | }; 855 | 856 | /***/ }), 857 | /* 9 */ 858 | /***/ (function(module, exports, __webpack_require__) { 859 | 860 | "use strict"; 861 | 862 | 863 | Object.defineProperty(exports, "__esModule", { 864 | value: true 865 | }); 866 | 867 | var _utils = __webpack_require__(1); 868 | 869 | var _utils2 = _interopRequireDefault(_utils); 870 | 871 | var _ksvuefpNav = __webpack_require__(17); 872 | 873 | var _ksvuefpNav2 = _interopRequireDefault(_ksvuefpNav); 874 | 875 | var _ksvuefpPreloader = __webpack_require__(18); 876 | 877 | var _ksvuefpPreloader2 = _interopRequireDefault(_ksvuefpPreloader); 878 | 879 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 880 | 881 | exports.default = { 882 | props: { 883 | options: { 884 | type: Object, 885 | default: function _default() {} 886 | }, 887 | sections: { 888 | type: Array, 889 | default: function _default() { 890 | return []; 891 | } 892 | } 893 | }, 894 | components: { 895 | fpNav: _ksvuefpNav2.default, 896 | ksvuefpPreloader: _ksvuefpPreloader2.default 897 | }, 898 | created: function created() { 899 | this.$ksvuefp.$emit('ksvuefp-options-changed', this.options); 900 | }, 901 | mounted: function mounted() { 902 | var vm = this; 903 | vm.$nextTick(function () { 904 | /** 905 | * We listen to our custom navclick event on ksvuefp bus 906 | * @param Event 907 | */ 908 | vm.$ksvuefp.$on('ksvuefp-nav-click', function (e) { 909 | e.oldIndex = vm.$ksvuefp.currentIndex; 910 | e.type = 'navclick'; 911 | vm.changeIndex(e); 912 | }); 913 | 914 | vm.$ksvuefp.$on('ksvuefp-section-loaded', function (i) { 915 | if (i !== vm.sections.length - 1) return; 916 | setTimeout(function () { 917 | vm.$ksvuefp.$emit('ksvuefp-ready'); 918 | }, 300); 919 | }); 920 | /** 921 | * We listen to resize event and then emit on $ksvuefp bus 922 | */ 923 | window.addEventListener('resize', function () { 924 | vm.$ksvuefp.$emit('ksvuefp-resized'); 925 | }); 926 | /** 927 | * We set the list of actions we want to trigger the animation with 928 | * @const {array} 929 | * 930 | */ 931 | var actions = ['wheel', 'mousewheel', 'keydown']; 932 | /** 933 | * For each action in the above array, trigger changeIndex method 934 | * 935 | */ 936 | actions.forEach(function (a) { 937 | document.addEventListener(a, vm.changeIndex); 938 | }); 939 | 940 | vm.$ksvuefp.$emit('ksvuefp-options-changed', vm.options); 941 | 942 | /** 943 | * trigger changeIndex method on swipe with HAMMER.JS if touch is detected 944 | * 945 | */ 946 | var isTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints > 0; 947 | if (!isTouch) return; 948 | 949 | var mc = new Hammer(vm.$el); 950 | mc.get('swipe').set({ direction: Hammer.DIRECTION_ALL }); 951 | 952 | mc.on('swipeup swipedown swiperight swipeleft', function (e) { 953 | vm.changeIndex(e); 954 | }); 955 | }); 956 | }, 957 | 958 | computed: { 959 | ksvuefpStyles: function ksvuefpStyles() { 960 | return { 961 | height: this.$ksvuefp.wHeight + 'px' 962 | }; 963 | } 964 | }, 965 | methods: { 966 | /** trigger the change index event 967 | * @param Event 968 | * 969 | */ 970 | changeIndex: function changeIndex(e) { 971 | if (e.defaultPrevented) { 972 | return; // Should do nothing if the key event was already consumed. 973 | } 974 | var vm = this; 975 | 976 | if (vm.$ksvuefp.slidingActive) return; // if last transition is not yet finished, return without doing anything 977 | 978 | var OldIndex = vm.$ksvuefp.currentIndex; 979 | var Length = vm.sections.length; 980 | var Options = vm.$ksvuefp.options; 981 | 982 | /** 983 | * We get the sliding direction using a custom func getDirection() in utils 984 | * @const String 985 | * @return up or down 986 | * 987 | */ 988 | var Direction = _utils2.default.getDirection(e, vm.$ksvuefp.options.animationType); 989 | 990 | if (Direction === 'none' || Direction === undefined) return; 991 | 992 | var nextIndex = void 0; 993 | 994 | /** 995 | * Get next index 996 | * @return index to go to 997 | * 998 | */ 999 | switch (e.type) { 1000 | case 'navclick': 1001 | // if is the event is from a click on navigation item 1002 | nextIndex = e.nextIndex; 1003 | break; 1004 | default: 1005 | // else 1006 | nextIndex = _utils2.default.getNextIndex(OldIndex, Direction, Length, Options); 1007 | break; 1008 | } 1009 | 1010 | if (nextIndex === 'none') return; 1011 | 1012 | this.$nextTick(function () { 1013 | // we wait for our computed datas to be ready 1014 | /** 1015 | * Emit change event on bus vm 1016 | * @param {integer} nextIndex 1017 | * @param {integer} OldIndex 1018 | * @param {String} Direction 1019 | * 1020 | */ 1021 | vm.$ksvuefp.$emit('ksvuefp-change-begin', nextIndex, OldIndex, Direction, vm.$ksvuefp.options.animDelay); 1022 | 1023 | /** 1024 | * Emit change-done event on bus vm when animation is finished 1025 | * 1026 | */ 1027 | setTimeout(function () { 1028 | vm.$ksvuefp.$emit('ksvuefp-change-done'); 1029 | }, vm.$ksvuefp.options.duration ? vm.$ksvuefp.options.duration + vm.$ksvuefp.options.animDelay + 100 : vm.$ksvuefp.options.animDelay + 1100); 1030 | }); 1031 | } 1032 | }, 1033 | watch: { 1034 | options: { 1035 | deep: true, 1036 | handler: function handler(val) { 1037 | this.$ksvuefp.$emit('ksvuefp-options-changed', val); 1038 | } 1039 | } 1040 | }, 1041 | beforeDestroy: function beforeDestroy() { 1042 | var vm = this; 1043 | /** 1044 | * We set the list of actions we want to trigger the animation with 1045 | * @const {array} 1046 | * 1047 | */ 1048 | var actions = ['wheel', 'mousewheel', 'keydown']; 1049 | /** 1050 | * For each action in the above array, trigger changeIndex method 1051 | * 1052 | */ 1053 | actions.forEach(function (a) { 1054 | document.removeEventListener(a, vm.changeIndex); 1055 | }); 1056 | window.addEventListener('resize', function () { 1057 | vm.$ksvuefp.$emit('ksvuefp-resized'); 1058 | }); 1059 | this.$off(); 1060 | this.$ksvuefp.$emit('ksvuefp-destroy'); 1061 | } 1062 | }; // 1063 | // 1064 | // 1065 | // 1066 | // 1067 | // 1068 | // 1069 | // 1070 | // 1071 | // 1072 | // 1073 | 1074 | /***/ }), 1075 | /* 10 */ 1076 | /***/ (function(module, exports, __webpack_require__) { 1077 | 1078 | "use strict"; 1079 | 1080 | 1081 | Object.defineProperty(exports, "__esModule", { 1082 | value: true 1083 | }); 1084 | exports.version = exports.ksvuefpSection = exports.ksvuefp = undefined; 1085 | 1086 | var _ksvuefp = __webpack_require__(5); 1087 | 1088 | var _ksvuefp2 = _interopRequireDefault(_ksvuefp); 1089 | 1090 | var _ksvuefpSection = __webpack_require__(4); 1091 | 1092 | var _ksvuefpSection2 = _interopRequireDefault(_ksvuefpSection); 1093 | 1094 | var _utils = __webpack_require__(1); 1095 | 1096 | var _utils2 = _interopRequireDefault(_utils); 1097 | 1098 | var _defaultOptions = __webpack_require__(3); 1099 | 1100 | var _defaultOptions2 = _interopRequireDefault(_defaultOptions); 1101 | 1102 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 1103 | 1104 | function plugin(Vue) { 1105 | Vue.prototype.$ksvuefp = new Vue({ 1106 | data: { 1107 | fpLoaded: false, 1108 | currentIndex: 0, 1109 | slidingActive: false, 1110 | sliderDirection: 'down', 1111 | wWidth: 0, 1112 | wHeight: 0, 1113 | options: {} 1114 | }, 1115 | created: function created() { 1116 | var vm = this; 1117 | vm.$on('ksvuefp-ready', function () { 1118 | vm.$emit('ksvuefp-resized'); 1119 | vm.fpLoaded = true; 1120 | }); 1121 | vm.$on('ksvuefp-options-changed', function (custom) { 1122 | vm.options = Object.assign({}, _defaultOptions2.default, custom); 1123 | }); 1124 | 1125 | vm.$on('ksvuefp-resized', function () { 1126 | vm.getWindowDim(); 1127 | }); 1128 | vm.$on('ksvuefp-destroy', function () { 1129 | vm.fpLoaded = false; 1130 | vm.currentIndex = 0; 1131 | vm.slidingActive = false; 1132 | vm.sliderDirection = 'down'; 1133 | vm.options = {}; 1134 | }); 1135 | 1136 | vm.$on('ksvuefp-change-begin', function (nextIndex, oldIndex, direction, delay) { 1137 | vm.slidingActive = true; 1138 | vm.sliderDirection = direction; 1139 | vm.$nextTick(function () { 1140 | setTimeout(function () { 1141 | vm.currentIndex = nextIndex; 1142 | }, delay || 0); 1143 | }); 1144 | }); 1145 | 1146 | vm.$on('ksvuefp-change-done', function () { 1147 | vm.slidingActive = false; 1148 | }); 1149 | }, 1150 | 1151 | methods: { 1152 | getWindowDim: function getWindowDim() { 1153 | var vm = this; 1154 | var Dimensions = _utils2.default.getWindowDim(); 1155 | vm.wWidth = Dimensions.wWidth; 1156 | vm.wHeight = Dimensions.wHeight; 1157 | vm.$nextTick(function () { 1158 | vm.$ksvuefp.$emit('ksvuefp-change-done'); 1159 | }); 1160 | }, 1161 | canAnimContent: function canAnimContent(index) { 1162 | var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 1163 | 1164 | if (index !== this.currentIndex) return; 1165 | if (wait) { 1166 | return !this.slidingActive ? true : false; 1167 | } 1168 | return true; 1169 | } 1170 | } 1171 | }); 1172 | Vue.component('ksvuefp', _ksvuefp2.default); 1173 | Vue.component('ksvuefp-section', _ksvuefpSection2.default); 1174 | } 1175 | 1176 | // Install by default if using the script tag 1177 | if (typeof window !== 'undefined' && window.Vue) { 1178 | window.Vue.use(plugin); 1179 | } 1180 | 1181 | exports.default = plugin; 1182 | 1183 | var version = '__VERSION__'; 1184 | // Export all components too 1185 | exports.ksvuefp = _ksvuefp2.default; 1186 | exports.ksvuefpSection = _ksvuefpSection2.default; 1187 | exports.version = version; 1188 | 1189 | /***/ }), 1190 | /* 11 */ 1191 | /***/ (function(module, exports, __webpack_require__) { 1192 | 1193 | var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 1194 | * EvEmitter v1.1.0 1195 | * Lil' event emitter 1196 | * MIT License 1197 | */ 1198 | 1199 | /* jshint unused: true, undef: true, strict: true */ 1200 | 1201 | ( function( global, factory ) { 1202 | // universal module definition 1203 | /* jshint strict: false */ /* globals define, module, window */ 1204 | if ( true ) { 1205 | // AMD - RequireJS 1206 | !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1207 | __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1208 | (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 1209 | __WEBPACK_AMD_DEFINE_FACTORY__), 1210 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1211 | } else if ( typeof module == 'object' && module.exports ) { 1212 | // CommonJS - Browserify, Webpack 1213 | module.exports = factory(); 1214 | } else { 1215 | // Browser globals 1216 | global.EvEmitter = factory(); 1217 | } 1218 | 1219 | }( typeof window != 'undefined' ? window : this, function() { 1220 | 1221 | "use strict"; 1222 | 1223 | function EvEmitter() {} 1224 | 1225 | var proto = EvEmitter.prototype; 1226 | 1227 | proto.on = function( eventName, listener ) { 1228 | if ( !eventName || !listener ) { 1229 | return; 1230 | } 1231 | // set events hash 1232 | var events = this._events = this._events || {}; 1233 | // set listeners array 1234 | var listeners = events[ eventName ] = events[ eventName ] || []; 1235 | // only add once 1236 | if ( listeners.indexOf( listener ) == -1 ) { 1237 | listeners.push( listener ); 1238 | } 1239 | 1240 | return this; 1241 | }; 1242 | 1243 | proto.once = function( eventName, listener ) { 1244 | if ( !eventName || !listener ) { 1245 | return; 1246 | } 1247 | // add event 1248 | this.on( eventName, listener ); 1249 | // set once flag 1250 | // set onceEvents hash 1251 | var onceEvents = this._onceEvents = this._onceEvents || {}; 1252 | // set onceListeners object 1253 | var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; 1254 | // set flag 1255 | onceListeners[ listener ] = true; 1256 | 1257 | return this; 1258 | }; 1259 | 1260 | proto.off = function( eventName, listener ) { 1261 | var listeners = this._events && this._events[ eventName ]; 1262 | if ( !listeners || !listeners.length ) { 1263 | return; 1264 | } 1265 | var index = listeners.indexOf( listener ); 1266 | if ( index != -1 ) { 1267 | listeners.splice( index, 1 ); 1268 | } 1269 | 1270 | return this; 1271 | }; 1272 | 1273 | proto.emitEvent = function( eventName, args ) { 1274 | var listeners = this._events && this._events[ eventName ]; 1275 | if ( !listeners || !listeners.length ) { 1276 | return; 1277 | } 1278 | // copy over to avoid interference if .off() in listener 1279 | listeners = listeners.slice(0); 1280 | args = args || []; 1281 | // once stuff 1282 | var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; 1283 | 1284 | for ( var i=0; i < listeners.length; i++ ) { 1285 | var listener = listeners[i] 1286 | var isOnce = onceListeners && onceListeners[ listener ]; 1287 | if ( isOnce ) { 1288 | // remove listener 1289 | // remove before trigger to prevent recursion 1290 | this.off( eventName, listener ); 1291 | // unset once flag 1292 | delete onceListeners[ listener ]; 1293 | } 1294 | // trigger listener 1295 | listener.apply( this, args ); 1296 | } 1297 | 1298 | return this; 1299 | }; 1300 | 1301 | proto.allOff = function() { 1302 | delete this._events; 1303 | delete this._onceEvents; 1304 | }; 1305 | 1306 | return EvEmitter; 1307 | 1308 | })); 1309 | 1310 | 1311 | /***/ }), 1312 | /* 12 */ 1313 | /***/ (function(module, exports) { 1314 | 1315 | // empty (null-loader) 1316 | 1317 | /***/ }), 1318 | /* 13 */ 1319 | /***/ (function(module, exports) { 1320 | 1321 | // empty (null-loader) 1322 | 1323 | /***/ }), 1324 | /* 14 */ 1325 | /***/ (function(module, exports) { 1326 | 1327 | // empty (null-loader) 1328 | 1329 | /***/ }), 1330 | /* 15 */ 1331 | /***/ (function(module, exports) { 1332 | 1333 | // empty (null-loader) 1334 | 1335 | /***/ }), 1336 | /* 16 */ 1337 | /***/ (function(module, exports, __webpack_require__) { 1338 | 1339 | var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 1340 | * imagesLoaded v4.1.3 1341 | * JavaScript is all like "You images are done yet or what?" 1342 | * MIT License 1343 | */ 1344 | 1345 | ( function( window, factory ) { 'use strict'; 1346 | // universal module definition 1347 | 1348 | /*global define: false, module: false, require: false */ 1349 | 1350 | if ( true ) { 1351 | // AMD 1352 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 1353 | __webpack_require__(11) 1354 | ], __WEBPACK_AMD_DEFINE_RESULT__ = function( EvEmitter ) { 1355 | return factory( window, EvEmitter ); 1356 | }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 1357 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1358 | } else if ( typeof module == 'object' && module.exports ) { 1359 | // CommonJS 1360 | module.exports = factory( 1361 | window, 1362 | require('ev-emitter') 1363 | ); 1364 | } else { 1365 | // browser global 1366 | window.imagesLoaded = factory( 1367 | window, 1368 | window.EvEmitter 1369 | ); 1370 | } 1371 | 1372 | })( typeof window !== 'undefined' ? window : this, 1373 | 1374 | // -------------------------- factory -------------------------- // 1375 | 1376 | function factory( window, EvEmitter ) { 1377 | 1378 | 'use strict'; 1379 | 1380 | var $ = window.jQuery; 1381 | var console = window.console; 1382 | 1383 | // -------------------------- helpers -------------------------- // 1384 | 1385 | // extend objects 1386 | function extend( a, b ) { 1387 | for ( var prop in b ) { 1388 | a[ prop ] = b[ prop ]; 1389 | } 1390 | return a; 1391 | } 1392 | 1393 | // turn element or nodeList into an array 1394 | function makeArray( obj ) { 1395 | var ary = []; 1396 | if ( Array.isArray( obj ) ) { 1397 | // use object if already an array 1398 | ary = obj; 1399 | } else if ( typeof obj.length == 'number' ) { 1400 | // convert nodeList to array 1401 | for ( var i=0; i < obj.length; i++ ) { 1402 | ary.push( obj[i] ); 1403 | } 1404 | } else { 1405 | // array of single index 1406 | ary.push( obj ); 1407 | } 1408 | return ary; 1409 | } 1410 | 1411 | // -------------------------- imagesLoaded -------------------------- // 1412 | 1413 | /** 1414 | * @param {Array, Element, NodeList, String} elem 1415 | * @param {Object or Function} options - if function, use as callback 1416 | * @param {Function} onAlways - callback function 1417 | */ 1418 | function ImagesLoaded( elem, options, onAlways ) { 1419 | // coerce ImagesLoaded() without new, to be new ImagesLoaded() 1420 | if ( !( this instanceof ImagesLoaded ) ) { 1421 | return new ImagesLoaded( elem, options, onAlways ); 1422 | } 1423 | // use elem as selector string 1424 | if ( typeof elem == 'string' ) { 1425 | elem = document.querySelectorAll( elem ); 1426 | } 1427 | 1428 | this.elements = makeArray( elem ); 1429 | this.options = extend( {}, this.options ); 1430 | 1431 | if ( typeof options == 'function' ) { 1432 | onAlways = options; 1433 | } else { 1434 | extend( this.options, options ); 1435 | } 1436 | 1437 | if ( onAlways ) { 1438 | this.on( 'always', onAlways ); 1439 | } 1440 | 1441 | this.getImages(); 1442 | 1443 | if ( $ ) { 1444 | // add jQuery Deferred object 1445 | this.jqDeferred = new $.Deferred(); 1446 | } 1447 | 1448 | // HACK check async to allow time to bind listeners 1449 | setTimeout( function() { 1450 | this.check(); 1451 | }.bind( this )); 1452 | } 1453 | 1454 | ImagesLoaded.prototype = Object.create( EvEmitter.prototype ); 1455 | 1456 | ImagesLoaded.prototype.options = {}; 1457 | 1458 | ImagesLoaded.prototype.getImages = function() { 1459 | this.images = []; 1460 | 1461 | // filter & find items if we have an item selector 1462 | this.elements.forEach( this.addElementImages, this ); 1463 | }; 1464 | 1465 | /** 1466 | * @param {Node} element 1467 | */ 1468 | ImagesLoaded.prototype.addElementImages = function( elem ) { 1469 | // filter siblings 1470 | if ( elem.nodeName == 'IMG' ) { 1471 | this.addImage( elem ); 1472 | } 1473 | // get background image on element 1474 | if ( this.options.background === true ) { 1475 | this.addElementBackgroundImages( elem ); 1476 | } 1477 | 1478 | // find children 1479 | // no non-element nodes, #143 1480 | var nodeType = elem.nodeType; 1481 | if ( !nodeType || !elementNodeTypes[ nodeType ] ) { 1482 | return; 1483 | } 1484 | var childImgs = elem.querySelectorAll('img'); 1485 | // concat childElems to filterFound array 1486 | for ( var i=0; i < childImgs.length; i++ ) { 1487 | var img = childImgs[i]; 1488 | this.addImage( img ); 1489 | } 1490 | 1491 | // get child background images 1492 | if ( typeof this.options.background == 'string' ) { 1493 | var children = elem.querySelectorAll( this.options.background ); 1494 | for ( i=0; i < children.length; i++ ) { 1495 | var child = children[i]; 1496 | this.addElementBackgroundImages( child ); 1497 | } 1498 | } 1499 | }; 1500 | 1501 | var elementNodeTypes = { 1502 | 1: true, 1503 | 9: true, 1504 | 11: true 1505 | }; 1506 | 1507 | ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) { 1508 | var style = getComputedStyle( elem ); 1509 | if ( !style ) { 1510 | // Firefox returns null if in a hidden iframe https://bugzil.la/548397 1511 | return; 1512 | } 1513 | // get url inside url("...") 1514 | var reURL = /url\((['"])?(.*?)\1\)/gi; 1515 | var matches = reURL.exec( style.backgroundImage ); 1516 | while ( matches !== null ) { 1517 | var url = matches && matches[2]; 1518 | if ( url ) { 1519 | this.addBackground( url, elem ); 1520 | } 1521 | matches = reURL.exec( style.backgroundImage ); 1522 | } 1523 | }; 1524 | 1525 | /** 1526 | * @param {Image} img 1527 | */ 1528 | ImagesLoaded.prototype.addImage = function( img ) { 1529 | var loadingImage = new LoadingImage( img ); 1530 | this.images.push( loadingImage ); 1531 | }; 1532 | 1533 | ImagesLoaded.prototype.addBackground = function( url, elem ) { 1534 | var background = new Background( url, elem ); 1535 | this.images.push( background ); 1536 | }; 1537 | 1538 | ImagesLoaded.prototype.check = function() { 1539 | var _this = this; 1540 | this.progressedCount = 0; 1541 | this.hasAnyBroken = false; 1542 | // complete if no images 1543 | if ( !this.images.length ) { 1544 | this.complete(); 1545 | return; 1546 | } 1547 | 1548 | function onProgress( image, elem, message ) { 1549 | // HACK - Chrome triggers event before object properties have changed. #83 1550 | setTimeout( function() { 1551 | _this.progress( image, elem, message ); 1552 | }); 1553 | } 1554 | 1555 | this.images.forEach( function( loadingImage ) { 1556 | loadingImage.once( 'progress', onProgress ); 1557 | loadingImage.check(); 1558 | }); 1559 | }; 1560 | 1561 | ImagesLoaded.prototype.progress = function( image, elem, message ) { 1562 | this.progressedCount++; 1563 | this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded; 1564 | // progress event 1565 | this.emitEvent( 'progress', [ this, image, elem ] ); 1566 | if ( this.jqDeferred && this.jqDeferred.notify ) { 1567 | this.jqDeferred.notify( this, image ); 1568 | } 1569 | // check if completed 1570 | if ( this.progressedCount == this.images.length ) { 1571 | this.complete(); 1572 | } 1573 | 1574 | if ( this.options.debug && console ) { 1575 | console.log( 'progress: ' + message, image, elem ); 1576 | } 1577 | }; 1578 | 1579 | ImagesLoaded.prototype.complete = function() { 1580 | var eventName = this.hasAnyBroken ? 'fail' : 'done'; 1581 | this.isComplete = true; 1582 | this.emitEvent( eventName, [ this ] ); 1583 | this.emitEvent( 'always', [ this ] ); 1584 | if ( this.jqDeferred ) { 1585 | var jqMethod = this.hasAnyBroken ? 'reject' : 'resolve'; 1586 | this.jqDeferred[ jqMethod ]( this ); 1587 | } 1588 | }; 1589 | 1590 | // -------------------------- -------------------------- // 1591 | 1592 | function LoadingImage( img ) { 1593 | this.img = img; 1594 | } 1595 | 1596 | LoadingImage.prototype = Object.create( EvEmitter.prototype ); 1597 | 1598 | LoadingImage.prototype.check = function() { 1599 | // If complete is true and browser supports natural sizes, 1600 | // try to check for image status manually. 1601 | var isComplete = this.getIsImageComplete(); 1602 | if ( isComplete ) { 1603 | // report based on naturalWidth 1604 | this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 1605 | return; 1606 | } 1607 | 1608 | // If none of the checks above matched, simulate loading on detached element. 1609 | this.proxyImage = new Image(); 1610 | this.proxyImage.addEventListener( 'load', this ); 1611 | this.proxyImage.addEventListener( 'error', this ); 1612 | // bind to image as well for Firefox. #191 1613 | this.img.addEventListener( 'load', this ); 1614 | this.img.addEventListener( 'error', this ); 1615 | this.proxyImage.src = this.img.src; 1616 | }; 1617 | 1618 | LoadingImage.prototype.getIsImageComplete = function() { 1619 | return this.img.complete && this.img.naturalWidth !== undefined; 1620 | }; 1621 | 1622 | LoadingImage.prototype.confirm = function( isLoaded, message ) { 1623 | this.isLoaded = isLoaded; 1624 | this.emitEvent( 'progress', [ this, this.img, message ] ); 1625 | }; 1626 | 1627 | // ----- events ----- // 1628 | 1629 | // trigger specified handler for event type 1630 | LoadingImage.prototype.handleEvent = function( event ) { 1631 | var method = 'on' + event.type; 1632 | if ( this[ method ] ) { 1633 | this[ method ]( event ); 1634 | } 1635 | }; 1636 | 1637 | LoadingImage.prototype.onload = function() { 1638 | this.confirm( true, 'onload' ); 1639 | this.unbindEvents(); 1640 | }; 1641 | 1642 | LoadingImage.prototype.onerror = function() { 1643 | this.confirm( false, 'onerror' ); 1644 | this.unbindEvents(); 1645 | }; 1646 | 1647 | LoadingImage.prototype.unbindEvents = function() { 1648 | this.proxyImage.removeEventListener( 'load', this ); 1649 | this.proxyImage.removeEventListener( 'error', this ); 1650 | this.img.removeEventListener( 'load', this ); 1651 | this.img.removeEventListener( 'error', this ); 1652 | }; 1653 | 1654 | // -------------------------- Background -------------------------- // 1655 | 1656 | function Background( url, element ) { 1657 | this.url = url; 1658 | this.element = element; 1659 | this.img = new Image(); 1660 | } 1661 | 1662 | // inherit LoadingImage prototype 1663 | Background.prototype = Object.create( LoadingImage.prototype ); 1664 | 1665 | Background.prototype.check = function() { 1666 | this.img.addEventListener( 'load', this ); 1667 | this.img.addEventListener( 'error', this ); 1668 | this.img.src = this.url; 1669 | // check if image is already complete 1670 | var isComplete = this.getIsImageComplete(); 1671 | if ( isComplete ) { 1672 | this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' ); 1673 | this.unbindEvents(); 1674 | } 1675 | }; 1676 | 1677 | Background.prototype.unbindEvents = function() { 1678 | this.img.removeEventListener( 'load', this ); 1679 | this.img.removeEventListener( 'error', this ); 1680 | }; 1681 | 1682 | Background.prototype.confirm = function( isLoaded, message ) { 1683 | this.isLoaded = isLoaded; 1684 | this.emitEvent( 'progress', [ this, this.element, message ] ); 1685 | }; 1686 | 1687 | // -------------------------- jQuery -------------------------- // 1688 | 1689 | ImagesLoaded.makeJQueryPlugin = function( jQuery ) { 1690 | jQuery = jQuery || window.jQuery; 1691 | if ( !jQuery ) { 1692 | return; 1693 | } 1694 | // set local variable 1695 | $ = jQuery; 1696 | // $().imagesLoaded() 1697 | $.fn.imagesLoaded = function( options, callback ) { 1698 | var instance = new ImagesLoaded( this, options, callback ); 1699 | return instance.jqDeferred.promise( $(this) ); 1700 | }; 1701 | }; 1702 | // try making plugin 1703 | ImagesLoaded.makeJQueryPlugin(); 1704 | 1705 | // -------------------------- -------------------------- // 1706 | 1707 | return ImagesLoaded; 1708 | 1709 | }); 1710 | 1711 | 1712 | /***/ }), 1713 | /* 17 */ 1714 | /***/ (function(module, exports, __webpack_require__) { 1715 | 1716 | function injectStyle (ssrContext) { 1717 | var i 1718 | __webpack_require__(14) 1719 | } 1720 | var Component = __webpack_require__(0)( 1721 | /* script */ 1722 | __webpack_require__(6), 1723 | /* template */ 1724 | __webpack_require__(21), 1725 | /* styles */ 1726 | injectStyle, 1727 | /* scopeId */ 1728 | null, 1729 | /* moduleIdentifier (server only) */ 1730 | "2fefe180" 1731 | ) 1732 | Component.options.__file = "C:\\Users\\romai\\ks-node\\vue-plugins\\node_modules\\ks-vue-fullpage\\src\\components\\ksvuefp-nav.vue" 1733 | if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")} 1734 | if (Component.options.functional) {console.error("[vue-loader] ksvuefp-nav.vue: functional components are not supported with templates, they should use render functions.")} 1735 | 1736 | module.exports = Component.exports 1737 | 1738 | 1739 | /***/ }), 1740 | /* 18 */ 1741 | /***/ (function(module, exports, __webpack_require__) { 1742 | 1743 | function injectStyle (ssrContext) { 1744 | var i 1745 | __webpack_require__(13) 1746 | } 1747 | var Component = __webpack_require__(0)( 1748 | /* script */ 1749 | __webpack_require__(7), 1750 | /* template */ 1751 | __webpack_require__(20), 1752 | /* styles */ 1753 | injectStyle, 1754 | /* scopeId */ 1755 | null, 1756 | /* moduleIdentifier (server only) */ 1757 | "06a62b93" 1758 | ) 1759 | Component.options.__file = "C:\\Users\\romai\\ks-node\\vue-plugins\\node_modules\\ks-vue-fullpage\\src\\components\\ksvuefp-preloader.vue" 1760 | if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")} 1761 | if (Component.options.functional) {console.error("[vue-loader] ksvuefp-preloader.vue: functional components are not supported with templates, they should use render functions.")} 1762 | 1763 | module.exports = Component.exports 1764 | 1765 | 1766 | /***/ }), 1767 | /* 19 */ 1768 | /***/ (function(module, exports) { 1769 | 1770 | module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; 1771 | return _c('div', { 1772 | class: ['ksvuefp', _vm.$ksvuefp.wWidth < _vm.$ksvuefp.options.normalScrollWidth ? 'is-ksvuefp-inactive' : null], 1773 | style: (_vm.ksvuefpStyles) 1774 | }, [_vm._ssrNode("
" + _vm._ssrEscape(_vm._s(_vm.preloaderText || 'loading...')) + "
{{ preloaderText || 'loading...' }}
8 |