ilyasakin / canvas-selection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Canvas Selection Demo

This project showcases a basic interactive canvas, reminiscent of the selection functionality found in design tools like Figma. In this canvas, you can interact with three objects by selecting them either through simple clicks or by employing a selection box – simply click and drag your cursor over the objects to choose them.

Getting Started

To run this demonstration on your local machine, follow these straightforward steps:

  1. Clone this repository to your computer.

  2. Navigate to the project directory.

  3. Install packages

    yarn
  4. Run the project

    yarn dev
  5. Your web browser will display the canvas demo.

Usage

Selecting Objects

You can select objects within the canvas using one of two methods:

  1. Clicking: To select an object, simply click on it. The selected object will be visibly highlighted.

  2. Selection Box: For choosing multiple objects simultaneously, click and drag your cursor to create a selection box. Any objects fully or partially enclosed within this selection box will be selected.

Deselecting Objects

To deselect any selected objects, click anywhere outside the chosen area.

License

MIT License

Copyright (c) 2023 ilyas akın

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

License:MIT License


Languages

Language:TypeScript 83.1%Language:CSS 13.4%Language:HTML 3.5%