{"id":25286664,"url":"https://github.com/jonathanlurie/crepuscule","last_synced_at":"2026-03-07T05:06:34.100Z","repository":{"id":187638066,"uuid":"671658234","full_name":"jonathanlurie/crepuscule","owner":"jonathanlurie","description":"A Maplibre and MapTiler SDK layer for ☀️ day and 🌙 night time","archived":false,"fork":false,"pushed_at":"2024-03-11T09:04:07.000Z","size":17855,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T06:35:48.193Z","etag":null,"topics":["daylight","layer","map","maplibre","maptiler"],"latest_commit_sha":null,"homepage":"https://me.jonathanlurie.fr/crepuscule/examples","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonathanlurie.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-07-27T20:45:26.000Z","updated_at":"2025-08-27T15:28:13.000Z","dependencies_parsed_at":"2025-02-12T21:51:08.956Z","dependency_job_id":"3f250698-07ac-4919-b27f-d19e1482b292","html_url":"https://github.com/jonathanlurie/crepuscule","commit_stats":null,"previous_names":["jonathanlurie/crepuscule"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jonathanlurie/crepuscule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanlurie%2Fcrepuscule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanlurie%2Fcrepuscule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanlurie%2Fcrepuscule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanlurie%2Fcrepuscule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonathanlurie","download_url":"https://codeload.github.com/jonathanlurie/crepuscule/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonathanlurie%2Fcrepuscule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30208730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T03:24:23.086Z","status":"ssl_error","status_checked_at":"2026-03-07T03:23:11.444Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["daylight","layer","map","maplibre","maptiler"],"created_at":"2025-02-12T21:50:57.048Z","updated_at":"2026-03-07T05:06:34.084Z","avatar_url":"https://github.com/jonathanlurie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![crepuscule logo](images/crepuscule-logo.png)\n\nDay/Night layer with twilight zone for [**MapLibre GL JS**](https://maplibre.org/maplibre-gl-js/docs/) and [**MapTiler SDK**](https://docs.maptiler.com/sdk-js/).\n\nTiles are dynamically generated in the browser (no fetch from API) from zoom level `0` to `22`. The twilight zone (smooth gradient) appears when the sun is between the horizon and -6° below horizon.\n\n```bash\nnpm install crepuscule\n```\n\nThis is how it looks like:\n![](images/01.png)\n![](images/02.png)\n![](images/03.png)\n![](images/04.png)\n\nCoupled with the `TemperatureLayer` [MapTiler Weather library](https://docs.maptiler.com/sdk-js/modules/weather/):\n![](images/morning.jpg)\n![](images/evening.jpg)\n\nCrepuscule comes with two different kinds of layers:\n- a fixed one that can programmatically be updated to any date and time (`Crepuscule`)\n- an automatic one that is being refreshed every 5 seconds to show realtime conditions (`CrepusculeLive`)\n\nUsage of `Crepuscule` with ES Module:\n```ts\nimport {\n  Crepuscule\n} from \"crepuscule\";\n\n// You first need to instanciate your Map object from MapLibre or MapTiler SDK.\n\n// Instanciate the Crepuscule instance:\nconst crepObj = new Crepuscule(map);\n\n// Alternatively with some options:\nconst crepObj = new Crepuscule(map, {\n  color: [0, 12, 55], // RGB in [0, 255]\n  opacity: 0.7,       // in [0, 1] \n  date: new Date(),   // any date\n  debug: true,        // removes the twilight gradient\n});\n\n// You can hide and show the Crepuscule layer:\ncrepObj.hide();\ncrepObj.show();\n\n// Alternatively, both hide and show can take some option to make smooth transitions:\ncrepObj.show({\n  duration: 1000,  // Millisconds it takes to fade in or out\n  delay: 100,      // Milliseconds it takes to start showing/hiding\n});\n\n// You can update the date of the Crepuscule instance\ncrepObj.setDate(new Date(...));\n\n// Remove the layers and source created by this Crepuscule instance\ncrepObj.unmount();\n\n// crepObj will no longer be usable after unmounting!\n```\n\nUsage of `CrepusculeLive` with ES Module:\n```ts\nimport {\n  CrepusculeLive\n} from \"crepuscule\";\n\n// You first need to instanciate your Map object from MapLibre or MapTiler SDK.\n\n// Instanciate the Crepuscule instance:\nconst crepLiveObj = new crepuscule.CrepusculeLive(map);\n\n// Alternatively with the same options as the simple Crepuscule instance:\nconst crepLiveObj = new crepuscule.CrepusculeLive(map, {...});\n\n// Once instanciated, the CrepusculeLive will start updating every 5sec\n// automatically. Yet it can be stopped and restarted:\n\ncrepLiveObj.stop();\ncrepLiveObj.start();\n\n// A CrepusculeLive can also be unmounted\ncrepLiveObj.unmount();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanlurie%2Fcrepuscule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanlurie%2Fcrepuscule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanlurie%2Fcrepuscule/lists"}