-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
84 lines (73 loc) · 1.82 KB
/
index.html
File metadata and controls
84 lines (73 loc) · 1.82 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Colors!</title>
<style>
input{
display: block;
padding: 5px;
margin: 5px 0;
}
button{
display: block;
padding: 5px;
margin: 5px 0;
background-color: #0bc;
text-align: center;
}
button:hover {
background-color: #0aa;
}
.color-test {
display: inline-block;
height: 200px;
width: 200px;
border: 2px solid #000;
margin-top: 10px;
margin-bottom: 10px;
border-radius: 200px;
}
#color_display {
/*width: 600px;*/
clear: both;
}
.color {
display: block;
height: 200px;
border: none;
float: left;
}
</style>
<script type="text/javascript" src="js/jquery-git2.min.js"></script>
<script type="text/javascript" src="js/underscore.js"></script>
<script type="text/javascript" src="js/backbone-min.js"></script>
</head>
<body>
<!-- <p>Color 1</p>
<input id="color1-input" type="text" placeholder="rgb or hex"/>
<p>Color 2</p>
<input id="color2-input" type="text" placeholder="rgb or hex"/>
<button>Submit!</button>
<div class="container">
<div id="color1" class="color-test"></div>
<div id="color3" class="color-test"></div>
<div id="color2" class="color-test"></div>
</div> -->
<div id="color_display">
</div>
<script type="text/javascript" src="js/ColorModel.js"></script>
<script type="text/javascript" src="js/ColorCollectionView.js"></script>
<script type="text/javascript">
var color1 = new ColorModel({hex: '#516FF0'});
var color2 = new ColorModel({hex: '#F0D251'});
var color3 = new ColorModel({hex: '#D551F0'});
var colorCollection = new Backbone.Collection([color1, color2, color3]);
var rootElement = document.querySelector("#color_display");
var colorCollectionView = new ColorCollectionView({
el: rootElement,
collection: colorCollection
});
colorCollectionView.render();
</script>
</body>
</html>