{"id":15092714,"url":"https://github.com/iolitetech/iogesture","last_synced_at":"2025-04-12T07:20:45.938Z","repository":{"id":246830347,"uuid":"823395829","full_name":"iolitetech/IOGesture","owner":"iolitetech","description":"IOGesture is a gesture recognition library for Blazor applications, wrapping the TinyGesture.js library. It simplifies handling touch and mouse gestures.","archived":false,"fork":false,"pushed_at":"2024-11-27T02:47:12.000Z","size":17526,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T02:34:09.596Z","etag":null,"topics":["blazor","blazor-application","blazor-component","blazor-components","blazor-gesture","blazor-server","blazor-wasm","blazor-webassembly","gesture-recognition","gesture-recognizer","gestures-recognition","tinygesture","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://iolitetech.github.io/IOGesture/","language":"C#","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/iolitetech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-07-03T00:51:20.000Z","updated_at":"2025-03-19T03:46:00.000Z","dependencies_parsed_at":"2024-07-06T14:02:47.418Z","dependency_job_id":null,"html_url":"https://github.com/iolitetech/IOGesture","commit_stats":null,"previous_names":["iolitetech/iogesture"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iolitetech%2FIOGesture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iolitetech%2FIOGesture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iolitetech%2FIOGesture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iolitetech%2FIOGesture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iolitetech","download_url":"https://codeload.github.com/iolitetech/IOGesture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530743,"owners_count":21119625,"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":["blazor","blazor-application","blazor-component","blazor-components","blazor-gesture","blazor-server","blazor-wasm","blazor-webassembly","gesture-recognition","gesture-recognizer","gestures-recognition","tinygesture","wasm","webassembly"],"created_at":"2024-09-25T11:01:29.761Z","updated_at":"2025-04-12T07:20:45.912Z","avatar_url":"https://github.com/iolitetech.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IOGesture\n[![NuGet](https://img.shields.io/nuget/dt/IOGesture?logo=nuget)](https://www.nuget.org/packages/IOGesture)\n![GitHub License](https://img.shields.io/github/license/iolitetech/IOGesture)\n![GitHub Release](https://img.shields.io/github/v/release/iolitetech/IOGesture)\n\n\nA lightweight and easy-to-use library for handling touch and gesture events in Blazor applications. This wrapper is built on top of the [TinyGesture](https://github.com/sciactive/tinygesture) library and provides seamless integration with Blazor components.\n\n## Features\n- **Pan Gestures**: Detect and handle pan gestures with start, move, and end callbacks.\n- **Swipe Gestures**: Easily recognize swipe gestures in all directions (up, down, left, right).\n- **Tap Gestures**: Identify single tap and double tap gestures.\n- **Long Press**: Handle long press events.\n- **Pinch and Rotate**: Manage pinch (zoom) and rotate gestures, complete with start and end callbacks.\n- **Customizable Options**: Configure gesture thresholds and other settings to fine-tune the gesture detection.\n\n:information_source: For more information please check the [TinyGesture](https://github.com/sciactive/tinygesture) repository.\n## Getting Started\n### Installation\n1. Install [IOGesture](https://www.nuget.org/packages/IOGesture) with dotnet cli in your Blazor app.\n\n  ```sh\n  dotnet add package IOGesture \n  ```\n\n2. Add the tinygesture.js and IOGesture.js script tag in your root file **_Host.cshtml for Blazor Server Apps** or **index.html for Blazor WebAssembly Apps**:\n  ```html\n\n  \u003cscript src=\"_framework/blazor.server.js\"\u003e\u003c/script\u003e\n  \u003cscript src=\"_content/IOGesture/js/IOGesture.js\" type=\"module\"\u003e\u003c/script\u003e\n  \u003cscript src=\"_content/IOGesture/js/tinygesture.js\" type=\"module\"\u003e\u003c/script\u003e\n  ```\n## Usage\nUse the `IOGesture.Components` then you can use the component: \n```Razor\n@using IOGesture.Components\n\n\u003cGesture\u003e\n  \u003ch1\u003eSwipe me.\u003c/h1\u003e\n\u003c/Gesture\u003e\n```\nThen you can listen to gesture event callbacks and pass the options with type of `GestureOptions`, You can access various properties of the gesture using the `Properties` object after you referenced the `Gesture` instance:\n```Razor\n\u003cGesture \n    @ref=\"ioGesture\"\n    OnPanMove=\"HandlePanMove\"\n    Options=\"gestureOptions\"\u003e\n        \u003c!-- Your content here --\u003e\n\u003c/Gesture\u003e\n\n@code {\n    private Gesture? ioGesture;\n    private GestureOptions gestureOptions = new GestureOptions\n    {\n        VelocityThreshold = 10,\n        PressThreshold = 8,\n        DiagonalSwipes = false,\n        DiagonalLimit = 15,\n        MouseSupport = true\n    };\n\n    private void HandlePanMove()\n    {\n        Console.WriteLine($\"X: {ioGesture.Properties.TouchMoveX}, Y: {ioGesture.Properties.TouchMoveY}\");\n    }\n\n    private void HandleSwipeLeft()\n    {\n        // Handle swipe left\n    }\n}\n```\n### GestureOptions Configuration\nCustomize gesture detection by setting properties in GestureOptions:\n\n- **`VelocityThreshold`**: Minimum velocity the gesture must be moving when the gesture ends to be considered a swipe.\n- **`PressThreshold`**: Point at which the pointer moved too much to consider it a tap or long press gesture.\n- **`DiagonalSwipes`**: If true, swiping in a diagonal direction will fire both a horizontal and a vertical swipe.\n- **`DiagonalLimit`**: The degree limit to consider a diagonal swipe when DiagonalSwipes is true.\n- **`MouseSupport`**: Listen to mouse events in addition to touch events (for desktop support).\n\n## License\nThis project is licensed under the MIT License. See the [LICENSE](https://github.com/iolitetech/IOGesture/blob/master/LICENSE.txt) file for details.\n\n## Acknowledgements\nThis wrapper is built on top of the [TinyGesture](https://github.com/sciactive/tinygesture) library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiolitetech%2Fiogesture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiolitetech%2Fiogesture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiolitetech%2Fiogesture/lists"}