-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
182 lines (175 loc) · 8.69 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
182
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>City Comparison</title>
<link rel="shortcut icon" href="img/logo.png"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css?family=Niconne|Cutive" rel="stylesheet" type="text/css">
</head>
<body ng-app="city-comp">
<div class="my-app" ng-controller = "mainCtrl">
<div class="heading text-center">
<h1 class="header">Cities Battle</h1>
</div>
<div class="cities-input" ng-hide = "filledCity">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="form-group text-center" id="city1-input">
<label>City 1:</label>
<input type="text" class="my-input" name="field" ng-model="city1" placeholder="Charlotte,etc..." tabindex="1" autocomplete="off" required>
</div>
<div class="alert alert-danger" ng-show="error1">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Sorry!</strong> This city is not in our database yet. Please pick another city to compare...
</div>
</div>
<div class="col-md-6">
<div class="form-group text-center" id="city1-input">
<label>City 2:</label>
<input type="text" class="my-input1" ng-model="city2" name="field" placeholder="San Francisco,etc..." tabindex="1" autocomplete="off" required>
</div>
<div class="alert alert-danger" ng-show="error2">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Sorry!</strong> This city is not in our database yet. Please pick another city to compare...
</div>
</div>
</div>
<div class="button compare-button text-center">
<button class="my-btn" ng-show="!filledCity&&validCity1&&validCity2" ng-click="compare()">Compare</button>
</div>
<div class="footer footer-front-page text-center">
<p>Made with <i class="fa fa-heart" aria-hidden="true"></i> by Lina!</p>
</div>
</div>
</div>
<div class="main" ng-show="filledCity">
<div class="result container" >
<div class="maps">
<img class="img-responsive img-thumbnail map" ng-src="{{city1Map || ''}}" alt="city1Map" >
<img class="img-responsive img-thumbnail map" ng-src="https://maps.googleapis.com/maps/api/staticmap?size=640x250&maptype=roadmap\ &markers=size:mid%7Ccolor:red%7C{{city1Basic.name || ''}},{{city1Basic.admin1DivisionCode || ''}}%7C{{city2Basic.name || ''}},{{city2Basic.admin1DivisionCode || ''}}&key=AIzaSyBD1-sGnREhhLAout5UUgMw4CihhLJmGPA" alt="cityMap">
<img class="img-responsive img-thumbnail map" ng-src="{{city2Map || ''}}" alt="city2Map">
</div>
<div class="row cityBasics">
<div class="col-sm-6 cityRes" id="city1">
<h2 class="cityName text-center">{{city1Basic.title}}</h2>
<img class="cityImg img-thumbnail img-responsive" ng-src="{{city1Img || ''}}" alt="city1Img">
<p class = "population">Population: {{city1Basic.population}} people.</p>
<p ng-bind-html="renderHtml(city1Info.summary)"></p>
</div>
<div class="col-sm-6 cityRes" id="city2">
<h2 class="cityName text-center">{{city2Basic.title}}</h2>
<img class="cityImg img-thumbnail img-responsive" ng-src="{{city2Img || ''}}" alt="city1Img">
<p class = "population">Population: {{city2Basic.population}} people.</p>
<p ng-bind-html="renderHtml(city2Info.summary)"></p>
</div>
</div>
<div class="row cityStats">
<h3 class="section-header text-center">Statistics (Score out of 10)</h3>
<div class="col-sm-6">
<div class="stats" ng-repeat="score in city1Info.categories track by $index">
<p>{{score.name}}</p>
<div class="progress">
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="{{score.score_out_of_10}}" aria-valuemin="0" aria-valuemax="10" style="width: {{percentage(score.score_out_of_10)}}%;">
<span>{{round(score.score_out_of_10)}}</span>
</div>
</div>
</div>
<h4 class="avg-score" ng-class="{'winner':average(city1Info.categories)>average(city2Info.categories)}">Average score: {{average(city1Info.categories)}}</h4>
</div>
<div class="col-sm-6">
<div class="stats" ng-repeat="score in city2Info.categories track by $index">
<p>{{score.name}}</p>
<div class="progress">
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="{{score.score_out_of_10}}" aria-valuemin="0" aria-valuemax="10" style="width: {{percentage(score.score_out_of_10)}}%;">
<span>{{round(score.score_out_of_10)}}</span>
</div>
</div>
</div>
<h4 class="avg-score" ng-class="{'winner':average(city2Info.categories)>average(city1Info.categories)}">Average score: {{average(city2Info.categories)}}</h4>
</div>
</div>
<div class="row cityPhotos">
<h3 class="section-header text-center">Photos</h3>
<div class="col-sm-6 photos-box">
<h4 class="box-city-name">{{city1Basic.title}}</h4>
<div ng-repeat="photo in city1Photos" class="inline-block">
<img class="img-responsive img-thumbnail" ng-src="https://farm{{photo.farm}}.staticflickr.com/{{photo.server}}/{{photo.id}}_{{photo.secret}}.jpg" alt="city1Photos">
</div>
</div>
<div class="col-sm-6 photos-box">
<h4 class="photos-city-name">{{city2Basic.title}}</h4>
<div ng-repeat="photo in city2Photos" class="inline-block">
<img class="img-responsive img-thumbnail" ng-src="https://farm{{photo.farm}}.staticflickr.com/{{photo.server}}/{{photo.id}}_{{photo.secret}}.jpg" alt="city2Photos">
</div>
</div>
</div>
<div class="row cityVideos">
<h3 class="section-header text-center">Videos</h3>
<div class="col-sm-6 videos-box">
<h4 class="videos-city-name">{{city1Basic.title}}</h4>
<div ng-repeat="video in city1Videos">
<iframe class="embed-responsive-item" ng-src="{{ trustSrc(embedUrl + video.id.videoId) }}" frameborder="1"></iframe>
</div>
</div>
<div class="col-sm-6 photos-box">
<h4 class="box-city-name">{{city2Basic.title}}</h4>
<div ng-repeat="video in city2Videos">
<iframe class="embed-responsive-item" ng-src="{{ trustSrc(embedUrl + video.id.videoId) }}" frameborder="1"></iframe>
</div>
</div>
</div>
<h4 class="summary">Due to statistics of teleport.org {{winner}} is better city than {{looser}}!</h4>
<div class="row cityPlaces">
<h3 class="section-header text-center">Here is something to do in {{winner}}</h3>
<div class="places-box">
<div class="places-info" ng-repeat="place in winnerPlaces track by $index">
<div class="col-sm-8 main-attributes">
<div class="row">
<div class="col-sm-offset-2 col-sm-2 media-ava">
<img class="img-thumbnail" ng-src="{{place.image_url || ''}}" alt="place-img">
</div>
<div class="col-sm-8 media-story">
<h5 class="title"><a href="{{place.url}}" target="_blank">{{place.name}}</a></h5>
<h6 class="raiting">Rating: {{place.rating}}<span class="reviews">- {{place.review_count}} reviews.</span></h6>
<span class="categories" ng-repeat="category in place.categories track by $index">#{{category[0]}}</span>
</div>
</div>
</div>
<div class="col-sm-4 secondary-attributes">
<address>
{{place.location.address[0]}}
<br>
{{place.location.city}},{{place.location.state_code}}
</address>
<span class="phone">Phone: {{place.display_phone}}</span>
</div>
</div>
</div>
</div>
<div class="button reset-button text-center">
<button class="my-btn" ng-show="filledCity" ng-click="reset()">Compare other cities <i class="fa fa-refresh fa-spin" aria-hidden="true"></i></button>
</div>
<div class="footer footer-result-page text-center">
<p>Made with <i class="fa fa-heart" aria-hidden="true"></i> by Lina!</p>
</div>
</div>
</div>
</div>
</div>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="js/teleport-autocomplete.js"></script>
<script src="js/app.js"></script>
<script src="js/teleport-api.js"></script>
<script src="js/yelp-api.js"></script>
<script src="js/flickr-api.js"></script>
<script src="js/youtube-api.js"></script>
</body>
</html>