-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
160 lines (146 loc) · 8.85 KB
/
index.html
File metadata and controls
160 lines (146 loc) · 8.85 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
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
<!doctype html>
<html ng-app="nbaOneOnOneApp">
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-route.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-sanitize.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-select/0.13.1/select.min.css">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-select/0.13.1/select.min.js"></script>
<script src="js/ui-bootstrap-tpls-0.13.4.min.js"></script>
<script src="js/controllers.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-68479323-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body ng-controller="oneOnOneController">
<script type="text/ng-template" id="myModalContent.html">
<div class="modal-header">
<h3 class="modal-title">{{offensivePlayer.DISPLAY_LAST_COMMA_FIRST}} vs {{shot.CLOSEST_DEFENDER}}, {{shot.MATCHUP}}</h3>
<h4>Period: {{shot.PERIOD}} | Clock: {{shot.GAME_CLOCK}} | Distance: {{shot.SHOT_DIST}} ft | {{shot.SHOT_RESULT}}</h4>
</div>
<div class="modal-body">
<iframe style="height: 400px; border: none; width:100%" ng-src="{{trustAsResourceUrl(iFrameUrl)}}"></iframe>
</div>
<div class="modal-footer">
<button class="btn btn-warning" type="button" ng-click="cancel()">Cancel</button>
</div>
</script>
<h1 align="center">One On One</h1>
<div class="container-fluid" ng-hide="eligiblePlayersLoaded">
<h3 align="center">Loading players...</h3>
</div>
<div class="container-fluid" ng-show="eligiblePlayersLoaded">
<div class="row">
<div class="col-sm-3 col-sm-offset-3">
<label>Offensive Player:</label>
<ui-select ng-model="playerOne.selected" theme="bootstrap" reset-search-input="true">
<ui-select-match placeholder="Player 1 Name">{{$select.selected.DISPLAY_LAST_COMMA_FIRST}}</ui-select-match>
<ui-select-choices repeat="playerOne in searchResultPlayerObjects" refresh="refreshPlayers($select.search)" refresh-delay="0">
<div ng-bind-html="playerOne.DISPLAY_LAST_COMMA_FIRST | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
<div class="col-sm-3">
<label>Defensive Player:</label>
<ui-select ng-model="playerTwo.selected" theme="bootstrap" reset-search-input="true">
<ui-select-match placeholder="Player 2 Name">{{$select.selected.DISPLAY_LAST_COMMA_FIRST}}</ui-select-match>
<ui-select-choices repeat="playerTwo in searchResultPlayerObjects" refresh="refreshPlayers($select.search)" refresh-delay="0">
<div ng-bind-html="playerTwo.DISPLAY_LAST_COMMA_FIRST | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
</div>
<div class="row top-buffer">
<div class="col-sm-6 col-sm-offset-3" align="center">
<button type="button" class="btn btn-default" ng-click="switchMatchup()" ng-show="playerOne.selected && playerTwo.selected">Switch Matchup</button>
<button type="button" class="btn btn-disabled" ng-hide="playerOne.selected && playerTwo.selected">Switch Matchup</button>
<button type="button" class="btn btn-default" ng-click="getShareableLink()" ng-show="playerOne.selected && playerTwo.selected">Shareable Link</button>
<button type="button" class="btn btn-disabled" ng-hide="playerOne.selected && playerTwo.selected">Share Matchup</button>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row top-buffer">
<div class="col-sm-3 col-sm-offset-3">
<div ng-repeat="(season,selected) in seasons">
<label align="right" class="custom-vertical visible-md-block visible-lg-block"><input type="checkbox" ng-model="seasons[season]"/> {{season}}</label>
<label align="center" class="visible-xs-block visible-sm-block"><input type="checkbox" ng-model="seasons[season]"/> {{season}}</label>
</div>
</div>
<div class="col-sm-3">
<div ng-repeat="(seasonType, selected) in seasonTypes">
<label class="custom-vertical visible-md-block visible-lg-block"><input type="checkbox" ng-model="seasonTypes[seasonType]"> {{seasonType}}</label>
<label align="center" class="visible-xs-block visible-sm-block"><input type="checkbox" ng-model="seasonTypes[seasonType]"> {{seasonType}}</label>
</div>
</div>
</div>
</div>
<div class="container" ng-show="eligiblePlayersLoaded">
<div class="row top-buffer">
<div class="col-sm-6 col-sm-offset-3">
<button type="button" class="btn btn-primary btn-block" ng-show="playerOne.selected && playerTwo.selected && verifySeasonSelected() && !shotsLoading && !shotsLoaded" ng-click="getShots()">Show shots</button>
<button type="button" class="btn btn-primary btn-block disabled" ng-show="playerOne.selected && playerTwo.selected && shotsLoading && !shotsLoaded">Loading shots</button>
<button type="button" class="btn btn-primary btn-block disabled" ng-hide="playerOne.selected && playerTwo.selected && verifySeasonSelected()">Show Shots</button>
<button type="button" class="btn btn-primary btn-block disabled" ng-show="playerOne.selected && playerTwo.selected && !shotsLoading && shotsLoaded">{{shotsVsDefender | numberMadeShots}} for {{shotsVsDefender.length}} ({{shotsVsDefender | percentageMadeShots}}%)</button>
</div>
</div>
</div>
<div ng-show="shotsLoaded" class="container-fluid">
<div class="row top-buffer" ng-hide="shotsVsDefender.length && !shotsLoading">
<h3 align="center">No shots found :/</h3>
<h5 align="center">Players at the same position work best</h5>
</div>
<div class="row top-buffer">
<div class="col-sm-6 col-sm-offset-3">
<accordion>
<accordion-group ng-repeat="(matchup, shots) in shotsVsDefenderGroupedByGame">
<accordion-heading>
<button class="btn-default">+</button> {{matchup}}
<div class="visible-md-inline-block visible-lg-inline-block">{{shots | numberMadeShots}} for {{shots.length}} ({{shots | percentageMadeShots}}%)</div>
<div class="visible-sm-inline-block">[{{shots | numberMadeShots}}/{{shots.length}}] ({{shots | percentageMadeShots}}%)</div>
<div class="visible-xs-inline-block">[{{shots | numberMadeShots}}/{{shots.length}}]</div>
</accordion-heading>
<span ng-show="isErrorGame(matchup)">Due to inconsistencies in the NBA stat counting, some videos for this game may be incorrect. The vast majority of games do not have any inconsistencies.</span>
<div class="table-responsive">
<table class="table">
<tr>
<td><b>Period</td>
<td><b>Clock</td>
<td><b>Value</td>
<td><b>Dist(ft)</td>
<td><b>Result</td>
</tr>
<tr ng-repeat="shot in shots">
<td>{{ shot.PERIOD }}</td>
<td>{{ shot.GAME_CLOCK }}</td>
<td>{{ shot.PTS_TYPE }}</td>
<td>{{ shot.SHOT_DIST}}</td>
<td>
{{ shot.SHOT_RESULT }} | <a href="" ng-click="showVideo(shot)">VIDEO</a>
</td>
</tr>
</table>
</div>
</accordion-group>
</accordion>
</div>
</div>
</div>
</body>
<footer align="center">
<p>Posted by: Pranav Badami</p>
<p>Contact information: <a href="pranavbadami@gmail.com">
pranavbadami@gmail.com</a>.</p>
</footer>
</html>