Repository: dimsemenov/PhotoSwipe Branch: master Commit: cd41cb587a46 Files: 159 Total size: 1000.8 KB Directory structure: gitextract_0u2e7_9t/ ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .github/ │ ├── FUNDING.yml │ └── workflows/ │ └── build.yml ├── .gitignore ├── LICENSE ├── README.md ├── build/ │ ├── config-builder.js │ ├── rollup.config.js │ └── rollup.config.watch.js ├── demo-docs-website/ │ ├── .gitignore │ ├── babel.config.js │ ├── docusaurus.config.js │ ├── package.json │ ├── repo-data.json │ ├── sidebars.js │ ├── src/ │ │ ├── components/ │ │ │ ├── HomepageFeatures/ │ │ │ │ ├── index.js │ │ │ │ └── styles.module.css │ │ │ └── PswpCodePreview/ │ │ │ ├── demo-images.js │ │ │ ├── gallery-templates/ │ │ │ │ ├── basic--badges.js │ │ │ │ ├── basic--cropped.js │ │ │ │ ├── basic.js │ │ │ │ ├── caption.js │ │ │ │ ├── content-types.js │ │ │ │ ├── custom-html-markup-data-source.js │ │ │ │ ├── getting-started.js │ │ │ │ └── srcset-test.js │ │ │ └── index.js │ │ ├── css/ │ │ │ ├── custom.css │ │ │ ├── docs-page.css │ │ │ ├── example-code-block.css │ │ │ ├── header.css │ │ │ ├── home.css │ │ │ ├── scrollbar.css │ │ │ └── sidebar-menu.css │ │ ├── pages/ │ │ │ ├── _index-deep-zoom-demo.js │ │ │ ├── _index-gallery-header.js │ │ │ ├── index.js │ │ │ └── index.module.css │ │ └── theme/ │ │ ├── CodeBlock/ │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── DocItem/ │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── DocItemFooter/ │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── DocPage/ │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── DocSidebar/ │ │ │ ├── index.js │ │ │ ├── is-same-path.ts │ │ │ └── styles.module.css │ │ ├── EditThisPage/ │ │ │ └── index.js │ │ ├── Footer/ │ │ │ ├── index.js │ │ │ └── styles.module.css │ │ ├── Logo/ │ │ │ └── index.js │ │ ├── MDXComponents/ │ │ │ ├── index.js │ │ │ └── styles.css │ │ └── Navbar/ │ │ ├── github-stars.js │ │ ├── index.js │ │ └── styles.module.css │ └── static/ │ ├── .nojekyll │ └── photoswipe/ │ ├── photoswipe-lightbox.esm.js │ ├── photoswipe.css │ └── photoswipe.esm.js ├── dist/ │ ├── photoswipe-lightbox.esm.js │ ├── photoswipe.css │ ├── photoswipe.esm.js │ ├── types/ │ │ ├── core/ │ │ │ ├── base.d.ts │ │ │ └── eventable.d.ts │ │ ├── gestures/ │ │ │ ├── drag-handler.d.ts │ │ │ ├── gestures.d.ts │ │ │ ├── tap-handler.d.ts │ │ │ └── zoom-handler.d.ts │ │ ├── keyboard.d.ts │ │ ├── lightbox/ │ │ │ └── lightbox.d.ts │ │ ├── main-scroll.d.ts │ │ ├── opener.d.ts │ │ ├── photoswipe.d.ts │ │ ├── scroll-wheel.d.ts │ │ ├── slide/ │ │ │ ├── content.d.ts │ │ │ ├── get-thumb-bounds.d.ts │ │ │ ├── loader.d.ts │ │ │ ├── pan-bounds.d.ts │ │ │ ├── placeholder.d.ts │ │ │ ├── slide.d.ts │ │ │ └── zoom-level.d.ts │ │ ├── types.d.ts │ │ ├── ui/ │ │ │ ├── button-arrow.d.ts │ │ │ ├── button-close.d.ts │ │ │ ├── button-zoom.d.ts │ │ │ ├── counter-indicator.d.ts │ │ │ ├── loading-indicator.d.ts │ │ │ ├── ui-element.d.ts │ │ │ └── ui.d.ts │ │ └── util/ │ │ ├── animations.d.ts │ │ ├── css-animation.d.ts │ │ ├── dom-events.d.ts │ │ ├── spring-animation.d.ts │ │ ├── spring-easer.d.ts │ │ ├── util.d.ts │ │ └── viewport-size.d.ts │ └── umd/ │ └── README.md ├── docs/ │ ├── adding-ui-elements.md │ ├── adjusting-zoom-level.md │ ├── caption.md │ ├── click-and-tap-actions.md │ ├── custom-content.md │ ├── data-sources.md │ ├── events.md │ ├── filters.md │ ├── getting-started.md │ ├── methods.md │ ├── native-fullscreen-on-open.md │ ├── opening-or-closing-transition.md │ ├── options.md │ ├── properties.md │ ├── react-image-gallery.md │ ├── styling.md │ ├── svelte-image-gallery.md │ └── vue-image-gallery.md ├── global.d.ts ├── package.json ├── src/ │ ├── js/ │ │ ├── core/ │ │ │ ├── base.js │ │ │ └── eventable.js │ │ ├── gestures/ │ │ │ ├── drag-handler.js │ │ │ ├── gestures.js │ │ │ ├── tap-handler.js │ │ │ └── zoom-handler.js │ │ ├── keyboard.js │ │ ├── lightbox/ │ │ │ └── lightbox.js │ │ ├── main-scroll.js │ │ ├── opener.js │ │ ├── photoswipe.js │ │ ├── scroll-wheel.js │ │ ├── slide/ │ │ │ ├── content.js │ │ │ ├── get-thumb-bounds.js │ │ │ ├── loader.js │ │ │ ├── pan-bounds.js │ │ │ ├── placeholder.js │ │ │ ├── slide.js │ │ │ └── zoom-level.js │ │ ├── types.ts │ │ ├── ui/ │ │ │ ├── button-arrow.js │ │ │ ├── button-close.js │ │ │ ├── button-zoom.js │ │ │ ├── counter-indicator.js │ │ │ ├── loading-indicator.js │ │ │ ├── ui-element.js │ │ │ └── ui.js │ │ └── util/ │ │ ├── animations.js │ │ ├── css-animation.js │ │ ├── dom-events.js │ │ ├── spring-animation.js │ │ ├── spring-easer.js │ │ ├── util.js │ │ └── viewport-size.js │ └── photoswipe.css └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ { "plugins": [ "@babel/plugin-transform-optional-chaining", "@babel/plugin-transform-nullish-coalescing-operator" ] } ================================================ FILE: .editorconfig ================================================ root = true [*] indent_style = space indent_size = 2 charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true ================================================ FILE: .eslintignore ================================================ node_modules !.*.js .eslintrc.js *.d.ts *.ts ================================================ FILE: .eslintrc.json ================================================ { "env": { "browser": true, "es6": true }, "extends": "airbnb-base", "parser": "@babel/eslint-parser", "parserOptions": { "sourceType": "module", "requireConfigFile": false, "babelOptions": { "plugins": ["@babel/plugin-syntax-class-properties"] } }, "overrides": [ { "files": [ "website/static/es6/**/*.js" ] } ], "rules": { "max-len": ["error", { "code": 100, "comments": 140 }], "comma-dangle": "off", "no-param-reassign": 0, "import/extensions": 0, "no-underscore-dangle": 0, "consistent-return": 0, "no-trailing-spaces": "warn", "spaced-comment": 0, "no-plusplus": 0, "prefer-template": 0, "object-curly-newline": 0, "arrow-body-style": 0, "import/prefer-default-export": 0, "no-else-return": 0, "no-lonely-if": 0, "default-case": 0, "linebreak-style": 0, "class-methods-use-this": 0, "max-classes-per-file": 0, "arrow-parens": 0, "no-multiple-empty-lines": 0, "no-mixed-operators": 0, "function-paren-newline": 0 } } ================================================ FILE: .github/FUNDING.yml ================================================ open_collective: photoswipe ================================================ FILE: .github/workflows/build.yml ================================================ name: PhotoSwipe Jobs on: [workflow_dispatch] jobs: build: name: Publish docs runs-on: ubuntu-latest steps: - name: "checkout repository" uses: actions/checkout@v2 - name: "setup node" uses: actions/setup-node@v2 with: node-version: 16 - name: "github api fetch (for stars count)" working-directory: demo-docs-website run: curl -s https://api.github.com/repos/dimsemenov/photoswipe -o ./repo-data.json - name: "npm install & build docs" working-directory: demo-docs-website run: | npm install npm run build - name: "install ssh key" uses: shimataro/ssh-key-action@v2 with: key: ${{ secrets.SSH_PRIVATE_KEY }} known_hosts: ${{ secrets.KNOWN_HOSTS }} - name: "deploy with rsync" run: rsync -avz ./demo-docs-website/build/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.RSYNC_DIR }} ================================================ FILE: .gitignore ================================================ node_modules/ release/ Gemfile.lock test/dest *.gem pkg/ *.swp *~ _site/ .bundle/ website/static/photoswipe/ .DS_Store bbin/ sftp-config* _site .htaccess private-* __article/ _site/* website/build/ node_modules _production all.min.css aws-keys.json *.sublime-project *.sublime-workspace website/dist/ *.idea /.idea .vscode .node-version .sass-cache/ ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2014-2022 Dmitry Semenov, https://dimsemenov.com 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. ================================================ FILE: README.md ================================================ **FEEDBACK NEEDED** I am developing the new version - PhotoSwipe v6, please [read about upcoming changes and leave feedback](https://github.com/dimsemenov/PhotoSwipe/discussions/2170). PhotoSwipe v5 — JavaScript image gallery and lightbox **[Demo](https://photoswipe.com)** | **[Documentation](https://photoswipe.com/getting-started/)** [![Sponsor via OpenCollective](https://img.shields.io/opencollective/all/photoswipe?label=Sponsor%20via%20OpenCollective)](https://opencollective.com/photoswipe) [![Follow on Twitter](https://img.shields.io/twitter/follow/photoswipe?style=social)](https://twitter.com/intent/user?screen_name=photoswipe) ### Repo structure - `dist/` - main JS and CSS - `src/` - source JS and CSS. - `src/js/photoswipe.js` - entry for PhotoSwipe Core. - `src/js/lightbox/lightbox.js` - entry for PhotoSwipe Lightbox. - `docs/` - documentation markdown files. - `demo-docs-website/` - website with documentation, demos and manual tests. - `build/` - rollup build config. To build JS and CSS in `dist/` directory, run `npm run build`. To run the demo website and automatically rebuild files during development, run `npm install` in `demo-docs-website/` and `npm run watch` in the root directory. ### Older versions Documentation for the old version (v4) can be found [here](https://photoswipe.com/v4-docs/getting-started.html) and [the code for 4.1.3 is here](https://github.com/dimsemenov/PhotoSwipe/tree/v4.1.3). [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct.svg)](https://savelife.in.ua/en/) --- This project is tested with [BrowserStack](https://www.browserstack.com/). ================================================ FILE: build/config-builder.js ================================================ // eslint-disable-next-line import/no-extraneous-dependencies import { terser } from 'rollup-plugin-terser'; import { babel } from '@rollup/plugin-babel'; import pkg from '../package.json'; const year = new Date().getFullYear(); function getBanner(name) { return `/*! * ${name} ${pkg.version} - https://photoswipe.com * (c) ${year} Dmytro Semenov */`; } function getMinifyPlugin() { return terser({ output: { comments: /^\**!/i, }, mangle: { properties: { // mangle properties and func names that start with underscore regex: /^_/, } } }); } function getBabelPlugin() { return babel({ exclude: 'node_modules/**' }) } const baseOutputDir = 'demo-docs-website/static/photoswipe/'; export const lightboxJS = { input: 'src/js/lightbox/lightbox.js', output: { banner: getBanner('PhotoSwipe Lightbox'), file: baseOutputDir + 'photoswipe-lightbox.esm.js', format: 'esm', sourcemap: true }, plugins: [getBabelPlugin()] }; export const coreJS = { input: 'src/js/photoswipe.js', output: { banner: getBanner('PhotoSwipe'), file: baseOutputDir + 'photoswipe.esm.js', format: 'esm', sourcemap: true }, plugins: [getBabelPlugin()] }; export const minLightboxJS = { input: 'src/js/lightbox/lightbox.js', output: { banner: getBanner('PhotoSwipe Lightbox'), file: baseOutputDir + 'photoswipe-lightbox.esm.min.js', format: 'esm' }, plugins: [getBabelPlugin(), getMinifyPlugin()] }; export const minCoreJS = { input: 'src/js/photoswipe.js', output: { banner: getBanner('PhotoSwipe'), file: baseOutputDir + 'photoswipe.esm.min.js', format: 'esm', }, plugins: [getBabelPlugin(), getMinifyPlugin()] }; // UMD config const umdBaseOutputDir = 'demo-docs-website/static/photoswipe/umd/'; export const umdMinLightboxJS = { input: 'src/js/lightbox/lightbox.js', output: { name: 'PhotoSwipeLightbox', banner: getBanner('PhotoSwipe Lightbox'), file: umdBaseOutputDir + 'photoswipe-lightbox.umd.min.js', format: 'umd' }, plugins: [getBabelPlugin(), getMinifyPlugin()] }; export const umdMinCoreJS = { input: 'src/js/photoswipe.js', output: { name: 'PhotoSwipe', banner: getBanner('PhotoSwipe'), file: umdBaseOutputDir + 'photoswipe.umd.min.js', format: 'umd', }, plugins: [getBabelPlugin(), getMinifyPlugin()] }; ================================================ FILE: build/rollup.config.js ================================================ import { lightboxJS, coreJS, minLightboxJS, minCoreJS, umdMinLightboxJS, umdMinCoreJS } from './config-builder'; export default [lightboxJS, coreJS, minLightboxJS, minCoreJS, umdMinLightboxJS, umdMinCoreJS]; ================================================ FILE: build/rollup.config.watch.js ================================================ import { lightboxJS, coreJS } from './config-builder'; export default [lightboxJS, coreJS]; ================================================ FILE: demo-docs-website/.gitignore ================================================ # Dependencies /node_modules # Production /build # Generated files .docusaurus .cache-loader # Misc .DS_Store .env.local .env.development.local .env.test.local .env.production.local npm-debug.log* yarn-debug.log* yarn-error.log* ================================================ FILE: demo-docs-website/babel.config.js ================================================ module.exports = { presets: [require.resolve('@docusaurus/core/lib/babel/preset')], }; ================================================ FILE: demo-docs-website/docusaurus.config.js ================================================ // @ts-check // Note: type annotations allow type checking and IDEs autocompletion const path = require('path'); const lightCodeTheme = require('prism-react-renderer/themes/github'); /** @type {import('@docusaurus/types').Config} */ const config = { title: 'PhotoSwipe', tagline: '', url: 'https://photoswipe.com', baseUrl: '/', onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', favicon: 'img/favicon-16x16.png', organizationName: 'dimsemenov', // Usually your GitHub org/user name. projectName: 'photoswipe', // Usually your repo name. // scripts: [ // 'https://docusaurus.io/slash.js', // { // src: // 'https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js', // async: true, // }, // ], stylesheets: [ { href: '/photoswipe/photoswipe.css', type: 'text/css', }, ], plugins: [ [ '@docusaurus/plugin-google-gtag', { trackingID: 'G-57MLE6HBT9', }, ], ], presets: [ [ 'classic', /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { path: '../docs/', routeBasePath: '/', sidebarPath: require.resolve('./sidebars.js'), // Please change this to your repo. editUrl: 'https://github.com/dimsemenov/PhotoSwipe/tree/master/docs', breadcrumbs: false }, theme: { customCss: require.resolve('./src/css/custom.css'), }, }), ], ], themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ colorMode: { defaultMode: 'light', disableSwitch: true, respectPrefersColorScheme: false, }, navbar: { title: 'PhotoSwipe', // logo: { // alt: 'My Site Logo', // src: 'img/logo.svg', // }, items: [ { type: 'doc', docId: 'getting-started', position: 'left', label: 'Docs', } ], }, footer: { style: 'dark', links: [ { }, { title: 'Community', items: [ { label: 'Twitter', href: 'https://twitter.com/photoswipe', }, ], }, { title: 'More', items: [ { label: 'Blog', to: '/blog', }, { label: 'GitHub', href: 'https://github.com/dimsemenov/photoswipe', }, ], }, ], copyright: 'Made in Ukraine by Dmytro Semenov', }, prism: { theme: lightCodeTheme, }, }), }; module.exports = config; ================================================ FILE: demo-docs-website/package.json ================================================ { "name": "demo-docs-website", "version": "0.0.0", "private": true, "scripts": { "docusaurus": "docusaurus", "start": "docusaurus start", "build": "docusaurus build", "build-and-analyze": "docusaurus build --bundle-analyzer", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { "@docsearch/react": "^3.0.0", "@docusaurus/core": "2.0.0-beta.17", "@docusaurus/plugin-google-gtag": "^2.0.0-beta.17", "@docusaurus/preset-classic": "2.0.0-beta.17", "@docusaurus/theme-live-codeblock": "^2.0.0-beta.17", "@mdx-js/react": "^1.6.22", "clsx": "^1.1.1", "photoswipe-deep-zoom-plugin": "^1.1.1", "photoswipe-dynamic-caption-plugin": "^1.1.1", "prism-react-renderer": "^1.2.1", "react": "^17.0.1", "react-dom": "^17.0.1" }, "browserslist": { "production": [ ">0.5%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } } ================================================ FILE: demo-docs-website/repo-data.json ================================================ { "id": 1580851, "name": "PhotoSwipe", "full_name": "dimsemenov/PhotoSwipe", "private": false, "owner": { "login": "dimsemenov", "id": 1061115, "avatar_url": "https://avatars.githubusercontent.com/u/1061115?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dimsemenov", "html_url": "https://github.com/dimsemenov", "followers_url": "https://api.github.com/users/dimsemenov/followers", "following_url": "https://api.github.com/users/dimsemenov/following{/other_user}", "gists_url": "https://api.github.com/users/dimsemenov/gists{/gist_id}", "starred_url": "https://api.github.com/users/dimsemenov/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dimsemenov/subscriptions", "organizations_url": "https://api.github.com/users/dimsemenov/orgs", "repos_url": "https://api.github.com/users/dimsemenov/repos", "events_url": "https://api.github.com/users/dimsemenov/events{/privacy}", "received_events_url": "https://api.github.com/users/dimsemenov/received_events", "type": "User", "site_admin": false }, "html_url": "https://github.com/dimsemenov/PhotoSwipe", "description": "JavaScript image gallery for mobile and desktop, modular, framework independent", "fork": false, "url": "https://api.github.com/repos/dimsemenov/PhotoSwipe", "forks_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/forks", "keys_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/keys{/key_id}", "collaborators_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/collaborators{/collaborator}", "teams_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/teams", "hooks_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/hooks", "issue_events_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/issues/events{/number}", "events_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/events", "assignees_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/assignees{/user}", "branches_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/branches{/branch}", "tags_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/tags", "blobs_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/git/blobs{/sha}", "git_tags_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/git/tags{/sha}", "git_refs_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/git/refs{/sha}", "trees_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/git/trees{/sha}", "statuses_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/statuses/{sha}", "languages_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/languages", "stargazers_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/stargazers", "contributors_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/contributors", "subscribers_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/subscribers", "subscription_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/subscription", "commits_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/commits{/sha}", "git_commits_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/git/commits{/sha}", "comments_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/comments{/number}", "issue_comment_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/issues/comments{/number}", "contents_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/contents/{+path}", "compare_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/compare/{base}...{head}", "merges_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/merges", "archive_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/{archive_format}{/ref}", "downloads_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/downloads", "issues_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/issues{/number}", "pulls_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/pulls{/number}", "milestones_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/milestones{/number}", "notifications_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/notifications{?since,all,participating}", "labels_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/labels{/name}", "releases_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/releases{/id}", "deployments_url": "https://api.github.com/repos/dimsemenov/PhotoSwipe/deployments", "created_at": "2011-04-07T05:46:29Z", "updated_at": "2022-03-27T01:05:17Z", "pushed_at": "2022-03-26T14:18:32Z", "git_url": "git://github.com/dimsemenov/PhotoSwipe.git", "ssh_url": "git@github.com:dimsemenov/PhotoSwipe.git", "clone_url": "https://github.com/dimsemenov/PhotoSwipe.git", "svn_url": "https://github.com/dimsemenov/PhotoSwipe", "homepage": "http://photoswipe.com", "size": 31451, "stargazers_count": 21653, "watchers_count": 21653, "language": "JavaScript", "has_issues": true, "has_projects": true, "has_downloads": true, "has_wiki": true, "has_pages": false, "forks_count": 3271, "mirror_url": null, "archived": false, "disabled": false, "open_issues_count": 564, "license": { "key": "mit", "name": "MIT License", "spdx_id": "MIT", "url": "https://api.github.com/licenses/mit", "node_id": "MDc6TGljZW5zZTEz" }, "allow_forking": true, "is_template": false, "topics": [ "gallery", "image", "javascript", "lightbox" ], "visibility": "public", "forks": 3271, "open_issues": 564, "watchers": 21655, "default_branch": "master", "temp_clone_token": null, "network_count": 3271, "subscribers_count": 556 } ================================================ FILE: demo-docs-website/sidebars.js ================================================ /** * Creating a sidebar enables you to: - create an ordered group of docs - render a sidebar for each doc of that group - provide next/previous navigation The sidebars can be generated from the filesystem, or explicitly defined here. Create as many sidebars as you want. */ // @ts-check /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure // tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], mainSidebar: [ { type: 'doc', id: 'getting-started', }, { type: 'category', label: 'Examples', items: [ { type: 'doc', id: 'styling', }, { type: 'doc', id: 'opening-or-closing-transition', }, { type: 'doc', id: 'adding-ui-elements', }, { type: 'doc', id: 'adjusting-zoom-level', }, { type: 'doc', id: 'caption', }, { type: 'doc', id: 'click-and-tap-actions', }, { type: 'doc', id: 'custom-content', }, { type: 'doc', id: 'data-sources', }, { type: 'doc', id: 'native-fullscreen-on-open', }, ], }, { type: 'category', label: 'API', items: [ { type: 'doc', id: 'options', }, { type: 'doc', id: 'events', }, { type: 'doc', id: 'filters', }, { type: 'doc', id: 'methods', }, ], }, { type: 'category', label: 'Frameworks', items: [ { type: 'doc', id: 'react-image-gallery', }, { type: 'doc', id: 'vue-image-gallery', }, { type: 'doc', id: 'svelte-image-gallery', }, ], }, ] // But you can create a sidebar manually /* tutorialSidebar: [ { type: 'category', label: 'Tutorial', items: ['hello'], }, ], */ }; module.exports = sidebars; ================================================ FILE: demo-docs-website/src/components/HomepageFeatures/index.js ================================================ import React from 'react'; import clsx from 'clsx'; import styles from './styles.module.css'; const FeatureList = [ { title: 'Easy to Use', Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, description: ( <> Docusaurus was designed from the ground up to be easily installed and used to get your website up and running quickly. ), }, { title: 'Focus on What Matters', Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, description: ( <> Docusaurus lets you focus on your docs, and we'll do the chores. Go ahead and move your docs into the docs directory. ), }, { title: 'Powered by React', Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, description: ( <> Extend or customize your website layout by reusing React. Docusaurus can be extended while reusing the same header and footer. ), }, ]; function Feature({Svg, title, description}) { return (

