{"id":20822284,"url":"https://github.com/radekvym/draggable-grid-js","last_synced_at":"2025-05-07T16:42:43.630Z","repository":{"id":87332957,"uuid":"514376917","full_name":"RadekVyM/Draggable-Grid-JS","owner":"RadekVyM","description":"JavaScript control that allows you to arrange items into a grid and to move between them by dragging.","archived":false,"fork":false,"pushed_at":"2025-01-24T11:23:10.000Z","size":48406,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T12:01:35.650Z","etag":null,"topics":["animations","component","control","drag","draggable","draggable-elements","grid-layout","javascript","javascript-library","web"],"latest_commit_sha":null,"homepage":"https://radekvym.github.io/Draggable-Grid-JS","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/RadekVyM.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-15T19:03:15.000Z","updated_at":"2025-03-03T10:02:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"c30f1420-2c97-4424-9ea7-3a9c00b14dcd","html_url":"https://github.com/RadekVyM/Draggable-Grid-JS","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/RadekVyM%2FDraggable-Grid-JS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RadekVyM%2FDraggable-Grid-JS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RadekVyM%2FDraggable-Grid-JS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RadekVyM%2FDraggable-Grid-JS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RadekVyM","download_url":"https://codeload.github.com/RadekVyM/Draggable-Grid-JS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252916426,"owners_count":21824762,"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":["animations","component","control","drag","draggable","draggable-elements","grid-layout","javascript","javascript-library","web"],"created_at":"2024-11-17T22:14:31.483Z","updated_at":"2025-05-07T16:42:43.624Z","avatar_url":"https://github.com/RadekVyM.png","language":"JavaScript","readme":"# Draggable Grid\n\nJavaScript control that allows you to arrange items of an unordered list into a grid and to move between them by dragging.\n\n[![Sample GIF](./images/sample.gif)](https://radekvym.github.io/Draggable-Grid-JS/index.html)\n\nSee [live demo](https://radekvym.github.io/Draggable-Grid-JS/index.html).\n\n## Usage\n\nImport styles needed for the control to function properly:\n\n``` html\n\u003clink rel=\"stylesheet\" href=\"./draggableGrid.css\"\u003e\n```\n\nWrap an unordered list in a `div` with `draggable-grid` class:\n\n``` html\n\u003cdiv\n    class=\"draggable-grid\"\n    data-orientation=\"horizontal\"\n    data-span=\"4\"\n    data-cell-size-ratio=\"3/4\"\n    data-max-cell-size=\"0.65 0.7\"\u003e\n    \u003cul\u003e\n        ...\n    \u003c/ul\u003e\n\u003c/div\u003e\n```\n\nParameters of the control can be set via data attributes:\n\n- `data-orientation` - `horizontal` or `vertical` orientation\n- `data-span` - number of rows or columns (depends on orientation)\n- `data-cell-size-ratio` - width to height ratio of the cell size\n- `data-max-cell-size` - how much screen space a cell can occupy (`width height`, 0-1 values)\n\nImport a JavaScript script:\n\n``` html\n\u003cscript src=\"./DraggableGrid.js\"\u003e\u003c/script\u003e\n```\n\nInitialize the control when the page is loaded:\n\n``` html\n\u003cscript\u003e\n    window.addEventListener(\"load\", () =\u003e {\n        const draggableGridDivs = document.body.querySelectorAll(\"div.draggable-grid\");\n\n        // Initialization of the control\n        for (const div of draggableGridDivs) {\n            DraggableGrid.initDraggableGridFor(div);\n        }\n    });\n\u003c/script\u003e\n```\n\n\u003e For more advanced usage, see the [sample source code](index.html) or the [library source code](./src/DraggableGrid.js). The control's public API is accessible via methods without an underscore.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradekvym%2Fdraggable-grid-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradekvym%2Fdraggable-grid-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradekvym%2Fdraggable-grid-js/lists"}