-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
181 lines (172 loc) · 5.06 KB
/
index.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!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>
<script src="js/portia.js"></script>
<script src="js/caskets.js"></script>
<title>Portia's Caskets</title>
</head>
<style>
body {
background-color:lightgrey;
}
ul {
padding-left: 40px;
list-style-type: none;
}
li {
padding-bottom: 10px;
}
table, tr {
padding: 4px;
text-align: center;
border: 1px solid black;
border-collapse: collapse;
margin: auto;
}
th, td {
padding: 10px;
}
.buttonDiv {
display: inline-block;
padding: 2px;
border: 2px;
}
.centered {
text-align: center;
}
.puzzle-text {
font-style: italic;
font-size: large;
}
.main-column {
background-color:white;
}
</style>
<script>
let portia1_puzzles = [];
let portia2_puzzles = [];
let portia3_puzzles = [];
//load data
$(document).ready(function(){
console.log("about to fetch remote data");
$.getJSON("data/portia2.json", function(data){
portia2_puzzles = data;
})
$.getJSON("data/portia3.json", function(data){
portia3_puzzles = data;
})
$.getJSON("data/portia1.json", function(data){
portia1_puzzles = data;
}).done(function() {
reset();
});
});
//initialize display
$(document).ready(function(){
console.log('initializing controllers');
//initialize buttons
$("#resetButton").on("click", function(){
reset();
});
$('.puzzleTypeBtn').on("click", function(event){
portia.version = parseInt(event.currentTarget.id);
console.log("portia puzzle type: " + portia.version);
setButtons();
reset();
});
//setup display
display.result = document.getElementById("solutionDisplay");
display.versionDescription = document.getElementById("versionDescription");
display.puzzleDescription = document.getElementById("puzzleDescription");
display.casketDisplay = document.getElementById("caskDisplay");
});
//additional functions
function setButtons() {
$(".btn-primary").addClass("btn-secondary");
$(".btn-primary").removeClass("btn-primary");
$("#" + portia.version).addClass("btn-primary");
$("#" + portia.version).removeClass("btn-secondary");
};
function reset() {
selectPuzzle();
puzzleReset();
};
function selectPuzzle() {
if (portia.version === 1){
portia.puzzles = portia1_puzzles;
} else if (portia.version === 2){
portia.puzzles = portia2_puzzles;
} else {
portia.puzzles = portia3_puzzles;
}
};
</script>
<body>
<nav class="navbar navbar-default" style="margin-bottom:0px">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="..">
<img src="imgs/github_badge1.png" style="max-width:100%;max-height:100%" >
</a>
<p class="navbar-text navbar-right">
<a href=".." class="navbar-link">dmackinnon1.github.io</a>
</p>
</div>
</div>
</nav>
<div class="container-fluid">
<div class='row'>
<div class='col-sm-0 col-md-1 col-lg-3'></div>
<div class='col-sm-12 col-md-10 col-lg-6 main-column'>
<div class="page-header">
<h1>Portia's Caskets</h1>
</div>
<p>
In Shakespeare's <em>The Merchant of Venice</em>, Portia vetted her suitors by asking them to uncover which of
three caskets concealed her portrait, while inscriptions on the caskets presented riddles that tested the virtue of her
potential partners. In the classic <em>What is the Name of this Book?</em> logician Raymond Smullyan imagined
several generations of clever Portias presenting suitors with caskets inscribed with statements that together formed a
logic puzzles whose solution would lead to the portrait.
Our Portias are friendly algorithms that spend their time generating logic puzzles for your enjoyment; no offers of
marriage are on the table. Your goal is to select the correct casket based on the clues presented by the casket inscriptions.
</p>
<br>
<p>
Use this page to try your luck, and puzzle solving skills, with three generations of Portias.
</p>
<hr>
<div class="centered">
<div class="btn-group btn-group-md " role="group">
<button type="button" id="1" class="puzzleTypeBtn btn btn-primary">Portia I</button>
<button type="button" id="2" class="puzzleTypeBtn btn btn-secondary">Portia II</button>
<button type="button" id="3" class="puzzleTypeBtn btn btn-secondary">Portia III</button>
</div>
</div>
<hr>
<div id="versionDescription"></div>
<br>
<div id="puzzleDescription" class='puzzle-text centered'></div>
<hr>
<div id="caskDisplay" class="centered" style="text-align=center"></div>
<br>
<div id="solutionDisplay" class="puzzle-text centered"></div>
<hr>
<div id="resetButtonHolder">
<button type="button" id="resetButton", class="btn btn-secondary typeButton">New Puzzle</span></button>
</div>
<br>
<br>
<img src="imgs/casketscene.jpg" style="max-width:100%;max-height:100%" >
<br>
<br>
</div>
<div class='col-sm-0 col-md-1 col-lg-3'></div>
</div>
</div>
</body>
</html>