diff --git a/.babelrc.json b/.babelrc.json
new file mode 100644
index 0000000..7d25832
--- /dev/null
+++ b/.babelrc.json
@@ -0,0 +1,8 @@
+{
+ "presets": [
+ "@babel/preset-env"
+ ],
+ "plugins": [
+ "@babel/plugin-proposal-class-properties"
+ ]
+}
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..1881c55
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,48 @@
+{
+ "rules": {
+ "prefer-template": "off",
+ "no-var": 1,
+ "no-unused-vars": 1,
+ "camelcase": 1,
+ "no-nested-ternary": 1,
+ "no-console": 1,
+ "no-template-curly-in-string": 1,
+ "no-self-compare": 1,
+ "import/prefer-default-export": 0,
+ "arrow-body-style": 1,
+ "import/no-extraneous-dependencies": [
+ "off",
+ {
+ "devDependencies": false
+ }
+ ]
+ },
+ "ignorePatterns": [
+ "dist",
+ "node_modules",
+ "webpack.*",
+ "config/paths.js"
+ ],
+ "env": {
+ "browser": true,
+ "es6": true
+ },
+ "extends": [
+ "eslint:recommended",
+ "prettier"
+ ],
+ "parserOptions": {
+ "ecmaVersion": 2021,
+ "sourceType": "module"
+ },
+ "plugins": [
+ "prettier"
+ ],
+ "settings": {
+ "import/resolver": {
+ "webpack": {
+ "config": "config/webpack.common.js"
+ }
+ }
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5e6fdbc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/package-lock.json
+/node_modules/
+/.idea/
+/package-lock.json
\ No newline at end of file
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..56a830c
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,11 @@
+.idea
+.gitignore
+.babelrc.json
+.eslintrc.json
+.prettierrc.json
+jsconfig.json
+/config
+/public
+/src
+/web
+/dev
\ No newline at end of file
diff --git a/.prettierrc.json b/.prettierrc.json
new file mode 100644
index 0000000..edc0835
--- /dev/null
+++ b/.prettierrc.json
@@ -0,0 +1,7 @@
+{
+ "trailingComma": "es5",
+ "singleQuote": true,
+ "tabWidth": 2,
+ "printWidth": 100,
+ "semi": false
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..562b904
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,20 @@
+### v2.0.0 - 2022-11-11
+
+- Refactor dev environment with webpack
+- Support jQuery and vanilla JS
+- Release NPM package
+
+### v1.1.1 - 2021-09-27
+
+- Fix bug when `responsive` property is not defined.
+
+### v1.1.0 - 2021-09-24
+
+- The core responsive handle has been split into `class ResponsiveObject()` so we can use this feature for other
+ libraries as well.
+
+> See [ResponsiveObject()](https://github.com/phucbm/js-gist/blob/main/responsive-object.js)
+
+### v1.0.0 - 2021-08-14
+
+- jQuery plugin for Flickity responsive
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..7db8016
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 Phuc Bui
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index 4bbae24..333df05 100644
--- a/README.md
+++ b/README.md
@@ -1,58 +1,95 @@
-# Flickity responsive v1.1.1 [![](https://data.jsdelivr.com/v1/package/gh/phucbm/flickity-responsive/badge)](https://www.jsdelivr.com/package/gh/phucbm/flickity-responsive)
+# Flickity Responsive
-A jQuery plugin that adds `responsive` option for Flickity.
+[![release](https://badgen.net/github/release/phucbm/flickity-responsive/)](https://github.com/phucbm/flickity-responsive/releases/latest)
+[![minified](https://badgen.net/badge/minified/4KB/cyan)](https://www.jsdelivr.com/package/gh/phucbm/flickity-responsive)
+[![jsdelivr](https://data.jsdelivr.com/v1/package/gh/phucbm/flickity-responsive/badge?style=rounded)](https://www.jsdelivr.com/package/gh/phucbm/flickity-responsive)
+[![license](https://badgen.net/github/license/phucbm/flickity-responsive/)](https://github.com/phucbm/flickity-responsive/blob/main/LICENSE)
-## Introduce
+> A vanilla JS plugin that adds `responsive` option for Flickity.
-> At the time of this plugin was made, Flickity does not officially offer any way to update the options on various screensizes.
+## Introduction
+
+> At the time of this plugin was made, Flickity does not officially offer any way to update the options on various
+> screensizes.
Read more about the issue here 👉 https://github.com/metafizzy/flickity/issues/233
-So, I create an jQuery plugin that brings `responsive` to Flickity, just like the
+So, I create a plugin that brings `responsive` to Flickity, just like the
way [Slick](https://kenwheeler.github.io/slick/) works.
-## Demo
-
-Check the latest demo on CodePen 👉 https://codepen.io/phucbui/pen/ExmJVZa
-
## Getting started
-Add `flickity-responsive.js` to your scripts, in this order 👇
+Add the script to your project in this order 👇
-- jQuery
+- jQuery (optional)
- Flickity
-- `flickity-responsive.js`
+- `flickity-responsive`
-### Download
+### NPM Package
+
+Install NPM package
+
+```shell
+npm i flickity-responsive
+```
+
+Import
+
+```js
+import {FlickityResponsive} from "flickity-responsive";
+```
-Directly from Github
+### Download
-[⬇️ flickity-responsive.js](https://raw.githubusercontent.com/phucbm/flickity-responsive/master/flickity-responsive.js)
+👉 Self hosted - [Download the latest release](https://github.com/phucbm/flickity-responsive/releases/latest)
-or
+```html
-### CDN
+
+```
-Get the latest minify version thanks for jsDelivr
+👉 CDN Hosted - [jsDelivr](https://www.jsdelivr.com/package/gh/phucbm/flickity-responsive)
```html
-
+
```
## Usage
-Use `$('.carousel').flickityResponsive()` to initialize your carousel.
+Just change the name, all other options stay the same.
+
+- `new Flickity()` => `new FlickityResponsive()`.
+- `$('.carousel').flickity()` => `$('.carousel').flickityResponsive()`.
```js
-// init flickity responsive
+// init with vanilla JS
+new FlickityResponsive('.carousel', {
+ cellAlign: "left",
+ contain: true,
+ freeScroll: true,
+ responsive: [
+ {
+ breakpoint: 748,
+ settings: {
+ wrapAround: true,
+ cellAlign: "center",
+ freeScroll: false,
+ prevNextButtons: false,
+ pageDots: false
+ }
+ }
+ ]
+});
+
+// init with jQuery
$('.carousel').flickityResponsive({
cellAlign: "left",
contain: true,
freeScroll: true,
responsive: [
{
- breakpoint: 1024,
+ breakpoint: 748,
settings: {
wrapAround: true,
cellAlign: "center",
@@ -67,24 +104,35 @@ $('.carousel').flickityResponsive({
## FYI
-This plugin uses Flickity's API and `matchMedia()` with some logics to decide when to destroy and re-initialize the
+This plugin respects Flickity's API and use `matchMedia()` to know when to destroy and re-initialize the
carousel.
-> **⚠️ Important note**: the `breakpoint` property is using CSS `max-width` logic. For instance, when you set `breakpoint:480`, that means responsive settings will be applied when the viewport is `<=480px` (while Slick is `<480px`). Let's be cleared 💎
+> **⚠️ Important note**: the `breakpoint` property is using CSS `max-width` logic. For instance, when you
+> set `breakpoint:480`, that means responsive settings will be applied when the viewport is `<=480px` (while Slick
+> is `<480px`). Let's be cleared 💎
-## Changelog
+## Deployment
-### v1.1.1 - 2021-09-27
+### Dev server
-- Fix bug when `responsive` property is not defined.
+Run dev server
-### v1.1.0 - 2021-09-24
+```shell
+npm run dev
+```
+
+### Generate production files
-- The core responsive handle has been split into `class ResponsiveObject()` so we can use this feature for other
- libraries as well.
+Generate UMD and module version
+
+```shell
+npm run prod
+```
-> See [ResponsiveObject()](https://github.com/phucbm/js-gist/blob/main/responsive-object.js)
+### Build sites
-### v1.0.0 - 2021-08-14
+Build production site
-- jQuery plugin for Flickity responsive
\ No newline at end of file
+```shell
+npm run build
+```
\ No newline at end of file
diff --git a/config/config.js b/config/config.js
new file mode 100644
index 0000000..25282f3
--- /dev/null
+++ b/config/config.js
@@ -0,0 +1,104 @@
+const packageInfo = require('../package.json');
+
+/**
+ * Environment variables
+ * scripts: cross-env NODE_ENV=development
+ */
+const env = process.env;
+
+
+/**
+ * Banner
+ */
+const bannerConfig = {
+ banner: `
+/**!
+ * ${packageInfo.prettyName} v${packageInfo.version}
+ * @author ${packageInfo.author.name}
+ * @homepage ${packageInfo.homepage}
+ * @license ${packageInfo.license} ${new Date().getFullYear()}
+ */`,
+ raw: true
+};
+
+
+/**
+ * Paths
+ */
+const path = require('path');
+const paths = {
+ // Source files
+ root: path.resolve(__dirname, '../'),
+ src: path.resolve(__dirname, '../src'),
+ entry: path.resolve(__dirname, '../src/_index.js'),
+
+ // Production build files
+ dist: path.resolve(__dirname, '../dist'),
+
+ // Build web
+ build: path.resolve(__dirname, '../build'),
+
+ // Static files that get copied to build folder
+ public: path.resolve(__dirname, '../public'),
+};
+
+
+/**
+ * Server
+ */
+const server = {
+ // Determine how modules within the project are treated
+ module: {
+ rules: [
+ // JavaScript: Use Babel to transpile JavaScript files
+ {test: /\.js$/, use: ['babel-loader']},
+
+ // Images: Copy image files to build folder
+ {test: /\.(?:ico|gif|png|jpg|jpeg)$/i, type: 'asset/resource'},
+
+ // Fonts and SVGs: Inline files
+ {test: /\.(woff(2)?|eot|ttf|otf|svg|)$/, type: 'asset/inline'},
+
+ // HTML
+ {test: /\.html$/i, loader: "html-loader",},
+
+ // Styles: Inject CSS into the head with source maps
+ {
+ test: /\.(sass|scss|css)$/,
+ use: [
+ 'style-loader',
+ {
+ loader: 'css-loader',
+ options: {sourceMap: true, importLoaders: 1, modules: false},
+ },
+ {loader: 'postcss-loader', options: {sourceMap: true}},
+ {loader: 'sass-loader', options: {sourceMap: true}},
+ ],
+ },
+ ],
+ },
+
+ resolve: {
+ modules: [paths.src, 'node_modules'],
+ extensions: ['.js', '.jsx', '.json'],
+ alias: {
+ '@': paths.src,
+ assets: paths.public,
+ },
+ },
+
+ // Control how source maps are generated
+ devtool: 'inline-source-map',
+};
+
+
+/**
+ * Export
+ */
+module.exports = {
+ paths,
+ packageInfo,
+ bannerConfig,
+ server,
+ env
+};
\ No newline at end of file
diff --git a/config/webpack.build.js b/config/webpack.build.js
new file mode 100644
index 0000000..cd4d94d
--- /dev/null
+++ b/config/webpack.build.js
@@ -0,0 +1,95 @@
+const MiniCssExtractPlugin = require('mini-css-extract-plugin');
+const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
+const {merge} = require('webpack-merge');
+const {CleanWebpackPlugin} = require("clean-webpack-plugin");
+const CopyWebpackPlugin = require("copy-webpack-plugin");
+const HtmlWebpackPlugin = require("html-webpack-plugin");
+const {paths, server, packageInfo, env} = require('./config');
+const path = require("path");
+
+/**
+ * Sample variables: "cross-env ENTRY=web"
+ * ENTRY: folder to start building the bundle
+ */
+const entryFolder = env.ENTRY || 'web';
+const entryPath = path.resolve(__dirname, `../${entryFolder}`);
+
+module.exports = merge(server, {
+ mode: 'production',
+ devtool: false,
+
+ // Where webpack looks to start building the bundle
+ entry: [entryPath + '/script.js'],
+
+ output: {
+ path: paths.build,
+ publicPath: '/',
+ filename: 'js/[name].[contenthash].bundle.js',
+ },
+ module: {
+ rules: [
+ {
+ test: /\.(sass|scss|css)$/,
+ use: [
+ MiniCssExtractPlugin.loader,
+ {
+ loader: 'css-loader',
+ options: {
+ importLoaders: 2,
+ sourceMap: false,
+ modules: false,
+ },
+ },
+ 'postcss-loader',
+ 'sass-loader',
+ ],
+ },
+ ],
+ },
+ plugins: [
+ // Extracts CSS into separate files
+ new MiniCssExtractPlugin({
+ filename: 'styles/[name].[contenthash].css',
+ chunkFilename: '[id].css',
+ }),
+ // Removes/cleans build folders and unused assets when rebuilding
+ new CleanWebpackPlugin(),
+
+ // Copies files from target to destination folder
+ new CopyWebpackPlugin({
+ patterns: [
+ {
+ from: paths.public,
+ to: 'assets',
+ globOptions: {
+ ignore: ['*.DS_Store'],
+ },
+ noErrorOnMissing: true,
+ },
+ ],
+ }),
+
+ // Generates an HTML file from a template
+ // Generates deprecation warning: https://github.com/jantimon/html-webpack-plugin/issues/1501
+ new HtmlWebpackPlugin({
+ inject: true,
+ hash: true,
+ title: packageInfo.prettyName,
+ favicon: paths.public + '/images/favicon.png',
+ template: entryPath + '/index.html', // template file
+ filename: 'index.html', // output file
+ }),
+ ],
+ optimization: {
+ minimize: true,
+ minimizer: [new CssMinimizerPlugin(), '...'],
+ runtimeChunk: {
+ name: 'runtime',
+ },
+ },
+ performance: {
+ hints: false,
+ maxEntrypointSize: 512000,
+ maxAssetSize: 512000,
+ },
+})
diff --git a/config/webpack.dev.js b/config/webpack.dev.js
new file mode 100644
index 0000000..eb9e813
--- /dev/null
+++ b/config/webpack.dev.js
@@ -0,0 +1,70 @@
+const {merge} = require('webpack-merge');
+const {CleanWebpackPlugin} = require("clean-webpack-plugin");
+const CopyWebpackPlugin = require("copy-webpack-plugin");
+const HtmlWebpackPlugin = require("html-webpack-plugin");
+const path = require("path");
+const {paths, packageInfo, server, env} = require("./config");
+
+/**
+ * Sample variables: "cross-env ENTRY=dev PORT=8080"
+ * PORT: open a server in this port
+ * ENTRY: folder to start building the bundle
+ */
+const port = env.PORT || '8080';
+const entryFolder = env.ENTRY || 'dev';
+const entryPath = path.resolve(__dirname, `../${entryFolder}`);
+
+module.exports = merge(server, {
+ // Set the mode to development or production
+ mode: 'development',
+
+ // Where webpack looks to start building the bundle
+ entry: [entryPath + '/script.js'],
+
+ // Where webpack outputs the assets and bundles
+ output: {
+ path: paths.dist,
+ filename: '[name].bundle.js',
+ publicPath: '/',
+ },
+
+ // Customize the webpack build process
+ plugins: [
+ // Removes/cleans build folders and unused assets when rebuilding
+ new CleanWebpackPlugin(),
+
+ // Copies files from target to destination folder
+ new CopyWebpackPlugin({
+ patterns: [
+ {
+ from: paths.public,
+ to: 'assets',
+ globOptions: {
+ ignore: ['*.DS_Store'],
+ },
+ noErrorOnMissing: true,
+ },
+ ],
+ }),
+
+ // Generates an HTML file from a template
+ // Generates deprecation warning: https://github.com/jantimon/html-webpack-plugin/issues/1501
+ new HtmlWebpackPlugin({
+ inject: true,
+ hash: true,
+ title: packageInfo.prettyName,
+ favicon: paths.public + '/images/favicon.png',
+ template: entryPath + '/index.html', // template file
+ filename: 'index.html', // output file
+ }),
+ ],
+
+ // Spin up a server for quick development
+ devServer: {
+ historyApiFallback: true,
+ open: true,
+ compress: true,
+ hot: true,
+ port: port,
+ },
+});
\ No newline at end of file
diff --git a/config/webpack.prod.js b/config/webpack.prod.js
new file mode 100644
index 0000000..7296f3c
--- /dev/null
+++ b/config/webpack.prod.js
@@ -0,0 +1,43 @@
+const TerserPlugin = require('terser-webpack-plugin');
+const webpack = require('webpack');
+const {paths, packageInfo, bannerConfig, env} = require('./config');
+
+/**
+ * Sample variables: "cross-env TARGET=umd"
+ * TARGET: libraryTarget
+ */
+const libraryTarget = env.TARGET || 'umd';
+let filename, experiments = {}, library = undefined, path = undefined;
+switch(libraryTarget){
+ case "module":
+ filename = `${packageInfo.outputFilename}.module.js`;
+ experiments = {
+ outputModule: true,
+ };
+ break;
+ default:
+ filename = `${packageInfo.outputFilename}.min.js`;
+ path = paths.root;
+}
+
+module.exports = {
+ mode: 'production',
+ devtool: false,
+ entry: paths.entry,
+ experiments,
+ output: {
+ path,
+ filename,
+ library,
+ libraryTarget,
+ umdNamedDefine: true,
+ // prevent error: `Uncaught ReferenceError: self is not define`
+ globalObject: 'this',
+ },
+ plugins: [
+ new webpack.BannerPlugin(bannerConfig)
+ ],
+ optimization: {
+ minimizer: [new TerserPlugin({extractComments: false})],
+ },
+};
\ No newline at end of file
diff --git a/dev/index.html b/dev/index.html
new file mode 100644
index 0000000..c360dd0
--- /dev/null
+++ b/dev/index.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+ Flickity Responsive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Flickity Responsive
+
+
+
+ Init with vanilla JS
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/script.js b/dev/script.js
new file mode 100644
index 0000000..26b33f2
--- /dev/null
+++ b/dev/script.js
@@ -0,0 +1,63 @@
+// public styles
+import '../public/style/fonts.css';
+
+// private style
+import './style.scss';
+
+// source script
+import {FlickityResponsive} from "@/_index";
+
+// import package info
+const packageInfo = require('../package.json');
+
+/**
+ * Update HTML
+ */
+// update title
+const title = `${packageInfo.prettyName} v${packageInfo.version}`;
+document.title = `[DEV] ${title} - ${packageInfo.description}`;
+document.querySelector('[data-title]').innerHTML = title;
+document.querySelector('[data-description]').innerHTML = packageInfo.description;
+
+/**
+ * Lib usage
+ */
+// init with vanilla JS
+new FlickityResponsive('.carousel', {
+ cellAlign: "left",
+ contain: true,
+ freeScroll: true,
+ responsive: [
+ {
+ breakpoint: 748,
+ settings: {
+ wrapAround: true,
+ cellAlign: "center",
+ freeScroll: false,
+ prevNextButtons: false,
+ pageDots: false
+ }
+ }
+ ]
+});
+
+// init with jQuery
+if(typeof jQuery !== 'undefined'){
+ jQuery('.carousel-2').flickityResponsive({
+ cellAlign: "left",
+ contain: true,
+ freeScroll: true,
+ responsive: [
+ {
+ breakpoint: 748,
+ settings: {
+ wrapAround: true,
+ cellAlign: "center",
+ freeScroll: false,
+ prevNextButtons: false,
+ pageDots: false
+ }
+ }
+ ]
+ });
+}
\ No newline at end of file
diff --git a/dev/style.scss b/dev/style.scss
new file mode 100644
index 0000000..fe7a141
--- /dev/null
+++ b/dev/style.scss
@@ -0,0 +1,51 @@
+/**
+ * Variables
+ */
+$font-size: 1rem;
+$font-family: 'Finlandica', sans-serif;
+$page-width: 768px;
+$color-primary: #f1c400;
+$color-on-primary: #141414;
+
+/* external css: flickity.css */
+
+* {
+ box-sizing: border-box;
+}
+
+body {
+ font-family: sans-serif;
+}
+
+.container {
+ max-width: $page-width;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.carousel {
+ background: #FAFAFA;
+}
+
+.carousel-cell {
+ width: 33%;
+ height: 200px;
+ margin-right: 10px;
+ background: #8C8;
+ border-radius: 5px;
+ counter-increment: carousel-cell;
+}
+
+/* cell number */
+.carousel-cell:before {
+ display: block;
+ text-align: center;
+ content: counter(carousel-cell);
+ line-height: 200px;
+ font-size: 80px;
+ color: white;
+}
+
+section {
+ margin-bottom: 100px;
+}
\ No newline at end of file
diff --git a/dist/flickity-responsive.module.js b/dist/flickity-responsive.module.js
new file mode 100644
index 0000000..9130f67
--- /dev/null
+++ b/dist/flickity-responsive.module.js
@@ -0,0 +1,13 @@
+/**!
+ * Flickity Responsive v2.0.0
+ * @author phucbm
+ * @homepage https://github.com/phucbm/flickity-responsive
+ * @license MIT 2022
+ */var t={d:(e,i)=>{for(var o in i)t.o(i,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:i[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{D:()=>a});
+/**!
+ * Match Media Screen v0.0.1
+ * @author phucbm
+ * @homepage https://github.com/phucbm/match-media-screen
+ * @license MIT 2022
+ */
+var i={d:(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},o={};function n(t,e=!0){const i=[...t];return e?i.sort(((t,e)=>t.breakpointt.breakpoint>e.breakpoint?1:-1)),i}i.d(o,{o:()=>r});class r{constructor(t){if(this.object=t.object||void 0,this.object){if(this.onMatched=t.onMatched,this.onUpdate=t.onUpdate,!this.object.responsive)return this.currentObject={type:"no-responsive",lastBreakpoint:void 0,breakpoint:-1,object:this.mergeObject(-1,this.object)},"function"==typeof this.onMatched&&this.onMatched(this.currentObject),console.warn("Property object must have responsive array."),!1;this.isInherit=void 0===t.isInherit||t.isInherit,this.debounce=t.debounce||100,this.currentObject={breakpoint:void 0,object:{}},this.object.responsive=n(this.object.responsive),this.match(),window.addEventListener("resize",function(t,e=150){let i;return(...o)=>{clearTimeout(i),i=setTimeout((()=>{t.apply(this,o)}),e)}}((()=>this.match()),this.debounce))}else console.warn("Property object:{} must be provided.")}match(){let t=!1;for(let e=0;et&&(i={...e[o].settings,...i})}return i={...this.object,...i},delete i.responsive,i}}var s=o.o;const c=(t,e)=>{new s({object:e,onMatched:e=>{if("undefined"==typeof Flickity)return void console.warn("Flickity is undefined!");let i=Flickity.data(t);void 0!==i&&i.destroy(),i=new Flickity(t,e.object),i.resize()}})};class a{constructor(t,e){c(t,e)}}var h;"undefined"!=typeof jQuery&&((h=jQuery).fn.flickityResponsive=function(t){h(this).get().forEach((e=>c(e,t)))});var b=e.D;export{b as FlickityResponsive};
\ No newline at end of file
diff --git a/flickity-responsive.js b/flickity-responsive.js
deleted file mode 100644
index 105f802..0000000
--- a/flickity-responsive.js
+++ /dev/null
@@ -1,187 +0,0 @@
-/*!
- * Flickity responsive v1.1.1
- * https://github.com/phucbm/flickity-responsive
- */
-
-(function($){
- $.fn.flickityResponsive = function(options){
- const $carousel = $(this);
- new ResponsiveObject({
- object: options,
- onMatched: (data) => {
- if(typeof $carousel.flickity !== undefined){
- // if already have flickity init
- if($carousel.data('flickity') !== undefined){
- // destroy
- $carousel.flickity('destroy');
- }
-
- // then init flickity
- $carousel.flickity(data.object);
-
- // and resize
- $carousel.flickity('resize');
- }else{
- console.warn('Flickity is undefined!');
- }
- }
- })
- }
-})(jQuery);
-
-
-/*!
- * Responsive Object v1.0.1
- * https://github.com/phucbm/js-gist/blob/main/responsive-object.js
- */
-class ResponsiveObject{
- constructor(config){
- this.object = config.object || undefined;
- if(!this.object) return;
-
- // callbacks
- this.onMatched = config.onMatched || function(){
- };
- this.onUpdate = config.onUpdate || function(){
- };
-
- // exit if there is no responsive object
- if(!this.object.responsive){
- // update
- this.currentObject = {
- type: 'no-responsive',
- lastBreakpoint: undefined,
- breakpoint: -1,
- object: this.mergeObject(-1, this.object)
- };
-
- // callback onMatched
- if(typeof this.onMatched === 'function'){
- this.onMatched(this.currentObject);
- }
- return false;
- }
-
- // if the current object don't have this key, search from the closest breakpoint above
- this.isInherit = typeof config.isInherit === 'undefined' ? true : config.isInherit;
-
- /** Current object bases on responsive data **/
- this.currentObject = {breakpoint: undefined, object: {}};
-
- /** Sort responsive breakpoints from big to small **/
- this.object.responsive = this.getSortedArray(this.object.responsive);
-
- /** Matching **/
- this.match();
- window.addEventListener('resize', () => {
- this.match();
- });
- }
-
- match(){
- let isMatched = false;
-
- // loop through all breakpoints
- for(let i = 0; i < this.object.responsive.length; i++){
- const breakpointData = this.object.responsive[i];
-
- // match query
- isMatched = matchMedia(this.getQuery(i)).matches;
-
- // if matched
- if(isMatched){
- // and is a new breakpoint
- if(this.currentObject.breakpoint !== breakpointData.breakpoint){
- // update
- this.currentObject = {
- type: 'responsive',
- lastBreakpoint: this.currentObject.breakpoint,
- breakpoint: breakpointData.breakpoint,
- object: this.mergeObject(breakpointData.breakpoint, breakpointData.settings)
- };
-
- // callback onMatched
- if(typeof this.onMatched === 'function'){
- this.onMatched(this.currentObject);
- }
- }
-
- // stop looping once matched
- break;
- }
- }
-
- // if no matching
- if(!isMatched && this.currentObject.breakpoint !== -1){
- // update
- this.currentObject = {
- type: 'default',
- lastBreakpoint: this.currentObject.breakpoint,
- breakpoint: -1,
- object: this.mergeObject(-1, this.object)
- };
-
- // callback onMatched
- if(typeof this.onMatched === 'function'){
- this.onMatched(this.currentObject);
- }
- }
-
- // callback onUpdate
- if(typeof this.onUpdate === 'function'){
- this.onUpdate(this.currentObject);
- }
- }
-
- // get query string from breakpoint
- getQuery(breakpointIndex){
- const breakpoint = this.object.responsive[breakpointIndex].breakpoint;
-
- let query = `screen and (max-width:${breakpoint}px)`;
-
- // set the min breakpoint if any
- const nextBreakpoint = this.object.responsive[breakpointIndex + 1];
- if(nextBreakpoint){
- query += ` and (min-width:${nextBreakpoint.breakpoint + 1}px)`
- }
-
- return query;
- }
-
- getSortedArray(array, isASC = true){
- const newArray = [...array];
-
- if(isASC){
- newArray.sort((a, b) => a.breakpoint < b.breakpoint && 1 || -1);
- }else{
- newArray.sort((a, b) => a.breakpoint > b.breakpoint && 1 || -1);
- }
-
- return newArray;
- }
-
- mergeObject(breakpoint, newObject){
- // clone new object
- let object = {...newObject};
-
- // if is inherit, check for previous breakpoint
- if(this.isInherit && breakpoint !== -1){
- const reversedBreakpoints = this.getSortedArray(this.object.responsive, false);
-
- for(let i = 0; i < reversedBreakpoints.length; i++){
- // only check for bigger breakpoint
- if(reversedBreakpoints[i].breakpoint > breakpoint){
- object = {...reversedBreakpoints[i].settings, ...object};
- }
- }
- }
-
- // merge with default object
- object = {...this.object, ...object};
-
- // remove responsive property
- delete object.responsive;
-
- return object;
- }
-}
\ No newline at end of file
diff --git a/flickity-responsive.min.js b/flickity-responsive.min.js
new file mode 100644
index 0000000..1cd4649
--- /dev/null
+++ b/flickity-responsive.min.js
@@ -0,0 +1,14 @@
+/**!
+ * Flickity Responsive v2.0.0
+ * @author phucbm
+ * @homepage https://github.com/phucbm/flickity-responsive
+ * @license MIT 2022
+ */
+!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var i in o)("object"==typeof exports?exports:e)[i]=o[i]}}(this,(()=>(()=>{"use strict";var e={d:(t,o)=>{for(var i in o)e.o(o,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{FlickityResponsive:()=>a});
+/**!
+ * Match Media Screen v0.0.1
+ * @author phucbm
+ * @homepage https://github.com/phucbm/match-media-screen
+ * @license MIT 2022
+ */
+var o={d:(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},i={};function r(e,t=!0){const o=[...e];return t?o.sort(((e,t)=>e.breakpointe.breakpoint>t.breakpoint?1:-1)),o}o.d(i,{o:()=>n});class n{constructor(e){if(this.object=e.object||void 0,this.object){if(this.onMatched=e.onMatched,this.onUpdate=e.onUpdate,!this.object.responsive)return this.currentObject={type:"no-responsive",lastBreakpoint:void 0,breakpoint:-1,object:this.mergeObject(-1,this.object)},"function"==typeof this.onMatched&&this.onMatched(this.currentObject),console.warn("Property object must have responsive array."),!1;this.isInherit=void 0===e.isInherit||e.isInherit,this.debounce=e.debounce||100,this.currentObject={breakpoint:void 0,object:{}},this.object.responsive=r(this.object.responsive),this.match(),window.addEventListener("resize",function(e,t=150){let o;return(...i)=>{clearTimeout(o),o=setTimeout((()=>{e.apply(this,i)}),t)}}((()=>this.match()),this.debounce))}else console.warn("Property object:{} must be provided.")}match(){let e=!1;for(let t=0;te&&(o={...t[i].settings,...o})}return o={...this.object,...o},delete o.responsive,o}}var s=i.o;const c=(e,t)=>{new s({object:t,onMatched:t=>{if("undefined"==typeof Flickity)return void console.warn("Flickity is undefined!");let o=Flickity.data(e);void 0!==o&&o.destroy(),o=new Flickity(e,t.object),o.resize()}})};class a{constructor(e,t){c(e,t)}}var b;return"undefined"!=typeof jQuery&&((b=jQuery).fn.flickityResponsive=function(e){b(this).get().forEach((t=>c(t,e)))}),t})()));
\ No newline at end of file
diff --git a/jsconfig.json b/jsconfig.json
new file mode 100644
index 0000000..5f5e5a8
--- /dev/null
+++ b/jsconfig.json
@@ -0,0 +1,11 @@
+{
+ "compilerOptions": {
+ "baseUrl": "./",
+ "paths": {
+ "@/*": [
+ "./src/*"
+ ]
+ },
+ "allowJs": true
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..648be2e
--- /dev/null
+++ b/package.json
@@ -0,0 +1,61 @@
+{
+ "name": "flickity-responsive",
+ "outputFilename": "flickity-responsive",
+ "prettyName": "Flickity Responsive",
+ "codeName": "FlickityResponsive",
+ "version": "2.0.0",
+ "description": "Responsive option for Flickity.",
+ "homepage": "https://github.com/phucbm/flickity-responsive",
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:phucbm/flickity-responsive"
+ },
+ "author": {
+ "name": "phucbm",
+ "url": "https://github.com/phucbm"
+ },
+ "keywords": [
+ "phucbm",
+ "javascript",
+ "flickity",
+ "responsive",
+ "es6"
+ ],
+ "main": "./dist/flickity-responsive.module.js",
+ "license": "MIT",
+ "scripts": {
+ "dev": "cross-env PORT=8081 webpack serve --config config/webpack.dev.js",
+ "build": "cross-env ENTRY=dev webpack --config config/webpack.build.js",
+ "prod": "webpack --config config/webpack.prod.js && cross-env TARGET=module webpack --config config/webpack.prod.js",
+ "publish": "npm run prod & npm publish"
+ },
+ "devDependencies": {
+ "@babel/core": "^7.15.8",
+ "@babel/plugin-proposal-class-properties": "^7.14.5",
+ "@babel/preset-env": "^7.15.8",
+ "@viivue/atomic-css": "^1.1.4",
+ "babel-loader": "^8.2.2",
+ "babel-preset-es2015": "^6.24.1",
+ "clean-webpack-plugin": "^4.0.0",
+ "copy-webpack-plugin": "^9.1.0",
+ "cross-env": "^7.0.3",
+ "css-loader": "^6.4.0",
+ "css-minimizer-webpack-plugin": "^3.1.1",
+ "html-loader": "^3.1.0",
+ "html-webpack-plugin": "^5.3.2",
+ "mini-css-extract-plugin": "^2.4.2",
+ "postcss-loader": "^6.2.0",
+ "postcss-preset-env": "^6.7.0",
+ "sass": "^1.43.5",
+ "sass-loader": "^12.2.0",
+ "style-loader": "^3.3.0",
+ "terser-webpack-plugin": "^5.3.1",
+ "webpack": "^5.58.2",
+ "webpack-cli": "^4.9.0",
+ "webpack-dev-server": "^4.3.1",
+ "webpack-merge": "^5.8.0"
+ },
+ "dependencies": {
+ "match-media-screen": "^0.0.1"
+ }
+}
diff --git a/public/fonts/Finlandica-Bold.woff b/public/fonts/Finlandica-Bold.woff
new file mode 100644
index 0000000..37c2c3d
Binary files /dev/null and b/public/fonts/Finlandica-Bold.woff differ
diff --git a/public/fonts/Finlandica-Bold.woff2 b/public/fonts/Finlandica-Bold.woff2
new file mode 100644
index 0000000..e5b2949
Binary files /dev/null and b/public/fonts/Finlandica-Bold.woff2 differ
diff --git a/public/fonts/Finlandica-BoldItalic.woff b/public/fonts/Finlandica-BoldItalic.woff
new file mode 100644
index 0000000..f8f29a6
Binary files /dev/null and b/public/fonts/Finlandica-BoldItalic.woff differ
diff --git a/public/fonts/Finlandica-BoldItalic.woff2 b/public/fonts/Finlandica-BoldItalic.woff2
new file mode 100644
index 0000000..b5b87f5
Binary files /dev/null and b/public/fonts/Finlandica-BoldItalic.woff2 differ
diff --git a/public/fonts/Finlandica-Italic.woff b/public/fonts/Finlandica-Italic.woff
new file mode 100644
index 0000000..6d4bb23
Binary files /dev/null and b/public/fonts/Finlandica-Italic.woff differ
diff --git a/public/fonts/Finlandica-Italic.woff2 b/public/fonts/Finlandica-Italic.woff2
new file mode 100644
index 0000000..391fb64
Binary files /dev/null and b/public/fonts/Finlandica-Italic.woff2 differ
diff --git a/public/fonts/Finlandica-Regular.woff b/public/fonts/Finlandica-Regular.woff
new file mode 100644
index 0000000..3fcc1e0
Binary files /dev/null and b/public/fonts/Finlandica-Regular.woff differ
diff --git a/public/fonts/Finlandica-Regular.woff2 b/public/fonts/Finlandica-Regular.woff2
new file mode 100644
index 0000000..5479a7b
Binary files /dev/null and b/public/fonts/Finlandica-Regular.woff2 differ
diff --git a/public/images/favicon.png b/public/images/favicon.png
new file mode 100644
index 0000000..06ec22a
Binary files /dev/null and b/public/images/favicon.png differ
diff --git a/public/style/fonts.css b/public/style/fonts.css
new file mode 100644
index 0000000..cc4de6f
--- /dev/null
+++ b/public/style/fonts.css
@@ -0,0 +1,38 @@
+/**
+ * Fonts
+ */
+@font-face {
+ font-family:"Finlandica";
+ src:url("../fonts/Finlandica-Bold.woff2") format("woff2"),
+ url("../fonts/Finlandica-Bold.woff") format("woff");
+ font-weight:bold;
+ font-style:normal;
+ font-display:swap;
+}
+
+@font-face {
+ font-family:"Finlandica";
+ src:url("../fonts/Finlandica-BoldItalic.woff2") format("woff2"),
+ url("../fonts/Finlandica-BoldItalic.woff") format("woff");
+ font-weight:bold;
+ font-style:italic;
+ font-display:swap;
+}
+
+@font-face {
+ font-family:"Finlandica";
+ src:url("../fonts/Finlandica-Italic.woff2") format("woff2"),
+ url("../fonts/Finlandica-Italic.woff") format("woff");
+ font-weight:normal;
+ font-style:italic;
+ font-display:swap;
+}
+
+@font-face {
+ font-family:"Finlandica";
+ src:url("../fonts/Finlandica-Regular.woff2") format("woff2"),
+ url("../fonts/Finlandica-Regular.woff") format("woff");
+ font-weight:normal;
+ font-style:normal;
+ font-display:swap;
+}
\ No newline at end of file
diff --git a/src/_index.js b/src/_index.js
new file mode 100644
index 0000000..110aecc
--- /dev/null
+++ b/src/_index.js
@@ -0,0 +1,54 @@
+import {MatchMediaScreen} from "match-media-screen";
+
+/**
+ * Init Flickity Responsive
+ * @param el
+ * @param options
+ */
+const init = (el, options) => {
+ new MatchMediaScreen({
+ object: options,
+ onMatched: (data) => {
+ // skip if Flickity is undefined
+ if(typeof Flickity === 'undefined'){
+ console.warn('Flickity is undefined!');
+ return;
+ }
+
+ // get instance
+ let customFlickity = Flickity.data(el);
+
+ // destroy if instance is found
+ if(typeof customFlickity !== 'undefined') customFlickity.destroy();
+
+ // init new instance
+ customFlickity = new Flickity(el, data.object);
+
+ // resize
+ customFlickity.resize();
+ }
+ });
+}
+
+
+/**
+ * Public class
+ * keep this class public to support legacy versions
+ */
+export class FlickityResponsive{
+ constructor(el, options){
+ init(el, options);
+ }
+}
+
+
+/**
+ * jQuery plugin
+ */
+if(typeof jQuery !== 'undefined'){
+ (function($){
+ $.fn.flickityResponsive = function(options){
+ $(this).get().forEach(el => init(el, options));
+ }
+ })(jQuery);
+}
\ No newline at end of file
diff --git a/src/utils.js b/src/utils.js
new file mode 100644
index 0000000..d1c9f99
--- /dev/null
+++ b/src/utils.js
@@ -0,0 +1,97 @@
+/**
+ * Debounce (ignore all, run the last)
+ * https://www.freecodecamp.org/news/javascript-debounce-example/
+ * @param func
+ * @param timeout
+ * @returns {(function(...[*]): void)|*}
+ */
+export function debounce(func, timeout = 150){
+ let timer;
+ return (...args) => {
+ clearTimeout(timer);
+ timer = setTimeout(() => {
+ func.apply(this, args);
+ }, timeout);
+ };
+}
+
+
+/**
+ * Debounce leading (run the first, ignore the rest)
+ * https://www.freecodecamp.org/news/javascript-debounce-example/
+ * @param func
+ * @param timeout
+ * @returns {(function(...[*]): void)|*}
+ */
+export function debounceLeading(func, timeout = 150){
+ let timer;
+ return (...args) => {
+ if(!timer){
+ func.apply(this, args);
+ }
+ clearTimeout(timer);
+ timer = setTimeout(() => {
+ timer = undefined;
+ }, timeout);
+ };
+}
+
+
+/**
+ * Get array with unique values
+ * https://stackoverflow.com/questions/1960473/get-all-unique-values-in-a-javascript-array-remove-duplicates
+ * @param array
+ * @returns {*}
+ */
+export function arrayUnique(array){
+ function onlyUnique(value, index, self){
+ return self.indexOf(value) === index;
+ }
+
+ return array.filter(onlyUnique);
+}
+
+
+/**
+ * Sort array of integers
+ * @param array
+ * @param asc
+ * @returns {*}
+ */
+export function arraySortInteger(array, asc = true){
+ return array.sort(function(a, b){
+ return asc ? a - b : b - a;
+ });
+}
+
+
+/**
+ * Set CSS
+ * @param target
+ * @param props
+ */
+export function setCSS(target, props){
+ Object.assign(target.style, props);
+}
+
+
+/**
+ * Console log
+ * @param context
+ * @param status
+ * @param message
+ */
+export function log(context, status, ...message){
+ if(context.options.dev){
+ console?.[status](...message);
+ }
+}
+
+
+/**
+ * Generate unique ID
+ */
+export function uniqueId(prefix = ''){
+ return prefix + (+new Date()).toString(16) +
+ (Math.random() * 100000000 | 0).toString(16);
+}
\ No newline at end of file
diff --git a/test/flickity.min.css b/test/flickity.min.css
deleted file mode 100644
index 18829b0..0000000
--- a/test/flickity.min.css
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! Flickity v2.2.2
-https://flickity.metafizzy.co
----------------------------------------------- */
-.flickity-enabled{position:relative}.flickity-enabled:focus{outline:0}.flickity-viewport{overflow:hidden;position:relative;height:100%}.flickity-slider{position:absolute;width:100%;height:100%}.flickity-enabled.is-draggable{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.flickity-enabled.is-draggable .flickity-viewport{cursor:move;cursor:-webkit-grab;cursor:grab}.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down{cursor:-webkit-grabbing;cursor:grabbing}.flickity-button{position:absolute;background:hsla(0,0%,100%,.75);border:none;color:#333}.flickity-button:hover{background:#fff;cursor:pointer}.flickity-button:focus{outline:0;box-shadow:0 0 0 5px #19f}.flickity-button:active{opacity:.6}.flickity-button:disabled{opacity:.3;cursor:auto;pointer-events:none}.flickity-button-icon{fill:currentColor}.flickity-prev-next-button{top:50%;width:44px;height:44px;border-radius:50%;transform:translateY(-50%)}.flickity-prev-next-button.previous{left:10px}.flickity-prev-next-button.next{right:10px}.flickity-rtl .flickity-prev-next-button.previous{left:auto;right:10px}.flickity-rtl .flickity-prev-next-button.next{right:auto;left:10px}.flickity-prev-next-button .flickity-button-icon{position:absolute;left:20%;top:20%;width:60%;height:60%}.flickity-page-dots{position:absolute;width:100%;bottom:-25px;padding:0;margin:0;list-style:none;text-align:center;line-height:1}.flickity-rtl .flickity-page-dots{direction:rtl}.flickity-page-dots .dot{display:inline-block;width:10px;height:10px;margin:0 8px;background:#333;border-radius:50%;opacity:.25;cursor:pointer}.flickity-page-dots .dot.is-selected{opacity:1}
\ No newline at end of file
diff --git a/test/flickity.pkgd.min.js b/test/flickity.pkgd.min.js
deleted file mode 100644
index db7e391..0000000
--- a/test/flickity.pkgd.min.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*!
- * Flickity PACKAGED v2.2.2
- * Touch, responsive, flickable carousels
- *
- * Licensed GPLv3 for open source use
- * or Flickity Commercial License for commercial use
- *
- * https://flickity.metafizzy.co
- * Copyright 2015-2021 Metafizzy
- */
-(function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s1){t=i.modulo(t,this.slideableWidth);t-=this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};n.setTranslateX=function(t,e){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"};n.dispatchScrollEvent=function(){var t=this.slides[0];if(!t){return}var e=-this.x-t.target;var i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])};n.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};n.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};n.settle=function(t){var e=!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100);if(e){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};n.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)};n._shiftCells=function(t,e,i){for(var n=0;n0?i:0;s.wrapShift(r);e-=s.size.outerWidth}};n._unshiftCells=function(t){if(!t||!t.length){return}for(var e=0;e0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}var n=this.cells.length;for(var s=t;s0){var s=this.cells[e];if(!s){break}n.push(s);e+=i;t-=s.size.outerWidth}return n};v._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}var t=this.options.rightToLeft;var e=t?"marginRight":"marginLeft";var i=t?"marginLeft":"marginRight";var n=this.slideableWidth-this.getLastCell().size[i];var s=n1;if(!i){return t}var n=a.modulo(t,e);var s=Math.abs(n-this.selectedIndex);var r=Math.abs(n+e-this.selectedIndex);var o=Math.abs(n-e-this.selectedIndex);if(!this.isDragSelect&&r=e){this.x+=this.slideableWidth}};v.previous=function(t,e){this.select(this.selectedIndex-1,t,e)};v.next=function(t,e){this.select(this.selectedIndex+1,t,e)};v.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};v.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};v.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){var e=this.queryCell(t);if(e){this.selectCell(t,false,true);return}}var i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};v.selectCell=function(t,e,i){var n=this.queryCell(t);if(!n){return}var s=this.getCellSlideIndex(n);this.select(s,e,i)};v.getCellSlideIndex=function(t){for(var e=0;e *");return this.getCell(t)};v.getAdjacentCellElements=function(t,e){if(!t){return this.selectedSlide.getCellElements()}e=e===undefined?this.selectedIndex:e;var i=this.slides.length;if(1+t*2>=i){return this.getCellElements()}var n=[];for(var s=e-t;s<=e+t;s++){var r=this.options.wrapAround?a.modulo(s,i):s;var o=this.slides[r];if(o){n=n.concat(o.getCellElements())}}return n};v.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#.]?[\d/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};v.uiChange=function(){this.emitEvent("uiChange")};v.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};v.onresize=function(){this.watchCSS();this.resize()};a.debounceMethod(p,"onresize",150);v.resize=function(){if(!this.isActive){return}this.getSize();if(this.options.wrapAround){this.x=a.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};v.watchCSS=function(){var t=this.options.watchCSS;if(!t){return}var e=h(this.element,":after").content;if(e.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};v.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||e){return}var i=p.keyboardHandlers[t.keyCode];if(i){i.call(this)}};p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};v.focus=function(){var t=n.pageYOffset;this.element.focus({preventScroll:true});if(n.pageYOffset!=t){n.scrollTo(n.pageXOffset,t)}};v.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach(function(t){t.destroy()});this.element.removeChild(this.viewport);u(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};v.destroy=function(){this.deactivate();n.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");if(l&&this.$element){l.removeData(this.element,"flickity")}delete this.element.flickityGUID;delete f[this.guid]};a.extend(v,r);p.data=function(t){t=a.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]};a.htmlInit(p,"flickity");if(l&&l.bridget){l.bridget("flickity",p)}p.setJQuery=function(t){l=t};p.Cell=s;p.Slide=o;return p});
-/*!
- * Unipointer v2.3.0
- * base class for doing one thing with pointer event
- * MIT license
- */
-(function(e,i){if(typeof define=="function"&&define.amd){define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.Unipointer=i(e,e.EvEmitter)}})(window,function t(s,e){function i(){}function n(){}var r=n.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,true)};r.unbindStartEvent=function(t){this._bindStartEvent(t,false)};r._bindStartEvent=function(t,e){e=e===undefined?true:e;var i=e?"addEventListener":"removeEventListener";var n="mousedown";if(s.PointerEvent){n="pointerdown"}else if("ontouchstart"in s){n="touchstart"}t[i](n,this)};r.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};r.getTouch=function(t){for(var e=0;e3||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent("dragMove",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,e);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unidragger"),require("fizzy-ui-utils"))}else{n.Flickity=s(n,n.Flickity,n.Unidragger,n.fizzyUIUtils)}})(window,function t(n,e,i,a){a.extend(e.defaults,{draggable:">1",dragThreshold:3});e.createMethods.push("_createDrag");var s=e.prototype;a.extend(s,i.prototype);s._touchActionValue="pan-y";var r="createTouch"in document;var o=false;s._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable);if(r&&!o){n.addEventListener("touchmove",function(){});o=true}};s.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};s.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};s.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};s.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};s.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};s._uiChangeDrag=function(){delete this.isFreeScrolling};s.pointerDown=function(t,e){if(!this.isDraggable){this._pointerDownDefault(t,e);return}var i=this.okayPointerDown(t);if(!i){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=h();n.addEventListener("scroll",this);this._pointerDownDefault(t,e)};s._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[e])};var l={INPUT:true,TEXTAREA:true,SELECT:true};s.pointerDownFocus=function(t){var e=l[t.target.nodeName];if(!e){this.focus()}};s._pointerDownPreventDefault=function(t){var e=t.type=="touchstart";var i=t.pointerType=="touch";var n=l[t.target.nodeName];if(!e&&!i&&!n){t.preventDefault()}};s.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};s.pointerUp=function(t,e){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[e]);this._dragPointerUp(t,e)};s.pointerDone=function(){n.removeEventListener("scroll",this);delete this.pointerDownScroll};s.dragStart=function(t,e){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();n.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[e])};s.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]);this._dragMove(t,e,i)};s.dragMove=function(t,e,i){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){i.x%=this.slideableWidth}var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var r=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>r?(s+r)*.5:s;var o=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=sthis.slides[0].target&&-n1;var s=n?a.modulo(e,i):e;var r=this.slides[s];if(!r){return null}var o=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+o)};s.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var e=this.previousDragX-this.dragX;if(t>0&&e>0){return 1}else if(t<0&&e<0){return-1}return 0};s.staticClick=function(t,e){var i=this.getParentCell(t.target);var n=i&&i.element;var s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])};s.onscroll=function(){var t=h();var e=this.pointerDownScroll.x-t.x;var i=this.pointerDownScroll.y-t.y;if(Math.abs(e)>3||Math.abs(i)>3){this._pointerDone()}};function h(){return{x:n.pageXOffset,y:n.pageYOffset}}return e});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/prev-next-button",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t;this.parent=e;this._create()}o.prototype=Object.create(n.prototype);o.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button";e.className+=this.isPrevious?" previous":" next";e.setAttribute("type","button");this.disable();e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};o.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parent.element.appendChild(this.element)};o.prototype.deactivate=function(){this.parent.element.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path");var i=a(this.parent.options.arrowShape);e.setAttribute("d",i);e.setAttribute("class","arrow");if(!this.isLeft){e.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(e);return t};function a(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype.handleEvent=s.handleEvent;o.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};o.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};o.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var e=t.length?t.length-1:0;var i=this.isPrevious?0:e;var n=this.parent.selectedIndex==i?"disable":"enable";this[n]()};o.prototype.destroy=function(){this.deactivate();this.allOff()};s.extend(i.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});i.createMethods.push("_createPrevNextButtons");var l=i.prototype;l._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new o(-1,this);this.nextButton=new o(1,this);this.on("activate",this.activatePrevNextButtons)};l.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};l.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};i.PrevNextButton=o;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/page-dots",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){function r(t){this.parent=t;this._create()}r.prototype=Object.create(n.prototype);r.prototype._create=function(){this.holder=document.createElement("ol");this.holder.className="flickity-page-dots";this.dots=[];this.handleClick=this.onClick.bind(this);this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};r.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parent.element.appendChild(this.holder)};r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parent.element.removeChild(this.holder)};r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};r.prototype.addDots=function(t){var e=document.createDocumentFragment();var i=[];var n=this.dots.length;var s=n+t;for(var r=n;r=this.cells.length){return}var o=this.cells.slice(n,s+1);this.navSelectedElements=o.map(function(t){return t.element});this.changeNavSelectedClass("add")};function a(t,e,i){return(e-t)*i+t}e.changeNavSelectedClass=function(e){this.navSelectedElements.forEach(function(t){t.classList[e]("is-nav-selected")})};e.activateAsNavFor=function(){this.navCompanionSelect(true)};e.removeNavSelectedElements=function(){if(!this.navSelectedElements){return}this.changeNavSelectedClass("remove");delete this.navSelectedElements};e.onNavStaticClick=function(t,e,i,n){if(typeof n=="number"){this.navCompanion.selectCell(n)}};e.deactivateAsNavFor=function(){this.removeNavSelectedElements()};e.destroyAsNavFor=function(){if(!this.navCompanion){return}this.navCompanion.off("select",this.onNavCompanionSelect);this.off("staticClick",this.onNavStaticClick);delete this.navCompanion};return n});
-/*!
- * imagesLoaded v4.1.4
- * JavaScript is all like "You images are done yet or what?"
- * MIT License
- */
-(function(e,i){"use strict";if(typeof define=="function"&&define.amd){define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.imagesLoaded=i(e,e.EvEmitter)}})(typeof window!=="undefined"?window:this,function t(e,i){var s=e.jQuery;var r=e.console;function o(t,e){for(var i in e){t[i]=e[i]}return t}var n=Array.prototype.slice;function a(t){if(Array.isArray(t)){return t}var e=typeof t=="object"&&typeof t.length=="number";if(e){return n.call(t)}return[t]}function l(t,e,i){if(!(this instanceof l)){return new l(t,e,i)}var n=t;if(typeof t=="string"){n=document.querySelectorAll(t)}if(!n){r.error("Bad element for imagesLoaded "+(n||t));return}this.elements=a(n);this.options=o({},this.options);if(typeof e=="function"){i=e}else{o(this.options,e)}if(i){this.on("always",i)}this.getImages();if(s){this.jqDeferred=new s.Deferred}setTimeout(this.check.bind(this))}l.prototype=Object.create(i.prototype);l.prototype.options={};l.prototype.getImages=function(){this.images=[];this.elements.forEach(this.addElementImages,this)};l.prototype.addElementImages=function(t){if(t.nodeName=="IMG"){this.addImage(t)}if(this.options.background===true){this.addElementBackgroundImages(t)}var e=t.nodeType;if(!e||!h[e]){return}var i=t.querySelectorAll("img");for(var n=0;n
-
-
-
-
- Flickity responsive v1.1.1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Resize to see the change
-
-
-
-
-
-
\ No newline at end of file
diff --git a/test/jquery.min.js b/test/jquery.min.js
deleted file mode 100644
index c4c6022..0000000
--- a/test/jquery.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
-!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 div {
- padding-top:130%;
-}
-
-@media only screen and (max-width:1024px) {
- .slide {
- width:70%;
- max-width:400px;
- }
-}
-
-#github {
- position:absolute;
- top:0;
- right:0;
- display:block;
-}
-#github img {
- width:60px;
-}