{"id":18632276,"url":"https://github.com/zurb/twentytwenty","last_synced_at":"2025-05-15T08:10:43.368Z","repository":{"id":8891012,"uuid":"10610712","full_name":"zurb/twentytwenty","owner":"zurb","description":"jQuery Plugin to Compare Images","archived":false,"fork":false,"pushed_at":"2020-12-03T19:28:24.000Z","size":821,"stargazers_count":1274,"open_issues_count":64,"forks_count":296,"subscribers_count":105,"default_branch":"master","last_synced_at":"2025-05-06T02:39:05.226Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zurb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-10T22:20:22.000Z","updated_at":"2025-04-25T02:06:52.000Z","dependencies_parsed_at":"2022-07-19T22:02:11.392Z","dependency_job_id":null,"html_url":"https://github.com/zurb/twentytwenty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zurb%2Ftwentytwenty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zurb%2Ftwentytwenty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zurb%2Ftwentytwenty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zurb%2Ftwentytwenty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zurb","download_url":"https://codeload.github.com/zurb/twentytwenty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254301432,"owners_count":22047904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T05:11:03.426Z","updated_at":"2025-05-15T08:10:43.326Z","avatar_url":"https://github.com/zurb.png","language":"CSS","funding_links":[],"categories":["CSS"],"sub_categories":[],"readme":"## Basic usage\n\nInclude the javascript and css files.\n\n```html\n\u003cscript src=\"js/jquery-3.2.1.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript src=\"js/jquery.event.move.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript src=\"js/jquery.twentytwenty.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"css/twentytwenty.css\" type=\"text/css\" media=\"screen\" /\u003e\n``` \nYou might need to change the paths to match your setup.\n\n\nAfter including the files you are ready to create a container that holds two images:\n\n```html\n\u003cdiv id=\"container1\"\u003e\n \u003c!-- The before image is first --\u003e\n \u003cimg src=\"http://placehold.it/400x200\u0026amp;text=1\" /\u003e\n \u003c!-- The after image is last --\u003e\n \u003cimg src=\"http://placehold.it/400x200\u0026amp;text=2\" /\u003e\n\u003c/div\u003e\n```\n\nNow initialize the plugin on the window load:\n\n```\n$(function(){\n  $(\"#container1\").twentytwenty();\n});\n```\n\n### Options\n\n\n```js\n$(function(){\n  $(\".twentytwenty-container\").twentytwenty({\n    default_offset_pct: 0.7, // How much of the before image is visible when the page loads\n    orientation: 'vertical', // Orientation of the before and after images ('horizontal' or 'vertical')\n    before_label: 'January 2017', // Set a custom before label\n    after_label: 'March 2017', // Set a custom after label\n    no_overlay: true, //Do not show the overlay with before and after\n    move_slider_on_hover: true, // Move slider on mouse hover?\n    move_with_handle_only: true, // Allow a user to swipe anywhere on the image to control slider movement. \n    click_to_move: false // Allow a user to click (or tap) anywhere on the image to move the slider to that location.\n  });\n});\n```\n\n### Prevent FOUC\n\nIf you want to avoid a [FOUC](http://en.wikipedia.org/wiki/Flash_of_unstyled_content) you can append the `twentytwenty-container` class to your container like so:\n\n```html\n\u003cdiv id=\"container1\" class=\"twentytwenty-container\"\u003e\n \u003c!-- The before image is first --\u003e\n \u003cimg src=\"http://placehold.it/400x200\u0026amp;text=1\" /\u003e\n \u003c!-- The after image is last --\u003e\n \u003cimg src=\"http://placehold.it/400x200\u0026amp;text=2\" /\u003e\n\u003c/div\u003e\n```\n\n### Multiple instances\n\nIf you want to use multiple instances of this plugin on a single page you can target the container class:\n\n```js\n$(function(){\n  $(\".twentytwenty-container\").twentytwenty();\n});\n```\n\n# Build with SCSS\n\nYou can use SCSS to customise the TwentyTwenty styles. All you need to do is make sure you have NPM and Grunt installed. Then, clone the repository and run \"npm install\" to install all the required Grunt modules. Run \"grunt develop\" to compile your CSS file (the Gruntfile is also configured to watch for changes):\n\n```bash\ngit clone git@github.com:zurb/twentytwenty.git\nnpm install\ngrunt develop\n```\n\nAll default [Sass](http://sass-lang.com/) variables can be found in `scss/twentytwenty.scss`.\n\n## Support\n\n- IE8+\n- Firefox (latest)\n- Chrome\n- Safari\n- Android \n- iOS (iPhone, iPad)\n\n## Dependencies\n\n  * [jquery](http://jquery.com/)\n  * [jquery.event.move](https://github.com/stephband/jquery.event.move)\n\n## MIT Open Source License\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzurb%2Ftwentytwenty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzurb%2Ftwentytwenty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzurb%2Ftwentytwenty/lists"}