-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.html
68 lines (60 loc) · 1.66 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<title>Celtic Knots</title>
</head>
<style>
.framed {
text-align: center;
border-style: solid;
border-width: 10px;
border-color: grey;
padding:20px;
}
</style>
<script src="/celtic/js/bldrs.js"></script>
<script src="/celtic/js/celtic_base.js"></script>
<script src="/celtic/js/celtic_display.js"></script>
<script>
$(document).ready(function(){
let knot = document.getElementById('knot');
knot.innerHTML = bigRandom(); //use functions defined below
});
//some knots to try in code above.
function trefoil(){
let grid = new Grid(3,3);
grid.initialize();
grid.borders();
grid.from(1,3).to(3,3);
let display = new RibbonKnotDisplay(grid, 40, 'white', 'darkblue');
return display.init().build();
};
function figure8(){
let grid = new Grid(3,4);
grid.initialize();
grid.borders();
grid.from(1,1).to(1,3);
grid.from(3,1).to(5,1);
grid.from(3,3).to(5,3);
let display = new RibbonKnotDisplay(grid, 40, 'lightblue', 'orangered');
return display.init().build();
}
function bigRandom(){
let grid = new Grid(10,10);
grid.initialize();
grid.borders();
grid.from(1,1).to(17,17);
grid.randomLines();
let display = new RibbonKnotDisplay(grid, 22, 'white', 'black');
return display.init().build();
}
</script>
<body>
<div id='knot' class='framed'></div>
</body
</html>