{"id":16367338,"url":"https://github.com/doong-jo/react-device-orientation-hook","last_synced_at":"2025-03-21T01:30:59.602Z","repository":{"id":42661551,"uuid":"380147477","full_name":"doong-jo/react-device-orientation-hook","owner":"doong-jo","description":"React Custom Hook using Device Orientation Web API","archived":false,"fork":false,"pushed_at":"2024-09-27T06:22:35.000Z","size":3149,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-12T02:49:47.099Z","etag":null,"topics":["accelorometer","device-orientation","gyroscope","hook","react"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-device-orientation-hook","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/doong-jo.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":"2021-06-25T06:36:12.000Z","updated_at":"2024-07-14T07:26:52.000Z","dependencies_parsed_at":"2024-10-23T06:07:16.904Z","dependency_job_id":null,"html_url":"https://github.com/doong-jo/react-device-orientation-hook","commit_stats":{"total_commits":35,"total_committers":2,"mean_commits":17.5,"dds":"0.48571428571428577","last_synced_commit":"94a20fa6a74574a40cf85be5eace901a4a94f67b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":"HarveyD/react-component-library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doong-jo%2Freact-device-orientation-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doong-jo%2Freact-device-orientation-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doong-jo%2Freact-device-orientation-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doong-jo%2Freact-device-orientation-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doong-jo","download_url":"https://codeload.github.com/doong-jo/react-device-orientation-hook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221810737,"owners_count":16884183,"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":["accelorometer","device-orientation","gyroscope","hook","react"],"created_at":"2024-10-11T02:49:41.902Z","updated_at":"2024-10-28T08:59:36.513Z","avatar_url":"https://github.com/doong-jo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-device-orientation-hook\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![CodeQL](https://github.com/doong-jo/react-device-orientation-hook/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/doong-jo/react-device-orientation-hook/actions/workflows/codeql-analysis.yml)\n\n## Demo\n\n\u003cimg src=\"https://user-images.githubusercontent.com/22005861/123515869-3d9c5b00-d6d4-11eb-8404-b1d148e7f365.gif\" width=\"300\" height=\"640\" /\u003e\n\n## Usage\n📌  [Device Orientation Event works only in HTTPS for security reasons.](https://w3c.github.io/deviceorientation/#security-and-privacy)\n\n```\nnpm i react-device-orientation-hook\n```\n\n```typescript\nimport useDeviceOrientation from 'react-device-orientation-hook;\n\nfunction Component() {\n  const { transformStyle, resetPivotOrientation } = useDeviceOrientation();\n\n  return (\n    \u003c\u003e\n      \u003cdiv style={transformStyle} onClick={resetPivotOrientation} \u003e\n        Hello World!\n      \u003c/div\u003e\n      \u003cp\u003eTouch text and Revise orientation\u003c/p\u003e\n    \u003c/\u003e\n  );\n}\n```\n\n## Device Orientation Web API Spec\n- [W3C](https://www.w3.org/TR/orientation-event/)\n- [Google Developers](https://developers.google.com/web/fundamentals/native-hardware/device-orientation)\n- [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/deviceorientation_event)\n\n## Development\n\n### Testing\n\n```\nnpm run test\n```\n\n### Building\n\n```\nnpm run build\n```\n\n### Storybook\n\nTo run a live-reload Storybook server on your local machine:\n\n```\nnpm run storybook\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoong-jo%2Freact-device-orientation-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoong-jo%2Freact-device-orientation-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoong-jo%2Freact-device-orientation-hook/lists"}