-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsix-degs-app.html
61 lines (52 loc) · 2.54 KB
/
six-degs-app.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
<html><head><link rel="import" href="player-path.html">
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/core-header-panel/core-header-panel.html">
<link rel="import" href="bower_components/core-ajax/core-ajax.html">
<link rel="import" href="bower_components/core-toolbar/core-toolbar.html">
<link rel="import" href="bower_components/font-roboto/roboto.html">
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">
<link rel="import" href="bower_components/paper-checkbox/paper-checkbox.html">
<!--
##### Example
<six-degs-app></six-degs-app>
@element six-degs-app
@blurb Element providing solution to [...].
@status [...]
-->
</head><body><polymer-element name="six-degs-app">
<template>
<link rel="stylesheet" href="six-degs-app.css">
<core-header-panel fit mode="waterfall">
<core-toolbar>
<div>6 Degrees of the NBA</div>
</core-toolbar>
<div class="content-wrapper">
<div layout horizontal around-justified>
<div class="welcome">
I wrote this after reading <a href="http://www.reddit.com/r/nba/comments/1lnjlz/lets_play_6_degrees_of_separation_hardcourt/">
this Reddit thread</a> using data from <a href="http://www.basketball-reference.com">basketball-reference.com</a>. Just enter
the names of any two NBA players and click "Find Path".
</div>
</div>
<div flex layout horizontal around-justified wrap>
<paper-input id="source" floatinglabel label="Source Player" value="Kobe Bryant"></paper-input>
<paper-input id="dest" floatinglabel label="Destination Player" value="Jerry West"></paper-input>
</div>
<div flex layout horizontal around-justified>
<paper-button raised on-tap="{{getPath}}">
Find path
</paper-button>
</div>
<div flex layout horizontal around-justified class="show-teams-wrapper">
<paper-checkbox label="Show Teams" checked="{{showTeams}}"></paper-checkbox>
</div>
<player-path showTeams?="{{showTeams}}" data="{{data}}" loading="{{loading}}"></player-path>
</core-header-panel>
</div>
<core-ajax id="ajax" method="POST" url="http://six-degrees-nba.appspot.com/pathfinder"
body="{source:1, dest:2}" response="{{data}}" handleas="json" loading="{{loading}}">
</core-ajax>
</template>
<script src="six-degs-app.js"></script>
</polymer-element></body></html>