{"id":17053795,"url":"https://github.com/terrymooreii/canvasclock","last_synced_at":"2026-04-11T22:03:34.546Z","repository":{"id":10732314,"uuid":"12986555","full_name":"TerryMooreII/CanvasClock","owner":"TerryMooreII","description":"Module that will load a clock in a canvas element.","archived":false,"fork":false,"pushed_at":"2013-09-24T00:35:19.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T12:35:25.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/TerryMooreII.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-09-21T00:01:39.000Z","updated_at":"2013-10-14T13:24:54.000Z","dependencies_parsed_at":"2022-09-22T21:41:27.908Z","dependency_job_id":null,"html_url":"https://github.com/TerryMooreII/CanvasClock","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/TerryMooreII%2FCanvasClock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerryMooreII%2FCanvasClock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerryMooreII%2FCanvasClock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerryMooreII%2FCanvasClock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TerryMooreII","download_url":"https://codeload.github.com/TerryMooreII/CanvasClock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245061384,"owners_count":20554563,"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-14T10:13:14.615Z","updated_at":"2026-04-11T22:03:34.414Z","avatar_url":"https://github.com/TerryMooreII.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"CanvasClock\n===========\n\nA customizable JavaScript module that will load a clock in a canvas element.\n\n![alt text](https://raw.github.com/TerryMooreII/CanvasClock/master/img/clock_ss.jpg \"Screen Shot\")\n\n###How to use\n\nInclude the JavaScript file also this depends on jQuery, i am working to remove that dependancy\n\n````html\n\u003cscript type=\"text/javascript\" src=\"js/canvas-clock.js\"\u003e\u003c/script\u003e\n\u003ccanvas id=\"clock\"\u003e\u003c/canvas\u003e\n````\n\nThen add this to enable the clock and its settings\n\n````javascript\nvar clock = new CanvasClock({\n\telement: 'clock'   //This is mandatory and its the ID of the canvas element.\n  \t//Set what ever options you want to change, see below\n});\n````\nThe display it\n\n````javascript\nclock.display();\n````\n\nOr everything inline\n````javascript\nnew CanvasClock({\n\telement: 'clock'   //This is mandatory and its the ID of the canvas element.\n  \t//Set what ever options you want to change, see below\n}).display();\n````\n\n###Methods\n\nThe methods work just like jQuery, where the same method is either a getter or a setter.\n\nGet/Set the timezoneOffset\n\n````javascript\nclock.timezoneOffset();       //Returns the value.  Ex -5\n\nclock.timezoneOffset('-1');   //Set the timezoneOffset to -1. Clock changes on next tick.\n````\n\nGet/Set the settings after initialization\n````javascript\nclock.settings(); \t\t\t   //Returns the settings object\n\nclock.settings({ \t\t\t   //Pass any object to change the settings\t\t\t\n\tradius:150,\n\tdisplayNumbers: false,\n});  \t\t\t\n````\n\n\n\n##Options\n\nHere are the list of options that you can pass at start up and their default value. \n````javascript\n{\n    element: 'clock',           //Canvas Element  \n    timezoneOffset: null,       //This will be the offset from UTC ex. -5\n    radius: 100,                //Radius of clock\n    displayClockOutline: true,  //Show the clock's outer circle\n    displayMinuteDashes:  true, //Show the clocks minute dashes \n    displayVertex: true,        //Center dot, not working.\n    displayNumbers: true,       //Show the numbers\n    \n    smallPoint: this.radius / 50,  //Center dot size, not working\n    \n    colors:{\n       backgroundColor: '#fff',\t\t//Background color\n       vertexColor: '#000000',\t\t//Color of the vertex Not implemented\n       dashColor: '#333',\t\t\t//Dash color \n       clockColor: '#333',\t\t\t//Outside border of the clock\n       numbersColor: '#333'\t\t\t//Color of the numbers\n    },\n     \n    minuteHand: {\n      display: true,\n      color: '#333',\n      width: 2,\t\t\t\t//Width of the hand\n      length: 10 \t\t\t//Note: Working on a good fomular for the length\n    },\n\n    secondHand:{\n      display: true,\n      color: '#333',\n      width: 1,\n      length: 10\n    },\n\n    hourHand:{\n      display: true,\n      color: '#333',\n      width: 2,\n      length: 40\n    },\n\n    onLoad: null,\t\t\t//Callback function to run once CanvasClock is loaded\n    onSecond: null,\t\t\t//Callback function to run every second\n    onHour: null,\t\t\t//Callback function to run every hour\n    onMinute: null\t\t\t//Callback function to fun every minute\n};\n````","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterrymooreii%2Fcanvasclock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterrymooreii%2Fcanvasclock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterrymooreii%2Fcanvasclock/lists"}