{"id":28629801,"url":"https://github.com/codebox/js-planet-phase","last_synced_at":"2025-07-18T19:32:45.951Z","repository":{"id":23629782,"uuid":"26999477","full_name":"codebox/js-planet-phase","owner":"codebox","description":"A small JavaScript library for rendering realistic moon and planet phases in HTML","archived":false,"fork":false,"pushed_at":"2019-03-06T08:37:37.000Z","size":5,"stargazers_count":27,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-12T12:13:39.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://codebox.org.uk/pages/html-moon-planet-phases","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/codebox.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":"2014-11-22T13:23:01.000Z","updated_at":"2025-03-28T04:55:01.000Z","dependencies_parsed_at":"2022-07-23T23:02:02.998Z","dependency_job_id":null,"html_url":"https://github.com/codebox/js-planet-phase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codebox/js-planet-phase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fjs-planet-phase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fjs-planet-phase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fjs-planet-phase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fjs-planet-phase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebox","download_url":"https://codeload.github.com/codebox/js-planet-phase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fjs-planet-phase/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265819949,"owners_count":23833554,"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":"2025-06-12T12:13:38.710Z","updated_at":"2025-07-18T19:32:45.926Z","avatar_url":"https://github.com/codebox.png","language":"JavaScript","readme":"# js-planet-phase\n\nThis JavaScript library can be used to draw somewhat realistic lunar or planetary discs, complete with phase shadows:\n\n![example](http://codebox.org.uk/assets/images/planet-phase-example.png)\n\nThe library requires that browsers support the CSS `border-radius` and `box-shadow` properties, which means it [should work everywhere except IE8 (and earlier)](http://caniuse.com/#feat=css-boxshadow).\n\nTo use the library, just include the [planet_phase.js](https://github.com/codebox/js-planet-phase/blob/master/planet_phase.js) file somewhere in your page, and call the `drawPlanetPhase` function once for each disc that you want to draw.\n\nThe simplest way to call the function is like this:\n\n\u003cpre\u003edrawPlanetPhase(document.getElementById('container'), 0.15, true);\n\u003c/pre\u003e\n\n*   The first argument is the HTML element that you want to contain the disc.\n*   The second argument must be a value between 0 and 1, indicating how large the shadow should be:\n    *   0 = new moon\n    *   0.25 = crescent\n    *   0.50 = quarter\n    *   0.75 = gibbous\n    *   1.00 = full moon\n*   The third argument is a boolean value indicating whether the disc should be waxing or waning (i.e. which side of the disc the shadow should be on):\n    *   true = waxing - shadow on the left\n    *   false = waning - shadow on the right\n*   The function also accepts an optional fourth argument, containing configuration values which change the size, colour and appearance of the disc:\n    *   `shadowColour` - CSS background-colour value for the shaded part of the disc\n    *   `lightColour` - CSS background-colour value for the illuminated part of the disc\n    *   `diameter` - diameter of the disc in pixels\n    *   `earthshine` - a number between 0 and 1, specifying the amount of light falling on the shaded part of the disc (0 = none, 1 = full illumination)\n    *   `blur` - amount of blur on the terminator in pixels (0 = no blur)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebox%2Fjs-planet-phase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebox%2Fjs-planet-phase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebox%2Fjs-planet-phase/lists"}