-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
109 lines (100 loc) · 4.72 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
<!DOCTYPE html>
<html>
<head>
<!-- jQuery and bootstrap js files -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<!-- My own JavaScript -->
<script type="text/javascript" src="handler.js"></script>
<script type="text/javascript" src="functions.js"></script>
<!-- character encoding so that it will be easier for mobile devices -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- bootstraps css files (CDN) -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<!-- my costum bootstrap css -->
<link rel="stylesheet" type="text/css" href="custom.css">
<!-- Optional Bootstrap theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
<!-- favicon -->
<link href='favicon' type='image/x-icon'/ >
<title>Methinks it is like a weasel</title>
</head>
<body>
<div class="page-header">
<h1>A Selective Evolution Program<br>
<small>Inspired by Richard Dawkins</small></h1>
</div>
<div class="row">
<div class="center-block">
<!-- INPUTS/OUTPUTS -->
<div class="input-group input-group-lg">
<span class="input-group-addon">Evolve this string:</span>
<input type="text" id="start_text" class="form-control" placeholder="(leave empty for random)" autofocus>
</div>
<div class="input-group input-group-lg">
<span class="input-group-addon">Using these characters:</span>
<input type="text" id="characters" class="form-control" value=" abcdefghijklmnopqrstuvwxyz">
</div>
<div class="input-group input-group-lg">
<span class="input-group-addon">Into this string:</span>
<input type="text" id="target_text" class="form-control" value="methinks it is like a weasle">
</div>
<div class="input-group input-group-lg">
<span class="input-group-addon">Best offspring:</span>
<input type="text" id="output_text" class="form-control" readonly="readonly">
</div>
<div class="input-group input-group-lg">
<span class="input-group-addon">Generations:</span>
<input type="text" id="generations" class="form-control" value="0" readonly="readonly">
</div>
</div>
</div> <!-- row -->
<!-- BUTTONS -->
<div class="btn-group">
<button class="btn btn-primary btn-lg" type="button" id="start"><span class="glyphicon glyphicon-play"></button>
<button class="btn btn-primary btn-lg" type="button" id="stop"><span class="glyphicon glyphicon-pause"></button>
<!--window.location.reload()-->
<button class="btn btn-primary btn-lg" type="button" id="reset"><span class="glyphicon glyphicon-refresh"></button>
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" type="button" data-toggle="modal" data-target="#myModal"><span class="glyphicon glyphicon-cog"></button>
</div>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">Settings</h4>
</div>
<!-- SETTINGS -->
<div class="modal-body">
<div id="settings">
<div class="input-group">
<span class="input-group-addon">Mutation:</span>
<input id="mutation_rate" type="number" value="5" class="form-control">
<span class="input-group-addon">%</span>
</div> <!-- input-group -->
<div class="input-group">
<span class="input-group-addon">Offspring:</span>
<input id="amount_offspring" type"number" value="100" class="form-control">
<span class="input-group-addon">/generation</span>
</div> <!-- input-group -->
<div class="input-group">
<span class="input-group-addon">delay:</span>
<input id="delay" type="text" max="100" min="1" value="50" class="form-control">
<span class="input-group-addon">ms</span>
</div> <!-- input-group -->
</div> <!-- /settings -->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Return</button>
</div>
</div>
</div>
</div>
<hr>
<div id=footer>
<p><b>This is a final project made by <a href="https://github.com/TheFelixR/weasleprogram">Felix Rosén </a>for CS50x</b></p>
</div>
</body>
</html>