{title}

{description}

); } export default function HomepageFeatures() { return (
{FeatureList.map((props, idx) => ( ))}
); } ================================================ FILE: demo-docs-website/src/components/HomepageFeatures/styles.module.css ================================================ .features { display: flex; align-items: center; padding: 2rem 0; width: 100%; } .featureSvg { height: 200px; width: 200px; } ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/demo-images.js ================================================ export const pswpDemoImages = [{"sizes":[{"height":2500,"width":1875,"type":"jpg","src":"1/img-2500.jpg"},{"height":2000,"width":1500,"type":"jpg","src":"1/img-2000.jpg"},{"height":1500,"width":1125,"type":"jpg","src":"1/img-1500.jpg"},{"height":1000,"width":750,"type":"jpg","src":"1/img-1000.jpg"},{"height":700,"width":525,"type":"jpg","src":"1/img-700.jpg"},{"height":400,"width":300,"type":"jpg","src":"1/img-400.jpg"},{"height":200,"width":150,"type":"jpg","src":"1/img-200.jpg"}]},{"sizes":[{"height":2500,"width":1669,"type":"jpg","src":"2/img-2500.jpg"},{"height":2000,"width":1335,"type":"jpg","src":"2/img-2000.jpg"},{"height":1500,"width":1001,"type":"jpg","src":"2/img-1500.jpg"},{"height":1000,"width":668,"type":"jpg","src":"2/img-1000.jpg"},{"height":700,"width":467,"type":"jpg","src":"2/img-700.jpg"},{"height":400,"width":267,"type":"jpg","src":"2/img-400.jpg"},{"height":200,"width":134,"type":"jpg","src":"2/img-200.jpg"}]},{"sizes":[{"height":1666,"width":2500,"type":"jpg","src":"3/img-2500.jpg"},{"height":1333,"width":2000,"type":"jpg","src":"3/img-2000.jpg"},{"height":1000,"width":1500,"type":"jpg","src":"3/img-1500.jpg"},{"height":667,"width":1000,"type":"jpg","src":"3/img-1000.jpg"},{"height":467,"width":700,"type":"jpg","src":"3/img-700.jpg"},{"height":267,"width":400,"type":"jpg","src":"3/img-400.jpg"},{"height":133,"width":200,"type":"jpg","src":"3/img-200.jpg"}]},{"sizes":[{"height":1667,"width":2500,"type":"jpg","src":"4/img-2500.jpg"},{"height":1333,"width":2000,"type":"jpg","src":"4/img-2000.jpg"},{"height":1000,"width":1500,"type":"jpg","src":"4/img-1500.jpg"},{"height":667,"width":1000,"type":"jpg","src":"4/img-1000.jpg"},{"height":467,"width":700,"type":"jpg","src":"4/img-700.jpg"},{"height":267,"width":400,"type":"jpg","src":"4/img-400.jpg"},{"height":133,"width":200,"type":"jpg","src":"4/img-200.jpg"}]},{"sizes":[{"height":1668,"width":2500,"type":"jpg","src":"5/img-2500.jpg"},{"height":1334,"width":2000,"type":"jpg","src":"5/img-2000.jpg"},{"height":1001,"width":1500,"type":"jpg","src":"5/img-1500.jpg"},{"height":667,"width":1000,"type":"jpg","src":"5/img-1000.jpg"},{"height":467,"width":700,"type":"jpg","src":"5/img-700.jpg"},{"height":267,"width":400,"type":"jpg","src":"5/img-400.jpg"},{"height":133,"width":200,"type":"jpg","src":"5/img-200.jpg"}]},{"sizes":[{"height":1667,"width":2500,"type":"jpg","src":"6/img-2500.jpg"},{"height":1333,"width":2000,"type":"jpg","src":"6/img-2000.jpg"},{"height":1000,"width":1500,"type":"jpg","src":"6/img-1500.jpg"},{"height":667,"width":1000,"type":"jpg","src":"6/img-1000.jpg"},{"height":467,"width":700,"type":"jpg","src":"6/img-700.jpg"},{"height":267,"width":400,"type":"jpg","src":"6/img-400.jpg"},{"height":133,"width":200,"type":"jpg","src":"6/img-200.jpg"}]},{"sizes":[{"height":2500,"width":1875,"type":"jpg","src":"7/img-2500.jpg"},{"height":2000,"width":1500,"type":"jpg","src":"7/img-2000.jpg"},{"height":1500,"width":1125,"type":"jpg","src":"7/img-1500.jpg"},{"height":1000,"width":750,"type":"jpg","src":"7/img-1000.jpg"},{"height":700,"width":525,"type":"jpg","src":"7/img-700.jpg"},{"height":400,"width":300,"type":"jpg","src":"7/img-400.jpg"},{"height":200,"width":150,"type":"jpg","src":"7/img-200.jpg"}]},{"sizes":[{"height":1667,"width":2500,"type":"jpg","src":"8/img-2500.jpg"},{"height":1334,"width":2000,"type":"jpg","src":"8/img-2000.jpg"},{"height":1000,"width":1500,"type":"jpg","src":"8/img-1500.jpg"},{"height":667,"width":1000,"type":"jpg","src":"8/img-1000.jpg"},{"height":467,"width":700,"type":"jpg","src":"8/img-700.jpg"},{"height":267,"width":400,"type":"jpg","src":"8/img-400.jpg"},{"height":133,"width":200,"type":"jpg","src":"8/img-200.jpg"}]},{"sizes":[{"height":1667,"width":2500,"type":"jpg","src":"9/img-2500.jpg"},{"height":1333,"width":2000,"type":"jpg","src":"9/img-2000.jpg"},{"height":1000,"width":1500,"type":"jpg","src":"9/img-1500.jpg"},{"height":667,"width":1000,"type":"jpg","src":"9/img-1000.jpg"},{"height":467,"width":700,"type":"jpg","src":"9/img-700.jpg"},{"height":267,"width":400,"type":"jpg","src":"9/img-400.jpg"},{"height":133,"width":200,"type":"jpg","src":"9/img-200.jpg"}]},{"sizes":[{"height":2500,"width":2000,"type":"jpg","src":"10/img-2500.jpg"},{"height":2000,"width":1600,"type":"jpg","src":"10/img-2000.jpg"},{"height":1500,"width":1200,"type":"jpg","src":"10/img-1500.jpg"},{"height":1000,"width":800,"type":"jpg","src":"10/img-1000.jpg"},{"height":700,"width":560,"type":"jpg","src":"10/img-700.jpg"},{"height":400,"width":320,"type":"jpg","src":"10/img-400.jpg"},{"height":200,"width":160,"type":"jpg","src":"10/img-200.jpg"}]},{"sizes":[{"height":2500,"width":2000,"type":"jpg","src":"11/img-2500.jpg"},{"height":2000,"width":1600,"type":"jpg","src":"11/img-2000.jpg"},{"height":1500,"width":1200,"type":"jpg","src":"11/img-1500.jpg"},{"height":1000,"width":800,"type":"jpg","src":"11/img-1000.jpg"},{"height":700,"width":560,"type":"jpg","src":"11/img-700.jpg"},{"height":400,"width":320,"type":"jpg","src":"11/img-400.jpg"},{"height":200,"width":160,"type":"jpg","src":"11/img-200.jpg"}]}]; ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/gallery-templates/basic--badges.js ================================================ export function basicBadgesTemplate(props) { let out = `'; return out; } ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/gallery-templates/basic--cropped.js ================================================ export function basicCroppedTemplate(props) { let out = `'; return out; } ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/gallery-templates/basic.js ================================================ export function basicTemplate(props) { let out = `'; return out; } ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/gallery-templates/caption.js ================================================ export function captionTemplate(props) { return ``; } ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/gallery-templates/content-types.js ================================================ export function contentTypesTemplate(props) { return ``; } ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/gallery-templates/custom-html-markup-data-source.js ================================================ export function customHTMLDataSourceTemplate(props) { let out = `'; return out; } ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/gallery-templates/getting-started.js ================================================ export function gettingStartedTemplate(props) { return ``; } ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/gallery-templates/srcset-test.js ================================================ export function srcsetTemplate(props) { const items = [{ thumbSrc: '1-300x200.png', largeSrc: '1-1500x1000.png', width: 1500, height: 1000, srcset: '%1-600x400.png 600w, %1-1200x800.png 1200w, %1-1500x1000.png 1500w' }, { thumbSrc: '2-300x200.png', largeSrc: '2-1500x1000.png', width: 1500, height: 1000, srcset: '%2-600x400.png 600w, %2-1200x800.png 1200w, %2-1500x1000.png 1500w' }, { thumbSrc: '3-300x300.png', largeSrc: '3-1500x1500.png', width: 1500, height: 1500, srcset: '%3-600x600.png 600w, %3-1200x1200.png 1200w, %3-1500x1500.png 1500w' }, { thumbSrc: '4-200x300.png', largeSrc: '4-1000x1500.png', width: 1000, height: 1500, srcset: '%4-400x600.png 400w, %4-800x1200.png 800w, %4-1000x1500.png 1000w' }]; let out = `'; return out; } ================================================ FILE: demo-docs-website/src/components/PswpCodePreview/index.js ================================================ import React from 'react'; import CodeBlock from '../../theme/CodeBlock'; import { pswpDemoImages } from './demo-images'; import { basicTemplate } from './gallery-templates/basic'; let uidCounter = 1; /** * Get the smallest size (but not smaller than minSize) * * @param {Array} sizes * @param {Integer} minSize */ const getSmallestImageSize = (sizes, minSize) => { sizes = sizes.filter(size => size.width >= minSize); return sizes.reduce((a, b) => (a.width < b.width ? a : b)); }; /** * Generates gallery for demo * * Supported params: * displayHTML: false|true (whether HTML code block should be visible) * numItems: Integer (number of images to display) * galleryID: String (ID attribute) */ function generateGallery(galleryData) { const thumbnailSize = 70; const cdnURL = 'https://cdn.photoswipe.com/photoswipe-demo-images/photos/'; const templateProps = { numItems: Math.min(parseInt(galleryData.numItems, 10) || 3, 11), id: galleryData.galleryID || (uidCounter++), img: [], cdnURL }; const { orientation } = galleryData; let demoImages = [ ...pswpDemoImages ]; if (orientation === 'landscape') { demoImages = demoImages.filter((imageData) => { return imageData.sizes[0].width >= imageData.sizes[0].height; }); } else if (orientation === 'portrait') { demoImages = demoImages.filter((imageData) => { return imageData.sizes[0].width <= imageData.sizes[0].height; }); } demoImages.forEach((imageData, index) => { const largest = imageData.sizes[0]; const thumbnail = getSmallestImageSize(imageData.sizes, thumbnailSize); templateProps.img.push({ index, width: largest.width, height: largest.height, src: cdnURL + largest.src, thumbSrc: cdnURL + thumbnail.src }); }); if (galleryData.templateFn) { return galleryData.templateFn(templateProps); } return basicTemplate(templateProps); } export default function PswpCodePreview(props) { return (
{ props.children } { props.galleryID && {generateGallery(props)} }
); } ================================================ FILE: demo-docs-website/src/css/custom.css ================================================ /** * Any CSS included here will be global. The classic template * bundles Infima by default. Infima is a CSS framework designed to * work well for content-centric websites. */ /* You can override the default Infima variables here. */ :root { --ifm-color-primary: #2e8555; --ifm-color-primary-dark: #29784c; --ifm-color-primary-darker: #277148; --ifm-color-primary-darkest: #205d3b; --ifm-color-primary-light: #33925d; --ifm-color-primary-lighter: #359962; --ifm-color-primary-lightest: #3cad6e; --ifm-code-font-size: 95%; --ifm-toc-border-color: rgba(0, 0, 0, 0.065); --ifm-code-background: rgb(250, 250, 250); --ifm-link-color: #3169B3; --ifm-link-hover-color: #C00; --ifm-link-decoration: underline; --ifm-link-hover-decoration: underline; --ifm-navbar-link-hover-color: var(--ifm-link-hover-color); --ifm-footer-background-color: none; --ifm-footer-color: auto; --ifm-footer-padding-horizontal: calc(var(--ifm-spacing-horizontal) * 2); --ifm-footer-padding-vertical: calc(var(--ifm-spacing-vertical) * 2); --pswp-docs-main-content-width: 1100px; --ifm-heading-font-weight: var(--ifm-font-weight-semibold); } a { transition: none; } a:hover { color: var(--ifm-link-hover-color); /* autoprefixer: ignore next */ text-decoration: var(--ifm-link-hover-decoration); } pre code, .pswp-example__preview { background: var(--ifm-code-background); } code { border: 0; } .docusaurus-highlight-code-line { background-color: rgba(0, 0, 0, 0.1); display: block; margin: 0 calc(-1 * var(--ifm-pre-padding)); padding: 0 var(--ifm-pre-padding); } .ukraine-flag { width: 21px; height: 14px; position: relative; background: #ffcc00; top: 2px; display: inline-block; margin-left: 3px; margin-right: 2px; } .ukraine-flag:before { content:''; position: absolute; width: 21px; height: 7px; left:0; top:0; background: #0066cc; } a.hash-link { text-decoration: none; transition: none; padding: 0.5rem 0.7rem; } .theme-code-block--hidden { display: none; } .navbar, .footer, .main-wrapper { width: 100%; max-width: var(--pswp-docs-main-content-width); margin: 0 auto; } .navbar { z-index: 20; box-shadow: none; border-bottom: 1px solid var(--ifm-toc-border-color); } .footer { margin-top: 60px; border-top: 1px solid var(--ifm-toc-border-color); } .docs-wrapper { display: flex; flex-direction: row; align-items: flex-start; justify-content: center; } .pswp-docs__main-column > article { max-width: 700px; } .pswp-docs__sidebar-menu { width: 30%; width: 250px; } /*.pswp-docs__main-column { width: 70%; } */ .theme-doc-markdown { /* max-width: 670px; */ } @import './sidebar-menu.css'; @import './docs-page.css'; @import './example-code-block.css'; @import './scrollbar.css'; @import './header.css'; @import './home.css'; ================================================ FILE: demo-docs-website/src/css/docs-page.css ================================================ /* .theme-doc-footer, .pagination-nav, .theme-doc-markdown > * { max-width: 650px; } */ .theme-doc-markdown iframe { width: 100%; height: 450px; } .theme-doc-footer { border-top: 1px solid var(--ifm-toc-border-color); padding: var(--ifm-global-spacing) 0; } nav.pagination-nav { border-top: 1px solid var(--ifm-toc-border-color); margin-top: 0; } a.pagination-nav__link { border: 0; text-decoration: none; padding: var(--ifm-global-spacing) 0; } a.pagination-nav__link .pagination-nav__sublabel { text-decoration: none; } .pagination-nav__label { font-size: var(--ifm-h3-font-size); } .pagination-nav__label::after, .pagination-nav__label::before { content: none !important; } ================================================ FILE: demo-docs-website/src/css/example-code-block.css ================================================ .pswp-example { width: 100%; position: relative; margin-bottom: 1rem; } span.docusaurus-highlight-code-line { background: rgba(255, 217, 109, .3); } .pswp-example .theme-code-block { width: calc(100% - 204px); margin-bottom: 4px; } .pswp-example__preview { width: 200px; position: absolute; right: 0; top: 0; height: 100%; overflow-y: auto; margin-left: 4px; } .pswp-example__preview { padding: var(--ifm-pre-padding); } .pswp-example .pswp-gallery { display: flex; flex-direction: row; align-items: flex-start; flex-wrap: wrap; position: relative; width: 155px; } .pswp-example .pswp-gallery img { display: block; } .pswp-gallery { display: flex; } .pswp-gallery > * { display: block; position: relative; margin-bottom: 4px; margin-right: 4px; width: 70px; } .pswp-example .pswp-gallery > *:nth-child(2n) { margin-right: 0; } .pswp-example .pswp-gallery--single-column > * { width: 120px; margin-bottom: 18px; font-size: 14px; } button.pswp-example__hide-html-btn { position: absolute; cursor: pointer; z-index: 10; font-size: 12px; right: 0; bottom: 0; color: var(--ifm-link-color); background: none; border: 0; padding: 2px 5px; background: var(--ifm-pre-background); } button.pswp-example__hide-html-btn:hover { color: var(--ifm-link-hover-color); } [data-cropped] img { width: 100%; height: 70px; object-fit: cover; } @media only screen and (max-width: 600px) { .pswp-example .theme-code-block { width: 100%; } .pswp-example__preview { width: 100%; height: auto; position: relative; } .pswp-example__preview .pswp-gallery { max-width: 150px; } } .pswp-example__code--hidden { display: none; } input[type="checkbox"].hidden-cb { width: 1px; height: 1px; opacity: 0.01; overflow: hidden; position: absolute; right: 0; bottom: 0; } label.pswp-example__toggle { position: absolute; right: 0; bottom: -25px; padding: 0 0; border-radius: 0; font-size: 14px; color: #1B57A5; cursor: pointer; z-index: 20; } label.pswp-example__toggle:hover { color: #c00; } input[type="checkbox"]:focus + label { outline: 1px dotted #212121; outline: 5px auto -webkit-focus-ring-color; } input[type="checkbox"]:checked { display: none; } input[type="checkbox"]:checked + label { display: none; } input[type="checkbox"]:checked + label + .pswp-example__code--hidden { display: block !important; } ================================================ FILE: demo-docs-website/src/css/header.css ================================================ a.navbar__brand { text-decoration: none; font-size: 20px; line-height: 1; white-space: nowrap; transform: translate(0, -2px); } a.navbar__link { color: var(--ifm-link-color); text-decoration: none; } a.navbar__link--active { color: var(--ifm-font-color-base); } .navbar__link svg { display: none; } a.pswp-docs__github-link { display: flex; flex-direction: row; align-items: flex-start; text-decoration: none; font-weight: var(--ifm-font-weight-semibold); } a.pswp-docs__github-link:hover { text-decoration: none; } .pswp-docs__github-link svg { transform: translate(0, 2px); margin-right: 3px; } .pswp-docs__github-link-left { border-top-left-radius: 4px; border-bottom-left-radius: 4px; padding: 2px 8px; border: 1px solid #D5D5D5; } .pswp-docs__github-link-right { background: #fff; border-top-right-radius: 4px; border-bottom-right-radius: 4px; padding: 2px 8px; border: 1px solid #D5D5D5; border-left: 0; color: #222; } .navbar__brand span { font-size: 12px; margin-left: 4px; margin-top: -12px; line-height: 1; } button.DocSearch { --docsearch-searchbox-background: #e9e9e9; --docsearch-primary-color: var(--ifm-link-color); --docsearch-text-color: #222; --docsearch-muted-color: #222; --docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color); --docsearch-highlight-color: var(--ifm-link-color); height: 35px; } button .DocSearch-Button-Placeholder { font-size: 16px; font-weight: 400; } button .DocSearch-Button-Keys { display: none !important; } ================================================ FILE: demo-docs-website/src/css/home.css ================================================ .pswp-docs__home .navbar__brand { display: none; } .pswp-docs__header-title-text { margin: 60px 0px 50px; font-size: 22px; text-align: center; } .pswp-docs__whats-new { margin-top: 50px; } .pswp-docs__whats-new h4 { margin: 50px auto 12px; font-size: 24px; } .pswp-docs__home-block-main-col > * { max-width: 600px; margin-left: auto; margin-right: auto; } .pswp-docs__home-block-full-width-col { max-width: 1068px; } .pswp-docs__header-title-text a svg { display: inline-block; width: 16px; fill: var(--ifm-link-color); transform: translate(0px, 3px); margin-left: 0.2em; } .pswp-docs__header-title-text a:hover svg { fill: var(--ifm-link-hover-color); } .pswp-docs__header-title-text a { font-weight: bold; text-decoration: none; } .pswp-docs__header-title-text h1 { font-weight: bold; font-size: 64px; line-height: 1; margin-bottom: 14px; } .pswp-docs__header-title-text h1 span { position: absolute; vertical-align: super; font-size: 16px; text-decoration: none; } .pswp-docs__header-title-text p { margin-bottom: 0; } .pswp-docs__home-gallery { position: relative; display: grid; width: 100%; grid-template-columns: 1fr 0.5fr 0.5fr; grid-gap: 10px; } .pswp-docs__home-gallery-credit { position: absolute; right: 0; bottom: -21px; font-size: 12px; } .pswp-docs__home-gallery .pswp-docs__home-gallery-item { position: relative; } figure.pswp-docs__home-gallery-item { display: block; margin: 0; padding: 0; } .pswp-docs__home-gallery-item figcaption { display: none; } .pswp-docs__home-gallery .pswp-docs__home-gallery-item img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; } .pswp-docs__home-gallery .pswp-docs__home-gallery-item:first-child { grid-row: span 2; } .pswp-docs__home-gallery .pswp-docs__home-gallery-item a { display: block; position: relative; overflow: hidden; width: 100%; height: 100%; padding-bottom: 100%; } .pswp-docs__home-gallery-example { display: flex; flex-direction: row; align-items: flex-start; flex-wrap: wrap; width: 100%; } .pswp-docs__home-gallery-example a { position: relative; margin: 0 4px 4px 0; line-height: 0; display: block; } .pswp-docs__home-gallery-example img { position: absolute; left: 0; top: 0; width: 100%; max-width: none; } .pswp-docs__home-block h2 { font-weight: bold; font-size: 40px; line-height: 1.1; margin: 70px auto 36px; } .pswp__dynamic-caption { font-size: 14px; line-height: 1.5; } #gallery--deep-zoom { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; } #gallery--deep-zoom figure { display: block; margin: 0; padding: 0; margin-right: 4px; min-width: 100px; max-width: 180px; } @media (max-width: 900px) { .pswp__dynamic-caption.pswp__dynamic-caption--aside { margin-top: 0; } } @media (max-width: 700px) { #gallery--deep-zoom { max-width: 296px; } } #gallery--deep-zoom figure:last-child { margin-right: 0; } #gallery--deep-zoom figure > a { display: block; position: relative; } #gallery--deep-zoom img { position: absolute; left: 0; top: 0; width: 100%; } figcaption.caption { font-size: 12px; margin-top: 6px; } @media (max-width: 650px) { .pswp-docs__home-gallery { grid-gap: 5px; } .pswp-docs__header-title-text h1 { font-size: 36px; } .pswp-docs__header-title-text { margin: 40px 0px 30px; font-size: 18px; text-align: center; } .pswp-docs__home-block h2 { font-size: 26px; margin: 40px auto 12px; } .pswp-docs__whats-new h4 { margin: 24px auto 12px; font-size: var(--ifm-font-size-base); } #gallery--deep-zoom { max-width: 296px; } } ================================================ FILE: demo-docs-website/src/css/scrollbar.css ================================================ /* style scrollbar */ .docs-styled-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; } .docs-styled-scrollbar::-webkit-scrollbar-button { width: 0px; height: 0px; } .docs-styled-scrollbar::-webkit-scrollbar-thumb { background: #C2C2C2; border: 0; border-radius: 0; } .docs-styled-scrollbar::-webkit-scrollbar-thumb:hover { background: #aaa; } .docs-styled-scrollbar::-webkit-scrollbar-thumb:active { background: #999; } .docs-styled-scrollbar::-webkit-scrollbar-track { background: none; border: 0; border-radius: 0; background: #eee; } .docs-styled-scrollbar::-webkit-scrollbar-track:hover { background: #ddd; } .docs-styled-scrollbar::-webkit-scrollbar-corner { background: none; } ================================================ FILE: demo-docs-website/src/css/sidebar-menu.css ================================================ aside.theme-doc-sidebar-container { border: 0; margin-top: 0; } aside.theme-doc-sidebar-container { position: sticky; margin-top: 30px; top: 30px; } .pswp-docs__sidebar-menu { position: relative; border-right: 1px solid var(--ifm-toc-border-color); display: flex; flex-direction: column; align-items: flex-start; padding: 0 var(--ifm-navbar-padding-horizontal) } .pswp-docs__sidebar-menu--mobile { position: relative; margin-top: 0; top: auto; } .pswp-docs__sidebar-menu-item { text-decoration: none; font-size: 16px; line-height: 22px; padding: 4px 0; } .pswp-docs__sidebar-menu-item--category { color: #393939; opacity: 0.5; margin-top: 16px; } .pswp-docs__sidebar-menu-item--category:first-child { margin-top: 0;; } a.pswp-docs__sidebar-menu-item--active { color: var(--ifm-font-color-base); } .docSidebarContainer { display: none; } @media (max-width: 996px) { .pswp-docs__sidebar-menu { border-right: 0; } .theme-doc-sidebar-container > .pswp-docs__sidebar-menu { display: none; } } @media (min-width: 997px) { } ================================================ FILE: demo-docs-website/src/pages/_index-deep-zoom-demo.js ================================================ import React, { useEffect } from 'react'; import Lightbox from '../../static/photoswipe/photoswipe-lightbox.esm.js'; //import PhotoSwipeDeepZoom from 'photoswipe-deep-zoom-plugin'; const galleryHTML = `
Cambriae Typus
Humphrey Llwyd
5,832px x 4,409px
A sergeant of the Light Horse
A sergeant of the Light Horse
George Lambert
4,578px x 5,736px
The Starry Night
Vincent van Gogh
30,000px x 23,756px
Magnolia and Erect Rock
Chen Hongshou
1,820px x 1,948px (not tiled)
`; export default function DeepZoomGalleryDemo() { useEffect(() => { let deepZoomPlugin; let lightbox = new Lightbox({ gallery: '#gallery--deep-zoom', children: 'figure > a', pswpModule: () => import('../../static/photoswipe/photoswipe.esm.js'), // dynamically load deep zoom plugin openPromise: () => { // make sure it's initialized only once per lightbox if (!deepZoomPlugin) { return import('photoswipe-deep-zoom-plugin').then((deepZoomPluginModule) => { deepZoomPlugin = new deepZoomPluginModule.default(lightbox, { // deep zoom plugin options }); }) } }, // Recommended PhotoSwipe options for this plugin allowPanToNext: false, // prevent swiping to the next slide when image is zoomed allowMouseDrag: true, // display dragging cursor at max zoom level wheelToZoom: true, // enable wheel-based zoom zoom: false // disable default zoom button }); lightbox.init(); return function cleanup() { if (lightbox) { lightbox.destroy(); lightbox = null; } if (deepZoomPlugin) { deepZoomPlugin.destroy(); deepZoomPlugin = null; } }; }, []); return (