{"id":15926398,"url":"https://github.com/zemse/projectile.js","last_synced_at":"2025-06-29T18:04:34.105Z","repository":{"id":119196534,"uuid":"173621076","full_name":"zemse/projectile.js","owner":"zemse","description":"Kinematics motion with HTML elements.","archived":false,"fork":false,"pushed_at":"2019-03-03T20:34:17.000Z","size":6,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T13:28:49.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://zemse.github.io/projectile.js/","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/zemse.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":"2019-03-03T19:38:28.000Z","updated_at":"2020-08-12T04:23:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"0beac851-6a4e-45ae-a0cf-554ae8759759","html_url":"https://github.com/zemse/projectile.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zemse/projectile.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fprojectile.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fprojectile.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fprojectile.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fprojectile.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zemse","download_url":"https://codeload.github.com/zemse/projectile.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemse%2Fprojectile.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262642958,"owners_count":23341817,"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":[],"created_at":"2024-10-06T22:40:38.061Z","updated_at":"2025-06-29T18:04:34.080Z","avatar_url":"https://github.com/zemse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# projectile.js\n\nKinematics motion with HTML elements.\n\n## How to\n\n1. Include the projectile.js file with the script src.\n```\n\u003cscript src=\"projectile.js\" charset=\"utf-8\"\u003e\u003c/script\u003e\n```\n\n2. In scripts, create an object with Projectile class. \n```\nconst ball = new Projectile(document.getElementById('element'));\n```\n\n3. You can change location of the element by using the setXY method of the object.\n```\nball.setXY(100, 100);\n```\n\n4. You can access to the current location of the element by using the getXY method of the object.\n```\nconsole.log(ball.getX()); //prints a Number e.g. 100\nconsole.log(ball.getY()); //prints a Number e.g. 100\nconsole.log(ball.getXY()); //prints an Object e.g. {x: 100, y: 100}\n```\n\n5. You can do a projectile of the element using the throwXY method of the object.\n```\nball.throw(100,-100); //x is towards right and y is towards bottom thats why -100.\nball.throw(100,-200,0); //specificy g value in third argument, default value is 100.\n```\n\n## Demo\nIn the demo, please open console and you can use ball.setXY, ball.getXY and ball.throwXY methods. You can find the demo [here](https://zemse.github.io/projectile.js/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzemse%2Fprojectile.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzemse%2Fprojectile.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzemse%2Fprojectile.js/lists"}