{"id":14385078,"url":"https://github.com/metafizzy/unidragger","last_synced_at":"2025-08-23T23:10:22.926Z","repository":{"id":26245904,"uuid":"29692927","full_name":"metafizzy/unidragger","owner":"metafizzy","description":":point_down: Draggable base class","archived":false,"fork":false,"pushed_at":"2023-07-19T07:14:29.000Z","size":133,"stargazers_count":86,"open_issues_count":4,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-31T10:04:27.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/metafizzy.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-01-22T18:19:12.000Z","updated_at":"2025-03-28T19:11:48.000Z","dependencies_parsed_at":"2024-03-04T00:34:32.820Z","dependency_job_id":null,"html_url":"https://github.com/metafizzy/unidragger","commit_stats":{"total_commits":51,"total_committers":1,"mean_commits":51.0,"dds":0.0,"last_synced_commit":"47a3fad361b224419881c45fc61bf8ab4661f380"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Funidragger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Funidragger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Funidragger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metafizzy%2Funidragger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metafizzy","download_url":"https://codeload.github.com/metafizzy/unidragger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640465,"owners_count":20971557,"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-08-28T18:01:55.925Z","updated_at":"2025-04-07T11:10:19.368Z","avatar_url":"https://github.com/metafizzy.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Unidragger\n\n_Base draggable class_\n\nUsed in [Flickity](https://flickity.metafizzy.co) and [Draggabilly](https://draggabilly.desandro.com).\n\nUnidragger handles all the event binding and handling to support a draggable library.\n\n## Features\n\n+ Touch device support: iOS, Android, Microsoft Surface\n+ Handles click events in `input` elements \n\n## Install\n\nnpm: `npm install unidragger`\n\nYarn: `yarn add unidragger`\n\n## Demo code\n\n``` js\n// your draggable class\nfunction Dragger( elem ) {\n  this.element = elem;\n}\n\n// use Unidragger as a mixin\nextend( Dragger.prototype, Unidragger.prototype );\n\nDragger.prototype.create = function() {\n  // set drag handles\n  this.handles = [ this.element ];\n  this.bindHandles();\n};\n\nDragger.prototype.dragStart = function( event, pointer ) {\n  console.log('drag start');\n};\n\nDragger.prototype.dragMove = function( event, pointer, moveVector ) {\n  var dragX = this.dragStartPoint.x + moveVector.x;\n  var dragY = this.dragStartPoint.y + moveVector.y;\n  this.element.style.left = dragX + 'px';\n  this.element.style.top = dragY + 'px';\n};\n\nDragger.prototype.dragEnd = function( event, pointer ) {\n  console.log('drag end');\n};\n```\n\n---\n\nMIT license\n\nBy [Metafizzy 🌈🐻](https://metafizzy.co)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetafizzy%2Funidragger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetafizzy%2Funidragger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetafizzy%2Funidragger/lists"}