{"id":16019654,"url":"https://github.com/iboard/cancoffee","last_synced_at":"2025-07-16T11:34:31.364Z","repository":{"id":15724959,"uuid":"18463179","full_name":"iboard/cancoffee","owner":"iboard","description":"An example of a coffescipt HTML5-canvas application. Tested with Jasmine","archived":false,"fork":false,"pushed_at":"2016-10-22T11:07:55.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T08:08:48.259Z","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/iboard.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}},"created_at":"2014-04-05T08:47:33.000Z","updated_at":"2016-10-22T11:07:57.000Z","dependencies_parsed_at":"2022-09-10T14:51:52.625Z","dependency_job_id":null,"html_url":"https://github.com/iboard/cancoffee","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/iboard%2Fcancoffee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboard%2Fcancoffee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboard%2Fcancoffee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iboard%2Fcancoffee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iboard","download_url":"https://codeload.github.com/iboard/cancoffee/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247283478,"owners_count":20913581,"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-08T17:05:02.605Z","updated_at":"2025-04-05T03:25:13.301Z","avatar_url":"https://github.com/iboard.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Canvas Application Template And Example\n\n... is a template you can use to start your [Jasmine-driven][jasmine] [Coffeescript]\nHTML5-Canvas application. (Based on [coffeemine])\n\nIt comes with a _Cakefile_ to watch your source- and spec-files in\n`src/coffee` and `spec/units`. Once you fetched the repository from\nGithub, cd into the project's root and start\n\n    cake assets:watch\n\nThen\n\n  * open `spec/suite.html` in your brower to run the tests.\n  * open `public/index.html` in your brower to run the application.\n\nYou can see a running implementation at\n\n  * [The Application](https://s3.eu-central-1.amazonaws.com/iboard.core/static/cancoffee/public/index.html)\n  * [The Jasime Suite](https://s3.eu-central-1.amazonaws.com/iboard.core/static/cancoffee/spec/suite.html)\n\n\n# The Application\n\n## index.html\n\nThe job of `index.html` is to\n\n  * Load all source-files\n  * Define a canvas-element (initially hidden)\n  * Define any HTML elements used by the application nested under a div-tag\n  with ID 'html-elements' (also hidden first)\n  * and finally instantiate the application-object.\n\n## Class CanvasApp\n\nSee file `src/app/canvas_app.coffee`. The class is supposed to\ninitialize a standard HTML5 application using a Canvas-object\nand a Gemoetry-object.\n\nIt depends on a canvas-element in the html-index-file which you\nprovide when you instantiate the application. In this example\nthe canvas-element has a CSS-id of 'main-canvas'.\n\n    app = new CanvasApp( \"main-canvas\")\n\nThis line at the bottom of `public/index.html` does this job.\n\nOn top of `canvas_app.coffee` you define an Actor. A coffeescript-class\nwhich responds to `execute()`\n\nAlso, you define a method named `installActions` which sets up\njQuery-Callbacks on your individual HTML5-elements/-inputs.\n\nThis example-application defines a 'LineDrawActor' which draws a number\nof random lines on the canvas. The number of lines can be selected from\nthe select-element in index.html.\nAs defined in `CanvasApp.installActions()` the application will run\nthe Actor's `execute()`-function each time the user selects from the\ndropdown.\n\nIf you want to write your own Canvas-Application, just write your\nown Actor-class and instantiate it in `CanvasApp.initializeActor()`.\n\nAll you have to do is to replace 'LineDrawActor' in `index.html` and\n`suite.html`.\n\n## Background, and Geometry\n\n### Background\n\nis a coffeescript-class responsible to draw the background of the\napplication. It is defined in `src/app/background.coffee`. You can change\nthe behavior of the `draw()`-function to draw any background you want\nin your application.\n\n### Geometry\n\n`app/geometry.coffee` sets the size of the canvas-element to the full\nsize of the html-body. Also, it sets the position to 'fixed', thus\nyou can place your HTML-elements above the background.\n\n### Lines\n\nis just a helper-class for our example-actor.\n\n\n\n\n[coffeemine]:    https://github.com/iboard/coffeemine\n[Jasmine]:       http://jasmine.github.io/\n[Coffeescript]:  http://coffeescript.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiboard%2Fcancoffee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiboard%2Fcancoffee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiboard%2Fcancoffee/lists"}