| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Fri, 09 Jan 2026 20:24:19 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090501175640
location: https://web.archive.org/web/20090501175640/https://github.com/mojombo/primer/
server-timing: captures_list;dur=0.766918, exclusion.robots;dur=0.055128, exclusion.robots.policy;dur=0.041551, esindex;dur=0.012436, cdx.remote;dur=9.648313, LoadShardBlock;dur=202.959616, PetaboxLoader3.datanode;dur=119.238166, PetaboxLoader3.resolve;dur=43.390859
x-app-server: wwwb-app227-dc8
x-ts: 302
x-tr: 242
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app227; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Fri, 09 Jan 2026 20:24:20 GMT
content-type: text/html; charset=utf-8
content-length: 110
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Fri, 01 May 2009 17:48:38 GMT
x-archive-orig-connection: close
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20090501175640/https://github.com/mojombo/primer/tree/master
x-archive-orig-x-runtime: 80ms
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 110
cache-control: max-age=1800
memento-datetime: Fri, 01 May 2009 17:56:40 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_9_20090501135100_crawl101-c/52_9_20090501175628_crawl101.arc.gz
server-timing: captures_list;dur=0.775460, exclusion.robots;dur=0.027954, exclusion.robots.policy;dur=0.012089, esindex;dur=0.016017, cdx.remote;dur=180.014227, LoadShardBlock;dur=250.008519, PetaboxLoader3.datanode;dur=152.069448, PetaboxLoader3.resolve;dur=206.482144, load_resource;dur=238.864569
x-app-server: wwwb-app227-dc8
x-ts: 301
x-tr: 700
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Fri, 09 Jan 2026 20:24:20 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.26
x-archive-orig-date: Fri, 01 May 2009 17:48:39 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 244ms
x-archive-orig-etag: "47e3a685208008e932fc4acb223948e7"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 18920
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Fri, 01 May 2009 17:56:40 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_9_20090501135100_crawl101-c/52_9_20090501175628_crawl101.arc.gz
server-timing: captures_list;dur=0.565791, exclusion.robots;dur=0.019401, exclusion.robots.policy;dur=0.008181, esindex;dur=0.011338, cdx.remote;dur=23.120152, LoadShardBlock;dur=203.133870, PetaboxLoader3.datanode;dur=125.522537, PetaboxLoader3.resolve;dur=65.056149, load_resource;dur=23.354392
x-app-server: wwwb-app227-dc8
x-ts: 200
x-tr: 300
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
mojombo's primer at master - GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| Description: | Primer is a Flash-like API built on top of Canvas using jQuery. |
| Clone URL: |
git://github.com/mojombo/primer.git
Give this clone URL to anyone.
git clone git://github.com/mojombo/primer.git
|
primer /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Loading commit data... |
|
| |
README | ||
| |
primer.js | ||
| |
test/ |
##### ##### ### ## ## ##### #####
# # # # # ## ## # # # #
# # # # # ## ## # # #
#### #### # # # # # ### ####
# # # # # # # # # # #
# # # # # # # # # # #
### ### ## ### ### # ### ##### ### ##
Primer. By Tom Preston-Werner.
Primer is a Flash-like API layered on top of Canvas.
INSTALL
----------------------------------------------------------------------------
Just include jQuery and Primer libraries on your page.
<script src="jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="primer.js" type="text/javascript"></script>
BASIC DRAWING EXAMPLE
-----------------------------------------------------------------------------
In your html create an empty div with an id you can reference later:
<div id="primer"></div>
In your JavaScript, create a new Primer object for the div, specifying width
and height.
$(function() {
var primer = new Primer("#primer", 100, 100)
...
})
Now that you have a Primer instance, you can start adding layers to it. Start
by creating an instance of Primer.Layer:
var square = new Primer.Layer()
Now you can draw on the layer. Let's draw a 20x20 pixel gray square.
square.fillStyle = "#888888"
square.fillRect(0, 0, 20, 20)
The square won't be drawn until it is added to the Primer instance.
primer.addChild(square)
BASIC ANIMATION EXAMPLE
-----------------------------------------------------------------------------
If you follow the instructions in [Basic Drawing Example], you'll have an
object called `square` that has been drawn to the screen. Moving the square
to another place is as easy as setting its `x` and `y` values.
square.x = 10
square.y = 10
The square has now moved to its new location. Contrary to raw Canvas work,
Primer layers redraw themselves any time they're moved. If we'd like the
square to move slowly across the screen, we can simply increase the `x` value
on an interval.
function go() {
square.x += 1
}
setInterval(go, 100)
BASIC EVENTS EXAMPLE
-----------------------------------------------------------------------------
In Primer it's easy to attach event listeners to your Layers. Let's say we
want to log "in" and "out" when you mouse over and mouse out of your gray
square.
square.mouseover(function() {
console.log("in")
})
square.mouseout(function() {
console.log("out")
})
BASIC TEXT EXAMPLE
-----------------------------------------------------------------------------
Primer implements a basic version of Canvas' text api with standard DOM
elements since no major browser release yet offers this. Let's draw the text
"Hello, World!" in 12px Monaco in red at (0, 0) with a max width of 100px:
var text = Primer.Layer()
text.font = "12px Monaco"
text.fillStyle = "#FF0000"
text.textAlign = "center"
text.fillText("Hello, World!", 0, 0, 100)
The signature of fillText() is (text, x, y, width). The font attribute takes
standard CSS font values.
The text API currently does not support any transformations except
translation.
This feature is coming soon. Sit tight!








