{"id":16183809,"url":"https://github.com/tleunen/css-pie-chart-timer","last_synced_at":"2026-03-18T18:18:20.921Z","repository":{"id":7101152,"uuid":"8393347","full_name":"tleunen/CSS-Pie-Chart-Timer","owner":"tleunen","description":"Create a pie chart timer/countdown using CSS and Javascript","archived":false,"fork":false,"pushed_at":"2013-03-31T01:01:45.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T15:31:53.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/tleunen.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":"2013-02-24T16:53:34.000Z","updated_at":"2014-08-25T19:47:03.000Z","dependencies_parsed_at":"2022-08-28T01:20:55.091Z","dependency_job_id":null,"html_url":"https://github.com/tleunen/CSS-Pie-Chart-Timer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleunen%2FCSS-Pie-Chart-Timer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleunen%2FCSS-Pie-Chart-Timer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleunen%2FCSS-Pie-Chart-Timer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleunen%2FCSS-Pie-Chart-Timer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tleunen","download_url":"https://codeload.github.com/tleunen/CSS-Pie-Chart-Timer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247655376,"owners_count":20974166,"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-10T07:07:07.936Z","updated_at":"2025-09-24T01:33:28.856Z","avatar_url":"https://github.com/tleunen.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSS Pie Chart Timer\n\nCreate a pie chart timer/countdown using CSS and Javascript.\n\nCSS Pie Chart Timer works fine on these browsers:\n* IE 9\n* Opera\n* Firefox\n* Chrome\n\nThe animation is done in Javascript as it's the only way to make it work properly with IE 9.\n\n## Html\n\nYou need to use a specific html hierarchy with css classes to make it work.\n* As a timer:\n\n```html\n    \u003cdiv id='wrapper1'\u003e\n        \u003cdiv class='pctTimer'\u003e\n            \u003cdiv class='pctTrack'\u003e\u003c/div\u003e\n            \u003cdiv class='pctPie'\u003e\n                \u003cdiv class='pctSpinner pctSlice'\u003e\u003c/div\u003e\n                \u003cdiv class='pctFiller pctSlice'\u003e\u003c/div\u003e\n            \u003c/div\u003e\n        \u003c/div\u003e\n    \u003c/div\u003e\n```\n* As a countdown:\n\n```html\n    \u003cdiv class='pctTimer pctCountdown'\u003e\n        \u003cdiv class='pctTrack'\u003e\u003c/div\u003e\n        \u003cdiv class='pctPie'\u003e\n            \u003cdiv class='pctSpinner pctSlice'\u003e\u003c/div\u003e\n            \u003cdiv class='pctFiller pctSlice'\u003e\u003c/div\u003e\n        \u003c/div\u003e\n    \u003c/div\u003e\n```\n\nAs you can see, the only difference between the 2 codes is the `pctCountdown` class.\nThe `\u003cdiv class='pctTrack'\u003e\u003c/div\u003e` block is also optional.\n\n## CSS or LESS\n\nThere is two version available in the repo:\n* a CSS file with some default values\n* a LESS file with a mixin so you can easily use it in your project\n\n## Usage\n\n### CSS\n\nTo customize the way the timer/countdown renders, you need to include `pie_chart_timer.css`. After that, you can customize the timer by changing some css classes:\n```css\n#wrapper1 .pctTimer {\n    font-size: 150px; /* The size (width and height) of the timer */\n}\n\n#wrapper1 .pctTrack,\n#wrapper1 .pctPie .pctSlice {\n    border: 0.05em solid #eee; /* size of the border (and track) and the color of the track */\n    width: 0.9em;  /* 1em - (2*border-width) */\n    height: 0.9em;  /* 1em - (2*border-width) */\n}\n\n#wrapper1 .pctPie .pctSlice {\n    background: transparent; /* fill-color of the timer */\n    border-color: #c0c0c0; /* border color of the timer */\n}\n```\n\n### LESS\n\nLESS is definitely the easiest way to use this small script. You only need to include `pie_chart_timer.mixin.less`. This will include basic css and provide you a mixin to easily set the size and style of your timer. Here is an example:\n\n```css\n#wrapper1 {\n    .pie-chart-timer(200px, 10px, #c0c0c0, #eee, transparent);\n}\n```\nThe arguments are:\n\n1. The size (width and height) of the timer\n2. The size of the border (and track)\n3. The color of the border [default: #c0c0c0]\n4. The color of the track [default: transparent]\n5. The fill-color of the timer [default: transparent]\n\nOnly the first two arguments are required.\n\n## Example\n\nYou can see an example of the code in `example.html`. This page uses the `css` version of the code. But an example using less is also available in `styles.less`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftleunen%2Fcss-pie-chart-timer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftleunen%2Fcss-pie-chart-timer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftleunen%2Fcss-pie-chart-timer/lists"}