diff --git a/.github/workflows/blueprint.yml b/.github/workflows/blueprint.yml index 8c38ee74..aeb9c1c3 100644 --- a/.github/workflows/blueprint.yml +++ b/.github/workflows/blueprint.yml @@ -53,8 +53,7 @@ jobs: - name: Build Verso Documentation run: | - cd verso - ./build_manual.sh + ./build_all.sh - name: Compile blueprint and documentation uses: leanprover-community/docgen-action@deed0cdc44dd8e5de07a300773eb751d33e32fc8 # 2025-10-26 diff --git a/.gitignore b/.gitignore index 2e362158..464a2bf5 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,9 @@ blueprint/src/web.pdf *.synctex.gz(busy) *.pdfsync ## Verso -/verso/.lake/ -/verso/html/ -/home_page/verso +/tutorial/.lake/ +/tutorial/html/ +/website/.lake/ +/website/_site/ +/website/html/ +/home_page/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25cf34f0..079dcadf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ Fork the repository and create a new branch for your contribution. Make your cha ## What to contribute -See the [Roadmap](ROADMAP.md). +See the [Roadmap](https://remydegenne.github.io/lean-bandits/roadmap). #### Finding tasks diff --git a/LeanMachineLearning/SequentialLearning/Algorithm.lean b/LeanMachineLearning/SequentialLearning/Algorithm.lean index e813da49..ca9717a9 100644 --- a/LeanMachineLearning/SequentialLearning/Algorithm.lean +++ b/LeanMachineLearning/SequentialLearning/Algorithm.lean @@ -10,6 +10,19 @@ public import LeanMachineLearning.ForMathlib.Traj /-! # Algorithms + +## Main definitions + +* `Algorithm α R`: a stochastic, sequential algorithm. +* `Environment α R`: a stochastic environment. +* `IsAlgEnvSeq A R' alg env P`: an algorithm-environment sequence. TODO +* `IsAlgEnvSeqUntil A R' alg env P N`: an algorithm-environment sequence until time `N`. TODO + +## Main statements + +* `isAlgEnvSeq_unique`: the law of the sequence of actions and observations generated by an + algorithm-environment pair is unique: it does not depend on the probability space used. + -/ @[expose] public section diff --git a/LeanMachineLearning/SequentialLearning/Deterministic.lean b/LeanMachineLearning/SequentialLearning/Deterministic.lean index 78fc3532..5ca311c0 100644 --- a/LeanMachineLearning/SequentialLearning/Deterministic.lean +++ b/LeanMachineLearning/SequentialLearning/Deterministic.lean @@ -9,6 +9,16 @@ public import LeanMachineLearning.SequentialLearning.IonescuTulceaSpace /-! # Deterministic algorithms + +A deterministic algorithm chooses its action in a deterministic way. That is, that action is given +by a measurable function of the history and not by a Markov kernel. + +## Main definitions + +* `detAlgorithm nextAction h_next action0`: a deterministic algorithm that chooses its action + according to the measurable function `nextAction` (with proof of measurability `h_next`), + with initial action `action0`. + -/ @[expose] public section diff --git a/README.md b/README.md index 86a2f350..9bf2cd95 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Please see our [contribution guide](CONTRIBUTING.md) and [code of conduct](CODE_ For discussions, you can reach out to us on the [Lean prover Zulip chat](https://leanprover.zulipchat.com/). +You can also see the [roadmap](https://remydegenne.github.io/lean-bandits/roadmap) for ideas on what to work on. + ## Current state of the library As a first proof of concept, the repository contains a formalization of regret bounds for several stochastic bandit algorithms. diff --git a/ROADMAP.md b/ROADMAP.md deleted file mode 100644 index 437766dd..00000000 --- a/ROADMAP.md +++ /dev/null @@ -1 +0,0 @@ -# Roadmap diff --git a/build_all.sh b/build_all.sh new file mode 100755 index 00000000..6520f3bf --- /dev/null +++ b/build_all.sh @@ -0,0 +1,25 @@ +set -x -e + +# Build tutorial +cd tutorial +lake build +rm -rf html _out +lake exe manual +mkdir html +mv _out/html-multi/* html/ +rm -rf _out +mkdir -p html/static +cp static_files/* html/static +cd .. + +# Build website +cd website +lake build +rm -rf _site +lake exe generate-site +cd .. + +# Copy outputs to home_page +mkdir -p home_page/tutorial +cp -r tutorial/html/* home_page/tutorial +cp -r website/_site/* home_page/ diff --git a/home_page/404.html b/home_page/404.html deleted file mode 100644 index fcebf3fc..00000000 --- a/home_page/404.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -permalink: /404.html -layout: default ---- - - - -
-

404

- -

