{"id":16070657,"url":"https://github.com/damonoehlman/ratchet","last_synced_at":"2025-06-18T23:33:34.109Z","repository":{"id":2397948,"uuid":"3364657","full_name":"DamonOehlman/ratchet","owner":"DamonOehlman","description":"CSS3 Transforms Parser and Manipulator","archived":false,"fork":false,"pushed_at":"2023-01-07T19:23:28.000Z","size":536,"stargazers_count":9,"open_issues_count":12,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-03T11:08:45.977Z","etag":null,"topics":["css","css3-transforms-parser"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"MansurAshraf/gradle-scalastyle-plugin","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DamonOehlman.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":"2012-02-06T06:01:15.000Z","updated_at":"2025-04-28T12:14:01.000Z","dependencies_parsed_at":"2023-01-11T16:09:58.857Z","dependency_job_id":null,"html_url":"https://github.com/DamonOehlman/ratchet","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/DamonOehlman/ratchet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fratchet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fratchet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fratchet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fratchet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DamonOehlman","download_url":"https://codeload.github.com/DamonOehlman/ratchet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamonOehlman%2Fratchet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260653476,"owners_count":23042641,"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":["css","css3-transforms-parser"],"created_at":"2024-10-09T07:06:12.954Z","updated_at":"2025-06-18T23:33:29.090Z","avatar_url":"https://github.com/DamonOehlman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ratchet - CSS3 Transform Parser \u0026 Manipulator\n\nRatchet assists with the process of dissecting CSS3 transform strings into\njavascript objects that you can then do something more intelligent with.\n\n[![NPM](https://nodei.co/npm/ratchet.png)](https://nodei.co/npm/ratchet/)\n\n[![unstable](https://img.shields.io/badge/stability-unstable-yellowgreen.svg)](https://github.com/dominictarr/stability#unstable) [![Build Status](https://api.travis-ci.org/DamonOehlman/ratchet.svg?branch=master)](https://travis-ci.org/DamonOehlman/ratchet)\n\n## Example Usage\n\nDisplayed below is a simple example. First a html file with a div element\nstyled to look like a square box:\n\n```html\n\u003chtml\u003e\n  \u003cbody\u003e\n    \u003cstyle type=\"text/css\"\u003e\n      #box {\n        width: 50px;\n        height: 50px;\n        background: red;\n      }\n    \u003c/style\u003e\n    \u003cdiv id=\"box\"\u003e\u003c/div\u003e\n    \u003cscript src=\"simple-bundle.js\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nAnd then some JS that can be used to manipulate the transform of the box (\nin partnership with the [feature](https://github.com/DamonOehlman/feature)\nmodule):\n\n```js\nconst ratchet = require('..');\nconst transform = require('feature/css')('transform');\n\nconst box = document.getElementById('box');\nconst { width: boxWidth } = box.getBoundingClientRect();\nconst t = transform \u0026\u0026 ratchet(transform(box));\n\nif (t) {\n  let forwards = true;\n\n  // this is all a bit hacky, but you get the idea\n  const animate = () =\u003e {\n    if (forwards) {\n      t.translate.x.value += 2;\n      t.rotate.z.value += 5;\n      forwards = forwards \u0026\u0026 t.translate.x.value + boxWidth \u003c window.innerWidth;\n    } else {\n      t.translate.x.value -= 2;\n      t.rotate.z.value -= 5;\n      forwards = t.translate.x.value \u003c 0;\n    }\n\n    transform(box, t.toString());\n    window.requestAnimationFrame(animate);\n  };\n\n  animate();\n}\n```\n\nIf you want to give this a go you should be able to run the example with\n[bde](https://github.com/DamonOehlman/bde) simply type `yarn example`\nin the repository once cloned an dependencies have been installed.\n\nAssuming it is working, you will see a square red box, moving\nand rotating towards the right of the screen.\n\n## Licence\n\nThe MIT License (MIT)\n\nCopyright (c) 2020 Damon Oehlman \u003cdamon.oehlman@gmail.com\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamonoehlman%2Fratchet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamonoehlman%2Fratchet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamonoehlman%2Fratchet/lists"}