{"id":20962969,"url":"https://github.com/doesdev/you-be-my-sun","last_synced_at":"2025-06-11T23:38:37.445Z","repository":{"id":57151266,"uuid":"76757193","full_name":"doesdev/you-be-my-sun","owner":"doesdev","description":"Make one DOM element hug another while staying closest to page center","archived":false,"fork":false,"pushed_at":"2017-07-27T23:41:35.000Z","size":6,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T19:08:27.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://doesdev.github.io/you-be-my-sun/","language":"JavaScript","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/doesdev.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}},"created_at":"2016-12-18T01:46:20.000Z","updated_at":"2017-01-01T10:05:54.000Z","dependencies_parsed_at":"2022-09-08T16:12:54.730Z","dependency_job_id":null,"html_url":"https://github.com/doesdev/you-be-my-sun","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/doesdev/you-be-my-sun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fyou-be-my-sun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fyou-be-my-sun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fyou-be-my-sun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fyou-be-my-sun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doesdev","download_url":"https://codeload.github.com/doesdev/you-be-my-sun/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doesdev%2Fyou-be-my-sun/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259364911,"owners_count":22846578,"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-11-19T02:39:37.718Z","updated_at":"2025-06-11T23:38:37.383Z","avatar_url":"https://github.com/doesdev.png","language":"JavaScript","readme":"# you-be-my-sun [![NPM version](https://badge.fury.io/js/you-be-my-sun.svg)](https://npmjs.org/package/you-be-my-sun)   [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)   [![Dependency Status](https://dependencyci.com/github/doesdev/you-be-my-sun/badge)](https://dependencyci.com/github/doesdev/you-be-my-sun)\n\n\u003e Make one DOM element hug another while staying closest to page center\n\n## install\n\n```sh\n$ npm install --save you-be-my-sun\n```\n\n## api\n- **sunEl** *(DOM Element - required - Element to gravitate around)*\n- **earthEl** *(DOM Element - required - Element that will gravitate)*\n- **fluidity** *(Number - optional [default 30] - Steps (in px) to evaluate positioning)*\n\n## usage\n\n```js\n'use strict'\n\n// Setup\nimport gravity from 'you-be-my-sun'\nconst sun = document.getElementById('sun')\nconst earth = document.getElementById('earth')\n\n// Main\nfunction positionEarth () {\n  let { x, y } = gravity(sun, earth, 1)\n  earth.style.left = `${x}px`\n  earth.style.top = `${y}px`\n}\n\npositionEarth()\n```\n\n## License\n\nMIT © [Andrew Carpenter](https://github.com/doesdev)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fyou-be-my-sun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoesdev%2Fyou-be-my-sun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoesdev%2Fyou-be-my-sun/lists"}