Page not found :(

-

The requested page could not be found.

-
\ No newline at end of file diff --git a/home_page/Gemfile b/home_page/Gemfile deleted file mode 100644 index 78763738..00000000 --- a/home_page/Gemfile +++ /dev/null @@ -1,25 +0,0 @@ -source "https://rubygems.org" - -# To upgrade, run `bundle update github-pages`. -gem "github-pages", group: :jekyll_plugins -# If you have any plugins, put them here! -group :jekyll_plugins do - #gem "jekyll-feed", "~> 0.12" -end - -# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem -# and associated library. -platforms :mingw, :x64_mingw, :mswin, :jruby do - gem "tzinfo", "~> 1.2" - gem "tzinfo-data" -end - -# Performance-booster for watching directories on Windows. -gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] - -# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem -# do not have a Java counterpart. -gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby] - -# Used for locally serving the website. -gem "webrick", "~> 1.7" \ No newline at end of file diff --git a/home_page/Gemfile.lock b/home_page/Gemfile.lock deleted file mode 100644 index 5436ad6b..00000000 --- a/home_page/Gemfile.lock +++ /dev/null @@ -1,287 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (6.0.5) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.11.1) - colorator (1.1.0) - commonmarker (0.23.4) - concurrent-ruby (1.1.10) - dnsruby (1.61.9) - simpleidn (~> 0.1) - em-websocket (0.5.3) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0) - ethon (0.15.0) - ffi (>= 1.15.0) - eventmachine (1.2.7) - execjs (2.8.1) - faraday (1.10.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.3) - multipart-post (>= 1.2, < 3) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - ffi (1.15.5) - forwardable-extended (2.6.0) - gemoji (3.0.1) - github-pages (226) - github-pages-health-check (= 1.17.9) - jekyll (= 3.9.2) - jekyll-avatar (= 0.7.0) - jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.2.0) - jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.15.1) - jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.13.0) - jekyll-include-cache (= 0.2.1) - jekyll-mentions (= 1.6.0) - jekyll-optional-front-matter (= 0.3.2) - jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.3.0) - jekyll-redirect-from (= 0.16.0) - jekyll-relative-links (= 0.6.1) - jekyll-remote-theme (= 0.4.3) - jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.8.0) - jekyll-sitemap (= 1.4.0) - jekyll-swiss (= 1.0.0) - jekyll-theme-architect (= 0.2.0) - jekyll-theme-cayman (= 0.2.0) - jekyll-theme-dinky (= 0.2.0) - jekyll-theme-hacker (= 0.2.0) - jekyll-theme-leap-day (= 0.2.0) - jekyll-theme-merlot (= 0.2.0) - jekyll-theme-midnight (= 0.2.0) - jekyll-theme-minimal (= 0.2.0) - jekyll-theme-modernist (= 0.2.0) - jekyll-theme-primer (= 0.6.0) - jekyll-theme-slate (= 0.2.0) - jekyll-theme-tactile (= 0.2.0) - jekyll-theme-time-machine (= 0.2.0) - jekyll-titles-from-headings (= 0.5.3) - jemoji (= 0.12.0) - kramdown (= 2.3.2) - kramdown-parser-gfm (= 1.1.0) - liquid (= 4.0.3) - mercenary (~> 0.3) - minima (= 2.5.1) - nokogiri (>= 1.13.4, < 2.0) - rouge (= 3.26.0) - terminal-table (~> 1.4) - github-pages-health-check (1.17.9) - addressable (~> 2.3) - dnsruby (~> 1.60) - octokit (~> 4.0) - public_suffix (>= 3.0, < 5.0) - typhoeus (~> 1.3) - html-pipeline (2.14.1) - activesupport (>= 2) - nokogiri (>= 1.4) - http_parser.rb (0.8.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jekyll (3.9.2) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (~> 0.7) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (>= 1.17, < 3) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - jekyll-avatar (0.7.0) - jekyll (>= 3.0, < 5.0) - jekyll-coffeescript (1.1.1) - coffee-script (~> 2.2) - coffee-script-source (~> 1.11.1) - jekyll-commonmark (1.4.0) - commonmarker (~> 0.22) - jekyll-commonmark-ghpages (0.2.0) - commonmarker (~> 0.23.4) - jekyll (~> 3.9.0) - jekyll-commonmark (~> 1.4.0) - rouge (>= 2.0, < 4.0) - jekyll-default-layout (0.1.4) - jekyll (~> 3.0) - jekyll-feed (0.15.1) - jekyll (>= 3.7, < 5.0) - jekyll-gist (1.5.0) - octokit (~> 4.2) - jekyll-github-metadata (2.13.0) - jekyll (>= 3.4, < 5.0) - octokit (~> 4.0, != 4.4.0) - jekyll-include-cache (0.2.1) - jekyll (>= 3.7, < 5.0) - jekyll-mentions (1.6.0) - html-pipeline (~> 2.3) - jekyll (>= 3.7, < 5.0) - jekyll-optional-front-matter (0.3.2) - jekyll (>= 3.0, < 5.0) - jekyll-paginate (1.1.0) - jekyll-readme-index (0.3.0) - jekyll (>= 3.0, < 5.0) - jekyll-redirect-from (0.16.0) - jekyll (>= 3.3, < 5.0) - jekyll-relative-links (0.6.1) - jekyll (>= 3.3, < 5.0) - jekyll-remote-theme (0.4.3) - addressable (~> 2.0) - jekyll (>= 3.5, < 5.0) - jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) - rubyzip (>= 1.3.0, < 3.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-seo-tag (2.8.0) - jekyll (>= 3.8, < 5.0) - jekyll-sitemap (1.4.0) - jekyll (>= 3.7, < 5.0) - jekyll-swiss (1.0.0) - jekyll-theme-architect (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-cayman (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-dinky (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-hacker (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-leap-day (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-merlot (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-midnight (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-minimal (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-modernist (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-primer (0.6.0) - jekyll (> 3.5, < 5.0) - jekyll-github-metadata (~> 2.9) - jekyll-seo-tag (~> 2.0) - jekyll-theme-slate (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-tactile (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-theme-time-machine (0.2.0) - jekyll (> 3.5, < 5.0) - jekyll-seo-tag (~> 2.0) - jekyll-titles-from-headings (0.5.3) - jekyll (>= 3.3, < 5.0) - jekyll-watch (2.2.1) - listen (~> 3.0) - jemoji (0.12.0) - gemoji (~> 3.0) - html-pipeline (~> 2.2) - jekyll (>= 3.0, < 5.0) - kramdown (2.3.2) - rexml - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - minima (2.5.1) - jekyll (>= 3.5, < 5.0) - jekyll-feed (~> 0.9) - jekyll-seo-tag (~> 2.1) - minitest (5.15.0) - multipart-post (2.1.1) - nokogiri (1.13.6-x86_64-linux) - racc (~> 1.4) - octokit (4.22.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (4.0.7) - racc (1.6.0) - rb-fsevent (0.11.1) - rb-inotify (0.10.1) - ffi (~> 1.0) - rexml (3.2.5) - rouge (3.26.0) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) - safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - simpleidn (0.2.1) - unf (~> 0.1.4) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) - typhoeus (1.4.0) - ethon (>= 0.9.0) - tzinfo (1.2.9) - thread_safe (~> 0.1) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.1) - unicode-display_width (1.8.0) - webrick (1.7.0) - zeitwerk (2.5.4) - -PLATFORMS - x86_64-linux - -DEPENDENCIES - github-pages - http_parser.rb (~> 0.6.0) - tzinfo (~> 1.2) - tzinfo-data - wdm (~> 0.1.1) - webrick (~> 1.7) - -BUNDLED WITH - 2.3.14 \ No newline at end of file diff --git a/home_page/_config.yml b/home_page/_config.yml deleted file mode 100644 index fe31b78c..00000000 --- a/home_page/_config.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Welcome to Jekyll! -# -# This config file is meant for settings that affect your whole blog, values -# which you are expected to set up once and rarely edit after that. If you find -# yourself editing this file very often, consider using Jekyll's data files -# feature for the data you need to update frequently. -# -# For technical reasons, this file is *NOT* reloaded automatically when you use -# 'bundle exec jekyll serve'. If you change this file, please restart the server process. -# -# If you need help with YAML syntax, here are some quick references for you: -# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml -# https://learnxinyminutes.com/docs/yaml/ -# -# Site settings -# These are used to personalize your new site. If you look in the HTML files, -# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. -# You can create any custom variable you would like, and they will be accessible -# in the templates via {{ site.myvariable }}. - -title: Lean Machine Learning -#email: your-email@example.com -description: A Lean formalization of machine learning algorithms by Remy Degenne and Paulo Rauber -baseurl: "" # the subpath of your site, e.g. /blog -url: "https://RemyDegenne.github.io/lean-bandits" # the base hostname & protocol for your site, e.g. http://example.com -twitter_username: -github_username: RemyDegenne -repository: RemyDegenne/lean-bandits - -# Build settings -remote_theme: pages-themes/cayman@v0.2.0 -plugins: - - jekyll-remote-theme - - jekyll-github-metadata diff --git a/home_page/_include/mathjax.html b/home_page/_include/mathjax.html deleted file mode 100644 index ab9c0075..00000000 --- a/home_page/_include/mathjax.html +++ /dev/null @@ -1,17 +0,0 @@ - -{% if page.usemathjax %} - - - - -{% endif %} \ No newline at end of file diff --git a/home_page/_layouts/default.html b/home_page/_layouts/default.html deleted file mode 100644 index 702ad836..00000000 --- a/home_page/_layouts/default.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - {% seo %} - - - - - - {% if jekyll.environment == "production" %} - - {% else %} - - {% endif %} - {% include head-custom.html %} - - - - Skip to the content. - - - -
- {{ content }} - - -
- - - diff --git a/home_page/assets/css/style.scss b/home_page/assets/css/style.scss deleted file mode 100644 index 312da210..00000000 --- a/home_page/assets/css/style.scss +++ /dev/null @@ -1,9 +0,0 @@ ---- ---- - -/* In this file you can add css rules overriding rules defined by your Jekyll theme. */ - -/* Import the CSS from the specified theme */ -@import "{{ site.theme }}"; - -/* Put your rules below this line */ \ No newline at end of file diff --git a/home_page/index.md b/home_page/index.md deleted file mode 100644 index 4b1356a8..00000000 --- a/home_page/index.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -# Feel free to add content and custom Front Matter to this file. -# To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults - -# layout: home -usemathjax: true ---- - -Machine learning algorithms and theorems, in Lean. - -Useful links: - -* [Tutorials]({{ site.url }}/verso/): pages that explain how to use the library. -* [Documentation]({{ site.url }}/docs/): documentation of every declaration in the Lean code. -* [Blueprint]({{ site.url }}/blueprint/): a latex document describing the content of the repository, served as html, with links to the code. -* [Blueprint as pdf]({{ site.url }}/blueprint.pdf): the same document as a pdf -* [Dependency graph]({{ site.url }}/blueprint/dep_graph_document.html): a graph of all definitions and theorems in the project, showing their dependencies -* [Zulip chat for Lean](https://leanprover.zulipchat.com/): the Lean community chat room. Ask any general Lean or Mathlib question there! diff --git a/verso/Manual.lean b/tutorial/Manual.lean similarity index 100% rename from verso/Manual.lean rename to tutorial/Manual.lean diff --git a/verso/Manual/Front.lean b/tutorial/Manual/Front.lean similarity index 73% rename from verso/Manual/Front.lean rename to tutorial/Manual/Front.lean index d6ab8160..fd391f89 100644 --- a/verso/Manual/Front.lean +++ b/tutorial/Manual/Front.lean @@ -1,3 +1,4 @@ +import Manual.Pages.Installation import Manual.Pages.DefiningAlgorithm import VersoManual @@ -15,6 +16,8 @@ authors := ["Rémy Degenne, Paulo Rauber"] shortTitle := "Lean Machine Learning" %%% -*Tutorials* +These tutorial pages will guide you through using the Lean Machine Learning library. + +{include 0 Manual.Pages.Installation} {include 0 Manual.Pages.DefiningAlgorithm} diff --git a/verso/Manual/Pages/DefiningAlgorithm.lean b/tutorial/Manual/Pages/DefiningAlgorithm.lean similarity index 97% rename from verso/Manual/Pages/DefiningAlgorithm.lean rename to tutorial/Manual/Pages/DefiningAlgorithm.lean index b3be63a9..9dba638f 100644 --- a/verso/Manual/Pages/DefiningAlgorithm.lean +++ b/tutorial/Manual/Pages/DefiningAlgorithm.lean @@ -169,11 +169,15 @@ The last argument `⟨0, hK⟩` is the first action of the algorithm, which is 0 ## A theorem about UCB We can now state a theorem about the regret of UCB in a stochastic bandit environment (which we won't prove here). +Let's first define the regret, which for stochastic bandits is the difference between the mean rewar that the algorithm would have obtained if it played always the best action, and the sum of mean rewards of the actions played. ```anchor regret (module := LeanMachineLearning.Bandit.Regret) def regret (ν : Kernel α ℝ) (A : ℕ → Ω → α) (t : ℕ) (ω : Ω) : ℝ := t * (⨆ a, (ν a)[id]) - ∑ s ∈ range t, (ν (A s ω))[id] ``` +The quantity `(ν a)[id]` is the mean reward of action `a` in the environment defined by `ν`. + +We can now state the regret bound for UCB. ```anchor UCB.regret_le (module := LeanMachineLearning.BanditAlgorithms.UCB) lemma regret_le [Nonempty (Fin K)] diff --git a/tutorial/Manual/Pages/Installation.lean b/tutorial/Manual/Pages/Installation.lean new file mode 100644 index 00000000..fb2b8634 --- /dev/null +++ b/tutorial/Manual/Pages/Installation.lean @@ -0,0 +1,63 @@ +import VersoManual + +open Verso.Genre Manual + +#doc (Manual) "Installation and Setup" => +%%% +htmlSplit := .never +%%% + +This tutorial guides you through installing Lean and setting up the Lean Machine Learning library. + +# Installing Lean + +Before using the Lean Machine Learning library, you need to install Lean. + +Follow the official installation instructions at [https://lean-lang.org/install/](https://lean-lang.org/install/). + +The recommended installation process will set up VS Code with the Lean extension. + +# Installing the Lean Machine Learning library + +There are two ways to get the library depending on your needs: +1. *Clone the repository*: if you want to explore the source code and experiment with modifications of the library, clone the GitHub repository +2. *Use as a dependency*: if you want to use the library in your own Lean project, you can add it as a dependency in your `lakefile.toml` (instructions below) + +## Cloning the Repository + +Move to a directory where you want to store the library, then run: + +``` +git clone https://github.com/remydegenne/lean-bandits.git +cd lean-bandits +``` +This will create a local copy of the repository on your machine and move to the project directory. +We then need to buid the project. +``` +lake exe cache get +lake build +``` +The `lake exe cache get` will get the precompiled Mathlib cache, which significantly speeds up the build process. The `lake build` command will then compile the library and all its dependencies. + +Note that if you want to contribute to the library, you should fork the repository and clone your fork instead of the main repository. + +## Using as a Dependency + +To use the library in your own Lean project (see the Lean installation instructions for how to create a project), add it as a dependency in your `lakefile.toml`: + +``` +[[require]] +name = "LeanMachineLearning" +git = "https://github.com/leanprover/lean-bandits" +``` + +# Testing the installation + +Create a new Lean file in your project and add the following code: +``` +import LeanMachineLearning + +#check Learning.Algorithm +``` + +If you don't see any errors, then the library is correctly installed and you can start using it in your own projects! diff --git a/verso/lake-manifest.json b/tutorial/lake-manifest.json similarity index 100% rename from verso/lake-manifest.json rename to tutorial/lake-manifest.json diff --git a/verso/lakefile.toml b/tutorial/lakefile.toml similarity index 100% rename from verso/lakefile.toml rename to tutorial/lakefile.toml diff --git a/verso/lean-toolchain b/tutorial/lean-toolchain similarity index 100% rename from verso/lean-toolchain rename to tutorial/lean-toolchain diff --git a/verso/static_files/LigaMenlo-Regular.ttf b/tutorial/static_files/LigaMenlo-Regular.ttf similarity index 100% rename from verso/static_files/LigaMenlo-Regular.ttf rename to tutorial/static_files/LigaMenlo-Regular.ttf diff --git a/tutorial/static_files/favicon.svg b/tutorial/static_files/favicon.svg new file mode 100644 index 00000000..ea497ae3 --- /dev/null +++ b/tutorial/static_files/favicon.svg @@ -0,0 +1 @@ +RealFaviconGeneratorhttps://realfavicongenerator.net \ No newline at end of file diff --git a/verso/static_files/scripts.js b/tutorial/static_files/scripts.js similarity index 100% rename from verso/static_files/scripts.js rename to tutorial/static_files/scripts.js diff --git a/verso/static_files/style.css b/tutorial/static_files/style.css similarity index 88% rename from verso/static_files/style.css rename to tutorial/static_files/style.css index 28b8f641..b329089b 100644 --- a/verso/static_files/style.css +++ b/tutorial/static_files/style.css @@ -1,8 +1,8 @@ :root { - --accent: #657ed4; - --accent-compl: #d4bb65; - --background: #eef0f2; - --background-lighter: #fafafa; + --accent: #d65d5d; + --accent-compl: #e8a0a0; + --background: #fef9f9; + --background-lighter: #fefcfc; } @font-face { @@ -54,4 +54,4 @@ p a:hover { code { font-family: "LigaMenlo"; font-variant-ligatures: normal; -} \ No newline at end of file +} diff --git a/verso/build_manual.sh b/verso/build_manual.sh deleted file mode 100755 index a2a94d75..00000000 --- a/verso/build_manual.sh +++ /dev/null @@ -1,14 +0,0 @@ -set -x -e - -lake build -rm -rf html _out -lake exe manual -mkdir html -mv _out/html-multi/* html/ -rm -rf _out -mkdir -p html/static -cp static_files/* html/static - -cd .. -mkdir -p home_page/verso -cp -r verso/html/* home_page/verso diff --git a/verso/static_files/favicon.svg b/verso/static_files/favicon.svg deleted file mode 100644 index 076857cf..00000000 --- a/verso/static_files/favicon.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - \ No newline at end of file diff --git a/website/LICENSE b/website/LICENSE new file mode 100644 index 00000000..813da297 --- /dev/null +++ b/website/LICENSE @@ -0,0 +1,71 @@ +Apache License 2.0 (Apache) +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +1. You must give any other recipients of the Work or Derivative Works a copy of this License; and + +2. You must cause any modified files to carry prominent notices stating that You changed the files; and + +3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + diff --git a/website/Main.lean b/website/Main.lean new file mode 100644 index 00000000..18864a74 --- /dev/null +++ b/website/Main.lean @@ -0,0 +1,105 @@ +/- +Copyright (c) 2026 Lean FRO, LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: David Thrane Christiansen +-/ +import VersoBlog + +import Site + +section +open Verso Genre Blog Site Syntax + +open Output Html Template Theme in +def theme : Theme := { Theme.default with + primaryTemplate := do + return {{ + + + + + "Lean Machine Learning — Formalized ML Theory" + + + + + + {{← builtinHeader }} + + + + + +
+ +
+
+ {{← param "content" }} +
+ + + + + + }} + } + +def versoSite : Site := site Site.FrontPage / + "roadmap" Site.Roadmap + static "static" ← "static_files" + +def main (args : List String) : IO UInt32 := do + blogMain theme versoSite (options := args) diff --git a/website/README.md b/website/README.md new file mode 100644 index 00000000..5a0305a7 --- /dev/null +++ b/website/README.md @@ -0,0 +1,56 @@ +# Verso Website + +The website for [Verso](https://github.com/leanprover/verso), built +using Verso itself. The main page content is in +[`Site/FrontPage.lean`](Site/FrontPage.lean) and the HTML theme is +defined in [`Main.lean`](Main.lean). + +## Building + +Requires [elan](https://github.com/leanprover/elan) (the Lean version +manager). + +```sh +lake build +``` + +## Generating HTML + +```sh +lake exe generate-site +``` + +The output is written to `_site/`. Serve it with a local web server to +view correctly: + +```sh +cd _site && python3 -m http.server +``` + +## Deployment + +Pushing to `main` automatically triggers a deployment of the website. + +## Development + +### Formatting + +This project uses [Prettier](https://prettier.io/) for formatting CSS, +Markdown, and YAML files. + +```sh +npm install +npx prettier --check . +npx prettier --write . # to auto-fix +``` + +### Conventions + +- All `.lean` files must start with a copyright header +- PR titles must follow the commit convention: `: ` + - Allowed types: `feat`, `fix`, `doc`, `style`, `refactor`, + `test`, `chore`, `perf` + +## License + +Apache 2.0 — see [LICENSE](LICENSE). diff --git a/website/Site.lean b/website/Site.lean new file mode 100644 index 00000000..b6c8a06d --- /dev/null +++ b/website/Site.lean @@ -0,0 +1,8 @@ +/- +Copyright (c) 2026 Lean FRO, LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: David Thrane Christiansen +-/ +import Site.FrontPage +import Site.Roadmap +import Site.Meta diff --git a/website/Site/FrontPage.lean b/website/Site/FrontPage.lean new file mode 100644 index 00000000..8fcee367 --- /dev/null +++ b/website/Site/FrontPage.lean @@ -0,0 +1,235 @@ +/- +Copyright (c) 2026 Lean FRO, LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: David Thrane Christiansen +-/ +import VersoBlog +import Site.Meta + +open Verso Genre +open Blog hiding lean +open Site + +#doc (Page) "Lean Machine Learning" => + +::::::htmlDiv (class := "hero") + +:::::htmlDiv (class := "hero-text") + +Lean Machine Learning + +The Lean library for machine learning research + +Lean Machine Learning is a carefully curated library of formalized definitions and theorems in machine learning theory, verified in [Lean](https://lean-lang.org). It provides a trusted foundation for researchers to explore and formalize machine learning algorithms with mathematical rigor. + +::::html a (class := "hero-btn primary") (href := "https://github.com/remydegenne/lean-bandits") +:::html img (src := "/static/arrow.svg") (alt := "") (width := "20") (height := "20") +::: +Get Started +:::: + +::::html a (class := "hero-btn secondary") (href := "tutorial") +:::html img (src := "/static/book.svg") (alt := "") (width := "20") (height := "20") +::: +Tutorials +:::: + +::::html a (class := "hero-btn secondary") (href := "docs") +:::html img (src := "/static/book.svg") (alt := "") (width := "20") (height := "20") +::: +Documentation +:::: + +::::: + +:::::: + +:::::html div (class := "pillars") (id := "about") + +::::htmlDiv (class := "pillar") + +*Rigorous Formalization* + +A library of high quality, human-checked, general definitions of machine learning concepts and the main theorems about them. We develop a carefully curated common vocabulary for researchers and AI systems to build on. + +:::: + +::::htmlDiv (class := "pillar") + +*Algorithms* + +Built for machine learning researchers. The library provides a framework for formalizing new algorithms and proving theoretical guarantees. It also provides executable implementations of machine learning algorithms, connected to formal specifications. + +:::: + +::::htmlDiv (class := "pillar") + +*Community-Driven* + +Open source and collaborative. The library is built on top of Mathlib and we contribute to it. +We welcome contributions of new algorithms, theorems, and improvements. Join discussions on Zulip or contribute on GitHub. + +:::: + +::::: + +::::::html div (class := "builds") (id := "goals") + +*Goals & Features* + +Lean Machine Learning is building a comprehensive foundation for formalized machine learning theory. The library provides high-quality formalizations, essential theorems, and a trusted framework for machine learning research. +You proved that your new algorithm converges at the optimal rate and your LLM formalized the proof. +Lean checked the proof. But who checked the Lean definition of optimal rate? We did. Since your LLM is using a Lean Machine Learning definition, you can trust it proved the right thing. + +:::::htmlDiv (class := "build-cards") + +::::htmlDiv (class := "build-card") + +*Formalized Definitions* + +Rigorous definitions of machine learning concepts: algorithms, performance measures, etc. A common vocabulary for researchers and AI systems to build on. + +:::: + +::::htmlDiv (class := "build-card") + +*Proven Theorems* + +Essential theorems in machine learning theory. Convergence guarantees, regret bounds, and foundational results in probability theory and optimization. + +:::: + +::::htmlDiv (class := "build-card") + +*AI-Ready* + +A common vocabulary of formal definitions that can be used by AI systems to generate theorems about objects we care about and avoid misformalization errors. + +:::: + +::::htmlDiv (class := "build-card") + +*Algorithmic Tools* + +A framework for defining and analyzing stochastic algorithms in Lean, and to connect formal specifications with executable implementations. + +:::: + +::::htmlDiv (class := "build-card") + +*Documentation* + +Comprehensive documentation with examples and tutorials to guide users through the library and its applications. + +:::: + +::::htmlDiv (class := "build-card") + +*Collaborative* + +Open source, collaborative, and integrated in the Lean ecosystem. +We welcome contributions from the community. +We build on top of Mathlib and contribute to it in return. + +:::: + +::::: + +:::::: + +::::::html div (id := "get-started") (class := "get-started") + +*Get Started* + +Learn more about Lean Machine Learning with the tutorials and documentation, or head over to GitHub to explore the code and contribute to the project. + +:::::htmlDiv (class := "cta-buttons") + +::::html a (class := "cta-btn primary") (href := "https://github.com/remydegenne/lean-bandits") +:::html img (src := "/static/arrow.svg") (alt := "") (width := "20") (height := "20") +::: +View on GitHub +:::: + +::::html a (class := "cta-btn secondary") (href := "tutorial") +:::html img (src := "/static/book.svg") (alt := "") (width := "20") (height := "20") +::: +Tutorials +:::: + +::::html a (class := "cta-btn secondary") (href := "docs") +:::html img (src := "/static/book.svg") (alt := "") (width := "20") (height := "20") +::: +Documentation +:::: + +::::html a (class := "cta-btn secondary") (href := "roadmap") +:::html img (src := "/static/book.svg") (alt := "") (width := "20") (height := "20") +::: +Roadmap +:::: + +::::html a (class := "cta-btn secondary") (href := "https://leanprover.zulipchat.com/") +:::html img (src := "/static/zulip.svg") (alt := "") (width := "20") (height := "20") +::: +Join Zulip +:::: + +::::: + +:::::: + +:::::::html div (class := "sponsors") (id := "sponsors") + +*Sponsors and Partners* + +We are grateful for the support of the following organizations. + +::::::htmlDiv (class := "sponsor-cards") + +:::::htmlDiv (class := "sponsor-card") +::::html a (href := "https://www.inria.fr/") +:::html img (src := "/static/Inria_logo_RGB.png") (alt := "Inria") +::: +:::: +Inria FORMAL exploratory action +::::: + +:::::: + +If you are interested in supporting Lean Machine Learning financially please reach out to Rémy Degenne at `remy [dot] degenne [at] inria [dot] fr` or on the Lean Zulip (preferred). + +::::::: + + +::::::html div (class := "showcase") (id := "maintainers") + +*Maintainers* + +:::::htmlDiv (class := "showcase-cards") + +::::htmlDiv (class := "showcase-card reference") + +[*Rémy Degenne*](https://remydegenne.github.io/) + +Inria centre at the University of Lille + +:::html img (src := "https://remydegenne.github.io/images/avatar2.jpg") (alt := "Rémy Degenne") (style := "border-radius: 50%; width: 150px; height: 150px; object-fit: cover;") +::: + +:::: + +::::htmlDiv (class := "showcase-card reference") + +[*Paulo Rauber*](https://www.paulorauber.com/) + +Queen Mary University of London + +:::html img (src := "https://www.paulorauber.com/files/images/profile.jpg") (alt := "Paulo Rauber") (style := "border-radius: 50%; width: 150px; height: 150px; object-fit: cover;") +::: + +:::: + +::::: + +:::::: diff --git a/website/Site/Meta.lean b/website/Site/Meta.lean new file mode 100644 index 00000000..d32a4a22 --- /dev/null +++ b/website/Site/Meta.lean @@ -0,0 +1,36 @@ +/- +Copyright (c) 2026 Lean FRO, LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: David Thrane Christiansen +-/ +import VersoBlog + +open Verso Genre Blog Site Output Html Template Theme + +open Verso Doc Elab +open Lean + +structure LightboxArgs where + alt : String + thumb : String + full : String + +section +open ArgParse +variable [Monad m] [MonadError m] +instance : FromArgs LightboxArgs m where + fromArgs := LightboxArgs.mk <$> + .named `alt .string false "Alt text" <*> + .named `thumb .string false "Thumbnail URL" <*> + .named `full .string false "Full URL" +end + +open Verso Output Html in +inline_component Inline.lightbox (alt thumb full : String) where + toHtml _ _ _ _ := do + return {{{{alt}}/}} + +@[role] +def lightbox : RoleExpanderOf LightboxArgs + | { alt, thumb, full }, _ => + ``(Inline.lightbox $(quote alt) $(quote thumb) $(quote full) #[]) diff --git a/website/Site/Roadmap.lean b/website/Site/Roadmap.lean new file mode 100644 index 00000000..467f09d5 --- /dev/null +++ b/website/Site/Roadmap.lean @@ -0,0 +1,104 @@ +/- +Copyright (c) 2026 Lean FRO, LLC. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Rémy Degenne +-/ +import VersoBlog +import Site.Meta + +open Verso Genre +open Blog hiding lean +open Site + +#doc (Page) "Roadmap" => + +::::::html div (class := "roadmap-page") + +:::::html div (class := "roadmap-header") + +*Roadmap* + +The development plan for Lean Machine Learning + +::::: + +:::::html div (class := "roadmap-section") + +*Vision* + +Lean Machine Learning provides a comprehensive library of formalized definitions and theorems in machine learning theory. +It is a trusted foundation for formalization of machine learning research. +As algorithms are central to machine learning, it provides tools to define and analyze stochastic algorithms in Lean, and to connect formal specifications with executable implementations. + + +::::html div (class := "roadmap-subsection") + +*Key Features* + +- High quality, human-checked, general definitions of machine learning concepts +- Tools to prove theoretical properties of machine learning algorithms +- Executable implementations of machine learning algorithms, connected to formal specifications +- Extensive documentation and tutorials to guide users through the library and its applications + +:::: + +::::html div (class := "roadmap-subsection") + +*Impact and beneficiaries* + +- Researchers can formalize their new results, since the required concepts are available in the library +- AI agents can prove new results or check papers without the risk of using an incorrectly formalized definition +- Students and researchers can access and search a large and trusted knowledge base about machine learning + +:::: + +::::: + +:::::html div (class := "roadmap-section") + +*Roadmap* + +We are currently in the early stages of development, with the core framework for defining and analyzing stochastic algorithms in place, as well as initial results about bandit algorithms. +Since the project is open and collaborative, the direction we will take for the extension of the library of theoretical results will be guided by the needs of the contributors, but we aim to cover a broad range of topics in machine learning theory and algorithms. + + +::::html div (class := "roadmap-subsection") + +*Year 1* + +- Library - theoretical foundations: concentration inequalities, decision theory, information theory related to testing +- Library - online learning: bandits, prediction with expert advice, online convex optimization +- Executable algorithms: define a probabilistic monad with do-notation, test it on the existing bandit algorithms, and connect it to the formal specifications of the algorithms +- Documentation: comprehensive documentation of the existing algorithm framework and bandit results, and tutorials to get started with the library +- AI readiness: demonstration of an AI formalization of a bandit or online learning paper using the library + +:::: + + +::::html div (class := "roadmap-subsection") + +*Year 2* + +- Library - statistical learning theory: PAC learning, Rademacher complexity, generalization bounds (PAC-Bayes) +- Library - reinforcement learning: Markov decision processes, value iteration, policy gradient methods +- Executable algorithms: have executable implementations of some online learning algorithms, on which we can run experiments and compare with the theoretical predictions +- Documentation: comprehensive documentation of the new theoretical results and algorithms, with tutorials +- Subject coverage and AI readiness: a folder with formalizations or reports on the feasibility of formalizing a wide array of papers from COLT/NeurIPS/ICML/ICLR using the library + +:::: + + +::::html div (class := "roadmap-subsection") + +*Year 3* + +- Library - deep learning: neural networks, backpropagation, generalization in deep learning +- Library - advanced reinforcement learning: deep Q-learning, actor-critic methods, multi-agent RL +- Executable algorithms: have executable implementations of deep learning and advanced RL algorithms, linked with theory +- Subject coverage and AI readiness: several new papers formalized using the library, and a demonstration of an AI system generating a new theorem about a machine learning algorithm using the library + +:::: + +::::: + +:::::: diff --git a/website/lake-manifest.json b/website/lake-manifest.json new file mode 100644 index 00000000..bd428155 --- /dev/null +++ b/website/lake-manifest.json @@ -0,0 +1,45 @@ +{"version": "1.1.0", + "packagesDir": ".lake/packages", + "packages": + [{"url": "https://github.com/leanprover/verso.git", + "type": "git", + "subDir": null, + "scope": "", + "rev": "372f82ee4e67c863cf473a9174a1a77e0bec74a2", + "name": "verso", + "manifestFile": "lake-manifest.json", + "inputRev": "v4.28.0", + "inherited": false, + "configFile": "lakefile.lean"}, + {"url": "https://github.com/leanprover-community/plausible", + "type": "git", + "subDir": null, + "scope": "", + "rev": "55c8532eb21ec9f6d565d51d96b8ca50bd1fbef3", + "name": "plausible", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml"}, + {"url": "https://github.com/acmepjz/md4lean", + "type": "git", + "subDir": null, + "scope": "", + "rev": "7e097e9a076d5fbe48aa39aceee871af0d011101", + "name": "MD4Lean", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.lean"}, + {"url": "https://github.com/leanprover/subverso", + "type": "git", + "subDir": null, + "scope": "", + "rev": "4539e605ff834c35ecc0bcd0b7daec69163fd9f0", + "name": "subverso", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.lean"}], + "name": "«verso-website»", + "lakeDir": ".lake"} diff --git a/website/lakefile.toml b/website/lakefile.toml new file mode 100644 index 00000000..a708dd92 --- /dev/null +++ b/website/lakefile.toml @@ -0,0 +1,15 @@ +name = "verso-website" +version = "0.1.0" +defaultTargets = ["Site", "generate-site"] + +[[require]] +name = "verso" +git = "https://github.com/leanprover/verso.git" +rev = "v4.28.0" + +[[lean_lib]] +name = "Site" + +[[lean_exe]] +name = "generate-site" +root = "Main" diff --git a/website/lean-toolchain b/website/lean-toolchain new file mode 100644 index 00000000..4c685fa0 --- /dev/null +++ b/website/lean-toolchain @@ -0,0 +1 @@ +leanprover/lean4:v4.28.0 diff --git a/website/static_files/Inria_logo_RGB.png b/website/static_files/Inria_logo_RGB.png new file mode 100644 index 00000000..4f3485aa Binary files /dev/null and b/website/static_files/Inria_logo_RGB.png differ diff --git a/website/static_files/arrow.svg b/website/static_files/arrow.svg new file mode 100644 index 00000000..31942d69 --- /dev/null +++ b/website/static_files/arrow.svg @@ -0,0 +1 @@ + diff --git a/website/static_files/book.svg b/website/static_files/book.svg new file mode 100644 index 00000000..317c041e --- /dev/null +++ b/website/static_files/book.svg @@ -0,0 +1 @@ + diff --git a/website/static_files/favicon.svg b/website/static_files/favicon.svg new file mode 100644 index 00000000..ea497ae3 --- /dev/null +++ b/website/static_files/favicon.svg @@ -0,0 +1 @@ +RealFaviconGeneratorhttps://realfavicongenerator.net \ No newline at end of file diff --git a/website/static_files/github.svg b/website/static_files/github.svg new file mode 100644 index 00000000..9f412c57 --- /dev/null +++ b/website/static_files/github.svg @@ -0,0 +1 @@ + diff --git a/website/static_files/glightbox/LICENSE b/website/static_files/glightbox/LICENSE new file mode 100644 index 00000000..43d17fbf --- /dev/null +++ b/website/static_files/glightbox/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Biati Digital https://www.biati.digital + +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/website/static_files/glightbox/css/glightbox.css b/website/static_files/glightbox/css/glightbox.css new file mode 100644 index 00000000..120aa434 --- /dev/null +++ b/website/static_files/glightbox/css/glightbox.css @@ -0,0 +1,939 @@ +.glightbox-container { + width: 100%; + height: 100%; + position: fixed; + top: 0; + left: 0; + z-index: 999999 !important; + overflow: hidden; + -ms-touch-action: none; + touch-action: none; + -webkit-text-size-adjust: 100%; + -moz-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; + text-size-adjust: 100%; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + outline: none; +} + +.glightbox-container.inactive { + display: none; +} + +.glightbox-container .gcontainer { + position: relative; + width: 100%; + height: 100%; + z-index: 9999; + overflow: hidden; +} + +.glightbox-container .gslider { + -webkit-transition: -webkit-transform 0.4s ease; + transition: -webkit-transform 0.4s ease; + transition: transform 0.4s ease; + transition: transform 0.4s ease, -webkit-transform 0.4s ease; + height: 100%; + left: 0; + top: 0; + width: 100%; + position: relative; + overflow: hidden; + display: -webkit-box !important; + display: -ms-flexbox !important; + display: flex !important; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} + +.glightbox-container .gslide { + width: 100%; + position: absolute; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + opacity: 0; +} + +.glightbox-container .gslide.current { + opacity: 1; + z-index: 99999; + position: relative; +} + +.glightbox-container .gslide.prev { + opacity: 1; + z-index: 9999; +} + +.glightbox-container .gslide-inner-content { + width: 100%; +} + +.glightbox-container .ginner-container { + position: relative; + width: 100%; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + max-width: 100%; + margin: auto; + height: 100vh; +} + +.glightbox-container .ginner-container.gvideo-container { + width: 100%; +} + +.glightbox-container .ginner-container.desc-bottom, + .glightbox-container .ginner-container.desc-top { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; +} + +.glightbox-container .ginner-container.desc-left, + .glightbox-container .ginner-container.desc-right { + max-width: 100% !important; +} + +.gslide iframe, + .gslide video { + outline: none !important; + border: none; + min-height: 165px; + -webkit-overflow-scrolling: touch; + -ms-touch-action: auto; + touch-action: auto; +} + +.gslide:not(.current) { + pointer-events: none; +} + +.gslide-image { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.gslide-image img { + max-height: 100vh; + display: block; + padding: 0; + float: none; + outline: none; + border: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + max-width: 100vw; + width: auto; + height: auto; + -o-object-fit: cover; + object-fit: cover; + -ms-touch-action: none; + touch-action: none; + margin: auto; + min-width: 200px; +} + +.desc-top .gslide-image img, + .desc-bottom .gslide-image img { + width: auto; +} + +.desc-left .gslide-image img, + .desc-right .gslide-image img { + width: auto; + max-width: 100%; +} + +.gslide-image img.zoomable { + position: relative; +} + +.gslide-image img.dragging { + cursor: -webkit-grabbing !important; + cursor: grabbing !important; + -webkit-transition: none; + transition: none; +} + +.gslide-video { + position: relative; + max-width: 100vh; + width: 100% !important; +} + +.gslide-video .plyr__poster-enabled.plyr--loading .plyr__poster { + display: none; +} + +.gslide-video .gvideo-wrapper { + width: 100%; + /* max-width: 160vmin; */ + margin: auto; +} + +.gslide-video::before { + content: ''; + position: absolute; + width: 100%; + height: 100%; + background: rgba(255, 0, 0, 0.34); + display: none; +} + +.gslide-video.playing::before { + display: none; +} + +.gslide-video.fullscreen { + max-width: 100% !important; + min-width: 100%; + height: 75vh; +} + +.gslide-video.fullscreen video { + max-width: 100% !important; + width: 100% !important; +} + +.gslide-inline { + background: #fff; + text-align: left; + max-height: calc(100vh - 40px); + overflow: auto; + max-width: 100%; + margin: auto; +} + +.gslide-inline .ginlined-content { + padding: 20px; + width: 100%; +} + +.gslide-inline .dragging { + cursor: -webkit-grabbing !important; + cursor: grabbing !important; + -webkit-transition: none; + transition: none; +} + +.ginlined-content { + overflow: auto; + display: block !important; + opacity: 1; +} + +.gslide-external { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + width: 100%; + min-width: 100%; + background: #fff; + padding: 0; + overflow: auto; + max-height: 75vh; + height: 100%; +} + +.gslide-media { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + width: auto; +} + +.zoomed .gslide-media { + -webkit-box-shadow: none !important; + box-shadow: none !important; +} + +.desc-top .gslide-media, + .desc-bottom .gslide-media { + margin: 0 auto; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; +} + +.gslide-description { + position: relative; + -webkit-box-flex: 1; + -ms-flex: 1 0 100%; + flex: 1 0 100%; +} + +.gslide-description.description-left, + .gslide-description.description-right { + max-width: 100%; +} + +.gslide-description.description-bottom, + .gslide-description.description-top { + margin: 0 auto; + width: 100%; +} + +.gslide-description p { + margin-bottom: 12px; +} + +.gslide-description p:last-child { + margin-bottom: 0; +} + +.zoomed .gslide-description { + display: none; +} + +.glightbox-button-hidden { + display: none; +} + + +/* + * Description for mobiles + * something like facebook does the description + * for the photos +*/ + +.glightbox-mobile .glightbox-container .gslide-description { + height: auto !important; + width: 100%; + position: absolute; + bottom: 0; + padding: 19px 11px; + max-width: 100vw !important; + -webkit-box-ordinal-group: 3 !important; + -ms-flex-order: 2 !important; + order: 2 !important; + max-height: 78vh; + overflow: auto !important; + background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.75))); + background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%); + -webkit-transition: opacity 0.3s linear; + transition: opacity 0.3s linear; + padding-bottom: 50px; +} + +.glightbox-mobile .glightbox-container .gslide-title { + color: #fff; + font-size: 1em; +} + +.glightbox-mobile .glightbox-container .gslide-desc { + color: #a1a1a1; +} + +.glightbox-mobile .glightbox-container .gslide-desc a { + color: #fff; + font-weight: bold; +} + +.glightbox-mobile .glightbox-container .gslide-desc * { + color: inherit; +} + +.glightbox-mobile .glightbox-container .gslide-desc .desc-more { + color: #fff; + opacity: 0.4; +} + +.gdesc-open .gslide-media { + -webkit-transition: opacity 0.5s ease; + transition: opacity 0.5s ease; + opacity: 0.4; +} + +.gdesc-open .gdesc-inner { + padding-bottom: 30px; +} + +.gdesc-closed .gslide-media { + -webkit-transition: opacity 0.5s ease; + transition: opacity 0.5s ease; + opacity: 1; +} + +.greset { + -webkit-transition: all 0.3s ease; + transition: all 0.3s ease; +} + +.gabsolute { + position: absolute; +} + +.grelative { + position: relative; +} + +.glightbox-desc { + display: none !important; +} + +.glightbox-open { + overflow: hidden; +} + +.gloader { + height: 25px; + width: 25px; + -webkit-animation: lightboxLoader 0.8s infinite linear; + animation: lightboxLoader 0.8s infinite linear; + border: 2px solid #fff; + border-right-color: transparent; + border-radius: 50%; + position: absolute; + display: block; + z-index: 9999; + left: 0; + right: 0; + margin: 0 auto; + top: 47%; +} + +.goverlay { + width: 100%; + height: calc(100vh + 1px); + position: fixed; + top: -1px; + left: 0; + background: #000; + will-change: opacity; +} + +.glightbox-mobile .goverlay { + background: #000; +} + +.gprev, +.gnext, +.gclose { + z-index: 99999; + cursor: pointer; + width: 26px; + height: 44px; + border: none; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; +} + +.gprev svg, +.gnext svg, +.gclose svg { + display: block; + width: 25px; + height: auto; + margin: 0; + padding: 0; +} + +.gprev.disabled, +.gnext.disabled, +.gclose.disabled { + opacity: 0.1; +} + +.gprev .garrow, +.gnext .garrow, +.gclose .garrow { + stroke: #fff; +} + +.gbtn.focused { + outline: 2px solid #0f3d81; +} + +iframe.wait-autoplay { + opacity: 0; +} + +.glightbox-closing .gnext, + .glightbox-closing .gprev, + .glightbox-closing .gclose { + opacity: 0 !important; +} + + +/*Skin */ + +.glightbox-clean .gslide-description { + background: #fff; +} + +.glightbox-clean .gdesc-inner { + padding: 22px 20px; +} + +.glightbox-clean .gslide-title { + font-size: 1em; + font-weight: normal; + font-family: arial; + color: #000; + margin-bottom: 19px; + line-height: 1.4em; +} + +.glightbox-clean .gslide-desc { + font-size: 0.86em; + margin-bottom: 0; + font-family: arial; + line-height: 1.4em; +} + +.glightbox-clean .gslide-video { + background: #000; +} + +.glightbox-clean .gprev, + .glightbox-clean .gnext, + .glightbox-clean .gclose { + background-color: rgba(0, 0, 0, 0.75); + border-radius: 4px; +} + +.glightbox-clean .gprev path, +.glightbox-clean .gnext path, +.glightbox-clean .gclose path { + fill: #fff; +} + +.glightbox-clean .gprev { + position: absolute; + top: -100%; + left: 30px; + width: 40px; + height: 50px; +} + +.glightbox-clean .gnext { + position: absolute; + top: -100%; + right: 30px; + width: 40px; + height: 50px; +} + +.glightbox-clean .gclose { + width: 35px; + height: 35px; + top: 15px; + right: 10px; + position: absolute; +} + +.glightbox-clean .gclose svg { + width: 18px; + height: auto; +} + +.glightbox-clean .gclose:hover { + opacity: 1; +} + + +/*CSS Animations*/ + +.gfadeIn { + -webkit-animation: gfadeIn 0.5s ease; + animation: gfadeIn 0.5s ease; +} + +.gfadeOut { + -webkit-animation: gfadeOut 0.5s ease; + animation: gfadeOut 0.5s ease; +} + +.gslideOutLeft { + -webkit-animation: gslideOutLeft 0.3s ease; + animation: gslideOutLeft 0.3s ease; +} + +.gslideInLeft { + -webkit-animation: gslideInLeft 0.3s ease; + animation: gslideInLeft 0.3s ease; +} + +.gslideOutRight { + -webkit-animation: gslideOutRight 0.3s ease; + animation: gslideOutRight 0.3s ease; +} + +.gslideInRight { + -webkit-animation: gslideInRight 0.3s ease; + animation: gslideInRight 0.3s ease; +} + +.gzoomIn { + -webkit-animation: gzoomIn 0.5s ease; + animation: gzoomIn 0.5s ease; +} + +.gzoomOut { + -webkit-animation: gzoomOut 0.5s ease; + animation: gzoomOut 0.5s ease; +} + +@-webkit-keyframes lightboxLoader { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes lightboxLoader { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@-webkit-keyframes gfadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes gfadeIn { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@-webkit-keyframes gfadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@keyframes gfadeOut { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +@-webkit-keyframes gslideInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-60%, 0, 0); + transform: translate3d(-60%, 0, 0); + } + to { + visibility: visible; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} + +@keyframes gslideInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-60%, 0, 0); + transform: translate3d(-60%, 0, 0); + } + to { + visibility: visible; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} + +@-webkit-keyframes gslideOutLeft { + from { + opacity: 1; + visibility: visible; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + -webkit-transform: translate3d(-60%, 0, 0); + transform: translate3d(-60%, 0, 0); + opacity: 0; + visibility: hidden; + } +} + +@keyframes gslideOutLeft { + from { + opacity: 1; + visibility: visible; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + -webkit-transform: translate3d(-60%, 0, 0); + transform: translate3d(-60%, 0, 0); + opacity: 0; + visibility: hidden; + } +} + +@-webkit-keyframes gslideInRight { + from { + opacity: 0; + visibility: visible; + -webkit-transform: translate3d(60%, 0, 0); + transform: translate3d(60%, 0, 0); + } + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} + +@keyframes gslideInRight { + from { + opacity: 0; + visibility: visible; + -webkit-transform: translate3d(60%, 0, 0); + transform: translate3d(60%, 0, 0); + } + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} + +@-webkit-keyframes gslideOutRight { + from { + opacity: 1; + visibility: visible; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + -webkit-transform: translate3d(60%, 0, 0); + transform: translate3d(60%, 0, 0); + opacity: 0; + } +} + +@keyframes gslideOutRight { + from { + opacity: 1; + visibility: visible; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + -webkit-transform: translate3d(60%, 0, 0); + transform: translate3d(60%, 0, 0); + opacity: 0; + } +} + +@-webkit-keyframes gzoomIn { + from { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + to { + opacity: 1; + } +} + +@keyframes gzoomIn { + from { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + to { + opacity: 1; + } +} + +@-webkit-keyframes gzoomOut { + from { + opacity: 1; + } + 50% { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + to { + opacity: 0; + } +} + +@keyframes gzoomOut { + from { + opacity: 1; + } + 50% { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + to { + opacity: 0; + } +} + +@media (min-width: 769px) { + .glightbox-container .ginner-container { + width: auto; + height: auto; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + } + .glightbox-container .ginner-container.desc-top .gslide-description { + -webkit-box-ordinal-group: 1; + -ms-flex-order: 0; + order: 0; + } + .glightbox-container .ginner-container.desc-top .gslide-image, + .glightbox-container .ginner-container.desc-top .gslide-image img { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1; + } + .glightbox-container .ginner-container.desc-left .gslide-description { + -webkit-box-ordinal-group: 1; + -ms-flex-order: 0; + order: 0; + } + .glightbox-container .ginner-container.desc-left .gslide-image { + -webkit-box-ordinal-group: 2; + -ms-flex-order: 1; + order: 1; + } + .gslide-image img { + max-height: 97vh; + max-width: 100%; + } + .gslide-image img.zoomable { + cursor: -webkit-zoom-in; + cursor: zoom-in; + } + .zoomed .gslide-image img.zoomable { + cursor: -webkit-grab; + cursor: grab; + } + .gslide-inline { + max-height: 95vh; + } + .gslide-external { + max-height: 100vh; + } + .gslide-description.description-left, + .gslide-description.description-right { + max-width: 275px; + } + .glightbox-open { + height: auto; + } + .goverlay { + background: rgba(0, 0, 0, 0.92); + } + .glightbox-clean .gslide-media { + -webkit-box-shadow: 1px 2px 9px 0px rgba(0, 0, 0, 0.65); + box-shadow: 1px 2px 9px 0px rgba(0, 0, 0, 0.65); + } + .glightbox-clean .description-left .gdesc-inner, +.glightbox-clean .description-right .gdesc-inner { + position: absolute; + height: 100%; + overflow-y: auto; + } + .glightbox-clean .gprev, + .glightbox-clean .gnext, + .glightbox-clean .gclose { + background-color: rgba(0, 0, 0, 0.32); + } + .glightbox-clean .gprev:hover, +.glightbox-clean .gnext:hover, +.glightbox-clean .gclose:hover { + background-color: rgba(0, 0, 0, 0.7); + } + .glightbox-clean .gprev { + top: 45%; + } + .glightbox-clean .gnext { + top: 45%; + } +} + +@media (min-width: 992px) { + .glightbox-clean .gclose { + opacity: 0.7; + right: 20px; + } +} + +@media screen and (max-height: 420px) { + .goverlay { + background: #000; + } +} diff --git a/website/static_files/glightbox/css/glightbox.min.css b/website/static_files/glightbox/css/glightbox.min.css new file mode 100644 index 00000000..f3f66a87 --- /dev/null +++ b/website/static_files/glightbox/css/glightbox.min.css @@ -0,0 +1 @@ +.glightbox-container{width:100%;height:100%;position:fixed;top:0;left:0;z-index:999999!important;overflow:hidden;-ms-touch-action:none;touch-action:none;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;outline:0}.glightbox-container.inactive{display:none}.glightbox-container .gcontainer{position:relative;width:100%;height:100%;z-index:9999;overflow:hidden}.glightbox-container .gslider{-webkit-transition:-webkit-transform .4s ease;transition:-webkit-transform .4s ease;transition:transform .4s ease;transition:transform .4s ease,-webkit-transform .4s ease;height:100%;left:0;top:0;width:100%;position:relative;overflow:hidden;display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.glightbox-container .gslide{width:100%;position:absolute;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;opacity:0}.glightbox-container .gslide.current{opacity:1;z-index:99999;position:relative}.glightbox-container .gslide.prev{opacity:1;z-index:9999}.glightbox-container .gslide-inner-content{width:100%}.glightbox-container .ginner-container{position:relative;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;max-width:100%;margin:auto;height:100vh}.glightbox-container .ginner-container.gvideo-container{width:100%}.glightbox-container .ginner-container.desc-bottom,.glightbox-container .ginner-container.desc-top{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.glightbox-container .ginner-container.desc-left,.glightbox-container .ginner-container.desc-right{max-width:100%!important}.gslide iframe,.gslide video{outline:0!important;border:none;min-height:165px;-webkit-overflow-scrolling:touch;-ms-touch-action:auto;touch-action:auto}.gslide:not(.current){pointer-events:none}.gslide-image{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.gslide-image img{max-height:100vh;display:block;padding:0;float:none;outline:0;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;max-width:100vw;width:auto;height:auto;-o-object-fit:cover;object-fit:cover;-ms-touch-action:none;touch-action:none;margin:auto;min-width:200px}.desc-bottom .gslide-image img,.desc-top .gslide-image img{width:auto}.desc-left .gslide-image img,.desc-right .gslide-image img{width:auto;max-width:100%}.gslide-image img.zoomable{position:relative}.gslide-image img.dragging{cursor:-webkit-grabbing!important;cursor:grabbing!important;-webkit-transition:none;transition:none}.gslide-video{position:relative;max-width:100vh;width:100%!important}.gslide-video .plyr__poster-enabled.plyr--loading .plyr__poster{display:none}.gslide-video .gvideo-wrapper{width:100%;margin:auto}.gslide-video::before{content:'';position:absolute;width:100%;height:100%;background:rgba(255,0,0,.34);display:none}.gslide-video.playing::before{display:none}.gslide-video.fullscreen{max-width:100%!important;min-width:100%;height:75vh}.gslide-video.fullscreen video{max-width:100%!important;width:100%!important}.gslide-inline{background:#fff;text-align:left;max-height:calc(100vh - 40px);overflow:auto;max-width:100%;margin:auto}.gslide-inline .ginlined-content{padding:20px;width:100%}.gslide-inline .dragging{cursor:-webkit-grabbing!important;cursor:grabbing!important;-webkit-transition:none;transition:none}.ginlined-content{overflow:auto;display:block!important;opacity:1}.gslide-external{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;min-width:100%;background:#fff;padding:0;overflow:auto;max-height:75vh;height:100%}.gslide-media{display:-webkit-box;display:-ms-flexbox;display:flex;width:auto}.zoomed .gslide-media{-webkit-box-shadow:none!important;box-shadow:none!important}.desc-bottom .gslide-media,.desc-top .gslide-media{margin:0 auto;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.gslide-description{position:relative;-webkit-box-flex:1;-ms-flex:1 0 100%;flex:1 0 100%}.gslide-description.description-left,.gslide-description.description-right{max-width:100%}.gslide-description.description-bottom,.gslide-description.description-top{margin:0 auto;width:100%}.gslide-description p{margin-bottom:12px}.gslide-description p:last-child{margin-bottom:0}.zoomed .gslide-description{display:none}.glightbox-button-hidden{display:none}.glightbox-mobile .glightbox-container .gslide-description{height:auto!important;width:100%;position:absolute;bottom:0;padding:19px 11px;max-width:100vw!important;-webkit-box-ordinal-group:3!important;-ms-flex-order:2!important;order:2!important;max-height:78vh;overflow:auto!important;background:-webkit-gradient(linear,left top,left bottom,from(rgba(0,0,0,0)),to(rgba(0,0,0,.75)));background:linear-gradient(to bottom,rgba(0,0,0,0) 0,rgba(0,0,0,.75) 100%);-webkit-transition:opacity .3s linear;transition:opacity .3s linear;padding-bottom:50px}.glightbox-mobile .glightbox-container .gslide-title{color:#fff;font-size:1em}.glightbox-mobile .glightbox-container .gslide-desc{color:#a1a1a1}.glightbox-mobile .glightbox-container .gslide-desc a{color:#fff;font-weight:700}.glightbox-mobile .glightbox-container .gslide-desc *{color:inherit}.glightbox-mobile .glightbox-container .gslide-desc .desc-more{color:#fff;opacity:.4}.gdesc-open .gslide-media{-webkit-transition:opacity .5s ease;transition:opacity .5s ease;opacity:.4}.gdesc-open .gdesc-inner{padding-bottom:30px}.gdesc-closed .gslide-media{-webkit-transition:opacity .5s ease;transition:opacity .5s ease;opacity:1}.greset{-webkit-transition:all .3s ease;transition:all .3s ease}.gabsolute{position:absolute}.grelative{position:relative}.glightbox-desc{display:none!important}.glightbox-open{overflow:hidden}.gloader{height:25px;width:25px;-webkit-animation:lightboxLoader .8s infinite linear;animation:lightboxLoader .8s infinite linear;border:2px solid #fff;border-right-color:transparent;border-radius:50%;position:absolute;display:block;z-index:9999;left:0;right:0;margin:0 auto;top:47%}.goverlay{width:100%;height:calc(100vh + 1px);position:fixed;top:-1px;left:0;background:#000;will-change:opacity}.glightbox-mobile .goverlay{background:#000}.gclose,.gnext,.gprev{z-index:99999;cursor:pointer;width:26px;height:44px;border:none;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.gclose svg,.gnext svg,.gprev svg{display:block;width:25px;height:auto;margin:0;padding:0}.gclose.disabled,.gnext.disabled,.gprev.disabled{opacity:.1}.gclose .garrow,.gnext .garrow,.gprev .garrow{stroke:#fff}.gbtn.focused{outline:2px solid #0f3d81}iframe.wait-autoplay{opacity:0}.glightbox-closing .gclose,.glightbox-closing .gnext,.glightbox-closing .gprev{opacity:0!important}.glightbox-clean .gslide-description{background:#fff}.glightbox-clean .gdesc-inner{padding:22px 20px}.glightbox-clean .gslide-title{font-size:1em;font-weight:400;font-family:arial;color:#000;margin-bottom:19px;line-height:1.4em}.glightbox-clean .gslide-desc{font-size:.86em;margin-bottom:0;font-family:arial;line-height:1.4em}.glightbox-clean .gslide-video{background:#000}.glightbox-clean .gclose,.glightbox-clean .gnext,.glightbox-clean .gprev{background-color:rgba(0,0,0,.75);border-radius:4px}.glightbox-clean .gclose path,.glightbox-clean .gnext path,.glightbox-clean .gprev path{fill:#fff}.glightbox-clean .gprev{position:absolute;top:-100%;left:30px;width:40px;height:50px}.glightbox-clean .gnext{position:absolute;top:-100%;right:30px;width:40px;height:50px}.glightbox-clean .gclose{width:35px;height:35px;top:15px;right:10px;position:absolute}.glightbox-clean .gclose svg{width:18px;height:auto}.glightbox-clean .gclose:hover{opacity:1}.gfadeIn{-webkit-animation:gfadeIn .5s ease;animation:gfadeIn .5s ease}.gfadeOut{-webkit-animation:gfadeOut .5s ease;animation:gfadeOut .5s ease}.gslideOutLeft{-webkit-animation:gslideOutLeft .3s ease;animation:gslideOutLeft .3s ease}.gslideInLeft{-webkit-animation:gslideInLeft .3s ease;animation:gslideInLeft .3s ease}.gslideOutRight{-webkit-animation:gslideOutRight .3s ease;animation:gslideOutRight .3s ease}.gslideInRight{-webkit-animation:gslideInRight .3s ease;animation:gslideInRight .3s ease}.gzoomIn{-webkit-animation:gzoomIn .5s ease;animation:gzoomIn .5s ease}.gzoomOut{-webkit-animation:gzoomOut .5s ease;animation:gzoomOut .5s ease}@-webkit-keyframes lightboxLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes lightboxLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes gfadeIn{from{opacity:0}to{opacity:1}}@keyframes gfadeIn{from{opacity:0}to{opacity:1}}@-webkit-keyframes gfadeOut{from{opacity:1}to{opacity:0}}@keyframes gfadeOut{from{opacity:1}to{opacity:0}}@-webkit-keyframes gslideInLeft{from{opacity:0;-webkit-transform:translate3d(-60%,0,0);transform:translate3d(-60%,0,0)}to{visibility:visible;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@keyframes gslideInLeft{from{opacity:0;-webkit-transform:translate3d(-60%,0,0);transform:translate3d(-60%,0,0)}to{visibility:visible;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@-webkit-keyframes gslideOutLeft{from{opacity:1;visibility:visible;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(-60%,0,0);transform:translate3d(-60%,0,0);opacity:0;visibility:hidden}}@keyframes gslideOutLeft{from{opacity:1;visibility:visible;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(-60%,0,0);transform:translate3d(-60%,0,0);opacity:0;visibility:hidden}}@-webkit-keyframes gslideInRight{from{opacity:0;visibility:visible;-webkit-transform:translate3d(60%,0,0);transform:translate3d(60%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@keyframes gslideInRight{from{opacity:0;visibility:visible;-webkit-transform:translate3d(60%,0,0);transform:translate3d(60%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@-webkit-keyframes gslideOutRight{from{opacity:1;visibility:visible;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(60%,0,0);transform:translate3d(60%,0,0);opacity:0}}@keyframes gslideOutRight{from{opacity:1;visibility:visible;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(60%,0,0);transform:translate3d(60%,0,0);opacity:0}}@-webkit-keyframes gzoomIn{from{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:1}}@keyframes gzoomIn{from{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:1}}@-webkit-keyframes gzoomOut{from{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}@keyframes gzoomOut{from{opacity:1}50%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}to{opacity:0}}@media (min-width:769px){.glightbox-container .ginner-container{width:auto;height:auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.glightbox-container .ginner-container.desc-top .gslide-description{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.glightbox-container .ginner-container.desc-top .gslide-image,.glightbox-container .ginner-container.desc-top .gslide-image img{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.glightbox-container .ginner-container.desc-left .gslide-description{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.glightbox-container .ginner-container.desc-left .gslide-image{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.gslide-image img{max-height:97vh;max-width:100%}.gslide-image img.zoomable{cursor:-webkit-zoom-in;cursor:zoom-in}.zoomed .gslide-image img.zoomable{cursor:-webkit-grab;cursor:grab}.gslide-inline{max-height:95vh}.gslide-external{max-height:100vh}.gslide-description.description-left,.gslide-description.description-right{max-width:275px}.glightbox-open{height:auto}.goverlay{background:rgba(0,0,0,.92)}.glightbox-clean .gslide-media{-webkit-box-shadow:1px 2px 9px 0 rgba(0,0,0,.65);box-shadow:1px 2px 9px 0 rgba(0,0,0,.65)}.glightbox-clean .description-left .gdesc-inner,.glightbox-clean .description-right .gdesc-inner{position:absolute;height:100%;overflow-y:auto}.glightbox-clean .gclose,.glightbox-clean .gnext,.glightbox-clean .gprev{background-color:rgba(0,0,0,.32)}.glightbox-clean .gclose:hover,.glightbox-clean .gnext:hover,.glightbox-clean .gprev:hover{background-color:rgba(0,0,0,.7)}.glightbox-clean .gprev{top:45%}.glightbox-clean .gnext{top:45%}}@media (min-width:992px){.glightbox-clean .gclose{opacity:.7;right:20px}}@media screen and (max-height:420px){.goverlay{background:#000}} diff --git a/website/static_files/glightbox/js/glightbox.js b/website/static_files/glightbox/js/glightbox.js new file mode 100644 index 00000000..678f7cb9 --- /dev/null +++ b/website/static_files/glightbox/js/glightbox.js @@ -0,0 +1,3087 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.GLightbox = factory()); +}(this, (function () { 'use strict'; + + function _classCallCheck(a, n) { + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); + } + function _defineProperties(e, r) { + for (var t = 0; t < r.length; t++) { + var o = r[t]; + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); + } + } + function _createClass(e, r, t) { + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { + writable: !1 + }), e; + } + function _toPrimitive(t, r) { + if ("object" != typeof t || !t) return t; + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || "default"); + if ("object" != typeof i) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return ("string" === r ? String : Number)(t); + } + function _toPropertyKey(t) { + var i = _toPrimitive(t, "string"); + return "symbol" == typeof i ? i : i + ""; + } + function _typeof(o) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, _typeof(o); + } + + var uid = Date.now(); + function extend() { + var extended = {}; + var deep = true; + var i = 0; + var length = arguments.length; + if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') { + deep = arguments[0]; + i++; + } + var merge = function merge(obj) { + for (var prop in obj) { + if (Object.prototype.hasOwnProperty.call(obj, prop)) { + if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') { + extended[prop] = extend(true, extended[prop], obj[prop]); + } else { + extended[prop] = obj[prop]; + } + } + } + }; + for (; i < length; i++) { + var obj = arguments[i]; + merge(obj); + } + return extended; + } + function each(collection, callback) { + if (isNode(collection) || collection === window || collection === document) { + collection = [collection]; + } + if (!isArrayLike(collection) && !isObject(collection)) { + collection = [collection]; + } + if (size(collection) == 0) { + return; + } + if (isArrayLike(collection) && !isObject(collection)) { + var l = collection.length, + i = 0; + for (; i < l; i++) { + if (callback.call(collection[i], collection[i], i, collection) === false) { + break; + } + } + } else if (isObject(collection)) { + for (var key in collection) { + if (has(collection, key)) { + if (callback.call(collection[key], collection[key], key, collection) === false) { + break; + } + } + } + } + } + function getNodeEvents(node) { + var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var fn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var cache = node[uid] = node[uid] || []; + var data = { + all: cache, + evt: null, + found: null + }; + if (name && fn && size(cache) > 0) { + each(cache, function (cl, i) { + if (cl.eventName == name && cl.fn.toString() == fn.toString()) { + data.found = true; + data.evt = i; + return false; + } + }); + } + return data; + } + function addEvent(eventName) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + onElement = _ref.onElement, + withCallback = _ref.withCallback, + _ref$avoidDuplicate = _ref.avoidDuplicate, + avoidDuplicate = _ref$avoidDuplicate === void 0 ? true : _ref$avoidDuplicate, + _ref$once = _ref.once, + once = _ref$once === void 0 ? false : _ref$once, + _ref$useCapture = _ref.useCapture, + useCapture = _ref$useCapture === void 0 ? false : _ref$useCapture; + var thisArg = arguments.length > 2 ? arguments[2] : undefined; + var element = onElement || []; + if (isString(element)) { + element = document.querySelectorAll(element); + } + function handler(event) { + if (isFunction(withCallback)) { + withCallback.call(thisArg, event, this); + } + if (once) { + handler.destroy(); + } + } + handler.destroy = function () { + each(element, function (el) { + var events = getNodeEvents(el, eventName, handler); + if (events.found) { + events.all.splice(events.evt, 1); + } + if (el.removeEventListener) { + el.removeEventListener(eventName, handler, useCapture); + } + }); + }; + each(element, function (el) { + var events = getNodeEvents(el, eventName, handler); + if (el.addEventListener && avoidDuplicate && !events.found || !avoidDuplicate) { + el.addEventListener(eventName, handler, useCapture); + events.all.push({ + eventName: eventName, + fn: handler + }); + } + }); + return handler; + } + function addClass(node, name) { + each(name.split(' '), function (cl) { + return node.classList.add(cl); + }); + } + function removeClass(node, name) { + each(name.split(' '), function (cl) { + return node.classList.remove(cl); + }); + } + function hasClass(node, name) { + return node.classList.contains(name); + } + function closest(elem, selector) { + while (elem !== document.body) { + elem = elem.parentElement; + if (!elem) { + return false; + } + var matches = typeof elem.matches == 'function' ? elem.matches(selector) : elem.msMatchesSelector(selector); + if (matches) { + return elem; + } + } + } + function animateElement(element) { + var animation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + if (!element || animation === '') { + return false; + } + if (animation === 'none') { + if (isFunction(callback)) { + callback(); + } + return false; + } + var animationEnd = whichAnimationEvent(); + var animationNames = animation.split(' '); + each(animationNames, function (name) { + addClass(element, 'g' + name); + }); + addEvent(animationEnd, { + onElement: element, + avoidDuplicate: false, + once: true, + withCallback: function withCallback(event, target) { + each(animationNames, function (name) { + removeClass(target, 'g' + name); + }); + if (isFunction(callback)) { + callback(); + } + } + }); + } + function cssTransform(node) { + var translate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + if (translate === '') { + node.style.webkitTransform = ''; + node.style.MozTransform = ''; + node.style.msTransform = ''; + node.style.OTransform = ''; + node.style.transform = ''; + return false; + } + node.style.webkitTransform = translate; + node.style.MozTransform = translate; + node.style.msTransform = translate; + node.style.OTransform = translate; + node.style.transform = translate; + } + function show(element) { + element.style.display = 'block'; + } + function hide(element) { + element.style.display = 'none'; + } + function createHTML(htmlStr) { + var frag = document.createDocumentFragment(), + temp = document.createElement('div'); + temp.innerHTML = htmlStr; + while (temp.firstChild) { + frag.appendChild(temp.firstChild); + } + return frag; + } + function windowSize() { + return { + width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, + height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight + }; + } + function whichAnimationEvent() { + var t, + el = document.createElement('fakeelement'); + var animations = { + animation: 'animationend', + OAnimation: 'oAnimationEnd', + MozAnimation: 'animationend', + WebkitAnimation: 'webkitAnimationEnd' + }; + for (t in animations) { + if (el.style[t] !== undefined) { + return animations[t]; + } + } + } + function whichTransitionEvent() { + var t, + el = document.createElement('fakeelement'); + var transitions = { + transition: 'transitionend', + OTransition: 'oTransitionEnd', + MozTransition: 'transitionend', + WebkitTransition: 'webkitTransitionEnd' + }; + for (t in transitions) { + if (el.style[t] !== undefined) { + return transitions[t]; + } + } + } + function createIframe(config) { + var url = config.url, + allow = config.allow, + callback = config.callback, + appendTo = config.appendTo; + var iframe = document.createElement('iframe'); + iframe.className = 'vimeo-video gvideo'; + iframe.src = url; + iframe.style.width = '100%'; + iframe.style.height = '100%'; + if (allow) { + iframe.setAttribute('allow', allow); + } + iframe.onload = function () { + iframe.onload = null; + addClass(iframe, 'node-ready'); + if (isFunction(callback)) { + callback(); + } + }; + if (appendTo) { + appendTo.appendChild(iframe); + } + return iframe; + } + function waitUntil(check, onComplete, delay, timeout) { + if (check()) { + onComplete(); + return; + } + if (!delay) { + delay = 100; + } + var timeoutPointer; + var intervalPointer = setInterval(function () { + if (!check()) { + return; + } + clearInterval(intervalPointer); + if (timeoutPointer) { + clearTimeout(timeoutPointer); + } + onComplete(); + }, delay); + if (timeout) { + timeoutPointer = setTimeout(function () { + clearInterval(intervalPointer); + }, timeout); + } + } + function injectAssets(url, waitFor, callback) { + if (isNil(url)) { + console.error('Inject assets error'); + return; + } + if (isFunction(waitFor)) { + callback = waitFor; + waitFor = false; + } + if (isString(waitFor) && waitFor in window) { + if (isFunction(callback)) { + callback(); + } + return; + } + var found; + if (url.indexOf('.css') !== -1) { + found = document.querySelectorAll('link[href="' + url + '"]'); + if (found && found.length > 0) { + if (isFunction(callback)) { + callback(); + } + return; + } + var head = document.getElementsByTagName('head')[0]; + var headStyles = head.querySelectorAll('link[rel="stylesheet"]'); + var link = document.createElement('link'); + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = url; + link.media = 'all'; + if (headStyles) { + head.insertBefore(link, headStyles[0]); + } else { + head.appendChild(link); + } + if (isFunction(callback)) { + callback(); + } + return; + } + found = document.querySelectorAll('script[src="' + url + '"]'); + if (found && found.length > 0) { + if (isFunction(callback)) { + if (isString(waitFor)) { + waitUntil(function () { + return typeof window[waitFor] !== 'undefined'; + }, function () { + callback(); + }); + return false; + } + callback(); + } + return; + } + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = url; + script.onload = function () { + if (isFunction(callback)) { + if (isString(waitFor)) { + waitUntil(function () { + return typeof window[waitFor] !== 'undefined'; + }, function () { + callback(); + }); + return false; + } + callback(); + } + }; + document.body.appendChild(script); + } + function isMobile() { + return 'navigator' in window && window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i); + } + function isTouch() { + return isMobile() !== null || document.createTouch !== undefined || 'ontouchstart' in window || 'onmsgesturechange' in window || navigator.msMaxTouchPoints; + } + function isFunction(f) { + return typeof f === 'function'; + } + function isString(s) { + return typeof s === 'string'; + } + function isNode(el) { + return !!(el && el.nodeType && el.nodeType == 1); + } + function isArray(ar) { + return Array.isArray(ar); + } + function isArrayLike(ar) { + return ar && ar.length && isFinite(ar.length); + } + function isObject(o) { + var type = _typeof(o); + return type === 'object' && o != null && !isFunction(o) && !isArray(o); + } + function isNil(o) { + return o == null; + } + function has(obj, key) { + return obj !== null && hasOwnProperty.call(obj, key); + } + function size(o) { + if (isObject(o)) { + if (o.keys) { + return o.keys().length; + } + var l = 0; + for (var k in o) { + if (has(o, k)) { + l++; + } + } + return l; + } else { + return o.length; + } + } + function isNumber(n) { + return !isNaN(parseFloat(n)) && isFinite(n); + } + + function getNextFocusElement() { + var current = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1; + var btns = document.querySelectorAll('.gbtn[data-taborder]:not(.disabled)'); + if (!btns.length) { + return false; + } + if (btns.length == 1) { + return btns[0]; + } + if (typeof current == 'string') { + current = parseInt(current); + } + var orders = []; + each(btns, function (btn) { + orders.push(btn.getAttribute('data-taborder')); + }); + var highestOrder = Math.max.apply(Math, orders.map(function (order) { + return parseInt(order); + })); + var newIndex = current < 0 ? 1 : current + 1; + if (newIndex > highestOrder) { + newIndex = '1'; + } + var nextOrders = orders.filter(function (el) { + return el >= parseInt(newIndex); + }); + var nextFocus = nextOrders.sort()[0]; + return document.querySelector(".gbtn[data-taborder=\"".concat(nextFocus, "\"]")); + } + function keyboardNavigation(instance) { + if (instance.events.hasOwnProperty('keyboard')) { + return false; + } + instance.events['keyboard'] = addEvent('keydown', { + onElement: window, + withCallback: function withCallback(event, target) { + event = event || window.event; + var key = event.keyCode; + if (key == 9) { + var focusedButton = document.querySelector('.gbtn.focused'); + if (!focusedButton) { + var activeElement = document.activeElement && document.activeElement.nodeName ? document.activeElement.nodeName.toLocaleLowerCase() : false; + if (activeElement == 'input' || activeElement == 'textarea' || activeElement == 'button') { + return; + } + } + event.preventDefault(); + var btns = document.querySelectorAll('.gbtn[data-taborder]'); + if (!btns || btns.length <= 0) { + return; + } + if (!focusedButton) { + var first = getNextFocusElement(); + if (first) { + first.focus(); + addClass(first, 'focused'); + } + return; + } + var currentFocusOrder = focusedButton.getAttribute('data-taborder'); + var nextFocus = getNextFocusElement(currentFocusOrder); + removeClass(focusedButton, 'focused'); + if (nextFocus) { + nextFocus.focus(); + addClass(nextFocus, 'focused'); + } + } + if (key == 39) { + instance.nextSlide(); + } + if (key == 37) { + instance.prevSlide(); + } + if (key == 27) { + instance.close(); + } + } + }); + } + + var ZoomImages = function () { + function ZoomImages(el, slide) { + var _this = this; + var onclose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + _classCallCheck(this, ZoomImages); + this.img = el; + this.slide = slide; + this.onclose = onclose; + if (this.img.setZoomEvents) { + return false; + } + this.active = false; + this.zoomedIn = false; + this.dragging = false; + this.currentX = null; + this.currentY = null; + this.initialX = null; + this.initialY = null; + this.xOffset = 0; + this.yOffset = 0; + this.img.addEventListener('mousedown', function (e) { + return _this.dragStart(e); + }, false); + this.img.addEventListener('mouseup', function (e) { + return _this.dragEnd(e); + }, false); + this.img.addEventListener('mousemove', function (e) { + return _this.drag(e); + }, false); + this.img.addEventListener('click', function (e) { + if (_this.slide.classList.contains('dragging-nav')) { + _this.zoomOut(); + return false; + } + if (!_this.zoomedIn) { + return _this.zoomIn(); + } + if (_this.zoomedIn && !_this.dragging) { + _this.zoomOut(); + } + }, false); + this.img.setZoomEvents = true; + } + return _createClass(ZoomImages, [{ + key: "zoomIn", + value: function zoomIn() { + var winWidth = this.widowWidth(); + if (this.zoomedIn || winWidth <= 768) { + return; + } + var img = this.img; + img.setAttribute('data-style', img.getAttribute('style')); + img.style.maxWidth = img.naturalWidth + 'px'; + img.style.maxHeight = img.naturalHeight + 'px'; + if (img.naturalWidth > winWidth) { + var centerX = winWidth / 2 - img.naturalWidth / 2; + this.setTranslate(this.img.parentNode, centerX, 0); + } + this.slide.classList.add('zoomed'); + this.zoomedIn = true; + } + }, { + key: "zoomOut", + value: function zoomOut() { + this.img.parentNode.setAttribute('style', ''); + this.img.setAttribute('style', this.img.getAttribute('data-style')); + this.slide.classList.remove('zoomed'); + this.zoomedIn = false; + this.currentX = null; + this.currentY = null; + this.initialX = null; + this.initialY = null; + this.xOffset = 0; + this.yOffset = 0; + if (this.onclose && typeof this.onclose == 'function') { + this.onclose(); + } + } + }, { + key: "dragStart", + value: function dragStart(e) { + e.preventDefault(); + if (!this.zoomedIn) { + this.active = false; + return; + } + if (e.type === 'touchstart') { + this.initialX = e.touches[0].clientX - this.xOffset; + this.initialY = e.touches[0].clientY - this.yOffset; + } else { + this.initialX = e.clientX - this.xOffset; + this.initialY = e.clientY - this.yOffset; + } + if (e.target === this.img) { + this.active = true; + this.img.classList.add('dragging'); + } + } + }, { + key: "dragEnd", + value: function dragEnd(e) { + var _this2 = this; + e.preventDefault(); + this.initialX = this.currentX; + this.initialY = this.currentY; + this.active = false; + setTimeout(function () { + _this2.dragging = false; + _this2.img.isDragging = false; + _this2.img.classList.remove('dragging'); + }, 100); + } + }, { + key: "drag", + value: function drag(e) { + if (this.active) { + e.preventDefault(); + if (e.type === 'touchmove') { + this.currentX = e.touches[0].clientX - this.initialX; + this.currentY = e.touches[0].clientY - this.initialY; + } else { + this.currentX = e.clientX - this.initialX; + this.currentY = e.clientY - this.initialY; + } + this.xOffset = this.currentX; + this.yOffset = this.currentY; + this.img.isDragging = true; + this.dragging = true; + this.setTranslate(this.img, this.currentX, this.currentY); + } + } + }, { + key: "onMove", + value: function onMove(e) { + if (!this.zoomedIn) { + return; + } + var xOffset = e.clientX - this.img.naturalWidth / 2; + var yOffset = e.clientY - this.img.naturalHeight / 2; + this.setTranslate(this.img, xOffset, yOffset); + } + }, { + key: "setTranslate", + value: function setTranslate(node, xPos, yPos) { + node.style.transform = 'translate3d(' + xPos + 'px, ' + yPos + 'px, 0)'; + } + }, { + key: "widowWidth", + value: function widowWidth() { + return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + } + }]); + }(); + + var DragSlides = function () { + function DragSlides() { + var _this = this; + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + _classCallCheck(this, DragSlides); + var dragEl = config.dragEl, + _config$toleranceX = config.toleranceX, + toleranceX = _config$toleranceX === void 0 ? 40 : _config$toleranceX, + _config$toleranceY = config.toleranceY, + toleranceY = _config$toleranceY === void 0 ? 65 : _config$toleranceY, + _config$slide = config.slide, + slide = _config$slide === void 0 ? null : _config$slide, + _config$instance = config.instance, + instance = _config$instance === void 0 ? null : _config$instance; + this.el = dragEl; + this.active = false; + this.dragging = false; + this.currentX = null; + this.currentY = null; + this.initialX = null; + this.initialY = null; + this.xOffset = 0; + this.yOffset = 0; + this.direction = null; + this.lastDirection = null; + this.toleranceX = toleranceX; + this.toleranceY = toleranceY; + this.toleranceReached = false; + this.dragContainer = this.el; + this.slide = slide; + this.instance = instance; + this.el.addEventListener('mousedown', function (e) { + return _this.dragStart(e); + }, false); + this.el.addEventListener('mouseup', function (e) { + return _this.dragEnd(e); + }, false); + this.el.addEventListener('mousemove', function (e) { + return _this.drag(e); + }, false); + } + return _createClass(DragSlides, [{ + key: "dragStart", + value: function dragStart(e) { + if (this.slide.classList.contains('zoomed')) { + this.active = false; + return; + } + if (e.type === 'touchstart') { + this.initialX = e.touches[0].clientX - this.xOffset; + this.initialY = e.touches[0].clientY - this.yOffset; + } else { + this.initialX = e.clientX - this.xOffset; + this.initialY = e.clientY - this.yOffset; + } + var clicked = e.target.nodeName.toLowerCase(); + var exludeClicks = ['input', 'select', 'textarea', 'button', 'a']; + if (e.target.classList.contains('nodrag') || closest(e.target, '.nodrag') || exludeClicks.indexOf(clicked) !== -1) { + this.active = false; + return; + } + e.preventDefault(); + if (e.target === this.el || clicked !== 'img' && closest(e.target, '.gslide-inline')) { + this.active = true; + this.el.classList.add('dragging'); + this.dragContainer = closest(e.target, '.ginner-container'); + } + } + }, { + key: "dragEnd", + value: function dragEnd(e) { + var _this2 = this; + e && e.preventDefault(); + this.initialX = 0; + this.initialY = 0; + this.currentX = null; + this.currentY = null; + this.initialX = null; + this.initialY = null; + this.xOffset = 0; + this.yOffset = 0; + this.active = false; + if (this.doSlideChange) { + this.instance.preventOutsideClick = true; + this.doSlideChange == 'right' && this.instance.prevSlide(); + this.doSlideChange == 'left' && this.instance.nextSlide(); + } + if (this.doSlideClose) { + this.instance.close(); + } + if (!this.toleranceReached) { + this.setTranslate(this.dragContainer, 0, 0, true); + } + setTimeout(function () { + _this2.instance.preventOutsideClick = false; + _this2.toleranceReached = false; + _this2.lastDirection = null; + _this2.dragging = false; + _this2.el.isDragging = false; + _this2.el.classList.remove('dragging'); + _this2.slide.classList.remove('dragging-nav'); + _this2.dragContainer.style.transform = ''; + _this2.dragContainer.style.transition = ''; + }, 100); + } + }, { + key: "drag", + value: function drag(e) { + if (this.active) { + e.preventDefault(); + this.slide.classList.add('dragging-nav'); + if (e.type === 'touchmove') { + this.currentX = e.touches[0].clientX - this.initialX; + this.currentY = e.touches[0].clientY - this.initialY; + } else { + this.currentX = e.clientX - this.initialX; + this.currentY = e.clientY - this.initialY; + } + this.xOffset = this.currentX; + this.yOffset = this.currentY; + this.el.isDragging = true; + this.dragging = true; + this.doSlideChange = false; + this.doSlideClose = false; + var currentXInt = Math.abs(this.currentX); + var currentYInt = Math.abs(this.currentY); + if (currentXInt > 0 && currentXInt >= Math.abs(this.currentY) && (!this.lastDirection || this.lastDirection == 'x')) { + this.yOffset = 0; + this.lastDirection = 'x'; + this.setTranslate(this.dragContainer, this.currentX, 0); + var doChange = this.shouldChange(); + if (!this.instance.settings.dragAutoSnap && doChange) { + this.doSlideChange = doChange; + } + if (this.instance.settings.dragAutoSnap && doChange) { + this.instance.preventOutsideClick = true; + this.toleranceReached = true; + this.active = false; + this.instance.preventOutsideClick = true; + this.dragEnd(null); + doChange == 'right' && this.instance.prevSlide(); + doChange == 'left' && this.instance.nextSlide(); + return; + } + } + if (this.toleranceY > 0 && currentYInt > 0 && currentYInt >= currentXInt && (!this.lastDirection || this.lastDirection == 'y')) { + this.xOffset = 0; + this.lastDirection = 'y'; + this.setTranslate(this.dragContainer, 0, this.currentY); + var doClose = this.shouldClose(); + if (!this.instance.settings.dragAutoSnap && doClose) { + this.doSlideClose = true; + } + if (this.instance.settings.dragAutoSnap && doClose) { + this.instance.close(); + } + return; + } + } + } + }, { + key: "shouldChange", + value: function shouldChange() { + var doChange = false; + var currentXInt = Math.abs(this.currentX); + if (currentXInt >= this.toleranceX) { + var dragDir = this.currentX > 0 ? 'right' : 'left'; + if (dragDir == 'left' && this.slide !== this.slide.parentNode.lastChild || dragDir == 'right' && this.slide !== this.slide.parentNode.firstChild) { + doChange = dragDir; + } + } + return doChange; + } + }, { + key: "shouldClose", + value: function shouldClose() { + var doClose = false; + var currentYInt = Math.abs(this.currentY); + if (currentYInt >= this.toleranceY) { + doClose = true; + } + return doClose; + } + }, { + key: "setTranslate", + value: function setTranslate(node, xPos, yPos) { + var animated = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + if (animated) { + node.style.transition = 'all .2s ease'; + } else { + node.style.transition = ''; + } + node.style.transform = "translate3d(".concat(xPos, "px, ").concat(yPos, "px, 0)"); + } + }]); + }(); + + function slideImage(slide, data, index, callback) { + var slideMedia = slide.querySelector('.gslide-media'); + var img = new Image(); + var titleID = 'gSlideTitle_' + index; + var textID = 'gSlideDesc_' + index; + img.addEventListener('load', function () { + if (isFunction(callback)) { + callback(); + } + }, false); + img.src = data.href; + if (data.sizes != '' && data.srcset != '') { + img.sizes = data.sizes; + img.srcset = data.srcset; + } + img.alt = ''; + if (!isNil(data.alt) && data.alt !== '') { + img.alt = data.alt; + } + if (data.title !== '') { + img.setAttribute('aria-labelledby', titleID); + } + if (data.description !== '') { + img.setAttribute('aria-describedby', textID); + } + if (data.hasOwnProperty('_hasCustomWidth') && data._hasCustomWidth) { + img.style.width = data.width; + } + if (data.hasOwnProperty('_hasCustomHeight') && data._hasCustomHeight) { + img.style.height = data.height; + } + slideMedia.insertBefore(img, slideMedia.firstChild); + return; + } + + function slideVideo(slide, data, index, callback) { + var _this = this; + var slideContainer = slide.querySelector('.ginner-container'); + var videoID = 'gvideo' + index; + var slideMedia = slide.querySelector('.gslide-media'); + var videoPlayers = this.getAllPlayers(); + addClass(slideContainer, 'gvideo-container'); + slideMedia.insertBefore(createHTML('
'), slideMedia.firstChild); + var videoWrapper = slide.querySelector('.gvideo-wrapper'); + injectAssets(this.settings.plyr.css, 'Plyr'); + var url = data.href; + var provider = data === null || data === void 0 ? void 0 : data.videoProvider; + var customPlaceholder = false; + slideMedia.style.maxWidth = data.width; + injectAssets(this.settings.plyr.js, 'Plyr', function () { + if (!provider && url.match(/vimeo\.com\/([0-9]*)/)) { + provider = 'vimeo'; + } + if (!provider && (url.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || url.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || url.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/) || url.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/))) { + provider = 'youtube'; + } + if (provider === 'local' || !provider) { + provider = 'local'; + var html = ''; + customPlaceholder = createHTML(html); + } + var placeholder = customPlaceholder ? customPlaceholder : createHTML("
")); + addClass(videoWrapper, "".concat(provider, "-video gvideo")); + videoWrapper.appendChild(placeholder); + videoWrapper.setAttribute('data-id', videoID); + videoWrapper.setAttribute('data-index', index); + var playerConfig = has(_this.settings.plyr, 'config') ? _this.settings.plyr.config : {}; + var player = new Plyr('#' + videoID, playerConfig); + player.on('ready', function (event) { + videoPlayers[videoID] = event.detail.plyr; + if (isFunction(callback)) { + callback(); + } + }); + waitUntil(function () { + return slide.querySelector('iframe') && slide.querySelector('iframe').dataset.ready == 'true'; + }, function () { + _this.resize(slide); + }); + player.on('enterfullscreen', handleMediaFullScreen); + player.on('exitfullscreen', handleMediaFullScreen); + }); + } + function handleMediaFullScreen(event) { + var media = closest(event.target, '.gslide-media'); + if (event.type === 'enterfullscreen') { + addClass(media, 'fullscreen'); + } + if (event.type === 'exitfullscreen') { + removeClass(media, 'fullscreen'); + } + } + + function slideInline(slide, data, index, callback) { + var _this = this; + var slideMedia = slide.querySelector('.gslide-media'); + var hash = has(data, 'href') && data.href ? data.href.split('#').pop().trim() : false; + var content = has(data, 'content') && data.content ? data.content : false; + var innerContent; + if (content) { + if (isString(content)) { + innerContent = createHTML("
".concat(content, "
")); + } + if (isNode(content)) { + if (content.style.display == 'none') { + content.style.display = 'block'; + } + var container = document.createElement('div'); + container.className = 'ginlined-content'; + container.appendChild(content); + innerContent = container; + } + } + if (hash) { + var div = document.getElementById(hash); + if (!div) { + return false; + } + var cloned = div.cloneNode(true); + cloned.style.height = data.height; + cloned.style.maxWidth = data.width; + addClass(cloned, 'ginlined-content'); + innerContent = cloned; + } + if (!innerContent) { + console.error('Unable to append inline slide content', data); + return false; + } + slideMedia.style.height = data.height; + slideMedia.style.width = data.width; + slideMedia.appendChild(innerContent); + this.events['inlineclose' + hash] = addEvent('click', { + onElement: slideMedia.querySelectorAll('.gtrigger-close'), + withCallback: function withCallback(e) { + e.preventDefault(); + _this.close(); + } + }); + if (isFunction(callback)) { + callback(); + } + return; + } + + function slideIframe(slide, data, index, callback) { + var slideMedia = slide.querySelector('.gslide-media'); + var iframe = createIframe({ + url: data.href, + callback: callback + }); + slideMedia.parentNode.style.maxWidth = data.width; + slideMedia.parentNode.style.height = data.height; + slideMedia.appendChild(iframe); + return; + } + + var SlideConfigParser = function () { + function SlideConfigParser() { + var slideParamas = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + _classCallCheck(this, SlideConfigParser); + this.defaults = { + href: '', + sizes: '', + srcset: '', + title: '', + type: '', + videoProvider: '', + description: '', + alt: '', + descPosition: 'bottom', + effect: '', + width: '', + height: '', + content: false, + zoomable: true, + draggable: true + }; + if (isObject(slideParamas)) { + this.defaults = extend(this.defaults, slideParamas); + } + } + return _createClass(SlideConfigParser, [{ + key: "sourceType", + value: function sourceType(url) { + var origin = url; + url = url.toLowerCase(); + if (url.match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/) !== null) { + return 'image'; + } + if (url.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || url.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/) || url.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/) || url.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/)) { + return 'video'; + } + if (url.match(/vimeo\.com\/([0-9]*)/)) { + return 'video'; + } + if (url.match(/\.(mp4|ogg|webm|mov)/) !== null) { + return 'video'; + } + if (url.match(/\.(mp3|wav|wma|aac|ogg)/) !== null) { + return 'audio'; + } + if (url.indexOf('#') > -1) { + var hash = origin.split('#').pop(); + if (hash.trim() !== '') { + return 'inline'; + } + } + if (url.indexOf('goajax=true') > -1) { + return 'ajax'; + } + return 'external'; + } + }, { + key: "parseConfig", + value: function parseConfig(element, settings) { + var _this = this; + var data = extend({ + descPosition: settings.descPosition + }, this.defaults); + if (isObject(element) && !isNode(element)) { + if (!has(element, 'type')) { + if (has(element, 'content') && element.content) { + element.type = 'inline'; + } else if (has(element, 'href')) { + element.type = this.sourceType(element.href); + } + } + var objectData = extend(data, element); + this.setSize(objectData, settings); + return objectData; + } + var url = ''; + var config = element.getAttribute('data-glightbox'); + var nodeType = element.nodeName.toLowerCase(); + if (nodeType === 'a') { + url = element.href; + } + if (nodeType === 'img') { + url = element.src; + data.alt = element.alt; + } + data.href = url; + each(data, function (val, key) { + if (has(settings, key) && key !== 'width') { + data[key] = settings[key]; + } + var nodeData = element.dataset[key]; + if (!isNil(nodeData)) { + data[key] = _this.sanitizeValue(nodeData); + } + }); + if (data.content) { + data.type = 'inline'; + } + if (!data.type && url) { + data.type = this.sourceType(url); + } + if (!isNil(config)) { + var cleanKeys = []; + each(data, function (v, k) { + cleanKeys.push(';\\s?' + k); + }); + cleanKeys = cleanKeys.join('\\s?:|'); + if (config.trim() !== '') { + each(data, function (val, key) { + var str = config; + var match = 's?' + key + 's?:s?(.*?)(' + cleanKeys + 's?:|$)'; + var regex = new RegExp(match); + var matches = str.match(regex); + if (matches && matches.length && matches[1]) { + var value = matches[1].trim().replace(/;\s*$/, ''); + data[key] = _this.sanitizeValue(value); + } + }); + } + } else { + if (!data.title && nodeType == 'a') { + var title = element.title; + if (!isNil(title) && title !== '') { + data.title = title; + } + } + if (!data.title && nodeType == 'img') { + var alt = element.alt; + if (!isNil(alt) && alt !== '') { + data.title = alt; + } + } + } + if (data.description && data.description.substring(0, 1) === '.') { + var description; + try { + description = document.querySelector(data.description).innerHTML; + } catch (error) { + if (!(error instanceof DOMException)) { + throw error; + } + } + if (description) { + data.description = description; + } + } + if (!data.description) { + var nodeDesc = element.querySelector('.glightbox-desc'); + if (nodeDesc) { + data.description = nodeDesc.innerHTML; + } + } + this.setSize(data, settings, element); + this.slideConfig = data; + return data; + } + }, { + key: "setSize", + value: function setSize(data, settings) { + var element = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + var defaultWith = data.type == 'video' ? this.checkSize(settings.videosWidth) : this.checkSize(settings.width); + var defaultHeight = this.checkSize(settings.height); + data.width = has(data, 'width') && data.width !== '' ? this.checkSize(data.width) : defaultWith; + data.height = has(data, 'height') && data.height !== '' ? this.checkSize(data.height) : defaultHeight; + if (element && data.type == 'image') { + data._hasCustomWidth = element.dataset.width ? true : false; + data._hasCustomHeight = element.dataset.height ? true : false; + } + return data; + } + }, { + key: "checkSize", + value: function checkSize(size) { + return isNumber(size) ? "".concat(size, "px") : size; + } + }, { + key: "sanitizeValue", + value: function sanitizeValue(val) { + if (val !== 'true' && val !== 'false') { + return val; + } + return val === 'true'; + } + }]); + }(); + + var Slide = function () { + function Slide(el, instance, index) { + _classCallCheck(this, Slide); + this.element = el; + this.instance = instance; + this.index = index; + } + return _createClass(Slide, [{ + key: "setContent", + value: function setContent() { + var _this = this; + var slide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + if (hasClass(slide, 'loaded')) { + return false; + } + var settings = this.instance.settings; + var slideConfig = this.slideConfig; + var isMobileDevice = isMobile(); + if (isFunction(settings.beforeSlideLoad)) { + settings.beforeSlideLoad({ + index: this.index, + slide: slide, + player: false + }); + } + var type = slideConfig.type; + var position = slideConfig.descPosition; + var slideMedia = slide.querySelector('.gslide-media'); + var slideTitle = slide.querySelector('.gslide-title'); + var slideText = slide.querySelector('.gslide-desc'); + var slideDesc = slide.querySelector('.gdesc-inner'); + var finalCallback = callback; + var titleID = 'gSlideTitle_' + this.index; + var textID = 'gSlideDesc_' + this.index; + if (isFunction(settings.afterSlideLoad)) { + finalCallback = function finalCallback() { + if (isFunction(callback)) { + callback(); + } + settings.afterSlideLoad({ + index: _this.index, + slide: slide, + player: _this.instance.getSlidePlayerInstance(_this.index) + }); + }; + } + if (slideConfig.title == '' && slideConfig.description == '') { + if (slideDesc) { + slideDesc.parentNode.parentNode.removeChild(slideDesc.parentNode); + } + } else { + if (slideTitle && slideConfig.title !== '') { + slideTitle.id = titleID; + slideTitle.innerHTML = slideConfig.title; + } else { + slideTitle.parentNode.removeChild(slideTitle); + } + if (slideText && slideConfig.description !== '') { + slideText.id = textID; + if (isMobileDevice && settings.moreLength > 0) { + slideConfig.smallDescription = this.slideShortDesc(slideConfig.description, settings.moreLength, settings.moreText); + slideText.innerHTML = slideConfig.smallDescription; + this.descriptionEvents(slideText, slideConfig); + } else { + slideText.innerHTML = slideConfig.description; + } + } else { + slideText.parentNode.removeChild(slideText); + } + addClass(slideMedia.parentNode, "desc-".concat(position)); + addClass(slideDesc.parentNode, "description-".concat(position)); + } + addClass(slideMedia, "gslide-".concat(type)); + addClass(slide, 'loaded'); + if (type === 'video') { + slideVideo.apply(this.instance, [slide, slideConfig, this.index, finalCallback]); + return; + } + if (type === 'external') { + slideIframe.apply(this, [slide, slideConfig, this.index, finalCallback]); + return; + } + if (type === 'inline') { + slideInline.apply(this.instance, [slide, slideConfig, this.index, finalCallback]); + if (slideConfig.draggable) { + new DragSlides({ + dragEl: slide.querySelector('.gslide-inline'), + toleranceX: settings.dragToleranceX, + toleranceY: settings.dragToleranceY, + slide: slide, + instance: this.instance + }); + } + return; + } + if (type === 'image') { + slideImage(slide, slideConfig, this.index, function () { + var img = slide.querySelector('img'); + if (slideConfig.draggable) { + new DragSlides({ + dragEl: img, + toleranceX: settings.dragToleranceX, + toleranceY: settings.dragToleranceY, + slide: slide, + instance: _this.instance + }); + } + if (slideConfig.zoomable && img.naturalWidth > img.offsetWidth) { + addClass(img, 'zoomable'); + new ZoomImages(img, slide, function () { + _this.instance.resize(); + }); + } + if (isFunction(finalCallback)) { + finalCallback(); + } + }); + return; + } + if (isFunction(finalCallback)) { + finalCallback(); + } + } + }, { + key: "slideShortDesc", + value: function slideShortDesc(string) { + var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50; + var wordBoundary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var div = document.createElement('div'); + div.innerHTML = string; + var cleanedString = div.innerText; + var useWordBoundary = wordBoundary; + string = cleanedString.trim(); + if (string.length <= n) { + return string; + } + var subString = string.substr(0, n - 1); + if (!useWordBoundary) { + return subString; + } + div = null; + return subString + '... ' + wordBoundary + ''; + } + }, { + key: "descriptionEvents", + value: function descriptionEvents(desc, data) { + var _this2 = this; + var moreLink = desc.querySelector('.desc-more'); + if (!moreLink) { + return false; + } + addEvent('click', { + onElement: moreLink, + withCallback: function withCallback(event, target) { + event.preventDefault(); + var body = document.body; + var desc = closest(target, '.gslide-desc'); + if (!desc) { + return false; + } + desc.innerHTML = data.description; + addClass(body, 'gdesc-open'); + var shortEvent = addEvent('click', { + onElement: [body, closest(desc, '.gslide-description')], + withCallback: function withCallback(event, target) { + if (event.target.nodeName.toLowerCase() !== 'a') { + removeClass(body, 'gdesc-open'); + addClass(body, 'gdesc-closed'); + desc.innerHTML = data.smallDescription; + _this2.descriptionEvents(desc, data); + setTimeout(function () { + removeClass(body, 'gdesc-closed'); + }, 400); + shortEvent.destroy(); + } + } + }); + } + }); + } + }, { + key: "create", + value: function create() { + return createHTML(this.instance.settings.slideHTML); + } + }, { + key: "getConfig", + value: function getConfig() { + if (!isNode(this.element) && !this.element.hasOwnProperty('draggable')) { + this.element.draggable = this.instance.settings.draggable; + } + var parser = new SlideConfigParser(this.instance.settings.slideExtraAttributes); + this.slideConfig = parser.parseConfig(this.element, this.instance.settings); + return this.slideConfig; + } + }]); + }(); + + function getLen(v) { + return Math.sqrt(v.x * v.x + v.y * v.y); + } + function dot(v1, v2) { + return v1.x * v2.x + v1.y * v2.y; + } + function getAngle(v1, v2) { + var mr = getLen(v1) * getLen(v2); + if (mr === 0) { + return 0; + } + var r = dot(v1, v2) / mr; + if (r > 1) { + r = 1; + } + return Math.acos(r); + } + function cross(v1, v2) { + return v1.x * v2.y - v2.x * v1.y; + } + function getRotateAngle(v1, v2) { + var angle = getAngle(v1, v2); + if (cross(v1, v2) > 0) { + angle *= -1; + } + return angle * 180 / Math.PI; + } + var EventsHandlerAdmin = function () { + function EventsHandlerAdmin(el) { + _classCallCheck(this, EventsHandlerAdmin); + this.handlers = []; + this.el = el; + } + return _createClass(EventsHandlerAdmin, [{ + key: "add", + value: function add(handler) { + this.handlers.push(handler); + } + }, { + key: "del", + value: function del(handler) { + if (!handler) { + this.handlers = []; + } + for (var i = this.handlers.length; i >= 0; i--) { + if (this.handlers[i] === handler) { + this.handlers.splice(i, 1); + } + } + } + }, { + key: "dispatch", + value: function dispatch() { + for (var i = 0, len = this.handlers.length; i < len; i++) { + var handler = this.handlers[i]; + if (typeof handler === 'function') { + handler.apply(this.el, arguments); + } + } + } + }]); + }(); + function wrapFunc(el, handler) { + var EventshandlerAdmin = new EventsHandlerAdmin(el); + EventshandlerAdmin.add(handler); + return EventshandlerAdmin; + } + var TouchEvents = function () { + function TouchEvents(el, option) { + _classCallCheck(this, TouchEvents); + this.element = typeof el == 'string' ? document.querySelector(el) : el; + this.start = this.start.bind(this); + this.move = this.move.bind(this); + this.end = this.end.bind(this); + this.cancel = this.cancel.bind(this); + this.element.addEventListener('touchstart', this.start, false); + this.element.addEventListener('touchmove', this.move, false); + this.element.addEventListener('touchend', this.end, false); + this.element.addEventListener('touchcancel', this.cancel, false); + this.preV = { + x: null, + y: null + }; + this.pinchStartLen = null; + this.zoom = 1; + this.isDoubleTap = false; + var noop = function noop() {}; + this.rotate = wrapFunc(this.element, option.rotate || noop); + this.touchStart = wrapFunc(this.element, option.touchStart || noop); + this.multipointStart = wrapFunc(this.element, option.multipointStart || noop); + this.multipointEnd = wrapFunc(this.element, option.multipointEnd || noop); + this.pinch = wrapFunc(this.element, option.pinch || noop); + this.swipe = wrapFunc(this.element, option.swipe || noop); + this.tap = wrapFunc(this.element, option.tap || noop); + this.doubleTap = wrapFunc(this.element, option.doubleTap || noop); + this.longTap = wrapFunc(this.element, option.longTap || noop); + this.singleTap = wrapFunc(this.element, option.singleTap || noop); + this.pressMove = wrapFunc(this.element, option.pressMove || noop); + this.twoFingerPressMove = wrapFunc(this.element, option.twoFingerPressMove || noop); + this.touchMove = wrapFunc(this.element, option.touchMove || noop); + this.touchEnd = wrapFunc(this.element, option.touchEnd || noop); + this.touchCancel = wrapFunc(this.element, option.touchCancel || noop); + this.translateContainer = this.element; + this._cancelAllHandler = this.cancelAll.bind(this); + window.addEventListener('scroll', this._cancelAllHandler); + this.delta = null; + this.last = null; + this.now = null; + this.tapTimeout = null; + this.singleTapTimeout = null; + this.longTapTimeout = null; + this.swipeTimeout = null; + this.x1 = this.x2 = this.y1 = this.y2 = null; + this.preTapPosition = { + x: null, + y: null + }; + } + return _createClass(TouchEvents, [{ + key: "start", + value: function start(evt) { + if (!evt.touches) { + return; + } + var ignoreDragFor = ['a', 'button', 'input']; + if (evt.target && evt.target.nodeName && ignoreDragFor.indexOf(evt.target.nodeName.toLowerCase()) >= 0) { + console.log('ignore drag for this touched element', evt.target.nodeName.toLowerCase()); + return; + } + this.now = Date.now(); + this.x1 = evt.touches[0].pageX; + this.y1 = evt.touches[0].pageY; + this.delta = this.now - (this.last || this.now); + this.touchStart.dispatch(evt, this.element); + if (this.preTapPosition.x !== null) { + this.isDoubleTap = this.delta > 0 && this.delta <= 250 && Math.abs(this.preTapPosition.x - this.x1) < 30 && Math.abs(this.preTapPosition.y - this.y1) < 30; + if (this.isDoubleTap) { + clearTimeout(this.singleTapTimeout); + } + } + this.preTapPosition.x = this.x1; + this.preTapPosition.y = this.y1; + this.last = this.now; + var preV = this.preV, + len = evt.touches.length; + if (len > 1) { + this._cancelLongTap(); + this._cancelSingleTap(); + var v = { + x: evt.touches[1].pageX - this.x1, + y: evt.touches[1].pageY - this.y1 + }; + preV.x = v.x; + preV.y = v.y; + this.pinchStartLen = getLen(preV); + this.multipointStart.dispatch(evt, this.element); + } + this._preventTap = false; + this.longTapTimeout = setTimeout(function () { + this.longTap.dispatch(evt, this.element); + this._preventTap = true; + }.bind(this), 750); + } + }, { + key: "move", + value: function move(evt) { + if (!evt.touches) { + return; + } + var preV = this.preV, + len = evt.touches.length, + currentX = evt.touches[0].pageX, + currentY = evt.touches[0].pageY; + this.isDoubleTap = false; + if (len > 1) { + var sCurrentX = evt.touches[1].pageX, + sCurrentY = evt.touches[1].pageY; + var v = { + x: evt.touches[1].pageX - currentX, + y: evt.touches[1].pageY - currentY + }; + if (preV.x !== null) { + if (this.pinchStartLen > 0) { + evt.zoom = getLen(v) / this.pinchStartLen; + this.pinch.dispatch(evt, this.element); + } + evt.angle = getRotateAngle(v, preV); + this.rotate.dispatch(evt, this.element); + } + preV.x = v.x; + preV.y = v.y; + if (this.x2 !== null && this.sx2 !== null) { + evt.deltaX = (currentX - this.x2 + sCurrentX - this.sx2) / 2; + evt.deltaY = (currentY - this.y2 + sCurrentY - this.sy2) / 2; + } else { + evt.deltaX = 0; + evt.deltaY = 0; + } + this.twoFingerPressMove.dispatch(evt, this.element); + this.sx2 = sCurrentX; + this.sy2 = sCurrentY; + } else { + if (this.x2 !== null) { + evt.deltaX = currentX - this.x2; + evt.deltaY = currentY - this.y2; + var movedX = Math.abs(this.x1 - this.x2), + movedY = Math.abs(this.y1 - this.y2); + if (movedX > 10 || movedY > 10) { + this._preventTap = true; + } + } else { + evt.deltaX = 0; + evt.deltaY = 0; + } + this.pressMove.dispatch(evt, this.element); + } + this.touchMove.dispatch(evt, this.element); + this._cancelLongTap(); + this.x2 = currentX; + this.y2 = currentY; + if (len > 1) { + evt.preventDefault(); + } + } + }, { + key: "end", + value: function end(evt) { + if (!evt.changedTouches) { + return; + } + this._cancelLongTap(); + var self = this; + if (evt.touches.length < 2) { + this.multipointEnd.dispatch(evt, this.element); + this.sx2 = this.sy2 = null; + } + if (this.x2 && Math.abs(this.x1 - this.x2) > 30 || this.y2 && Math.abs(this.y1 - this.y2) > 30) { + evt.direction = this._swipeDirection(this.x1, this.x2, this.y1, this.y2); + this.swipeTimeout = setTimeout(function () { + self.swipe.dispatch(evt, self.element); + }, 0); + } else { + this.tapTimeout = setTimeout(function () { + if (!self._preventTap) { + self.tap.dispatch(evt, self.element); + } + if (self.isDoubleTap) { + self.doubleTap.dispatch(evt, self.element); + self.isDoubleTap = false; + } + }, 0); + if (!self.isDoubleTap) { + self.singleTapTimeout = setTimeout(function () { + self.singleTap.dispatch(evt, self.element); + }, 250); + } + } + this.touchEnd.dispatch(evt, this.element); + this.preV.x = 0; + this.preV.y = 0; + this.zoom = 1; + this.pinchStartLen = null; + this.x1 = this.x2 = this.y1 = this.y2 = null; + } + }, { + key: "cancelAll", + value: function cancelAll() { + this._preventTap = true; + clearTimeout(this.singleTapTimeout); + clearTimeout(this.tapTimeout); + clearTimeout(this.longTapTimeout); + clearTimeout(this.swipeTimeout); + } + }, { + key: "cancel", + value: function cancel(evt) { + this.cancelAll(); + this.touchCancel.dispatch(evt, this.element); + } + }, { + key: "_cancelLongTap", + value: function _cancelLongTap() { + clearTimeout(this.longTapTimeout); + } + }, { + key: "_cancelSingleTap", + value: function _cancelSingleTap() { + clearTimeout(this.singleTapTimeout); + } + }, { + key: "_swipeDirection", + value: function _swipeDirection(x1, x2, y1, y2) { + return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? 'Left' : 'Right' : y1 - y2 > 0 ? 'Up' : 'Down'; + } + }, { + key: "on", + value: function on(evt, handler) { + if (this[evt]) { + this[evt].add(handler); + } + } + }, { + key: "off", + value: function off(evt, handler) { + if (this[evt]) { + this[evt].del(handler); + } + } + }, { + key: "destroy", + value: function destroy() { + if (this.singleTapTimeout) { + clearTimeout(this.singleTapTimeout); + } + if (this.tapTimeout) { + clearTimeout(this.tapTimeout); + } + if (this.longTapTimeout) { + clearTimeout(this.longTapTimeout); + } + if (this.swipeTimeout) { + clearTimeout(this.swipeTimeout); + } + this.element.removeEventListener('touchstart', this.start); + this.element.removeEventListener('touchmove', this.move); + this.element.removeEventListener('touchend', this.end); + this.element.removeEventListener('touchcancel', this.cancel); + this.rotate.del(); + this.touchStart.del(); + this.multipointStart.del(); + this.multipointEnd.del(); + this.pinch.del(); + this.swipe.del(); + this.tap.del(); + this.doubleTap.del(); + this.longTap.del(); + this.singleTap.del(); + this.pressMove.del(); + this.twoFingerPressMove.del(); + this.touchMove.del(); + this.touchEnd.del(); + this.touchCancel.del(); + this.preV = this.pinchStartLen = this.zoom = this.isDoubleTap = this.delta = this.last = this.now = this.tapTimeout = this.singleTapTimeout = this.longTapTimeout = this.swipeTimeout = this.x1 = this.x2 = this.y1 = this.y2 = this.preTapPosition = this.rotate = this.touchStart = this.multipointStart = this.multipointEnd = this.pinch = this.swipe = this.tap = this.doubleTap = this.longTap = this.singleTap = this.pressMove = this.touchMove = this.touchEnd = this.touchCancel = this.twoFingerPressMove = null; + window.removeEventListener('scroll', this._cancelAllHandler); + return null; + } + }]); + }(); + + function resetSlideMove(slide) { + var transitionEnd = whichTransitionEvent(); + var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + var media = hasClass(slide, 'gslide-media') ? slide : slide.querySelector('.gslide-media'); + var container = closest(media, '.ginner-container'); + var desc = slide.querySelector('.gslide-description'); + if (windowWidth > 769) { + media = container; + } + addClass(media, 'greset'); + cssTransform(media, 'translate3d(0, 0, 0)'); + addEvent(transitionEnd, { + onElement: media, + once: true, + withCallback: function withCallback(event, target) { + removeClass(media, 'greset'); + } + }); + media.style.opacity = ''; + if (desc) { + desc.style.opacity = ''; + } + } + function touchNavigation(instance) { + if (instance.events.hasOwnProperty('touch')) { + return false; + } + var winSize = windowSize(); + var winWidth = winSize.width; + var winHeight = winSize.height; + var process = false; + var currentSlide = null; + var media = null; + var mediaImage = null; + var doingMove = false; + var initScale = 1; + var maxScale = 4.5; + var currentScale = 1; + var doingZoom = false; + var imageZoomed = false; + var zoomedPosX = null; + var zoomedPosY = null; + var lastZoomedPosX = null; + var lastZoomedPosY = null; + var hDistance; + var vDistance; + var hDistancePercent = 0; + var vDistancePercent = 0; + var vSwipe = false; + var hSwipe = false; + var startCoords = {}; + var endCoords = {}; + var xDown = 0; + var yDown = 0; + var isInlined; + var sliderWrapper = document.getElementById('glightbox-slider'); + var overlay = document.querySelector('.goverlay'); + var touchInstance = new TouchEvents(sliderWrapper, { + touchStart: function touchStart(e) { + process = true; + if (hasClass(e.targetTouches[0].target, 'ginner-container') || closest(e.targetTouches[0].target, '.gslide-desc') || e.targetTouches[0].target.nodeName.toLowerCase() == 'a') { + process = false; + } + if (closest(e.targetTouches[0].target, '.gslide-inline') && !hasClass(e.targetTouches[0].target.parentNode, 'gslide-inline')) { + process = false; + } + if (process) { + endCoords = e.targetTouches[0]; + startCoords.pageX = e.targetTouches[0].pageX; + startCoords.pageY = e.targetTouches[0].pageY; + xDown = e.targetTouches[0].clientX; + yDown = e.targetTouches[0].clientY; + currentSlide = instance.activeSlide; + media = currentSlide.querySelector('.gslide-media'); + isInlined = currentSlide.querySelector('.gslide-inline'); + mediaImage = null; + if (hasClass(media, 'gslide-image')) { + mediaImage = media.querySelector('img'); + } + var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + if (windowWidth > 769) { + media = currentSlide.querySelector('.ginner-container'); + } + removeClass(overlay, 'greset'); + if (e.pageX > 20 && e.pageX < window.innerWidth - 20) { + return; + } + e.preventDefault(); + } + }, + touchMove: function touchMove(e) { + if (!process) { + return; + } + endCoords = e.targetTouches[0]; + if (doingZoom || imageZoomed) { + return; + } + if (isInlined && isInlined.offsetHeight > winHeight) { + var moved = startCoords.pageX - endCoords.pageX; + if (Math.abs(moved) <= 13) { + return false; + } + } + doingMove = true; + var xUp = e.targetTouches[0].clientX; + var yUp = e.targetTouches[0].clientY; + var xDiff = xDown - xUp; + var yDiff = yDown - yUp; + if (Math.abs(xDiff) > Math.abs(yDiff)) { + vSwipe = false; + hSwipe = true; + } else { + hSwipe = false; + vSwipe = true; + } + hDistance = endCoords.pageX - startCoords.pageX; + hDistancePercent = hDistance * 100 / winWidth; + vDistance = endCoords.pageY - startCoords.pageY; + vDistancePercent = vDistance * 100 / winHeight; + var opacity; + if (vSwipe && mediaImage) { + opacity = 1 - Math.abs(vDistance) / winHeight; + overlay.style.opacity = opacity; + if (instance.settings.touchFollowAxis) { + hDistancePercent = 0; + } + } + if (hSwipe) { + opacity = 1 - Math.abs(hDistance) / winWidth; + media.style.opacity = opacity; + if (instance.settings.touchFollowAxis) { + vDistancePercent = 0; + } + } + if (!mediaImage) { + return cssTransform(media, "translate3d(".concat(hDistancePercent, "%, 0, 0)")); + } + cssTransform(media, "translate3d(".concat(hDistancePercent, "%, ").concat(vDistancePercent, "%, 0)")); + }, + touchEnd: function touchEnd() { + if (!process) { + return; + } + doingMove = false; + if (imageZoomed || doingZoom) { + lastZoomedPosX = zoomedPosX; + lastZoomedPosY = zoomedPosY; + return; + } + var v = Math.abs(parseInt(vDistancePercent)); + var h = Math.abs(parseInt(hDistancePercent)); + if (v > 29 && mediaImage) { + instance.close(); + return; + } + if (v < 29 && h < 25) { + addClass(overlay, 'greset'); + overlay.style.opacity = 1; + return resetSlideMove(media); + } + }, + multipointEnd: function multipointEnd() { + setTimeout(function () { + doingZoom = false; + }, 50); + }, + multipointStart: function multipointStart() { + doingZoom = true; + initScale = currentScale ? currentScale : 1; + }, + pinch: function pinch(evt) { + if (!mediaImage || doingMove) { + return false; + } + doingZoom = true; + mediaImage.scaleX = mediaImage.scaleY = initScale * evt.zoom; + var scale = initScale * evt.zoom; + imageZoomed = true; + if (scale <= 1) { + imageZoomed = false; + scale = 1; + lastZoomedPosY = null; + lastZoomedPosX = null; + zoomedPosX = null; + zoomedPosY = null; + mediaImage.setAttribute('style', ''); + return; + } + if (scale > maxScale) { + scale = maxScale; + } + mediaImage.style.transform = "scale3d(".concat(scale, ", ").concat(scale, ", 1)"); + currentScale = scale; + }, + pressMove: function pressMove(e) { + if (imageZoomed && !doingZoom) { + var mhDistance = endCoords.pageX - startCoords.pageX; + var mvDistance = endCoords.pageY - startCoords.pageY; + if (lastZoomedPosX) { + mhDistance = mhDistance + lastZoomedPosX; + } + if (lastZoomedPosY) { + mvDistance = mvDistance + lastZoomedPosY; + } + zoomedPosX = mhDistance; + zoomedPosY = mvDistance; + var style = "translate3d(".concat(mhDistance, "px, ").concat(mvDistance, "px, 0)"); + if (currentScale) { + style += " scale3d(".concat(currentScale, ", ").concat(currentScale, ", 1)"); + } + cssTransform(mediaImage, style); + } + }, + swipe: function swipe(evt) { + if (imageZoomed) { + return; + } + if (doingZoom) { + doingZoom = false; + return; + } + if (evt.direction == 'Left') { + if (instance.index == instance.elements.length - 1) { + return resetSlideMove(media); + } + instance.nextSlide(); + } + if (evt.direction == 'Right') { + if (instance.index == 0) { + return resetSlideMove(media); + } + instance.prevSlide(); + } + } + }); + instance.events['touch'] = touchInstance; + } + + var _version = '3.3.1'; + var isMobile$1 = isMobile(); + var isTouch$1 = isTouch(); + var html = document.getElementsByTagName('html')[0]; + var defaults = { + selector: '.glightbox', + elements: null, + skin: 'clean', + theme: 'clean', + closeButton: true, + startAt: null, + autoplayVideos: true, + autofocusVideos: true, + descPosition: 'bottom', + width: '900px', + height: '506px', + videosWidth: '960px', + beforeSlideChange: null, + afterSlideChange: null, + beforeSlideLoad: null, + afterSlideLoad: null, + slideInserted: null, + slideRemoved: null, + slideExtraAttributes: null, + onOpen: null, + onClose: null, + loop: false, + zoomable: true, + draggable: true, + dragAutoSnap: false, + dragToleranceX: 40, + dragToleranceY: 65, + preload: true, + oneSlidePerOpen: false, + touchNavigation: true, + touchFollowAxis: true, + keyboardNavigation: true, + closeOnOutsideClick: true, + plugins: false, + plyr: { + css: 'https://cdn.plyr.io/3.6.12/plyr.css', + js: 'https://cdn.plyr.io/3.6.12/plyr.js', + config: { + ratio: '16:9', + fullscreen: { + enabled: true, + iosNative: true + }, + youtube: { + noCookie: true, + rel: 0, + showinfo: 0, + iv_load_policy: 3 + }, + vimeo: { + byline: false, + portrait: false, + title: false, + transparent: false + } + } + }, + openEffect: 'zoom', + closeEffect: 'zoom', + slideEffect: 'slide', + moreText: 'See more', + moreLength: 60, + cssEfects: { + fade: { + "in": 'fadeIn', + out: 'fadeOut' + }, + zoom: { + "in": 'zoomIn', + out: 'zoomOut' + }, + slide: { + "in": 'slideInRight', + out: 'slideOutLeft' + }, + slideBack: { + "in": 'slideInLeft', + out: 'slideOutRight' + }, + none: { + "in": 'none', + out: 'none' + } + }, + svg: { + close: '', + next: ' ', + prev: '' + } + }; + defaults.slideHTML = "
\n
\n
\n
\n
\n
\n
\n

