Commit a04ad27e authored by Dave Griffiths's avatar Dave Griffiths

meander

parent 6ec17ada
......@@ -11,6 +11,17 @@ html, body {
// cursor: url(images/mouse.png), default;
}
input {
margin: 0;
}
input[type="checkbox"] {
display:inline-block;
width:15px;
height:15px;
margin: 0;
}
.canvas {
/* position: absolute;
left: 0px;
......
......@@ -4,15 +4,13 @@
<title>dyadic calculator</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<body bgcolor="#777">
<h1>A dyadic device</h1>
<div>
<div style="width:50%; margin:0 auto;">
<h1>A dyadic device</h1>
<!--<canvas class="canvas" id="webgl-canvas" width="640" height="480"></canvas> -->
<canvas class="canvas" id="canvas" width="480" height="480" style="float:left"></canvas>
<div id="liftplan" style="float:left"/>
<br/>
<div id="heddles" style="margin-bottom:2em;"/>
<div id="heddles"></div>
<canvas class="canvas" id="canvas" width="380" height="680" style="float:left;"></canvas>
<div id="liftplan" style="margin-top:-18px;"></div>
<div style="display:none;">
......
......@@ -57,33 +57,43 @@
(define (build-interface)
(let ((c ($ "#heddles") ))
(c.append "Heddles<br/>")
(build-line "heddle-1" c (list 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0)) (c.append "<br/>")
(build-line "heddle-2" c (list 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1)) (c.append "<br/>")
(build-line "heddle-3" c (list 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0)) (c.append "<br/>")
(build-line "heddle-4" c (list 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0)) (c.append "<br/>"))
(build-line "heddle-1" c (list 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1)) (c.append "<br/>")
(build-line "heddle-2" c (list 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0)) (c.append "<br/>")
(build-line "heddle-3" c (list 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0)) (c.append "<br/>")
(build-line "heddle-4" c (list 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0)) (c.append "<br/>"))
(let ((c ($ "#liftplan") ))
(c.append "Lift plan<br/>")
(build-line "lift-1" c (list 1 0 1 0)) (c.append "<br/>")
(build-line "lift-2" c (list 0 1 0 1)) (c.append "<br/>")
(build-line "lift-3" c (list 1 0 1 0)) (c.append "<br/>")
(build-line "lift-4" c (list 0 1 0 1)) (c.append "<br/>")
(build-line "lift-5" c (list 1 0 1 1)) (c.append "<br/>")
(build-line "lift-6" c (list 0 1 1 0)) (c.append "<br/>")
(build-line "lift-7" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-8" c (list 1 0 0 0)) (c.append "<br/>")
(build-line "lift-9" c (list 0 0 0 1)) (c.append "<br/>")
(build-line "lift-10" c (list 0 0 1 1)) (c.append "<br/>")
(build-line "lift-11" c (list 0 1 1 0)) (c.append "<br/>")
(build-line "lift-12" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-13" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-1" c (list 1 0 0 0)) (c.append "<br/>")
(build-line "lift-2" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-3" c (list 1 1 1 0)) (c.append "<br/>")
(build-line "lift-4" c (list 1 1 1 0)) (c.append "<br/>")
(build-line "lift-5" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-6" c (list 1 0 0 0)) (c.append "<br/>")
(build-line "lift-7" c (list 0 0 0 1)) (c.append "<br/>")
(build-line "lift-8" c (list 0 0 1 1)) (c.append "<br/>")
(build-line "lift-9" c (list 0 1 1 1)) (c.append "<br/>")
(build-line "lift-10" c (list 0 1 1 1)) (c.append "<br/>")
(build-line "lift-11" c (list 0 0 1 1)) (c.append "<br/>")
(build-line "lift-12" c (list 0 0 0 1)) (c.append "<br/>")
(build-line "lift-13" c (list 1 0 0 0)) (c.append "<br/>")
(build-line "lift-14" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-15" c (list 0 0 1 1)) (c.append "<br/>")
(build-line "lift-16" c (list 0 0 1 1)) (c.append "<br/>")
(build-line "lift-15" c (list 1 1 1 0)) (c.append "<br/>")
(build-line "lift-16" c (list 1 1 1 0)) (c.append "<br/>")
(build-line "lift-17" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-18" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-19" c (list 0 0 1 1)) (c.append "<br/>")
(build-line "lift-18" c (list 1 0 0 0)) (c.append "<br/>")
(build-line "lift-19" c (list 0 0 0 1)) (c.append "<br/>")
(build-line "lift-20" c (list 0 0 1 1)) (c.append "<br/>")
(build-line "lift-21" c (list 0 1 1 1)) (c.append "<br/>")
(build-line "lift-22" c (list 0 1 1 1)) (c.append "<br/>")
(build-line "lift-23" c (list 0 0 1 1)) (c.append "<br/>")
(build-line "lift-24" c (list 0 0 0 1)) (c.append "<br/>")
(build-line "lift-25" c (list 1 0 0 0)) (c.append "<br/>")
(build-line "lift-26" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-27" c (list 1 1 1 0)) (c.append "<br/>")
(build-line "lift-28" c (list 1 1 1 0)) (c.append "<br/>")
(build-line "lift-29" c (list 1 1 0 0)) (c.append "<br/>")
(build-line "lift-30" c (list 1 0 0 0)) (c.append "<br/>")
(build-line "lift-31" c (list 0 0 0 1)) (c.append "<br/>")
))
(define (read-line id c)
......@@ -102,30 +112,29 @@
(read-line "heddle-4" 24))
(build-list
20 (lambda (i)
31 (lambda (i)
(read-line (string-append "lift-" (+ i 1)) 4)))
(repeat (list "fat") 27)))
(repeat (list "fat" "fat-dark") 13)))
(set! weave
(loom-weave l (repeat (list "fat-dark") 30) 0))
(loom-weave l (repeat (list "fat-dark" "fat") 15) 0))
)
(define update-tick 0)
(define (nightjar-intro c)
(build-interface)
(game-modify-render
(lambda (ctx)
(set! update-tick (+ (* 100 (game-time-delta c)) update-tick))
(when (> update-tick 5)
(set! update-tick 0)
(update))
(set! ctx.font "normal 30pt amatic")
(draw-weave ctx 20 20 weave)
(set! ctx.font "normal 40pt amatic"))
(update)
(set! ctx.font "normal 30pt amatic")
(ctx.clearRect 0 0 screen-width screen-height)
(draw-weave ctx 0 0 weave)
(set! ctx.font "normal 40pt amatic")
))
(game-modify-buttons
(list
)
......@@ -143,6 +152,7 @@
"thr-weft-thin.png"
"thr-warp-fat.png"
"thr-weft-fat.png"
"thr-warp-fat-dark.png"
"thr-weft-fat-dark.png"
"tog-off.png"
"tog-on.png"
......
......@@ -664,7 +664,7 @@
(define (top-render)
(when (not (eq? game 0))
(ctx.clearRect 0 0 screen-width screen-height)
; (ctx.clearRect 0 0 screen-width screen-height)
(let ((t (- (js "new Date()") load-time)))
(set! ctx.fillStyle "#fff");
;; (ctx.fillText (+ "Time is: " t) 10 750)
......@@ -678,7 +678,8 @@
(buttons-render! ctx t (game-buttons game))
(draggables-render! ctx t (game-draggables game))
(ctx.restore))
(requestAnimFrame top-render ctx)))
(requestAnimFrame top-render ctx)
))
(define game 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment