Commit ef8d4895 authored by Dave Griffiths's avatar Dave Griffiths

tablet weaving stuff

parent b7516914
......@@ -7,7 +7,7 @@ html, body {
font-family: 'amatic';
color: #000;
font-size: 20;
background: #777;
background: #fff;
// cursor: url(images/mouse.png), default;
}
......
......@@ -118,20 +118,25 @@
(define pos 10)
(define (card-to-direction card)
(if (eq? (card-memory card) "b")
(if (eq? (card-angle card) "z") "front" "back")
(if (eq? (card-angle card) "z") "back" "front")))
(define (card-loom-weave-top loom)
(define canvas (document.getElementById "canvas"))
(define ctx (canvas.getContext "2d"))
(set! pos (+ pos 14))
(index-for-each
(lambda (i card)
(let ((direction (if (eq? (card-angle card) "z") "front" "back"))
(let ((direction (card-to-direction card))
(colour (if (eq? (car (card-weave card)) "#") "black" "white")))
(ctx.drawImage (find-image (string-append "tabwarp-" direction "-" colour ".png"))
(* i 7) pos)))
(card-loom-cards loom))
(index-for-each
(lambda (i card)
(let ((direction (if (eq? (card-angle card) "s") "front" "back"))
(let ((direction (card-to-direction card))
(colour (if (eq? (cadr (card-weave card)) "#") "black" "white")))
(ctx.drawImage (find-image (string-append "tabwarp-" direction "-" colour ".png"))
(+ (* i 7) 80) pos)))
......@@ -305,13 +310,3 @@
"#" "#"
"." ".")
)))
;(load-images!
; (append
; (list
; "tabwarp.png"
; "tabwarp-black.png"
; ))
; (lambda ()
; (display "ello")
; ))
<!DOCTYPE html>
<html>
<html style="background:#aaa;">
<head>
<title>tablet weave livecoding</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<body>
<body style="background:#aaa;">
<div style="width:50%; margin:0 auto; float:left;">
<h1>tablet weave livecoding</h1>
......@@ -19,16 +19,18 @@
(weave-forward 8)
(weave-back 8)
(twist 0 2 4 6)
(weave-forward 8)
(weave-back 8)
</textarea>
<input type="submit" value="weave">
(repeat 4
(weave-forward 2)
(weave-back 3))
</textarea></br>
<input type="submit" value="weave me">
</form>
<h2>output</h2>
<pre><div id="output"></div></pre>
<h2>compiler</h2>
<!-- <h2>compiler</h2> -->
<pre><div id="compiled" style="visibility:hidden;"></div></pre>
......
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