\n
\n
\n
\n
\n
\n
"; + defaults.lightboxHTML = "
\n
\n
\n
\n
\n \n \n \n
\n
"; + var GlightboxInit = function () { + function GlightboxInit() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + _classCallCheck(this, GlightboxInit); + this.customOptions = options; + this.settings = extend(defaults, options); + this.effectsClasses = this.getAnimationClasses(); + this.videoPlayers = {}; + this.apiEvents = []; + this.fullElementsList = false; + } + return _createClass(GlightboxInit, [{ + key: "init", + value: function init() { + var _this = this; + var selector = this.getSelector(); + if (selector) { + this.baseEvents = addEvent('click', { + onElement: selector, + withCallback: function withCallback(e, target) { + e.preventDefault(); + _this.open(target); + } + }); + } + this.elements = this.getElements(); + } + }, { + key: "open", + value: function open() { + var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + var startAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + if (this.elements.length === 0) { + return false; + } + this.activeSlide = null; + this.prevActiveSlideIndex = null; + this.prevActiveSlide = null; + var index = isNumber(startAt) ? startAt : this.settings.startAt; + if (isNode(element)) { + var gallery = element.getAttribute('data-gallery'); + if (gallery) { + this.fullElementsList = this.elements; + this.elements = this.getGalleryElements(this.elements, gallery); + } + if (isNil(index)) { + index = this.getElementIndex(element); + if (index < 0) { + index = 0; + } + } + } + if (!isNumber(index)) { + index = 0; + } + this.build(); + animateElement(this.overlay, this.settings.openEffect === 'none' ? 'none' : this.settings.cssEfects.fade["in"]); + var body = document.body; + var scrollBar = window.innerWidth - document.documentElement.clientWidth; + if (scrollBar > 0) { + var styleSheet = document.createElement('style'); + styleSheet.type = 'text/css'; + styleSheet.className = 'gcss-styles'; + styleSheet.innerText = ".gscrollbar-fixer {margin-right: ".concat(scrollBar, "px}"); + document.head.appendChild(styleSheet); + addClass(body, 'gscrollbar-fixer'); + } + addClass(body, 'glightbox-open'); + addClass(html, 'glightbox-open'); + if (isMobile$1) { + addClass(document.body, 'glightbox-mobile'); + this.settings.slideEffect = 'slide'; + } + this.showSlide(index, true); + if (this.elements.length === 1) { + addClass(this.prevButton, 'glightbox-button-hidden'); + addClass(this.nextButton, 'glightbox-button-hidden'); + } else { + removeClass(this.prevButton, 'glightbox-button-hidden'); + removeClass(this.nextButton, 'glightbox-button-hidden'); + } + this.lightboxOpen = true; + this.trigger('open'); + if (isFunction(this.settings.onOpen)) { + this.settings.onOpen(); + } + if (isTouch$1 && this.settings.touchNavigation) { + touchNavigation(this); + } + if (this.settings.keyboardNavigation) { + keyboardNavigation(this); + } + } + }, { + key: "openAt", + value: function openAt() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + this.open(null, index); + } + }, { + key: "showSlide", + value: function showSlide() { + var _this2 = this; + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var first = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + show(this.loader); + this.index = parseInt(index); + var current = this.slidesContainer.querySelector('.current'); + if (current) { + removeClass(current, 'current'); + } + this.slideAnimateOut(); + var slideNode = this.slidesContainer.querySelectorAll('.gslide')[index]; + if (hasClass(slideNode, 'loaded')) { + this.slideAnimateIn(slideNode, first); + hide(this.loader); + } else { + show(this.loader); + var slide = this.elements[index]; + var slideData = { + index: this.index, + slide: slideNode, + slideNode: slideNode, + slideConfig: slide.slideConfig, + slideIndex: this.index, + trigger: slide.node, + player: null + }; + this.trigger('slide_before_load', slideData); + slide.instance.setContent(slideNode, function () { + hide(_this2.loader); + _this2.resize(); + _this2.slideAnimateIn(slideNode, first); + _this2.trigger('slide_after_load', slideData); + }); + } + this.slideDescription = slideNode.querySelector('.gslide-description'); + this.slideDescriptionContained = this.slideDescription && hasClass(this.slideDescription.parentNode, 'gslide-media'); + if (this.settings.preload) { + this.preloadSlide(index + 1); + this.preloadSlide(index - 1); + } + this.updateNavigationClasses(); + this.activeSlide = slideNode; + } + }, { + key: "preloadSlide", + value: function preloadSlide(index) { + var _this3 = this; + if (index < 0 || index > this.elements.length - 1) { + return false; + } + if (isNil(this.elements[index])) { + return false; + } + var slideNode = this.slidesContainer.querySelectorAll('.gslide')[index]; + if (hasClass(slideNode, 'loaded')) { + return false; + } + var slide = this.elements[index]; + var type = slide.type; + var slideData = { + index: index, + slide: slideNode, + slideNode: slideNode, + slideConfig: slide.slideConfig, + slideIndex: index, + trigger: slide.node, + player: null + }; + this.trigger('slide_before_load', slideData); + if (type === 'video' || type === 'external') { + setTimeout(function () { + slide.instance.setContent(slideNode, function () { + _this3.trigger('slide_after_load', slideData); + }); + }, 200); + } else { + slide.instance.setContent(slideNode, function () { + _this3.trigger('slide_after_load', slideData); + }); + } + } + }, { + key: "prevSlide", + value: function prevSlide() { + this.goToSlide(this.index - 1); + } + }, { + key: "nextSlide", + value: function nextSlide() { + this.goToSlide(this.index + 1); + } + }, { + key: "goToSlide", + value: function goToSlide() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + this.prevActiveSlide = this.activeSlide; + this.prevActiveSlideIndex = this.index; + if (!this.loop() && (index < 0 || index > this.elements.length - 1)) { + return false; + } + if (index < 0) { + index = this.elements.length - 1; + } else if (index >= this.elements.length) { + index = 0; + } + this.showSlide(index); + } + }, { + key: "insertSlide", + value: function insertSlide() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1; + if (index < 0) { + index = this.elements.length; + } + var slide = new Slide(config, this, index); + var data = slide.getConfig(); + var slideInfo = extend({}, data); + var newSlide = slide.create(); + var totalSlides = this.elements.length - 1; + slideInfo.index = index; + slideInfo.node = false; + slideInfo.instance = slide; + slideInfo.slideConfig = data; + this.elements.splice(index, 0, slideInfo); + var addedSlideNode = null; + var addedSlidePlayer = null; + if (this.slidesContainer) { + if (index > totalSlides) { + this.slidesContainer.appendChild(newSlide); + } else { + var existingSlide = this.slidesContainer.querySelectorAll('.gslide')[index]; + this.slidesContainer.insertBefore(newSlide, existingSlide); + } + if (this.settings.preload && this.index == 0 && index == 0 || this.index - 1 == index || this.index + 1 == index) { + this.preloadSlide(index); + } + if (this.index === 0 && index === 0) { + this.index = 1; + } + this.updateNavigationClasses(); + addedSlideNode = this.slidesContainer.querySelectorAll('.gslide')[index]; + addedSlidePlayer = this.getSlidePlayerInstance(index); + slideInfo.slideNode = addedSlideNode; + } + this.trigger('slide_inserted', { + index: index, + slide: addedSlideNode, + slideNode: addedSlideNode, + slideConfig: data, + slideIndex: index, + trigger: null, + player: addedSlidePlayer + }); + if (isFunction(this.settings.slideInserted)) { + this.settings.slideInserted({ + index: index, + slide: addedSlideNode, + player: addedSlidePlayer + }); + } + } + }, { + key: "removeSlide", + value: function removeSlide() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1; + if (index < 0 || index > this.elements.length - 1) { + return false; + } + var slide = this.slidesContainer && this.slidesContainer.querySelectorAll('.gslide')[index]; + if (slide) { + if (this.getActiveSlideIndex() == index) { + if (index == this.elements.length - 1) { + this.prevSlide(); + } else { + this.nextSlide(); + } + } + slide.parentNode.removeChild(slide); + } + this.elements.splice(index, 1); + this.trigger('slide_removed', index); + if (isFunction(this.settings.slideRemoved)) { + this.settings.slideRemoved(index); + } + } + }, { + key: "slideAnimateIn", + value: function slideAnimateIn(slide, first) { + var _this4 = this; + var slideMedia = slide.querySelector('.gslide-media'); + var slideDesc = slide.querySelector('.gslide-description'); + var prevData = { + index: this.prevActiveSlideIndex, + slide: this.prevActiveSlide, + slideNode: this.prevActiveSlide, + slideIndex: this.prevActiveSlide, + slideConfig: isNil(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, + trigger: isNil(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, + player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) + }; + var nextData = { + index: this.index, + slide: this.activeSlide, + slideNode: this.activeSlide, + slideConfig: this.elements[this.index].slideConfig, + slideIndex: this.index, + trigger: this.elements[this.index].node, + player: this.getSlidePlayerInstance(this.index) + }; + if (slideMedia.offsetWidth > 0 && slideDesc) { + hide(slideDesc); + slideDesc.style.display = ''; + } + removeClass(slide, this.effectsClasses); + if (first) { + animateElement(slide, this.settings.cssEfects[this.settings.openEffect]["in"], function () { + if (_this4.settings.autoplayVideos) { + _this4.slidePlayerPlay(slide); + } + _this4.trigger('slide_changed', { + prev: prevData, + current: nextData + }); + if (isFunction(_this4.settings.afterSlideChange)) { + _this4.settings.afterSlideChange.apply(_this4, [prevData, nextData]); + } + }); + } else { + var effectName = this.settings.slideEffect; + var animIn = effectName !== 'none' ? this.settings.cssEfects[effectName]["in"] : effectName; + if (this.prevActiveSlideIndex > this.index) { + if (this.settings.slideEffect == 'slide') { + animIn = this.settings.cssEfects.slideBack["in"]; + } + } + animateElement(slide, animIn, function () { + if (_this4.settings.autoplayVideos) { + _this4.slidePlayerPlay(slide); + } + _this4.trigger('slide_changed', { + prev: prevData, + current: nextData + }); + if (isFunction(_this4.settings.afterSlideChange)) { + _this4.settings.afterSlideChange.apply(_this4, [prevData, nextData]); + } + }); + } + setTimeout(function () { + _this4.resize(slide); + }, 100); + addClass(slide, 'current'); + } + }, { + key: "slideAnimateOut", + value: function slideAnimateOut() { + if (!this.prevActiveSlide) { + return false; + } + var prevSlide = this.prevActiveSlide; + removeClass(prevSlide, this.effectsClasses); + addClass(prevSlide, 'prev'); + var animation = this.settings.slideEffect; + var animOut = animation !== 'none' ? this.settings.cssEfects[animation].out : animation; + this.slidePlayerPause(prevSlide); + this.trigger('slide_before_change', { + prev: { + index: this.prevActiveSlideIndex, + slide: this.prevActiveSlide, + slideNode: this.prevActiveSlide, + slideIndex: this.prevActiveSlideIndex, + slideConfig: isNil(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].slideConfig, + trigger: isNil(this.prevActiveSlideIndex) ? null : this.elements[this.prevActiveSlideIndex].node, + player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) + }, + current: { + index: this.index, + slide: this.activeSlide, + slideNode: this.activeSlide, + slideIndex: this.index, + slideConfig: this.elements[this.index].slideConfig, + trigger: this.elements[this.index].node, + player: this.getSlidePlayerInstance(this.index) + } + }); + if (isFunction(this.settings.beforeSlideChange)) { + this.settings.beforeSlideChange.apply(this, [{ + index: this.prevActiveSlideIndex, + slide: this.prevActiveSlide, + player: this.getSlidePlayerInstance(this.prevActiveSlideIndex) + }, { + index: this.index, + slide: this.activeSlide, + player: this.getSlidePlayerInstance(this.index) + }]); + } + if (this.prevActiveSlideIndex > this.index && this.settings.slideEffect == 'slide') { + animOut = this.settings.cssEfects.slideBack.out; + } + animateElement(prevSlide, animOut, function () { + var container = prevSlide.querySelector('.ginner-container'); + var media = prevSlide.querySelector('.gslide-media'); + var desc = prevSlide.querySelector('.gslide-description'); + container.style.transform = ''; + media.style.transform = ''; + removeClass(media, 'greset'); + media.style.opacity = ''; + if (desc) { + desc.style.opacity = ''; + } + removeClass(prevSlide, 'prev'); + }); + } + }, { + key: "getAllPlayers", + value: function getAllPlayers() { + return this.videoPlayers; + } + }, { + key: "getSlidePlayerInstance", + value: function getSlidePlayerInstance(index) { + var id = 'gvideo' + index; + var videoPlayers = this.getAllPlayers(); + if (has(videoPlayers, id) && videoPlayers[id]) { + return videoPlayers[id]; + } + return false; + } + }, { + key: "stopSlideVideo", + value: function stopSlideVideo(slide) { + if (isNode(slide)) { + var node = slide.querySelector('.gvideo-wrapper'); + if (node) { + slide = node.getAttribute('data-index'); + } + } + console.log('stopSlideVideo is deprecated, use slidePlayerPause'); + var player = this.getSlidePlayerInstance(slide); + if (player && player.playing) { + player.pause(); + } + } + }, { + key: "slidePlayerPause", + value: function slidePlayerPause(slide) { + if (isNode(slide)) { + var node = slide.querySelector('.gvideo-wrapper'); + if (node) { + slide = node.getAttribute('data-index'); + } + } + var player = this.getSlidePlayerInstance(slide); + if (player && player.playing) { + player.pause(); + } + } + }, { + key: "playSlideVideo", + value: function playSlideVideo(slide) { + if (isNode(slide)) { + var node = slide.querySelector('.gvideo-wrapper'); + if (node) { + slide = node.getAttribute('data-index'); + } + } + console.log('playSlideVideo is deprecated, use slidePlayerPlay'); + var player = this.getSlidePlayerInstance(slide); + if (player && !player.playing) { + player.play(); + } + } + }, { + key: "slidePlayerPlay", + value: function slidePlayerPlay(slide) { + var _this$settings$plyr$c; + if (isMobile$1 && !((_this$settings$plyr$c = this.settings.plyr.config) !== null && _this$settings$plyr$c !== void 0 && _this$settings$plyr$c.muted)) { + return; + } + if (isNode(slide)) { + var node = slide.querySelector('.gvideo-wrapper'); + if (node) { + slide = node.getAttribute('data-index'); + } + } + var player = this.getSlidePlayerInstance(slide); + if (player && !player.playing) { + player.play(); + if (this.settings.autofocusVideos) { + player.elements.container.focus(); + } + } + } + }, { + key: "setElements", + value: function setElements(elements) { + var _this5 = this; + this.settings.elements = false; + var newElements = []; + if (elements && elements.length) { + each(elements, function (el, i) { + var slide = new Slide(el, _this5, i); + var data = slide.getConfig(); + var slideInfo = extend({}, data); + slideInfo.slideConfig = data; + slideInfo.instance = slide; + slideInfo.index = i; + newElements.push(slideInfo); + }); + } + this.elements = newElements; + if (this.lightboxOpen) { + this.slidesContainer.innerHTML = ''; + if (this.elements.length) { + each(this.elements, function () { + var slide = createHTML(_this5.settings.slideHTML); + _this5.slidesContainer.appendChild(slide); + }); + this.showSlide(0, true); + } + } + } + }, { + key: "getElementIndex", + value: function getElementIndex(node) { + var index = false; + each(this.elements, function (el, i) { + if (has(el, 'node') && el.node == node) { + index = i; + return true; + } + }); + return index; + } + }, { + key: "getElements", + value: function getElements() { + var _this6 = this; + var list = []; + this.elements = this.elements ? this.elements : []; + if (!isNil(this.settings.elements) && isArray(this.settings.elements) && this.settings.elements.length) { + each(this.settings.elements, function (el, i) { + var slide = new Slide(el, _this6, i); + var elData = slide.getConfig(); + var slideInfo = extend({}, elData); + slideInfo.node = false; + slideInfo.index = i; + slideInfo.instance = slide; + slideInfo.slideConfig = elData; + list.push(slideInfo); + }); + } + var nodes = false; + var selector = this.getSelector(); + if (selector) { + nodes = document.querySelectorAll(this.getSelector()); + } + if (!nodes) { + return list; + } + each(nodes, function (el, i) { + var slide = new Slide(el, _this6, i); + var elData = slide.getConfig(); + var slideInfo = extend({}, elData); + slideInfo.node = el; + slideInfo.index = i; + slideInfo.instance = slide; + slideInfo.slideConfig = elData; + slideInfo.gallery = el.getAttribute('data-gallery'); + list.push(slideInfo); + }); + return list; + } + }, { + key: "getGalleryElements", + value: function getGalleryElements(list, gallery) { + return list.filter(function (el) { + return el.gallery == gallery; + }); + } + }, { + key: "getSelector", + value: function getSelector() { + if (this.settings.elements) { + return false; + } + if (this.settings.selector && this.settings.selector.substring(0, 5) == 'data-') { + return "*[".concat(this.settings.selector, "]"); + } + return this.settings.selector; + } + }, { + key: "getActiveSlide", + value: function getActiveSlide() { + return this.slidesContainer.querySelectorAll('.gslide')[this.index]; + } + }, { + key: "getActiveSlideIndex", + value: function getActiveSlideIndex() { + return this.index; + } + }, { + key: "getAnimationClasses", + value: function getAnimationClasses() { + var effects = []; + for (var key in this.settings.cssEfects) { + if (this.settings.cssEfects.hasOwnProperty(key)) { + var effect = this.settings.cssEfects[key]; + effects.push("g".concat(effect["in"])); + effects.push("g".concat(effect.out)); + } + } + return effects.join(' '); + } + }, { + key: "build", + value: function build() { + var _this7 = this; + if (this.built) { + return false; + } + var children = document.body.childNodes; + var bodyChildElms = []; + each(children, function (el) { + if (el.parentNode == document.body && el.nodeName.charAt(0) !== '#' && el.hasAttribute && !el.hasAttribute('aria-hidden')) { + bodyChildElms.push(el); + el.setAttribute('aria-hidden', 'true'); + } + }); + var nextSVG = has(this.settings.svg, 'next') ? this.settings.svg.next : ''; + var prevSVG = has(this.settings.svg, 'prev') ? this.settings.svg.prev : ''; + var closeSVG = has(this.settings.svg, 'close') ? this.settings.svg.close : ''; + var lightboxHTML = this.settings.lightboxHTML; + lightboxHTML = lightboxHTML.replace(/{nextSVG}/g, nextSVG); + lightboxHTML = lightboxHTML.replace(/{prevSVG}/g, prevSVG); + lightboxHTML = lightboxHTML.replace(/{closeSVG}/g, closeSVG); + lightboxHTML = createHTML(lightboxHTML); + document.body.appendChild(lightboxHTML); + var modal = document.getElementById('glightbox-body'); + this.modal = modal; + var closeButton = modal.querySelector('.gclose'); + this.prevButton = modal.querySelector('.gprev'); + this.nextButton = modal.querySelector('.gnext'); + this.overlay = modal.querySelector('.goverlay'); + this.loader = modal.querySelector('.gloader'); + this.slidesContainer = document.getElementById('glightbox-slider'); + this.bodyHiddenChildElms = bodyChildElms; + this.events = {}; + addClass(this.modal, 'glightbox-' + this.settings.skin); + if (this.settings.closeButton && closeButton) { + this.events['close'] = addEvent('click', { + onElement: closeButton, + withCallback: function withCallback(e, target) { + e.preventDefault(); + _this7.close(); + } + }); + } + if (closeButton && !this.settings.closeButton) { + closeButton.parentNode.removeChild(closeButton); + } + if (this.nextButton) { + this.events['next'] = addEvent('click', { + onElement: this.nextButton, + withCallback: function withCallback(e, target) { + e.preventDefault(); + _this7.nextSlide(); + } + }); + } + if (this.prevButton) { + this.events['prev'] = addEvent('click', { + onElement: this.prevButton, + withCallback: function withCallback(e, target) { + e.preventDefault(); + _this7.prevSlide(); + } + }); + } + if (this.settings.closeOnOutsideClick) { + this.events['outClose'] = addEvent('click', { + onElement: modal, + withCallback: function withCallback(e, target) { + if (!_this7.preventOutsideClick && !hasClass(document.body, 'glightbox-mobile') && !closest(e.target, '.ginner-container')) { + if (!closest(e.target, '.gbtn') && !hasClass(e.target, 'gnext') && !hasClass(e.target, 'gprev')) { + _this7.close(); + } + } + } + }); + } + each(this.elements, function (slide, i) { + _this7.slidesContainer.appendChild(slide.instance.create()); + slide.slideNode = _this7.slidesContainer.querySelectorAll('.gslide')[i]; + }); + if (isTouch$1) { + addClass(document.body, 'glightbox-touch'); + } + this.events['resize'] = addEvent('resize', { + onElement: window, + withCallback: function withCallback() { + _this7.resize(); + } + }); + this.built = true; + } + }, { + key: "resize", + value: function resize() { + var slide = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + slide = !slide ? this.activeSlide : slide; + if (!slide || hasClass(slide, 'zoomed')) { + return; + } + var winSize = windowSize(); + var video = slide.querySelector('.gvideo-wrapper'); + var image = slide.querySelector('.gslide-image'); + var description = this.slideDescription; + var winWidth = winSize.width; + var winHeight = winSize.height; + if (winWidth <= 768) { + addClass(document.body, 'glightbox-mobile'); + } else { + removeClass(document.body, 'glightbox-mobile'); + } + if (!video && !image) { + return; + } + var descriptionResize = false; + if (description && (hasClass(description, 'description-bottom') || hasClass(description, 'description-top')) && !hasClass(description, 'gabsolute')) { + descriptionResize = true; + } + if (image) { + if (winWidth <= 768) { + var imgNode = image.querySelector('img'); + } else if (descriptionResize) { + var _this$elements$this$i; + var descHeight = description.offsetHeight; + var _imgNode = image.querySelector('img'); + var slideTriggerNode = (_this$elements$this$i = this.elements[this.index]) === null || _this$elements$this$i === void 0 ? void 0 : _this$elements$this$i.node; + var maxHeightValue = '100vh'; + if (slideTriggerNode) { + var _slideTriggerNode$get; + maxHeightValue = (_slideTriggerNode$get = slideTriggerNode.getAttribute('data-height')) !== null && _slideTriggerNode$get !== void 0 ? _slideTriggerNode$get : maxHeightValue; + } + _imgNode.setAttribute('style', "max-height: calc(".concat(maxHeightValue, " - ").concat(descHeight, "px)")); + description.setAttribute('style', "max-width: ".concat(_imgNode.offsetWidth, "px;")); + } + } + if (video) { + var ratio = has(this.settings.plyr.config, 'ratio') ? this.settings.plyr.config.ratio : ''; + if (!ratio) { + var containerWidth = video.clientWidth; + var containerHeight = video.clientHeight; + var divisor = containerWidth / containerHeight; + ratio = "".concat(containerWidth / divisor, ":").concat(containerHeight / divisor); + } + var videoRatio = ratio.split(':'); + var videoWidth = this.settings.videosWidth; + var maxWidth = this.settings.videosWidth; + if (isNumber(videoWidth) || videoWidth.indexOf('px') !== -1) { + maxWidth = parseInt(videoWidth); + } else { + if (videoWidth.indexOf('vw') !== -1) { + maxWidth = winWidth * parseInt(videoWidth) / 100; + } else if (videoWidth.indexOf('vh') !== -1) { + maxWidth = winHeight * parseInt(videoWidth) / 100; + } else if (videoWidth.indexOf('%') !== -1) { + maxWidth = winWidth * parseInt(videoWidth) / 100; + } else { + maxWidth = parseInt(video.clientWidth); + } + } + var maxHeight = maxWidth / (parseInt(videoRatio[0]) / parseInt(videoRatio[1])); + maxHeight = Math.floor(maxHeight); + if (descriptionResize) { + winHeight = winHeight - description.offsetHeight; + } + if (maxWidth > winWidth || maxHeight > winHeight || winHeight < maxHeight && winWidth > maxWidth) { + var vwidth = video.offsetWidth; + var vheight = video.offsetHeight; + var _ratio = winHeight / vheight; + var vsize = { + width: vwidth * _ratio, + height: vheight * _ratio + }; + video.parentNode.setAttribute('style', "max-width: ".concat(vsize.width, "px")); + if (descriptionResize) { + description.setAttribute('style', "max-width: ".concat(vsize.width, "px;")); + } + } else { + video.parentNode.style.maxWidth = "".concat(videoWidth); + if (descriptionResize) { + description.setAttribute('style', "max-width: ".concat(videoWidth, ";")); + } + } + } + } + }, { + key: "reload", + value: function reload() { + this.init(); + } + }, { + key: "updateNavigationClasses", + value: function updateNavigationClasses() { + var loop = this.loop(); + removeClass(this.nextButton, 'disabled'); + removeClass(this.prevButton, 'disabled'); + if (this.index == 0 && this.elements.length - 1 == 0) { + addClass(this.prevButton, 'disabled'); + addClass(this.nextButton, 'disabled'); + } else if (this.index === 0 && !loop) { + addClass(this.prevButton, 'disabled'); + } else if (this.index === this.elements.length - 1 && !loop) { + addClass(this.nextButton, 'disabled'); + } + } + }, { + key: "loop", + value: function loop() { + var loop = has(this.settings, 'loopAtEnd') ? this.settings.loopAtEnd : null; + loop = has(this.settings, 'loop') ? this.settings.loop : loop; + return loop; + } + }, { + key: "close", + value: function close() { + var _this8 = this; + if (!this.lightboxOpen) { + if (this.events) { + for (var key in this.events) { + if (this.events.hasOwnProperty(key)) { + this.events[key].destroy(); + } + } + this.events = null; + } + return false; + } + if (this.closing) { + return false; + } + this.closing = true; + this.slidePlayerPause(this.activeSlide); + if (this.fullElementsList) { + this.elements = this.fullElementsList; + } + if (this.bodyHiddenChildElms.length) { + each(this.bodyHiddenChildElms, function (el) { + el.removeAttribute('aria-hidden'); + }); + } + addClass(this.modal, 'glightbox-closing'); + animateElement(this.overlay, this.settings.openEffect == 'none' ? 'none' : this.settings.cssEfects.fade.out); + animateElement(this.activeSlide, this.settings.cssEfects[this.settings.closeEffect].out, function () { + _this8.activeSlide = null; + _this8.prevActiveSlideIndex = null; + _this8.prevActiveSlide = null; + _this8.built = false; + if (_this8.events) { + for (var _key in _this8.events) { + if (_this8.events.hasOwnProperty(_key)) { + _this8.events[_key].destroy(); + } + } + _this8.events = null; + } + var body = document.body; + removeClass(html, 'glightbox-open'); + removeClass(body, 'glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer'); + _this8.modal.parentNode.removeChild(_this8.modal); + _this8.trigger('close'); + if (isFunction(_this8.settings.onClose)) { + _this8.settings.onClose(); + } + var styles = document.querySelector('.gcss-styles'); + if (styles) { + styles.parentNode.removeChild(styles); + } + _this8.lightboxOpen = false; + _this8.closing = null; + }); + } + }, { + key: "destroy", + value: function destroy() { + this.close(); + this.clearAllEvents(); + if (this.baseEvents) { + this.baseEvents.destroy(); + } + } + }, { + key: "on", + value: function on(evt, callback) { + var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + if (!evt || !isFunction(callback)) { + throw new TypeError('Event name and callback must be defined'); + } + this.apiEvents.push({ + evt: evt, + once: once, + callback: callback + }); + } + }, { + key: "once", + value: function once(evt, callback) { + this.on(evt, callback, true); + } + }, { + key: "trigger", + value: function trigger(eventName) { + var _this9 = this; + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var onceTriggered = []; + each(this.apiEvents, function (event, i) { + var evt = event.evt, + once = event.once, + callback = event.callback; + if (evt == eventName) { + callback(data); + if (once) { + onceTriggered.push(i); + } + } + }); + if (onceTriggered.length) { + each(onceTriggered, function (i) { + return _this9.apiEvents.splice(i, 1); + }); + } + } + }, { + key: "clearAllEvents", + value: function clearAllEvents() { + this.apiEvents.splice(0, this.apiEvents.length); + } + }, { + key: "version", + value: function version() { + return _version; + } + }]); + }(); + function glightbox () { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var instance = new GlightboxInit(options); + instance.init(); + return instance; + } + + return glightbox; + +}))); diff --git a/website/static_files/glightbox/js/glightbox.min.js b/website/static_files/glightbox/js/glightbox.min.js new file mode 100644 index 00000000..93fafa9c --- /dev/null +++ b/website/static_files/glightbox/js/glightbox.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).GLightbox=t()}(this,(function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=e[l]=e[l]||[],s={all:n,evt:null,found:null};return t&&i&&M(n)>0&&r(n,(function(e,n){if(e.eventName==t&&e.fn.toString()==i.toString())return s.found=!0,s.evt=n,!1})),s}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.onElement,n=t.withCallback,s=t.avoidDuplicate,l=void 0===s||s,o=t.once,h=void 0!==o&&o,d=t.useCapture,c=void 0!==d&&d,u=arguments.length>2?arguments[2]:void 0,g=i||[];function v(e){C(n)&&n.call(u,e,this),h&&v.destroy()}return k(g)&&(g=document.querySelectorAll(g)),v.destroy=function(){r(g,(function(t){var i=a(t,e,v);i.found&&i.all.splice(i.evt,1),t.removeEventListener&&t.removeEventListener(e,v,c)}))},r(g,(function(t){var i=a(t,e,v);(t.addEventListener&&l&&!i.found||!l)&&(t.addEventListener(e,v,c),i.all.push({eventName:e,fn:v}))})),v}function d(e,t){r(t.split(" "),(function(t){return e.classList.add(t)}))}function c(e,t){r(t.split(" "),(function(t){return e.classList.remove(t)}))}function u(e,t){return e.classList.contains(t)}function g(e,t){for(;e!==document.body;){if(!(e=e.parentElement))return!1;if("function"==typeof e.matches?e.matches(t):e.msMatchesSelector(t))return e}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||""===t)return!1;if("none"===t)return C(i)&&i(),!1;var n=b(),s=t.split(" ");r(s,(function(t){d(e,"g"+t)})),h(n,{onElement:e,avoidDuplicate:!1,once:!0,withCallback:function(e,t){r(s,(function(e){c(t,"g"+e)})),C(i)&&i()}})}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(""===t)return e.style.webkitTransform="",e.style.MozTransform="",e.style.msTransform="",e.style.OTransform="",e.style.transform="",!1;e.style.webkitTransform=t,e.style.MozTransform=t,e.style.msTransform=t,e.style.OTransform=t,e.style.transform=t}function p(e){e.style.display="block"}function m(e){e.style.display="none"}function y(e){var t=document.createDocumentFragment(),i=document.createElement("div");for(i.innerHTML=e;i.firstChild;)t.appendChild(i.firstChild);return t}function x(){return{width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}}function b(){var e,t=document.createElement("fakeelement"),i={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(e in i)if(void 0!==t.style[e])return i[e]}function S(e,t,i,n){if(e())t();else{var s;i||(i=100);var l=setInterval((function(){e()&&(clearInterval(l),s&&clearTimeout(s),t())}),i);n&&(s=setTimeout((function(){clearInterval(l)}),n))}}function w(e,t,i){if(O(e))console.error("Inject assets error");else if(C(t)&&(i=t,t=!1),k(t)&&t in window)C(i)&&i();else{var n;if(-1!==e.indexOf(".css")){if((n=document.querySelectorAll('link[href="'+e+'"]'))&&n.length>0)return void(C(i)&&i());var s=document.getElementsByTagName("head")[0],l=s.querySelectorAll('link[rel="stylesheet"]'),o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.href=e,o.media="all",l?s.insertBefore(o,l[0]):s.appendChild(o),void(C(i)&&i())}if((n=document.querySelectorAll('script[src="'+e+'"]'))&&n.length>0){if(C(i)){if(k(t))return S((function(){return void 0!==window[t]}),(function(){i()})),!1;i()}}else{var r=document.createElement("script");r.type="text/javascript",r.src=e,r.onload=function(){if(C(i)){if(k(t))return S((function(){return void 0!==window[t]}),(function(){i()})),!1;i()}},document.body.appendChild(r)}}}function T(){return"navigator"in window&&window.navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i)}function C(e){return"function"==typeof e}function k(e){return"string"==typeof e}function E(e){return!(!e||!e.nodeType||1!=e.nodeType)}function A(e){return Array.isArray(e)}function L(e){return e&&e.length&&isFinite(e.length)}function I(e){return"object"===s(e)&&null!=e&&!C(e)&&!A(e)}function O(e){return null==e}function P(e,t){return null!==e&&hasOwnProperty.call(e,t)}function M(e){if(I(e)){if(e.keys)return e.keys().length;var t=0;for(var i in e)P(e,i)&&t++;return t}return e.length}function z(e){return!isNaN(parseFloat(e))&&isFinite(e)}function X(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=document.querySelectorAll(".gbtn[data-taborder]:not(.disabled)");if(!t.length)return!1;if(1==t.length)return t[0];"string"==typeof e&&(e=parseInt(e));var i=[];r(t,(function(e){i.push(e.getAttribute("data-taborder"))}));var n=Math.max.apply(Math,i.map((function(e){return parseInt(e)}))),s=e<0?1:e+1;s>n&&(s="1");var l=i.filter((function(e){return e>=parseInt(s)})),o=l.sort()[0];return document.querySelector('.gbtn[data-taborder="'.concat(o,'"]'))}function Y(e){if(e.events.hasOwnProperty("keyboard"))return!1;e.events.keyboard=h("keydown",{onElement:window,withCallback:function(t,i){var n=(t=t||window.event).keyCode;if(9==n){var s=document.querySelector(".gbtn.focused");if(!s){var l=!(!document.activeElement||!document.activeElement.nodeName)&&document.activeElement.nodeName.toLocaleLowerCase();if("input"==l||"textarea"==l||"button"==l)return}t.preventDefault();var o=document.querySelectorAll(".gbtn[data-taborder]");if(!o||o.length<=0)return;if(!s){var r=X();return void(r&&(r.focus(),d(r,"focused")))}var a=X(s.getAttribute("data-taborder"));c(s,"focused"),a&&(a.focus(),d(a,"focused"))}39==n&&e.nextSlide(),37==n&&e.prevSlide(),27==n&&e.close()}})}var q=i((function t(i,n){var s=this,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e(this,t),this.img=i,this.slide=n,this.onclose=l,this.img.setZoomEvents)return!1;this.active=!1,this.zoomedIn=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.img.addEventListener("mousedown",(function(e){return s.dragStart(e)}),!1),this.img.addEventListener("mouseup",(function(e){return s.dragEnd(e)}),!1),this.img.addEventListener("mousemove",(function(e){return s.drag(e)}),!1),this.img.addEventListener("click",(function(e){return s.slide.classList.contains("dragging-nav")?(s.zoomOut(),!1):s.zoomedIn?void(s.zoomedIn&&!s.dragging&&s.zoomOut()):s.zoomIn()}),!1),this.img.setZoomEvents=!0}),[{key:"zoomIn",value:function(){var e=this.widowWidth();if(!(this.zoomedIn||e<=768)){var t=this.img;if(t.setAttribute("data-style",t.getAttribute("style")),t.style.maxWidth=t.naturalWidth+"px",t.style.maxHeight=t.naturalHeight+"px",t.naturalWidth>e){var i=e/2-t.naturalWidth/2;this.setTranslate(this.img.parentNode,i,0)}this.slide.classList.add("zoomed"),this.zoomedIn=!0}}},{key:"zoomOut",value:function(){this.img.parentNode.setAttribute("style",""),this.img.setAttribute("style",this.img.getAttribute("data-style")),this.slide.classList.remove("zoomed"),this.zoomedIn=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.onclose&&"function"==typeof this.onclose&&this.onclose()}},{key:"dragStart",value:function(e){e.preventDefault(),this.zoomedIn?("touchstart"===e.type?(this.initialX=e.touches[0].clientX-this.xOffset,this.initialY=e.touches[0].clientY-this.yOffset):(this.initialX=e.clientX-this.xOffset,this.initialY=e.clientY-this.yOffset),e.target===this.img&&(this.active=!0,this.img.classList.add("dragging"))):this.active=!1}},{key:"dragEnd",value:function(e){var t=this;e.preventDefault(),this.initialX=this.currentX,this.initialY=this.currentY,this.active=!1,setTimeout((function(){t.dragging=!1,t.img.isDragging=!1,t.img.classList.remove("dragging")}),100)}},{key:"drag",value:function(e){this.active&&(e.preventDefault(),"touchmove"===e.type?(this.currentX=e.touches[0].clientX-this.initialX,this.currentY=e.touches[0].clientY-this.initialY):(this.currentX=e.clientX-this.initialX,this.currentY=e.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.img.isDragging=!0,this.dragging=!0,this.setTranslate(this.img,this.currentX,this.currentY))}},{key:"onMove",value:function(e){if(this.zoomedIn){var t=e.clientX-this.img.naturalWidth/2,i=e.clientY-this.img.naturalHeight/2;this.setTranslate(this.img,t,i)}}},{key:"setTranslate",value:function(e,t,i){e.style.transform="translate3d("+t+"px, "+i+"px, 0)"}},{key:"widowWidth",value:function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}}]),N=i((function t(){var i=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,t);var s=n.dragEl,l=n.toleranceX,o=void 0===l?40:l,r=n.toleranceY,a=void 0===r?65:r,h=n.slide,d=void 0===h?null:h,c=n.instance,u=void 0===c?null:c;this.el=s,this.active=!1,this.dragging=!1,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.direction=null,this.lastDirection=null,this.toleranceX=o,this.toleranceY=a,this.toleranceReached=!1,this.dragContainer=this.el,this.slide=d,this.instance=u,this.el.addEventListener("mousedown",(function(e){return i.dragStart(e)}),!1),this.el.addEventListener("mouseup",(function(e){return i.dragEnd(e)}),!1),this.el.addEventListener("mousemove",(function(e){return i.drag(e)}),!1)}),[{key:"dragStart",value:function(e){if(this.slide.classList.contains("zoomed"))this.active=!1;else{"touchstart"===e.type?(this.initialX=e.touches[0].clientX-this.xOffset,this.initialY=e.touches[0].clientY-this.yOffset):(this.initialX=e.clientX-this.xOffset,this.initialY=e.clientY-this.yOffset);var t=e.target.nodeName.toLowerCase();e.target.classList.contains("nodrag")||g(e.target,".nodrag")||-1!==["input","select","textarea","button","a"].indexOf(t)?this.active=!1:(e.preventDefault(),(e.target===this.el||"img"!==t&&g(e.target,".gslide-inline"))&&(this.active=!0,this.el.classList.add("dragging"),this.dragContainer=g(e.target,".ginner-container")))}}},{key:"dragEnd",value:function(e){var t=this;e&&e.preventDefault(),this.initialX=0,this.initialY=0,this.currentX=null,this.currentY=null,this.initialX=null,this.initialY=null,this.xOffset=0,this.yOffset=0,this.active=!1,this.doSlideChange&&(this.instance.preventOutsideClick=!0,"right"==this.doSlideChange&&this.instance.prevSlide(),"left"==this.doSlideChange&&this.instance.nextSlide()),this.doSlideClose&&this.instance.close(),this.toleranceReached||this.setTranslate(this.dragContainer,0,0,!0),setTimeout((function(){t.instance.preventOutsideClick=!1,t.toleranceReached=!1,t.lastDirection=null,t.dragging=!1,t.el.isDragging=!1,t.el.classList.remove("dragging"),t.slide.classList.remove("dragging-nav"),t.dragContainer.style.transform="",t.dragContainer.style.transition=""}),100)}},{key:"drag",value:function(e){if(this.active){e.preventDefault(),this.slide.classList.add("dragging-nav"),"touchmove"===e.type?(this.currentX=e.touches[0].clientX-this.initialX,this.currentY=e.touches[0].clientY-this.initialY):(this.currentX=e.clientX-this.initialX,this.currentY=e.clientY-this.initialY),this.xOffset=this.currentX,this.yOffset=this.currentY,this.el.isDragging=!0,this.dragging=!0,this.doSlideChange=!1,this.doSlideClose=!1;var t=Math.abs(this.currentX),i=Math.abs(this.currentY);if(t>0&&t>=Math.abs(this.currentY)&&(!this.lastDirection||"x"==this.lastDirection)){this.yOffset=0,this.lastDirection="x",this.setTranslate(this.dragContainer,this.currentX,0);var n=this.shouldChange();if(!this.instance.settings.dragAutoSnap&&n&&(this.doSlideChange=n),this.instance.settings.dragAutoSnap&&n)return this.instance.preventOutsideClick=!0,this.toleranceReached=!0,this.active=!1,this.instance.preventOutsideClick=!0,this.dragEnd(null),"right"==n&&this.instance.prevSlide(),void("left"==n&&this.instance.nextSlide())}if(this.toleranceY>0&&i>0&&i>=t&&(!this.lastDirection||"y"==this.lastDirection)){this.xOffset=0,this.lastDirection="y",this.setTranslate(this.dragContainer,0,this.currentY);var s=this.shouldClose();return!this.instance.settings.dragAutoSnap&&s&&(this.doSlideClose=!0),void(this.instance.settings.dragAutoSnap&&s&&this.instance.close())}}}},{key:"shouldChange",value:function(){var e=!1;if(Math.abs(this.currentX)>=this.toleranceX){var t=this.currentX>0?"right":"left";("left"==t&&this.slide!==this.slide.parentNode.lastChild||"right"==t&&this.slide!==this.slide.parentNode.firstChild)&&(e=t)}return e}},{key:"shouldClose",value:function(){var e=!1;return Math.abs(this.currentY)>=this.toleranceY&&(e=!0),e}},{key:"setTranslate",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.style.transition=n?"all .2s ease":"",e.style.transform="translate3d(".concat(t,"px, ").concat(i,"px, 0)")}}]);function D(e,t,i,n){var s=e.querySelector(".gslide-media"),l=new Image,o="gSlideTitle_"+i,r="gSlideDesc_"+i;l.addEventListener("load",(function(){C(n)&&n()}),!1),l.src=t.href,""!=t.sizes&&""!=t.srcset&&(l.sizes=t.sizes,l.srcset=t.srcset),l.alt="",O(t.alt)||""===t.alt||(l.alt=t.alt),""!==t.title&&l.setAttribute("aria-labelledby",o),""!==t.description&&l.setAttribute("aria-describedby",r),t.hasOwnProperty("_hasCustomWidth")&&t._hasCustomWidth&&(l.style.width=t.width),t.hasOwnProperty("_hasCustomHeight")&&t._hasCustomHeight&&(l.style.height=t.height),s.insertBefore(l,s.firstChild)}function _(e,t,i,n){var s=this,l=e.querySelector(".ginner-container"),o="gvideo"+i,r=e.querySelector(".gslide-media"),a=this.getAllPlayers();d(l,"gvideo-container"),r.insertBefore(y('
'),r.firstChild);var h=e.querySelector(".gvideo-wrapper");w(this.settings.plyr.css,"Plyr");var c=t.href,u=null==t?void 0:t.videoProvider,g=!1;r.style.maxWidth=t.width,w(this.settings.plyr.js,"Plyr",(function(){if(!u&&c.match(/vimeo\.com\/([0-9]*)/)&&(u="vimeo"),!u&&(c.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||c.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||c.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||c.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/))&&(u="youtube"),"local"===u||!u){u="local";var l='")}var r=g||y('
'));d(h,"".concat(u,"-video gvideo")),h.appendChild(r),h.setAttribute("data-id",o),h.setAttribute("data-index",i);var v=P(s.settings.plyr,"config")?s.settings.plyr.config:{},f=new Plyr("#"+o,v);f.on("ready",(function(e){a[o]=e.detail.plyr,C(n)&&n()})),S((function(){return e.querySelector("iframe")&&"true"==e.querySelector("iframe").dataset.ready}),(function(){s.resize(e)})),f.on("enterfullscreen",W),f.on("exitfullscreen",W)}))}function W(e){var t=g(e.target,".gslide-media");"enterfullscreen"===e.type&&d(t,"fullscreen"),"exitfullscreen"===e.type&&c(t,"fullscreen")}function B(e,t,i,n){var s,l=this,o=e.querySelector(".gslide-media"),r=!(!P(t,"href")||!t.href)&&t.href.split("#").pop().trim(),a=!(!P(t,"content")||!t.content)&&t.content;if(a&&(k(a)&&(s=y('
'.concat(a,"
"))),E(a))){"none"==a.style.display&&(a.style.display="block");var c=document.createElement("div");c.className="ginlined-content",c.appendChild(a),s=c}if(r){var u=document.getElementById(r);if(!u)return!1;var g=u.cloneNode(!0);g.style.height=t.height,g.style.maxWidth=t.width,d(g,"ginlined-content"),s=g}if(!s)return console.error("Unable to append inline slide content",t),!1;o.style.height=t.height,o.style.width=t.width,o.appendChild(s),this.events["inlineclose"+r]=h("click",{onElement:o.querySelectorAll(".gtrigger-close"),withCallback:function(e){e.preventDefault(),l.close()}}),C(n)&&n()}function H(e,t,i,n){var s=e.querySelector(".gslide-media"),l=function(e){var t=e.url,i=e.allow,n=e.callback,s=e.appendTo,l=document.createElement("iframe");return l.className="vimeo-video gvideo",l.src=t,l.style.width="100%",l.style.height="100%",i&&l.setAttribute("allow",i),l.onload=function(){l.onload=null,d(l,"node-ready"),C(n)&&n()},s&&s.appendChild(l),l}({url:t.href,callback:n});s.parentNode.style.maxWidth=t.width,s.parentNode.style.height=t.height,s.appendChild(l)}var j=i((function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,t),this.defaults={href:"",sizes:"",srcset:"",title:"",type:"",videoProvider:"",description:"",alt:"",descPosition:"bottom",effect:"",width:"",height:"",content:!1,zoomable:!0,draggable:!0},I(i)&&(this.defaults=o(this.defaults,i))}),[{key:"sourceType",value:function(e){var t=e;return null!==(e=e.toLowerCase()).match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/)?"image":e.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/)||e.match(/youtu\.be\/([a-zA-Z0-9\-_]+)/)||e.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-zA-Z0-9\-_]+)/)||e.match(/(youtube\.com|youtube-nocookie\.com)\/shorts\/([a-zA-Z0-9\-_]+)/)||e.match(/vimeo\.com\/([0-9]*)/)||null!==e.match(/\.(mp4|ogg|webm|mov)/)?"video":null!==e.match(/\.(mp3|wav|wma|aac|ogg)/)?"audio":e.indexOf("#")>-1&&""!==t.split("#").pop().trim()?"inline":e.indexOf("goajax=true")>-1?"ajax":"external"}},{key:"parseConfig",value:function(e,t){var i=this,n=o({descPosition:t.descPosition},this.defaults);if(I(e)&&!E(e)){P(e,"type")||(P(e,"content")&&e.content?e.type="inline":P(e,"href")&&(e.type=this.sourceType(e.href)));var s=o(n,e);return this.setSize(s,t),s}var l="",a=e.getAttribute("data-glightbox"),h=e.nodeName.toLowerCase();if("a"===h&&(l=e.href),"img"===h&&(l=e.src,n.alt=e.alt),n.href=l,r(n,(function(s,l){P(t,l)&&"width"!==l&&(n[l]=t[l]);var o=e.dataset[l];O(o)||(n[l]=i.sanitizeValue(o))})),n.content&&(n.type="inline"),!n.type&&l&&(n.type=this.sourceType(l)),O(a)){if(!n.title&&"a"==h){var d=e.title;O(d)||""===d||(n.title=d)}if(!n.title&&"img"==h){var c=e.alt;O(c)||""===c||(n.title=c)}}else{var u=[];r(n,(function(e,t){u.push(";\\s?"+t)})),u=u.join("\\s?:|"),""!==a.trim()&&r(n,(function(e,t){var s=a,l=new RegExp("s?"+t+"s?:s?(.*?)("+u+"s?:|$)"),o=s.match(l);if(o&&o.length&&o[1]){var r=o[1].trim().replace(/;\s*$/,"");n[t]=i.sanitizeValue(r)}}))}if(n.description&&"."===n.description.substring(0,1)){var g;try{g=document.querySelector(n.description).innerHTML}catch(e){if(!(e instanceof DOMException))throw e}g&&(n.description=g)}if(!n.description){var v=e.querySelector(".glightbox-desc");v&&(n.description=v.innerHTML)}return this.setSize(n,t,e),this.slideConfig=n,n}},{key:"setSize",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n="video"==e.type?this.checkSize(t.videosWidth):this.checkSize(t.width),s=this.checkSize(t.height);return e.width=P(e,"width")&&""!==e.width?this.checkSize(e.width):n,e.height=P(e,"height")&&""!==e.height?this.checkSize(e.height):s,i&&"image"==e.type&&(e._hasCustomWidth=!!i.dataset.width,e._hasCustomHeight=!!i.dataset.height),e}},{key:"checkSize",value:function(e){return z(e)?"".concat(e,"px"):e}},{key:"sanitizeValue",value:function(e){return"true"!==e&&"false"!==e?e:"true"===e}}]),V=i((function t(i,n,s){e(this,t),this.element=i,this.instance=n,this.index=s}),[{key:"setContent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(u(t,"loaded"))return!1;var n=this.instance.settings,s=this.slideConfig,l=T();C(n.beforeSlideLoad)&&n.beforeSlideLoad({index:this.index,slide:t,player:!1});var o=s.type,r=s.descPosition,a=t.querySelector(".gslide-media"),h=t.querySelector(".gslide-title"),c=t.querySelector(".gslide-desc"),g=t.querySelector(".gdesc-inner"),v=i,f="gSlideTitle_"+this.index,p="gSlideDesc_"+this.index;if(C(n.afterSlideLoad)&&(v=function(){C(i)&&i(),n.afterSlideLoad({index:e.index,slide:t,player:e.instance.getSlidePlayerInstance(e.index)})}),""==s.title&&""==s.description?g&&g.parentNode.parentNode.removeChild(g.parentNode):(h&&""!==s.title?(h.id=f,h.innerHTML=s.title):h.parentNode.removeChild(h),c&&""!==s.description?(c.id=p,l&&n.moreLength>0?(s.smallDescription=this.slideShortDesc(s.description,n.moreLength,n.moreText),c.innerHTML=s.smallDescription,this.descriptionEvents(c,s)):c.innerHTML=s.description):c.parentNode.removeChild(c),d(a.parentNode,"desc-".concat(r)),d(g.parentNode,"description-".concat(r))),d(a,"gslide-".concat(o)),d(t,"loaded"),"video"!==o){if("external"!==o)return"inline"===o?(B.apply(this.instance,[t,s,this.index,v]),void(s.draggable&&new N({dragEl:t.querySelector(".gslide-inline"),toleranceX:n.dragToleranceX,toleranceY:n.dragToleranceY,slide:t,instance:this.instance}))):void("image"!==o?C(v)&&v():D(t,s,this.index,(function(){var i=t.querySelector("img");s.draggable&&new N({dragEl:i,toleranceX:n.dragToleranceX,toleranceY:n.dragToleranceY,slide:t,instance:e.instance}),s.zoomable&&i.naturalWidth>i.offsetWidth&&(d(i,"zoomable"),new q(i,t,(function(){e.instance.resize()}))),C(v)&&v()})));H.apply(this,[t,s,this.index,v])}else _.apply(this.instance,[t,s,this.index,v])}},{key:"slideShortDesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=document.createElement("div");n.innerHTML=e;var s=n.innerText,l=i;if((e=s.trim()).length<=t)return e;var o=e.substr(0,t-1);return l?(n=null,o+'... '+i+""):o}},{key:"descriptionEvents",value:function(e,t){var i=this,n=e.querySelector(".desc-more");if(!n)return!1;h("click",{onElement:n,withCallback:function(e,n){e.preventDefault();var s=document.body,l=g(n,".gslide-desc");if(!l)return!1;l.innerHTML=t.description,d(s,"gdesc-open");var o=h("click",{onElement:[s,g(l,".gslide-description")],withCallback:function(e,n){"a"!==e.target.nodeName.toLowerCase()&&(c(s,"gdesc-open"),d(s,"gdesc-closed"),l.innerHTML=t.smallDescription,i.descriptionEvents(l,t),setTimeout((function(){c(s,"gdesc-closed")}),400),o.destroy())}})}})}},{key:"create",value:function(){return y(this.instance.settings.slideHTML)}},{key:"getConfig",value:function(){E(this.element)||this.element.hasOwnProperty("draggable")||(this.element.draggable=this.instance.settings.draggable);var e=new j(this.instance.settings.slideExtraAttributes);return this.slideConfig=e.parseConfig(this.element,this.instance.settings),this.slideConfig}}]);function F(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function R(e,t){var i=function(e,t){var i=F(e)*F(t);if(0===i)return 0;var n=function(e,t){return e.x*t.x+e.y*t.y}(e,t)/i;return n>1&&(n=1),Math.acos(n)}(e,t);return function(e,t){return e.x*t.y-t.x*e.y}(e,t)>0&&(i*=-1),180*i/Math.PI}var G=i((function t(i){e(this,t),this.handlers=[],this.el=i}),[{key:"add",value:function(e){this.handlers.push(e)}},{key:"del",value:function(e){e||(this.handlers=[]);for(var t=this.handlers.length;t>=0;t--)this.handlers[t]===e&&this.handlers.splice(t,1)}},{key:"dispatch",value:function(){for(var e=0,t=this.handlers.length;e=0)console.log("ignore drag for this touched element",e.target.nodeName.toLowerCase());else{this.now=Date.now(),this.x1=e.touches[0].pageX,this.y1=e.touches[0].pageY,this.delta=this.now-(this.last||this.now),this.touchStart.dispatch(e,this.element),null!==this.preTapPosition.x&&(this.isDoubleTap=this.delta>0&&this.delta<=250&&Math.abs(this.preTapPosition.x-this.x1)<30&&Math.abs(this.preTapPosition.y-this.y1)<30,this.isDoubleTap&&clearTimeout(this.singleTapTimeout)),this.preTapPosition.x=this.x1,this.preTapPosition.y=this.y1,this.last=this.now;var t=this.preV;if(e.touches.length>1){this._cancelLongTap(),this._cancelSingleTap();var i={x:e.touches[1].pageX-this.x1,y:e.touches[1].pageY-this.y1};t.x=i.x,t.y=i.y,this.pinchStartLen=F(t),this.multipointStart.dispatch(e,this.element)}this._preventTap=!1,this.longTapTimeout=setTimeout(function(){this.longTap.dispatch(e,this.element),this._preventTap=!0}.bind(this),750)}}},{key:"move",value:function(e){if(e.touches){var t=this.preV,i=e.touches.length,n=e.touches[0].pageX,s=e.touches[0].pageY;if(this.isDoubleTap=!1,i>1){var l=e.touches[1].pageX,o=e.touches[1].pageY,r={x:e.touches[1].pageX-n,y:e.touches[1].pageY-s};null!==t.x&&(this.pinchStartLen>0&&(e.zoom=F(r)/this.pinchStartLen,this.pinch.dispatch(e,this.element)),e.angle=R(r,t),this.rotate.dispatch(e,this.element)),t.x=r.x,t.y=r.y,null!==this.x2&&null!==this.sx2?(e.deltaX=(n-this.x2+l-this.sx2)/2,e.deltaY=(s-this.y2+o-this.sy2)/2):(e.deltaX=0,e.deltaY=0),this.twoFingerPressMove.dispatch(e,this.element),this.sx2=l,this.sy2=o}else{if(null!==this.x2){e.deltaX=n-this.x2,e.deltaY=s-this.y2;var a=Math.abs(this.x1-this.x2),h=Math.abs(this.y1-this.y2);(a>10||h>10)&&(this._preventTap=!0)}else e.deltaX=0,e.deltaY=0;this.pressMove.dispatch(e,this.element)}this.touchMove.dispatch(e,this.element),this._cancelLongTap(),this.x2=n,this.y2=s,i>1&&e.preventDefault()}}},{key:"end",value:function(e){if(e.changedTouches){this._cancelLongTap();var t=this;e.touches.length<2&&(this.multipointEnd.dispatch(e,this.element),this.sx2=this.sy2=null),this.x2&&Math.abs(this.x1-this.x2)>30||this.y2&&Math.abs(this.y1-this.y2)>30?(e.direction=this._swipeDirection(this.x1,this.x2,this.y1,this.y2),this.swipeTimeout=setTimeout((function(){t.swipe.dispatch(e,t.element)}),0)):(this.tapTimeout=setTimeout((function(){t._preventTap||t.tap.dispatch(e,t.element),t.isDoubleTap&&(t.doubleTap.dispatch(e,t.element),t.isDoubleTap=!1)}),0),t.isDoubleTap||(t.singleTapTimeout=setTimeout((function(){t.singleTap.dispatch(e,t.element)}),250))),this.touchEnd.dispatch(e,this.element),this.preV.x=0,this.preV.y=0,this.zoom=1,this.pinchStartLen=null,this.x1=this.x2=this.y1=this.y2=null}}},{key:"cancelAll",value:function(){this._preventTap=!0,clearTimeout(this.singleTapTimeout),clearTimeout(this.tapTimeout),clearTimeout(this.longTapTimeout),clearTimeout(this.swipeTimeout)}},{key:"cancel",value:function(e){this.cancelAll(),this.touchCancel.dispatch(e,this.element)}},{key:"_cancelLongTap",value:function(){clearTimeout(this.longTapTimeout)}},{key:"_cancelSingleTap",value:function(){clearTimeout(this.singleTapTimeout)}},{key:"_swipeDirection",value:function(e,t,i,n){return Math.abs(e-t)>=Math.abs(i-n)?e-t>0?"Left":"Right":i-n>0?"Up":"Down"}},{key:"on",value:function(e,t){this[e]&&this[e].add(t)}},{key:"off",value:function(e,t){this[e]&&this[e].del(t)}},{key:"destroy",value:function(){return this.singleTapTimeout&&clearTimeout(this.singleTapTimeout),this.tapTimeout&&clearTimeout(this.tapTimeout),this.longTapTimeout&&clearTimeout(this.longTapTimeout),this.swipeTimeout&&clearTimeout(this.swipeTimeout),this.element.removeEventListener("touchstart",this.start),this.element.removeEventListener("touchmove",this.move),this.element.removeEventListener("touchend",this.end),this.element.removeEventListener("touchcancel",this.cancel),this.rotate.del(),this.touchStart.del(),this.multipointStart.del(),this.multipointEnd.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubleTap.del(),this.longTap.del(),this.singleTap.del(),this.pressMove.del(),this.twoFingerPressMove.del(),this.touchMove.del(),this.touchEnd.del(),this.touchCancel.del(),this.preV=this.pinchStartLen=this.zoom=this.isDoubleTap=this.delta=this.last=this.now=this.tapTimeout=this.singleTapTimeout=this.longTapTimeout=this.swipeTimeout=this.x1=this.x2=this.y1=this.y2=this.preTapPosition=this.rotate=this.touchStart=this.multipointStart=this.multipointEnd=this.pinch=this.swipe=this.tap=this.doubleTap=this.longTap=this.singleTap=this.pressMove=this.touchMove=this.touchEnd=this.touchCancel=this.twoFingerPressMove=null,window.removeEventListener("scroll",this._cancelAllHandler),null}}]);function $(e){var t=function(){var e,t=document.createElement("fakeelement"),i={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in i)if(void 0!==t.style[e])return i[e]}(),i=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=u(e,"gslide-media")?e:e.querySelector(".gslide-media"),s=g(n,".ginner-container"),l=e.querySelector(".gslide-description");i>769&&(n=s),d(n,"greset"),f(n,"translate3d(0, 0, 0)"),h(t,{onElement:n,once:!0,withCallback:function(e,t){c(n,"greset")}}),n.style.opacity="",l&&(l.style.opacity="")}function J(e){if(e.events.hasOwnProperty("touch"))return!1;var t,i,n,s=x(),l=s.width,o=s.height,r=!1,a=null,h=null,v=null,p=!1,m=1,y=1,b=!1,S=!1,w=null,T=null,C=null,k=null,E=0,A=0,L=!1,I=!1,O={},P={},M=0,z=0,X=document.getElementById("glightbox-slider"),Y=document.querySelector(".goverlay"),q=new U(X,{touchStart:function(t){if(r=!0,(u(t.targetTouches[0].target,"ginner-container")||g(t.targetTouches[0].target,".gslide-desc")||"a"==t.targetTouches[0].target.nodeName.toLowerCase())&&(r=!1),g(t.targetTouches[0].target,".gslide-inline")&&!u(t.targetTouches[0].target.parentNode,"gslide-inline")&&(r=!1),r){if(P=t.targetTouches[0],O.pageX=t.targetTouches[0].pageX,O.pageY=t.targetTouches[0].pageY,M=t.targetTouches[0].clientX,z=t.targetTouches[0].clientY,a=e.activeSlide,h=a.querySelector(".gslide-media"),n=a.querySelector(".gslide-inline"),v=null,u(h,"gslide-image")&&(v=h.querySelector("img")),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>769&&(h=a.querySelector(".ginner-container")),c(Y,"greset"),t.pageX>20&&t.pageXo){var a=O.pageX-P.pageX;if(Math.abs(a)<=13)return!1}p=!0;var d,c=s.targetTouches[0].clientX,u=s.targetTouches[0].clientY,g=M-c,m=z-u;if(Math.abs(g)>Math.abs(m)?(L=!1,I=!0):(I=!1,L=!0),t=P.pageX-O.pageX,E=100*t/l,i=P.pageY-O.pageY,A=100*i/o,L&&v&&(d=1-Math.abs(i)/o,Y.style.opacity=d,e.settings.touchFollowAxis&&(E=0)),I&&(d=1-Math.abs(t)/l,h.style.opacity=d,e.settings.touchFollowAxis&&(A=0)),!v)return f(h,"translate3d(".concat(E,"%, 0, 0)"));f(h,"translate3d(".concat(E,"%, ").concat(A,"%, 0)"))}},touchEnd:function(){if(r){if(p=!1,S||b)return C=w,void(k=T);var t=Math.abs(parseInt(A)),i=Math.abs(parseInt(E));if(!(t>29&&v))return t<29&&i<25?(d(Y,"greset"),Y.style.opacity=1,$(h)):void 0;e.close()}},multipointEnd:function(){setTimeout((function(){b=!1}),50)},multipointStart:function(){b=!0,m=y||1},pinch:function(e){if(!v||p)return!1;b=!0,v.scaleX=v.scaleY=m*e.zoom;var t=m*e.zoom;if(S=!0,t<=1)return S=!1,t=1,k=null,C=null,w=null,T=null,void v.setAttribute("style","");t>4.5&&(t=4.5),v.style.transform="scale3d(".concat(t,", ").concat(t,", 1)"),y=t},pressMove:function(e){if(S&&!b){var t=P.pageX-O.pageX,i=P.pageY-O.pageY;C&&(t+=C),k&&(i+=k),w=t,T=i;var n="translate3d(".concat(t,"px, ").concat(i,"px, 0)");y&&(n+=" scale3d(".concat(y,", ").concat(y,", 1)")),f(v,n)}},swipe:function(t){if(!S)if(b)b=!1;else{if("Left"==t.direction){if(e.index==e.elements.length-1)return $(h);e.nextSlide()}if("Right"==t.direction){if(0==e.index)return $(h);e.prevSlide()}}}});e.events.touch=q}var K=T(),Q=null!==T()||void 0!==document.createTouch||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints,ee=document.getElementsByTagName("html")[0],te={selector:".glightbox",elements:null,skin:"clean",theme:"clean",closeButton:!0,startAt:null,autoplayVideos:!0,autofocusVideos:!0,descPosition:"bottom",width:"900px",height:"506px",videosWidth:"960px",beforeSlideChange:null,afterSlideChange:null,beforeSlideLoad:null,afterSlideLoad:null,slideInserted:null,slideRemoved:null,slideExtraAttributes:null,onOpen:null,onClose:null,loop:!1,zoomable:!0,draggable:!0,dragAutoSnap:!1,dragToleranceX:40,dragToleranceY:65,preload:!0,oneSlidePerOpen:!1,touchNavigation:!0,touchFollowAxis:!0,keyboardNavigation:!0,closeOnOutsideClick:!0,plugins:!1,plyr:{css:"https://cdn.plyr.io/3.6.12/plyr.css",js:"https://cdn.plyr.io/3.6.12/plyr.js",config:{ratio:"16:9",fullscreen:{enabled:!0,iosNative:!0},youtube:{noCookie:!0,rel:0,showinfo:0,iv_load_policy:3},vimeo:{byline:!1,portrait:!1,title:!1,transparent:!1}}},openEffect:"zoom",closeEffect:"zoom",slideEffect:"slide",moreText:"See more",moreLength:60,cssEfects:{fade:{in:"fadeIn",out:"fadeOut"},zoom:{in:"zoomIn",out:"zoomOut"},slide:{in:"slideInRight",out:"slideOutLeft"},slideBack:{in:"slideInLeft",out:"slideOutRight"},none:{in:"none",out:"none"}},svg:{close:'',next:' ',prev:''},slideHTML:'
\n
\n
\n
\n
\n
\n
\n

\n
\n
\n
\n
\n
\n
',lightboxHTML:''},ie=i((function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e(this,t),this.customOptions=i,this.settings=o(te,i),this.effectsClasses=this.getAnimationClasses(),this.videoPlayers={},this.apiEvents=[],this.fullElementsList=!1}),[{key:"init",value:function(){var e=this,t=this.getSelector();t&&(this.baseEvents=h("click",{onElement:t,withCallback:function(t,i){t.preventDefault(),e.open(i)}})),this.elements=this.getElements()}},{key:"open",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(0===this.elements.length)return!1;this.activeSlide=null,this.prevActiveSlideIndex=null,this.prevActiveSlide=null;var i=z(t)?t:this.settings.startAt;if(E(e)){var n=e.getAttribute("data-gallery");n&&(this.fullElementsList=this.elements,this.elements=this.getGalleryElements(this.elements,n)),O(i)&&(i=this.getElementIndex(e))<0&&(i=0)}z(i)||(i=0),this.build(),v(this.overlay,"none"===this.settings.openEffect?"none":this.settings.cssEfects.fade.in);var s=document.body,l=window.innerWidth-document.documentElement.clientWidth;if(l>0){var o=document.createElement("style");o.type="text/css",o.className="gcss-styles",o.innerText=".gscrollbar-fixer {margin-right: ".concat(l,"px}"),document.head.appendChild(o),d(s,"gscrollbar-fixer")}d(s,"glightbox-open"),d(ee,"glightbox-open"),K&&(d(document.body,"glightbox-mobile"),this.settings.slideEffect="slide"),this.showSlide(i,!0),1===this.elements.length?(d(this.prevButton,"glightbox-button-hidden"),d(this.nextButton,"glightbox-button-hidden")):(c(this.prevButton,"glightbox-button-hidden"),c(this.nextButton,"glightbox-button-hidden")),this.lightboxOpen=!0,this.trigger("open"),C(this.settings.onOpen)&&this.settings.onOpen(),Q&&this.settings.touchNavigation&&J(this),this.settings.keyboardNavigation&&Y(this)}},{key:"openAt",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.open(null,e)}},{key:"showSlide",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p(this.loader),this.index=parseInt(t);var n=this.slidesContainer.querySelector(".current");n&&c(n,"current"),this.slideAnimateOut();var s=this.slidesContainer.querySelectorAll(".gslide")[t];if(u(s,"loaded"))this.slideAnimateIn(s,i),m(this.loader);else{p(this.loader);var l=this.elements[t],o={index:this.index,slide:s,slideNode:s,slideConfig:l.slideConfig,slideIndex:this.index,trigger:l.node,player:null};this.trigger("slide_before_load",o),l.instance.setContent(s,(function(){m(e.loader),e.resize(),e.slideAnimateIn(s,i),e.trigger("slide_after_load",o)}))}this.slideDescription=s.querySelector(".gslide-description"),this.slideDescriptionContained=this.slideDescription&&u(this.slideDescription.parentNode,"gslide-media"),this.settings.preload&&(this.preloadSlide(t+1),this.preloadSlide(t-1)),this.updateNavigationClasses(),this.activeSlide=s}},{key:"preloadSlide",value:function(e){var t=this;if(e<0||e>this.elements.length-1)return!1;if(O(this.elements[e]))return!1;var i=this.slidesContainer.querySelectorAll(".gslide")[e];if(u(i,"loaded"))return!1;var n=this.elements[e],s=n.type,l={index:e,slide:i,slideNode:i,slideConfig:n.slideConfig,slideIndex:e,trigger:n.node,player:null};this.trigger("slide_before_load",l),"video"===s||"external"===s?setTimeout((function(){n.instance.setContent(i,(function(){t.trigger("slide_after_load",l)}))}),200):n.instance.setContent(i,(function(){t.trigger("slide_after_load",l)}))}},{key:"prevSlide",value:function(){this.goToSlide(this.index-1)}},{key:"nextSlide",value:function(){this.goToSlide(this.index+1)}},{key:"goToSlide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.prevActiveSlide=this.activeSlide,this.prevActiveSlideIndex=this.index,!this.loop()&&(e<0||e>this.elements.length-1))return!1;e<0?e=this.elements.length-1:e>=this.elements.length&&(e=0),this.showSlide(e)}},{key:"insertSlide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;t<0&&(t=this.elements.length);var i=new V(e,this,t),n=i.getConfig(),s=o({},n),l=i.create(),r=this.elements.length-1;s.index=t,s.node=!1,s.instance=i,s.slideConfig=n,this.elements.splice(t,0,s);var a=null,h=null;if(this.slidesContainer){if(t>r)this.slidesContainer.appendChild(l);else{var d=this.slidesContainer.querySelectorAll(".gslide")[t];this.slidesContainer.insertBefore(l,d)}(this.settings.preload&&0==this.index&&0==t||this.index-1==t||this.index+1==t)&&this.preloadSlide(t),0===this.index&&0===t&&(this.index=1),this.updateNavigationClasses(),a=this.slidesContainer.querySelectorAll(".gslide")[t],h=this.getSlidePlayerInstance(t),s.slideNode=a}this.trigger("slide_inserted",{index:t,slide:a,slideNode:a,slideConfig:n,slideIndex:t,trigger:null,player:h}),C(this.settings.slideInserted)&&this.settings.slideInserted({index:t,slide:a,player:h})}},{key:"removeSlide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e<0||e>this.elements.length-1)return!1;var t=this.slidesContainer&&this.slidesContainer.querySelectorAll(".gslide")[e];t&&(this.getActiveSlideIndex()==e&&(e==this.elements.length-1?this.prevSlide():this.nextSlide()),t.parentNode.removeChild(t)),this.elements.splice(e,1),this.trigger("slide_removed",e),C(this.settings.slideRemoved)&&this.settings.slideRemoved(e)}},{key:"slideAnimateIn",value:function(e,t){var i=this,n=e.querySelector(".gslide-media"),s=e.querySelector(".gslide-description"),l={index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlide,slideConfig:O(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:O(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},o={index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideConfig:this.elements[this.index].slideConfig,slideIndex:this.index,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)};if(n.offsetWidth>0&&s&&(m(s),s.style.display=""),c(e,this.effectsClasses),t)v(e,this.settings.cssEfects[this.settings.openEffect].in,(function(){i.settings.autoplayVideos&&i.slidePlayerPlay(e),i.trigger("slide_changed",{prev:l,current:o}),C(i.settings.afterSlideChange)&&i.settings.afterSlideChange.apply(i,[l,o])}));else{var r=this.settings.slideEffect,a="none"!==r?this.settings.cssEfects[r].in:r;this.prevActiveSlideIndex>this.index&&"slide"==this.settings.slideEffect&&(a=this.settings.cssEfects.slideBack.in),v(e,a,(function(){i.settings.autoplayVideos&&i.slidePlayerPlay(e),i.trigger("slide_changed",{prev:l,current:o}),C(i.settings.afterSlideChange)&&i.settings.afterSlideChange.apply(i,[l,o])}))}setTimeout((function(){i.resize(e)}),100),d(e,"current")}},{key:"slideAnimateOut",value:function(){if(!this.prevActiveSlide)return!1;var e=this.prevActiveSlide;c(e,this.effectsClasses),d(e,"prev");var t=this.settings.slideEffect,i="none"!==t?this.settings.cssEfects[t].out:t;this.slidePlayerPause(e),this.trigger("slide_before_change",{prev:{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,slideNode:this.prevActiveSlide,slideIndex:this.prevActiveSlideIndex,slideConfig:O(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].slideConfig,trigger:O(this.prevActiveSlideIndex)?null:this.elements[this.prevActiveSlideIndex].node,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},current:{index:this.index,slide:this.activeSlide,slideNode:this.activeSlide,slideIndex:this.index,slideConfig:this.elements[this.index].slideConfig,trigger:this.elements[this.index].node,player:this.getSlidePlayerInstance(this.index)}}),C(this.settings.beforeSlideChange)&&this.settings.beforeSlideChange.apply(this,[{index:this.prevActiveSlideIndex,slide:this.prevActiveSlide,player:this.getSlidePlayerInstance(this.prevActiveSlideIndex)},{index:this.index,slide:this.activeSlide,player:this.getSlidePlayerInstance(this.index)}]),this.prevActiveSlideIndex>this.index&&"slide"==this.settings.slideEffect&&(i=this.settings.cssEfects.slideBack.out),v(e,i,(function(){var t=e.querySelector(".ginner-container"),i=e.querySelector(".gslide-media"),n=e.querySelector(".gslide-description");t.style.transform="",i.style.transform="",c(i,"greset"),i.style.opacity="",n&&(n.style.opacity=""),c(e,"prev")}))}},{key:"getAllPlayers",value:function(){return this.videoPlayers}},{key:"getSlidePlayerInstance",value:function(e){var t="gvideo"+e,i=this.getAllPlayers();return!(!P(i,t)||!i[t])&&i[t]}},{key:"stopSlideVideo",value:function(e){if(E(e)){var t=e.querySelector(".gvideo-wrapper");t&&(e=t.getAttribute("data-index"))}console.log("stopSlideVideo is deprecated, use slidePlayerPause");var i=this.getSlidePlayerInstance(e);i&&i.playing&&i.pause()}},{key:"slidePlayerPause",value:function(e){if(E(e)){var t=e.querySelector(".gvideo-wrapper");t&&(e=t.getAttribute("data-index"))}var i=this.getSlidePlayerInstance(e);i&&i.playing&&i.pause()}},{key:"playSlideVideo",value:function(e){if(E(e)){var t=e.querySelector(".gvideo-wrapper");t&&(e=t.getAttribute("data-index"))}console.log("playSlideVideo is deprecated, use slidePlayerPlay");var i=this.getSlidePlayerInstance(e);i&&!i.playing&&i.play()}},{key:"slidePlayerPlay",value:function(e){var t;if(!K||null!==(t=this.settings.plyr.config)&&void 0!==t&&t.muted){if(E(e)){var i=e.querySelector(".gvideo-wrapper");i&&(e=i.getAttribute("data-index"))}var n=this.getSlidePlayerInstance(e);n&&!n.playing&&(n.play(),this.settings.autofocusVideos&&n.elements.container.focus())}}},{key:"setElements",value:function(e){var t=this;this.settings.elements=!1;var i=[];e&&e.length&&r(e,(function(e,n){var s=new V(e,t,n),l=s.getConfig(),r=o({},l);r.slideConfig=l,r.instance=s,r.index=n,i.push(r)})),this.elements=i,this.lightboxOpen&&(this.slidesContainer.innerHTML="",this.elements.length&&(r(this.elements,(function(){var e=y(t.settings.slideHTML);t.slidesContainer.appendChild(e)})),this.showSlide(0,!0)))}},{key:"getElementIndex",value:function(e){var t=!1;return r(this.elements,(function(i,n){if(P(i,"node")&&i.node==e)return t=n,!0})),t}},{key:"getElements",value:function(){var e=this,t=[];this.elements=this.elements?this.elements:[],!O(this.settings.elements)&&A(this.settings.elements)&&this.settings.elements.length&&r(this.settings.elements,(function(i,n){var s=new V(i,e,n),l=s.getConfig(),r=o({},l);r.node=!1,r.index=n,r.instance=s,r.slideConfig=l,t.push(r)}));var i=!1;return this.getSelector()&&(i=document.querySelectorAll(this.getSelector())),i?(r(i,(function(i,n){var s=new V(i,e,n),l=s.getConfig(),r=o({},l);r.node=i,r.index=n,r.instance=s,r.slideConfig=l,r.gallery=i.getAttribute("data-gallery"),t.push(r)})),t):t}},{key:"getGalleryElements",value:function(e,t){return e.filter((function(e){return e.gallery==t}))}},{key:"getSelector",value:function(){return!this.settings.elements&&(this.settings.selector&&"data-"==this.settings.selector.substring(0,5)?"*[".concat(this.settings.selector,"]"):this.settings.selector)}},{key:"getActiveSlide",value:function(){return this.slidesContainer.querySelectorAll(".gslide")[this.index]}},{key:"getActiveSlideIndex",value:function(){return this.index}},{key:"getAnimationClasses",value:function(){var e=[];for(var t in this.settings.cssEfects)if(this.settings.cssEfects.hasOwnProperty(t)){var i=this.settings.cssEfects[t];e.push("g".concat(i.in)),e.push("g".concat(i.out))}return e.join(" ")}},{key:"build",value:function(){var e=this;if(this.built)return!1;var t=document.body.childNodes,i=[];r(t,(function(e){e.parentNode==document.body&&"#"!==e.nodeName.charAt(0)&&e.hasAttribute&&!e.hasAttribute("aria-hidden")&&(i.push(e),e.setAttribute("aria-hidden","true"))}));var n=P(this.settings.svg,"next")?this.settings.svg.next:"",s=P(this.settings.svg,"prev")?this.settings.svg.prev:"",l=P(this.settings.svg,"close")?this.settings.svg.close:"",o=this.settings.lightboxHTML;o=y(o=(o=(o=o.replace(/{nextSVG}/g,n)).replace(/{prevSVG}/g,s)).replace(/{closeSVG}/g,l)),document.body.appendChild(o);var a=document.getElementById("glightbox-body");this.modal=a;var c=a.querySelector(".gclose");this.prevButton=a.querySelector(".gprev"),this.nextButton=a.querySelector(".gnext"),this.overlay=a.querySelector(".goverlay"),this.loader=a.querySelector(".gloader"),this.slidesContainer=document.getElementById("glightbox-slider"),this.bodyHiddenChildElms=i,this.events={},d(this.modal,"glightbox-"+this.settings.skin),this.settings.closeButton&&c&&(this.events.close=h("click",{onElement:c,withCallback:function(t,i){t.preventDefault(),e.close()}})),c&&!this.settings.closeButton&&c.parentNode.removeChild(c),this.nextButton&&(this.events.next=h("click",{onElement:this.nextButton,withCallback:function(t,i){t.preventDefault(),e.nextSlide()}})),this.prevButton&&(this.events.prev=h("click",{onElement:this.prevButton,withCallback:function(t,i){t.preventDefault(),e.prevSlide()}})),this.settings.closeOnOutsideClick&&(this.events.outClose=h("click",{onElement:a,withCallback:function(t,i){e.preventOutsideClick||u(document.body,"glightbox-mobile")||g(t.target,".ginner-container")||g(t.target,".gbtn")||u(t.target,"gnext")||u(t.target,"gprev")||e.close()}})),r(this.elements,(function(t,i){e.slidesContainer.appendChild(t.instance.create()),t.slideNode=e.slidesContainer.querySelectorAll(".gslide")[i]})),Q&&d(document.body,"glightbox-touch"),this.events.resize=h("resize",{onElement:window,withCallback:function(){e.resize()}}),this.built=!0}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if((e=e||this.activeSlide)&&!u(e,"zoomed")){var t=x(),i=e.querySelector(".gvideo-wrapper"),n=e.querySelector(".gslide-image"),s=this.slideDescription,l=t.width,o=t.height;if(l<=768?d(document.body,"glightbox-mobile"):c(document.body,"glightbox-mobile"),i||n){var r=!1;if(s&&(u(s,"description-bottom")||u(s,"description-top"))&&!u(s,"gabsolute")&&(r=!0),n)if(l<=768)n.querySelector("img");else if(r){var a,h,g=s.offsetHeight,v=n.querySelector("img"),f=null===(a=this.elements[this.index])||void 0===a?void 0:a.node,p="100vh";f&&(p=null!==(h=f.getAttribute("data-height"))&&void 0!==h?h:p),v.setAttribute("style","max-height: calc(".concat(p," - ").concat(g,"px)")),s.setAttribute("style","max-width: ".concat(v.offsetWidth,"px;"))}if(i){var m=P(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!m){var y=i.clientWidth,b=i.clientHeight,S=y/b;m="".concat(y/S,":").concat(b/S)}var w=m.split(":"),T=this.settings.videosWidth,C=this.settings.videosWidth,k=(C=z(T)||-1!==T.indexOf("px")?parseInt(T):-1!==T.indexOf("vw")?l*parseInt(T)/100:-1!==T.indexOf("vh")?o*parseInt(T)/100:-1!==T.indexOf("%")?l*parseInt(T)/100:parseInt(i.clientWidth))/(parseInt(w[0])/parseInt(w[1]));if(k=Math.floor(k),r&&(o-=s.offsetHeight),C>l||k>o||oC){var E=i.offsetWidth,A=i.offsetHeight,L=o/A,I={width:E*L,height:A*L};i.parentNode.setAttribute("style","max-width: ".concat(I.width,"px")),r&&s.setAttribute("style","max-width: ".concat(I.width,"px;"))}else i.parentNode.style.maxWidth="".concat(T),r&&s.setAttribute("style","max-width: ".concat(T,";"))}}}}},{key:"reload",value:function(){this.init()}},{key:"updateNavigationClasses",value:function(){var e=this.loop();c(this.nextButton,"disabled"),c(this.prevButton,"disabled"),0==this.index&&this.elements.length-1==0?(d(this.prevButton,"disabled"),d(this.nextButton,"disabled")):0!==this.index||e?this.index!==this.elements.length-1||e||d(this.nextButton,"disabled"):d(this.prevButton,"disabled")}},{key:"loop",value:function(){var e=P(this.settings,"loopAtEnd")?this.settings.loopAtEnd:null;return e=P(this.settings,"loop")?this.settings.loop:e,e}},{key:"close",value:function(){var e=this;if(!this.lightboxOpen){if(this.events){for(var t in this.events)this.events.hasOwnProperty(t)&&this.events[t].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slidePlayerPause(this.activeSlide),this.fullElementsList&&(this.elements=this.fullElementsList),this.bodyHiddenChildElms.length&&r(this.bodyHiddenChildElms,(function(e){e.removeAttribute("aria-hidden")})),d(this.modal,"glightbox-closing"),v(this.overlay,"none"==this.settings.openEffect?"none":this.settings.cssEfects.fade.out),v(this.activeSlide,this.settings.cssEfects[this.settings.closeEffect].out,(function(){if(e.activeSlide=null,e.prevActiveSlideIndex=null,e.prevActiveSlide=null,e.built=!1,e.events){for(var t in e.events)e.events.hasOwnProperty(t)&&e.events[t].destroy();e.events=null}var i=document.body;c(ee,"glightbox-open"),c(i,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),e.modal.parentNode.removeChild(e.modal),e.trigger("close"),C(e.settings.onClose)&&e.settings.onClose();var n=document.querySelector(".gcss-styles");n&&n.parentNode.removeChild(n),e.lightboxOpen=!1,e.closing=null}))}},{key:"destroy",value:function(){this.close(),this.clearAllEvents(),this.baseEvents&&this.baseEvents.destroy()}},{key:"on",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||!C(t))throw new TypeError("Event name and callback must be defined");this.apiEvents.push({evt:e,once:i,callback:t})}},{key:"once",value:function(e,t){this.on(e,t,!0)}},{key:"trigger",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[];r(this.apiEvents,(function(t,s){var l=t.evt,o=t.once,r=t.callback;l==e&&(r(i),o&&n.push(s))})),n.length&&r(n,(function(e){return t.apiEvents.splice(e,1)}))}},{key:"clearAllEvents",value:function(){this.apiEvents.splice(0,this.apiEvents.length)}},{key:"version",value:function(){return"3.3.1"}}]);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new ie(e);return t.init(),t}})); diff --git a/website/static_files/style.css b/website/static_files/style.css new file mode 100644 index 00000000..2a5366e5 --- /dev/null +++ b/website/static_files/style.css @@ -0,0 +1,1042 @@ +/* Verso Website - Base Styles */ + +:root { + --color-primary: #d65d5d; + --color-accent: #c97a00; + --color-bg: #fef9f9; + --color-text: #2a2a2a; + --color-text-muted: #64748b; + --color-code-bg: #f8f4f4; + --color-white: #ffffff; + --color-border: #f3e4e4; + --font-sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + --font-mono: "Fira Code", "JetBrains Mono", monospace; + --max-width: 1100px; + --hover-bg-color: rgba(0, 0, 0, 0.07); + /* Filter that converts black to --color-primary; update when primary changes */ + --filter-primary: invert(50%) sepia(30%) saturate(1500%) hue-rotate(330deg) brightness(95%) + contrast(90%); + --filter-white: brightness(0) invert(1); +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: var(--font-sans); + color: var(--color-text); + background-color: var(--color-bg); + line-height: 1.6; +} + +/* Navigation */ +.navbar { + background: var(--color-white); + border-bottom: 2px solid var(--color-border); + padding: 1.5rem 10vw; +} + +.nav-inner { + max-width: var(--max-width); + margin: 0 auto; + display: flex; + gap: 3rem; + align-items: center; +} + +.logo { + font-size: 1.25rem; + font-weight: 700; + color: var(--color-primary); + text-decoration: none; +} + +.nav-links { + display: flex; + gap: 2rem; + align-items: center; +} + +.nav-links a { + color: var(--color-text-muted); + text-decoration: none; + font-weight: 500; + transition: color 0.2s; +} + +.nav-links a:hover { + color: var(--color-primary); +} + +.nav-links .divider { + color: #999; +} + +.nav-links svg { + vertical-align: middle; + fill: var(--color-text-muted); + transition: fill 0.2s; +} + +.nav-links img { + vertical-align: middle; +} + +.nav-links { + flex: 1; +} + +.nav-links a:last-child { + margin-left: auto; +} + +.nav-links a:hover svg { + fill: var(--color-primary); +} + +/* Main content */ +main { + max-width: var(--max-width); + margin: 0 auto; + padding: 2rem 1.5rem; +} + +/* Footer */ +footer { + background: var(--color-primary); + color: rgba(255, 255, 255, 0.7); + padding: 4rem 10vw 2rem; + font-size: 0.9rem; +} + +.footer-inner { + max-width: var(--max-width); + margin: 0 auto; +} + +.footer-columns { + display: grid; + grid-template-columns: repeat(4, auto); + justify-content: start; + gap: 2rem 4rem; + margin-bottom: 3rem; +} + +.footer-col { + display: flex; + flex-direction: column; + gap: 0.6rem; +} + +.footer-col h4 { + color: var(--color-white); + font-size: 0.85rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.05em; + margin-bottom: 0.5rem; +} + +footer a { + color: rgba(255, 255, 255, 0.6); + text-decoration: none; + transition: color 0.2s; + font-size: 0.9rem; +} + +footer a:hover { + color: var(--color-white); +} + +.footer-copy { + border-top: 1px solid rgba(255, 255, 255, 0.1); + padding-top: 1.5rem; + text-align: center; + font-size: 0.8rem; + color: rgba(255, 255, 255, 0.4); +} + +/* Verso source highlighting */ +.verso-source { + background: var(--color-code-bg); + border: 1px solid var(--color-border); + border-radius: 0.5rem; + padding: 1.25rem; + overflow-x: auto; + font-family: var(--font-mono); + font-size: 0.9rem; + line-height: 1.5; +} + +.verso-source code { + font-family: inherit; +} + +.verso-header { + color: var(--color-primary); + font-weight: 700; +} + +.verso-bold { + color: #7c3aed; +} + +.verso-emph { + color: #7c3aed; +} + +.verso-code { + color: #047355; +} + +.verso-ext-name { + color: #d65d5d; +} + +.verso-directive, +.verso-directive-delim { + color: var(--color-accent); +} + +/* Highlight whole directive when hovering ::: delimiters */ +.verso-source .verso-directive-wrap:has(.verso-directive-delim:hover) { + background-color: var(--hover-bg-color); +} + +/* Suppress individual hover for ::: (wrapper handles it) */ +.verso-source .verso-directive-wrap .verso-directive-delim:hover { + background-color: transparent; +} + +.verso-role, +.verso-role-delim { + color: var(--color-accent); +} + +.verso-source .verso-role-wrap:has(.verso-role-delim:hover) { + background-color: var(--hover-bg-color); +} + +/* Suppress individual hover for role braces (wrapper handles it) */ +.verso-source .verso-role-wrap .verso-role-delim:hover { + background-color: transparent; +} + +.verso-arg { + color: #d65d5d; +} + +.verso-link, +.verso-link-delim { + color: var(--color-primary); +} + +.verso-source .verso-link-wrap:has(.verso-link-delim:hover) { + background-color: var(--hover-bg-color); +} + +/* Suppress individual hover for link delimiters (wrapper handles it) */ +.verso-source .verso-link-wrap .verso-link-delim:hover { + background-color: transparent; +} + +.verso-math { + color: #9333ea; +} + +.verso-metadata { + color: var(--color-text-muted); +} + +.verso-flag { + color: #dc2626; +} + +.verso-codeblock, +.verso-codeblock-wrap { + color: #008322; +} + +.verso-blockquote { + color: var(--color-text-muted); +} + +.verso-footnote, +.verso-footnote-ref, +.verso-link-ref { + color: var(--color-primary); + font-style: italic; +} + +/* Verso syntax tooltips (uses Tippy.js, initialized in Main.lean) */ +.verso-source [data-tooltip] { + cursor: default; + transition: background-color 0.15s; + border-radius: 2px; +} + +.verso-source [data-tooltip]:hover { + background-color: var(--hover-bg-color); +} + +.verso-source .verso-codeblock-wrap, +.verso-source .verso-directive-wrap { + display: inline-block; +} + +/* Highlight whole codeblock when hovering a fence or content */ +.verso-source .verso-codeblock-wrap:has(.verso-codeblock-fence:hover), +.verso-source .verso-codeblock-wrap:has(.verso-codeblock-content:hover) { + background-color: var(--hover-bg-color); +} + +/* Suppress individual hover for fences/content (wrapper handles it) */ +.verso-source .verso-codeblock-wrap .verso-codeblock-fence:hover, +.verso-source .verso-codeblock-wrap .verso-codeblock-content:hover { + background-color: transparent; +} + +/* Hide default page title (we have the nav logo) */ +article > h1:first-child { + display: none; +} + +/* Hero Section */ +.hero { + padding: 4rem 0 3rem; +} + +.hero-text { + text-align: center; + max-width: 700px; + margin: 0 auto 3rem; +} + +.hero-text > p:first-child { + font-size: 3rem; + font-weight: 800; + line-height: 1.1; + letter-spacing: -0.03em; + margin-bottom: 0.5rem; + color: var(--color-primary); +} + +.hero-text > p:nth-child(2) { + font-size: 1.75rem; + font-weight: 700; + line-height: 1.3; + letter-spacing: -0.01em; + margin-bottom: 1rem; +} + +.hero-text > p:nth-child(3) { + font-size: 1.125rem; + color: var(--color-text-muted); + line-height: 1.7; + margin-bottom: 1.5rem; +} + +/* Hero CTA Buttons */ +.hero-text > p:last-child { + display: flex; + gap: 1rem; + justify-content: center; + margin-top: 2rem; +} + +.hero-btn + .hero-btn { + margin-left: 1rem; +} + +.hero-btn { + display: inline-flex; + align-items: center; + gap: 0.5rem; + padding: 1rem 2.5rem; + border-radius: 0.5rem; + font-size: 17px; + font-weight: 500; + text-decoration: none; + cursor: pointer; + transition: all 0.3s; +} + +.hero-btn img { + width: 20px; + height: 20px; +} + +.hero-btn.primary { + background: var(--color-primary); + color: var(--color-white); +} + +.hero-btn.primary img { + filter: var(--filter-white); +} + +.hero-btn.primary:hover { + background: color-mix(in srgb, var(--color-primary) 80%, white); +} + +.hero-btn.secondary { + border: 2px solid var(--color-primary); + background: var(--color-white); + color: var(--color-primary); +} + +.hero-btn.secondary:hover { + background: var(--color-primary); + color: var(--color-white); +} + +.hero-btn.secondary img { + filter: var(--filter-primary); +} + +.hero-btn.secondary:hover img { + filter: var(--filter-white); +} + +/* Verso Demo (source/output side-by-side) */ +.verso-demo { + display: grid; + grid-template-columns: 1fr 1fr; + border-radius: 1rem; + overflow: hidden; + border: 2px solid var(--color-primary); + background: var(--color-white); + box-shadow: + 0px 35px 77px rgba(9, 62, 185, 0.1), + 0px 140px 140px rgba(9, 62, 185, 0.09); +} + +.verso-source-panel { + background: var(--color-code-bg); + border-right: 1px solid var(--color-border); + min-width: 0; +} + +.verso-source-panel .verso-source { + border: none; + border-radius: 0; + background: transparent; + font-size: 0.82rem; + margin: 0; + white-space: pre-wrap; + overflow-wrap: break-word; +} + +.verso-source-panel .verso-codeblock-content { + white-space: pre; +} + +.verso-source-panel .verso-directive-wrap { + display: inline; +} + +.verso-output-panel { + padding: 1.25rem; + font-size: 0.95rem; + overflow-x: auto; + min-width: 0; +} + +.verso-output-panel > p { + margin-bottom: 0.75rem; +} + +.verso-output-panel > p:last-child { + margin-bottom: 0; +} + +.verso-output-panel .theorem { + border-radius: 0.375rem; + padding: 1rem 1.25rem; + margin-top: 2.5rem; + margin-bottom: 0; + border: 1px solid #999; + position: relative; +} + +.verso-output-panel .theorem > .theorem-name { + position: absolute; + top: -0.8em; + background-color: var(--color-white); + font-weight: bold; + font-style: italic; +} + +.verso-output-panel .theorem > .theorem-name::before { + content: "Theorem: "; + font-style: normal; +} + +.verso-output-panel .hl.lean.block { + font-size: 0.82rem; + background: var(--color-code-bg); + border-radius: 0.375rem; + margin-top: 1rem; + padding: 1rem; + margin-bottom: 0.75rem; + overflow-x: auto; +} + +.verso-output-panel .hl.lean .token.binding-hl, +.verso-output-panel .hl.lean .literal.string:hover, +.verso-output-panel .hl.lean .token.typed:hover { + background-color: rgba(0, 0, 0, 0.07); +} + +/* Placeholder images */ +.placeholder-img { + background: var(--color-code-bg); + border: 2px dashed #d1d5db; + border-radius: 0.5rem; + padding: 2rem 1rem; + margin-top: 1rem; + text-align: center; + color: var(--color-text-muted); + font-size: 0.85rem; + font-style: italic; +} + +/* Pillar images */ +.pillar img { + margin-top: 1rem; + width: 100%; + aspect-ratio: 16 / 9; + object-fit: cover; + object-position: top left; + border-radius: 0.5rem; + border: 1px solid var(--color-border); + cursor: pointer; + transition: box-shadow 0.2s; +} + +.pillar img:hover { + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12); +} + +/* Lightbox */ +.lightbox-overlay { + display: none; + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.75); + z-index: 1000; + justify-content: center; + align-items: center; + cursor: pointer; +} + +.lightbox-overlay.active { + display: flex; +} + +.lightbox-overlay img { + max-width: 90vw; + max-height: 90vh; + border-radius: 0.5rem; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); +} + +/* Section titles (bold paragraphs used as headings) */ +.pillars > p:first-child > strong, +.builds > p:first-child > strong, +.showcase > p:first-child > strong, +.sponsors > p:first-child > strong { + font-size: 2.5rem; + font-weight: 700; + color: var(--color-text); +} + +.builds > p:first-child, +.showcase > p:first-child, +.sponsors > p:first-child { + text-align: center; + margin-bottom: 1rem; +} + +/* Pillars */ +.pillars { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 2rem; + padding: 5rem 0; +} + +.pillar { + display: flex; + flex-direction: column; +} + +.pillar > :last-child { + margin-top: auto; +} + +.pillar > p:first-child { + margin-bottom: 0.75rem; +} + +.pillar > p:first-child > strong { + font-size: 1.25rem; + font-weight: 700; + color: var(--color-primary); +} + +.pillar > p:nth-child(2) { + color: var(--color-text-muted); + line-height: 1.7; +} + +/* What Can You Build */ +.builds { + padding: 5rem 0; +} + +.builds > p:nth-child(2) { + text-align: center; + color: var(--color-text-muted); + max-width: 650px; + margin: 0 auto 2rem; + line-height: 1.7; +} + +.build-cards { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1.25rem; + border: 2px solid var(--color-primary); + border-radius: 1rem; + padding: 1.5rem; + background: var(--color-white); + box-shadow: + 0px 35px 77px rgba(9, 62, 185, 0.1), + 0px 140px 140px rgba(9, 62, 185, 0.09); +} + +.build-card { + background: var(--color-white); + border: 1px solid var(--color-border); + border-radius: 0.5rem; + padding: 1.5rem; +} + +.build-card > p:first-child > strong { + font-size: 1.05rem; + color: var(--color-text); +} + +.build-card > p:nth-child(2) { + color: var(--color-text-muted); + font-size: 0.95rem; + margin-top: 0.25rem; +} + +/* Showcase */ +.showcase { + padding: 5rem 0; +} + +.showcase-cards { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1.25rem; + margin-top: 1.5rem; +} + +.showcase-card { + background: var(--color-white); + border: 1px solid var(--color-border); + border-radius: 0.5rem; + padding: 1.5rem; + border-top: 3px solid var(--color-text-muted); + position: relative; + transition: box-shadow 0.2s; + cursor: pointer; +} + +.showcase-card:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); +} + +.showcase-card.reference { + border-top-color: var(--color-primary); +} +.showcase-card.website { + border-top-color: var(--color-accent); +} +.showcase-card.textbook { + border-top-color: #059669; +} +.showcase-card.course { + border-top-color: #7c3aed; +} + +.showcase-card > p:first-child a { + font-weight: 600; + color: var(--color-text); + text-decoration: none; +} + +.showcase-card > p:first-child a::after { + content: ""; + position: absolute; + inset: 0; +} + +.showcase-card > p:first-child a:hover { + color: var(--color-primary); +} + +.showcase-card > p:nth-child(2) { + color: var(--color-text-muted); + font-size: 0.95rem; + margin-top: 0.25rem; +} + +/* Maintainers section - center card content */ +#maintainers .showcase-card { + text-align: center; + display: flex; + flex-direction: column; + align-items: center; +} + +#maintainers .showcase-card img { + margin-top: 1rem; +} + +/* Sponsors */ +.sponsors { + padding: 5rem 0; +} + +.sponsors > p:nth-child(2) { + text-align: center; + color: var(--color-text-muted); + max-width: 650px; + margin: 0 auto 2rem; + line-height: 1.7; +} + +.sponsor-cards { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 2rem; + margin-top: 2rem; + margin-bottom: 3rem; + align-items: center; +} + +.sponsor-card { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 1rem; + transition: opacity 0.2s, transform 0.2s; + text-align: center; +} + +.sponsor-card:hover { + opacity: 0.8; + transform: translateY(-2px); +} + +.sponsors > p:nth-child(4) { + color: var(--color-text-muted); + margin-top: 2rem; + line-height: 1.7; +} + +.sponsor-card img { + max-width: 100%; + height: auto; + max-height: 180px; + object-fit: contain; +} + +.sponsor-card a { + display: flex; + align-items: center; + justify-content: center; + text-decoration: none; +} + +/* Get Started (CTA section — inset blue card) */ +.get-started { + background: var(--color-primary); + color: var(--color-white); + padding: 4rem 3rem; + text-align: center; + border-radius: 1rem; + margin-bottom: 2rem; +} + +.get-started > p:first-child > strong { + font-size: 2.5rem; + font-weight: 700; + color: var(--color-white); +} + +.get-started > p:nth-child(2) { + color: rgba(255, 255, 255, 0.85); + max-width: 650px; + margin: 0.5rem auto 0; + line-height: 1.7; + font-size: 1.05rem; +} + +.cta-buttons { + display: flex; + gap: 1rem; + justify-content: center; + margin-top: 2rem; + flex-wrap: wrap; +} + +.cta-btn { + display: inline-flex; + align-items: center; + gap: 0.5rem; + padding: 0.85rem 2rem; + border-radius: 0.5rem; + font-size: 16px; + font-weight: 500; + text-decoration: none; + cursor: pointer; + transition: all 0.3s; +} + +.cta-btn img { + width: 18px; + height: 18px; +} + +.cta-btn.primary { + background: var(--color-white); + color: var(--color-primary); +} + +.cta-btn.primary img { + filter: var(--filter-primary); +} + +.cta-btn.primary:hover { + background: rgba(255, 255, 255, 0.9); +} + +.cta-btn.secondary { + border: 2px solid var(--color-white); + background: transparent; + color: var(--color-white); +} + +.cta-btn.secondary:hover { + background: rgba(255, 255, 255, 0.15); +} + +.cta-btn.secondary img { + filter: var(--filter-white); +} + +/* Roadmap Page */ +.roadmap-page { + max-width: var(--max-width); + margin: 0 auto; + padding: 3rem 2rem 5rem; +} + +.roadmap-header { + text-align: center; + margin-bottom: 3rem; +} + +.roadmap-header p:first-child strong { + font-size: 3rem; + font-weight: 700; + color: var(--color-primary); +} + +.roadmap-header p:nth-child(2) { + color: var(--color-text-muted); + font-size: 1.2rem; + margin-top: 0.5rem; +} + +.roadmap-section { + margin-bottom: 3rem; +} + +.roadmap-section p:first-child strong { + font-size: 1.75rem; + font-weight: 700; + color: var(--color-primary); +} + +.roadmap-section p:first-child { + margin-bottom: 0.75rem; +} + +.roadmap-section p:nth-child(2) { + color: var(--color-text-muted); + margin-bottom: 1rem; + line-height: 1.7; +} + +.roadmap-section ul { + margin-left: 2rem !important; + margin-bottom: 1rem !important; + margin-top: 0 !important; + padding-left: 1rem !important; + text-align: left !important; +} + +.roadmap-section li { + margin-top: 0 !important; + margin-bottom: 0.5rem !important; + padding-top: 0 !important; + padding-bottom: 0 !important; + border: none !important; + border-top: none !important; + border-bottom: none !important; + text-align: left !important; +} + +.roadmap-section li::before, +.roadmap-section li::after { + display: none !important; + content: none !important; +} + +.roadmap-section li p { + text-align: left !important; + margin: 0 !important; + padding: 0 !important; + border: none !important; +} + +.roadmap-subsection { + margin-top: 1.5rem; + margin-bottom: 1.5rem; +} + +.roadmap-subsection p:first-child em { + font-size: 1.25rem; + font-weight: 600; + color: var(--color-text); + font-style: normal; +} + +.roadmap-subsection p:first-child strong { + font-size: 1.25rem; + font-weight: 600; + color: var(--color-text); +} + +.roadmap-subsection p:first-child { + margin-bottom: 0.5rem; +} + +.roadmap-subsection ul { + margin-left: 2rem !important; + margin-top: 0 !important; + padding-left: 1rem !important; + text-align: left !important; +} + +.roadmap-subsection li { + margin-top: 0 !important; + margin-bottom: 0.4rem !important; + padding-top: 0 !important; + padding-bottom: 0 !important; + border: none !important; + border-top: none !important; + border-bottom: none !important; + text-align: left !important; +} + +.roadmap-subsection li::before, +.roadmap-subsection li::after { + display: none !important; + content: none !important; +} + +.roadmap-subsection li p { + text-align: left !important; + margin: 0 !important; + padding: 0 !important; + border: none !important; +} + +.roadmap-page p:last-child { + text-align: center; + margin-top: 3rem; + padding-top: 2rem; + border-top: 1px solid var(--color-border); +} + +.roadmap-page a { + color: var(--color-primary); + text-decoration: none; +} + +.roadmap-page a:hover { + text-decoration: underline; +} + +/* Responsive */ +@media (max-width: 1024px) { + .verso-demo { + grid-template-columns: 1fr; + } + + .verso-source-panel { + border-right: none; + border-bottom: 1px solid var(--color-border); + } +} + +@media (max-width: 768px) { + .navbar { + padding: 1rem 1.5rem; + } + + .nav-links { + display: none; + } + + .hero-text > p:first-child { + font-size: 2rem; + } + + .hero-text > p:last-child { + flex-direction: column; + align-items: center; + } + + .pillars, + .build-cards, + .showcase-cards { + grid-template-columns: 1fr; + } + + .footer-columns { + grid-template-columns: 1fr; + gap: 1.5rem; + } + + .cta-buttons { + flex-direction: column; + align-items: center; + } + + .get-started { + padding: 3rem 1.5rem; + } +} diff --git a/website/static_files/zulip.svg b/website/static_files/zulip.svg new file mode 100644 index 00000000..691c9902 --- /dev/null +++ b/website/static_files/zulip.svg @@ -0,0 +1 @@ +