{"id":27637857,"url":"https://github.com/qkorbit/fastdrag","last_synced_at":"2026-04-27T11:31:51.246Z","repository":{"id":57233193,"uuid":"194861863","full_name":"qkorbit/Fastdrag","owner":"qkorbit","description":"A fast and lovely drag \u0026 drop library.","archived":false,"fork":false,"pushed_at":"2019-07-03T09:56:09.000Z","size":287,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-18T16:50:01.681Z","etag":null,"topics":["drag","drag-drop","dragging","drop","fastdrag","front-end","javascript","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/qkorbit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-02T12:48:06.000Z","updated_at":"2021-09-04T10:48:27.000Z","dependencies_parsed_at":"2022-08-31T20:51:10.282Z","dependency_job_id":null,"html_url":"https://github.com/qkorbit/Fastdrag","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/qkorbit%2FFastdrag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qkorbit%2FFastdrag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qkorbit%2FFastdrag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qkorbit%2FFastdrag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qkorbit","download_url":"https://codeload.github.com/qkorbit/Fastdrag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250518729,"owners_count":21444016,"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":["drag","drag-drop","dragging","drop","fastdrag","front-end","javascript","typescript"],"created_at":"2025-04-23T21:33:01.333Z","updated_at":"2026-04-27T11:31:51.201Z","avatar_url":"https://github.com/qkorbit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastdrag\n\n[![Build Status](https://www.travis-ci.org/qkorbit/fastdrag.svg?branch=master)](https://www.travis-ci.org/qkorbit/fastdrag)\n\nA fast and lovely drag \u0026 drop library.\n\n![demo](https://raw.githubusercontent.com/qkorbit/Fastdrag/master/example/show.gif)\n\n## Features\n\n* 👌 Easy to use\n* 🚀 Tiny size, \u003c2Kb gziped\n* 🤣 Modular, easy to extend\n* ⚡️ Only pure JavaScript\n\n## Getting Started\n\n### Installation\n\nYou can get it on npm:\n\n```bash\nnpm install fastdrag --save\n```\n\nAs a dependency:\n\n```javascript\nimport Fastdrag from 'Fastdrag'\n```\n\nOr via CDN:\n\n```html\n\u003cscript src=\"https://unpkg.com/fastdrag@latest/dist/fastdrag.min.js\"\u003e\u003c/script\u003e\n```\n\n### Examples\n\n```javascript\nlet instance = new Fastdrag({\n  el: document.getElementById('demo'),\n  friction: 2\n})\n```\n\nOr in a more simple way:\n\n```javascript\nlet instanceList = Fastdrag.to(document.getElementsByClassName('dragdrag'))\n```\n\n## API\n\n|   Methods   |   Description   |\n|:--------:|:--------:|\n|Fastdrag  | Create the instance  |\n|config | Modify the setting |\n|destroy | Destroy the instance |\n|on | Add eventListener to instance |\n|to | Generate instances quickly |\n\n### class Fastdrag\n\n\u003e new Fastdrag(options): Fastdrag Instance\n\nCreate the instance.\n\n* options:\n\n|   Parameter   |  Default Value  |   Description   | Type    |\n|:--------:|:--------:|:--------:|:--------:|\n|el| document.body |The container|HTMLElement|\n|friction| 3 |The friction of target|number|\n|rotateRange| 60 |The rotate range limit|number|\n|scale|1|The scale factor of Container|number|\n\n### config\n\n\u003e config(options): void\n\nEverything can be changed except 'el'.\n\nexamples:\n\n```javascript\nlet instance = new Fastdrag({\n  el: document.getElementById('demo'),\n  friction: 2\n})\n\ninstance.config({\n  friction: 5\n})\n```\n### destroy\n\n\u003e destroy(): void\n\nDestroy the instance.\n\nexamples:\n\n```javascript\nlet instance = new Fastdrag({\n  el: document.getElementById('demo'),\n  friction: 2\n})\n\ninstance.destroy()\n```\n\n### to\n\n\u003e to(target, options): Fastdrag Instances\n\n|   Parameter   |  Default Value  |   Description   | Type    |\n|:--------:|:--------:|:--------:|:--------:|\n|target| document.body |The container|HTMLElement \\| HTMLElement[]|\n|options| {} |As same as Fastdrag options|object|\n\n\n### on\n\n\u003e on(event, callback): void\n\nNormally, you can listen the browser's native event on the instance of Fastdrag:\n\n```javascript\nlet demo = document.getElementById('demo')\nlet instance = new Fastdrag({\n  el: demo,\n  friction: 4\n})\n\n// Actually, animation is still moving.\ndemo.addEventListener('dragend', e =\u003e {\n\tconsole.log('done!')\n})\n\n```\n\nBut sometimes you need to get more exactly what happened:\n\n```javascript\nlet demo = document.getElementById('demo')\nlet instance = new Fastdrag({\n  el: demo,\n  friction: 4\n})\n\ninstance.on('end', e =\u003e {\n  console.log('done!')\n})\n\n```\n\n* params:\n\n|   Parameter   |  Default Value  |   Description   | Type    |\n|:--------:|:--------:|:--------:|:--------:|\n|event| document.body |The event name|string|\n|callback| n =\u003e n |The callback function|function|\n\n* event list:\n\n|   Event   |   Description   |\n|:--------:|:--------:|\n|start  | As same as dragstart  |\n|move | Every AnimationFrame of motion would trigger it |\n|end | Trigger if Animation is stopped |\n\n\n## Inspiration\n\nInspired by: https://github.com/ClassicOldSong/Drag.js\n\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqkorbit%2Ffastdrag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqkorbit%2Ffastdrag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqkorbit%2Ffastdrag/lists"}