{"id":25554701,"url":"https://github.com/halil-yesilyurt/rectangle-drawer","last_synced_at":"2025-06-10T15:31:34.746Z","repository":{"id":251107610,"uuid":"836329247","full_name":"halil-yesilyurt/rectangle-drawer","owner":"halil-yesilyurt","description":"Allows users to create, resize, and move rectangles on a webpage using an object-oriented approach.","archived":false,"fork":false,"pushed_at":"2025-02-09T23:35:40.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-31T06:57:50.637Z","etag":null,"topics":["javascript","javascript-vanilla","object-oriented-programming","oop"],"latest_commit_sha":null,"homepage":"https://rectangle-drawer.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halil-yesilyurt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-31T16:04:50.000Z","updated_at":"2025-02-09T23:41:44.000Z","dependencies_parsed_at":"2025-02-20T13:41:51.745Z","dependency_job_id":"74966993-d69c-4f7b-8e6a-ef1c9144204e","html_url":"https://github.com/halil-yesilyurt/rectangle-drawer","commit_stats":null,"previous_names":["halil-yesilyurt/rectangle-drawer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halil-yesilyurt%2Frectangle-drawer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halil-yesilyurt%2Frectangle-drawer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halil-yesilyurt%2Frectangle-drawer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halil-yesilyurt%2Frectangle-drawer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halil-yesilyurt","download_url":"https://codeload.github.com/halil-yesilyurt/rectangle-drawer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halil-yesilyurt%2Frectangle-drawer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259101345,"owners_count":22805258,"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":["javascript","javascript-vanilla","object-oriented-programming","oop"],"created_at":"2025-02-20T13:41:47.363Z","updated_at":"2025-06-10T15:31:34.713Z","avatar_url":"https://github.com/halil-yesilyurt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"The Rectangle Drawer is a JavaScript application that allows users to draw, resize, and interact with rectangles on a webpage. Developed in pure JavaScript without any third-party libraries or frameworks, this project demonstrates object-oriented programming principles and DOM manipulation techniques.\n\n## Features\n\n- Drawing Rectangles: Users can draw new rectangles by clicking and dragging the mouse on the screen. The size of the rectangle is dynamically displayed above the rectangle during the drawing process.\n\n- Resizing Rectangles: Existing rectangles can be resized by grabbing their edges or corners. The cursor changes to indicate the possible resizing direction (e.g., col-size, row-size).\n\n- Moving Rectangles: Rectangles can be moved when the top left corner is grabbed while holding the Ctrl or Cmd key. This allows for easy repositioning of existing rectangles.\n\n- Size Indicator: The size of the rectangle (width x height) is only visible during drawing or resizing. It is positioned slightly above the rectangle and does not overflow the screen, even near the browser edges.\n\n- Minimum Size Constraint: Rectangles must have a minimum size of 10x10 pixels. If a rectangle smaller than this size is attempted, it will be automatically removed. Additionally, resizing cannot reduce the rectangle's size below this minimum dimension.\n\n- Viewport Constraints: Rectangles cannot be drawn outside the browser viewport. However, if the browser window is resized, the application allows scrolling in both axes.\n\n## File Structure\n\n- HTML: The HTML file contains only basic initialization tags, providing a clean and minimal structure.\n\n- CSS: The CSS file defines styles for rectangles, size indicators, and cursor changes.\n\n- JavaScript: The JavaScript file implements the functionality in an object-oriented manner, using the RectDrawer class.\n\n## Usage\n\n**1. Drawing:** Click and drag to draw a new rectangle. If the cursor is not over an existing rectangle, a new one will start from the mouse down point.\n\n**2. Resizing:** Click on an existing rectangle's edge or corner. The cursor will change to indicate the resize direction. Drag to resize the rectangle.\n\n**3. Constraints:** The minimum size for any rectangle is 10x10 pixels. Any smaller rectangle will be automatically removed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalil-yesilyurt%2Frectangle-drawer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalil-yesilyurt%2Frectangle-drawer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalil-yesilyurt%2Frectangle-drawer/lists"}