{"id":26781676,"url":"https://github.com/pixelunion/bc-swipe-fade","last_synced_at":"2025-03-29T08:17:30.218Z","repository":{"id":44075317,"uuid":"132650372","full_name":"pixelunion/bc-swipe-fade","owner":"pixelunion","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-10T01:16:34.000Z","size":573,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-03-26T12:58:30.021Z","etag":null,"topics":["library"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixelunion.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":"2018-05-08T18:42:11.000Z","updated_at":"2021-05-21T15:36:02.000Z","dependencies_parsed_at":"2023-01-26T01:30:46.769Z","dependency_job_id":null,"html_url":"https://github.com/pixelunion/bc-swipe-fade","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-swipe-fade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-swipe-fade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-swipe-fade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelunion%2Fbc-swipe-fade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelunion","download_url":"https://codeload.github.com/pixelunion/bc-swipe-fade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246156411,"owners_count":20732397,"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":["library"],"created_at":"2025-03-29T08:17:29.586Z","updated_at":"2025-03-29T08:17:30.211Z","avatar_url":"https://github.com/pixelunion.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bigcommerce Product Image Galleries\n\nMake the product images change. Make them change differently based on screen size.\n\n### Installation\n\n```\nnpm i --save github:pixelunion/bc-swipe-fade\n```\n\n### Usage\n\n```\nimport $ from 'jquery';\nimport SwipeFade from 'bc-swipe-fade';\n\nlet gallery = new SwipeFade({\n  el: $('.product-slides-container'),\n  callback: (index, el) {\n    console.log(`welcome to slide number ${index}`);\n  }\n});\n```\n\n\n### Options\n\n`el`: A jQuery object of our gallery container.\n`callback`: a function to run after each slide change.\n\n### Some sample markup\n\n```\n\u003cdiv class=\"product-slides-container\"\u003e\n  \u003cdiv class=\"product-slides-wrap\"\u003e\n    \u003cdiv class=\"product-slide\"\u003e\n      \u003cimg src=\"demo/images/photo-1.jpg\"\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"product-slide\"\u003e\n      \u003cimg src=\"demo/images/photo-2.jpg\"\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"product-slide\"\u003e\n      \u003cimg src=\"demo/images/photo-3.jpg\"\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"product-slide\"\u003e\n      \u003cimg src=\"demo/images/photo-4.jpg\"\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\nThe module is classname agnositc but remember to wrap your slides in TWO elements.\n\n### Methods\n\n`.change(index)`: Switch to a slide\n\n`.next()` and `prev()` are available as well.\n\n### Responsiveness\n\nThe module will watch for an `:after` pseudoelement on the same element with which the module is initialized. If the `:after` element has a `content: 'swipe';` property, the module will arrange itself as a touch-driven swipe gallery. If not, it will fade. CSS is therefore a little specific:\n\n### Important CSS\n\n```\n.product-slides-container {\n  position: relative;\n  overflow: hidden;\n}\n\n.product-slides-wrap {\n  position: relative;\n  overflow: hidden;\n}\n\n@media(swiping-breakpoint) {\n  .product-slides-container {\n    \u0026:after {\n      display: none;\n      content: \"swipe\";\n    }\n  }\n\n  .product-slide {\n    position: relative;\n    float: left;\n    width: 100%;\n    transition: all 0.2s ease;\n  }\n}\n\n@media(fading-breakpoint) {\n  .product-slide {\n    position: absolute;\n    top: 0;\n    left: 0;\n    z-index: -1;\n    opacity: 0;\n\n    \u0026.current {\n      z-index: auto;\n      opacity: 1;\n    }\n  }\n}\n\n```\n\n\n### Navigation\n\nThe module currently does not include any navigation by default. Make use of the callback and public methods to bake your own. Have a look at the demo.\n\n### Todo\n- Make use of jquery.trend for handling transition events\n- Make fading work for IE8 (opacity)\n- Further es6ification\n\n### Further Development\n\nFor debugging or improvements you can run a standalone test version of the module using a very basic node server:\n\n```\n$ npm install\n$ npm run serve\n```\nThis will allow you to make changes to the JS and HTML. To re-compile the scss you'll need to run `npm run build` from a separate terminal window after each change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelunion%2Fbc-swipe-fade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelunion%2Fbc-swipe-fade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelunion%2Fbc-swipe-fade/lists"}