Skip to content

Commit

Permalink
✨ add soccer (NCAA) as supported sport
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenank committed Sep 14, 2022
1 parent 76fad1f commit d560a71
Show file tree
Hide file tree
Showing 9 changed files with 865 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

![A screenshot of the web application.](./resources/ice-hockey-screenshot.png)

**04/02/22: The ability to filter rows based on their column values has been added!**
**09/13/22: Soccer (NCAA) has been added as a playing area**

A [web application](https://shot-plotter.netlify.app/) for plotting events on a sport's playing area with a single click, while keeping track of any other details. The application supports download and upload of .csv files to retrieve that plotted data.

Currently 12 different playing areas across 8 different sports are supported: ice hockey (NHL, IIHF), floorball (IFF), handball (IHF), volleyball (NCAA), basketball (NBA, NCAA, WNBA), men's lacrosse (NCAA), women's lacrosse (NCAA), and American football (NFL, NCAA).
Currently 13 different playing areas across 9 different sports are supported: ice hockey (NHL, IIHF), floorball (IFF), handball (IHF), volleyball (NCAA), basketball (NBA, NCAA, WNBA), men's lacrosse (NCAA), women's lacrosse (NCAA), American football (NFL, NCAA), and soccer (NCAA).

![A screenshot of the main page of the web application allowing you to pick between sports.](./resources/sport-select-screenshot.png)

Expand Down
131 changes: 131 additions & 0 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

<body>
<!-- inject:banner -->
<div class="alert alert-info" role="alert">
<b>09/13/22:</b> Soccer (NCAA) has been added as a playing area!
</div>
<!-- endinject -->
<div class="center header">
<h1>Shot-Plotter</h1>
Expand Down Expand Up @@ -2661,6 +2664,134 @@ <h6 class="card-title">
Football (NCAA)
</button>
</div>
</a>
<a href="./soccer-ncaa" class="card" id="soccer-ncaa">
<div class="card-header">
<!-- inject:cardplayingarea -->
<svg id="soccer-ncaa-svg" xmlns="http://www.w3.org/2000/svg" width="100%" viewBox=" -1 -1 122 77">
<g id="transformations">
<clipPath id="clipBorder">
<path d=" M 0 0
L 120 0
L 120 75
L 0 75
Z" />
</clipPath>
<path id="background" d="
M 0 0
L 120 0
L 120 75
L 0 75
Z" stroke="transparent" fill="#036602"></path>
<path id="halfway-line" d="M 60 0 L 60 75" stroke-width="0.1389" stroke="white"></path>
<circle id="halfway-circle" cx="60" cy="37.5" r="10" fill="transparent" stroke-width="0.1389" stroke="white">
</circle>
<path id="outside-perimeter" d="
M 0 0
L 120 0
L 120 75
L 0 75
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<g id="left-goal-area">
<path id="left-eighteen-yd-box" d="
M 0 15.5
L 18 15.5
L 18 59.5
L 0 59.5
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="left-goal-area" d="
M 0 27.5
L 6 27.5
L 6 47.5
L 0 47.5
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="left-penalty-kick-mark" d="
M 12 37.167
L 12 37.8333
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="left-goal-arc" d="
M 18 29.5
A 10 10 1 0 1 18 45.5
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>

<path id="goal-line" d="
M 0 33.5
L 0 41.5" stroke-width="0.75" stroke="white"></path>
<path id="top-left-corner" d="
M 1 0
A 1 1 1 0 1 0 1
" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="top-right-corner" d="
M 0 74
A 1 1 0 0 1 1 75
" stroke-width="0.1389" stroke="white" fill="transparent"></path>
</g>
<g id="right-goal-area" transform="translate(120 75) rotate(180)">
<path id="right-eighteen-yd-box" d="
M 0 15.5
L 18 15.5
L 18 59.5
L 0 59.5
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="right-goal-area" d="
M 0 27.5
L 6 27.5
L 6 47.5
L 0 47.5
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="right-penalty-kick-mark" d="
M 12 37.167
L 12 37.8333
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="right-goal-arc" d="
M 18 29.5
A 10 10 1 0 1 18 45.5
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>

<path id="goal-line" d="
M 0 33.5
L 0 41.5" stroke-width="0.75" stroke="white"></path>
<path id="top-right-corner" d="
M 1 0
A 1 1 1 0 1 0 1
" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="top-right-corner" d="
M 0 74
A 1 1 0 0 1 1 75
" stroke-width="0.1389" stroke="white" fill="transparent"></path>
</g>
</g>
</svg>
<!-- endinject -->
</div>
<div class="card-body">
<h6 class="card-title">
Soccer (NCAA)
</h6>
<div class="card-text">
<div>
<span class="bold">Dimensions: </span><span>
120 x 75
</span>
</div>
<div>
<span class="bold">Units: </span><span>
yards
</span>
</div>
<div>
<span class="bold">Specifications: </span><span>
National Collegiate Athletic Association (2022 & 2023)
</span>
</div>
</div>
</div>
<div class="card-footer text-center white-bg">
<button type="button" class="grey-btn card-btn">
Go To
Soccer (NCAA)
</button>
</div>
</a>
<!-- endinject -->
</div>
Expand Down
204 changes: 204 additions & 0 deletions html/soccer-meerse.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
<!DOCTYPE html>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/resources/favicon.svg" />
<link rel="mask-icon" href="/resources/favicon.svg" color="red" />

<!-- inject:analytics -->
<!-- Plausible -->
<script defer data-domain="shot-plotter.netlify.app" src="https://plausible.io/js/plausible.js"></script>
<!-- endinject -->

<title>Shot-Plotter</title>

<!-- Google fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600" rel="stylesheet" type="text/css" />

<!-- lodash -->
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>

<!-- UUID -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/uuid/8.1.0/uuidv4.min.js"></script>

<!-- downloadjs -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/downloadjs/1.4.8/download.min.js" integrity="sha512-WiGQZv8WpmQVRUFXZywo7pHIO0G/o3RyiAJZj8YXNN4AV7ReR1RYWVmZJ6y3H06blPcjJmG/sBpOVZjTSFFlzQ==" crossorigin="anonymous"></script>

<!-- PapaParse -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js" integrity="sha512-rKFvwjvE4liWPlFnvH4ZhRDfNZ9FOpdkD/BU5gAIA3VS3vOQrQ5BjKgbO3kxebKhHdHcNUHLqxQYSoxee9UwgA==" crossorigin="anonymous"></script>

<!-- D3.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/6.6.0/d3.min.js" integrity="sha512-XgjkLS0sSzUq88GniFcrLy6zjgVWkBoRFziaLm1Z+gVgkHuO3ieikhD/Q6eNKXAsp88yvBFS0n6ovVlabXftIg==" crossorigin="anonymous"></script>

<!-- SortableJS :: Latest (https://www.jsdelivr.com/package/npm/sortablejs) -->
<script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>

<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<!-- Select2 -->
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>

<!-- TockTimer -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocktimer/1.1.0/tock.min.js" integrity="sha512-vq5wJzEIsMaUGpNliTdBuAuvevdVhlFcbSKtz+YgJwfriIN03L20HoPnmywMcmjom64KLcjnBfTV3CSn2Y0rOg==" crossorigin="anonymous" referrerpolicy="no-referrer">
</script>

<!-- Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.min.js" integrity="sha384-j0CNLUeiqtyaRmlzUHCPZ+Gy5fQu0dQ6eZ/xAww941Ai1SxSY+0EQqNXNE6DZiVc" crossorigin="anonymous"></script>

<!-- Bootstrap Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/font/bootstrap-icons.css" />
<link rel="stylesheet" href="/index.css" />
</head>

<body>
<!-- inject:banner -->
<!-- endinject -->
<div class="center header">
<h1>Shot-Plotter</h1>
</div>
<div class="center medium-text">
A graphical interface for tracking locational events in sports.
Click on the playing area to log an event!
</div>
<hr />

<div class="main">
<div id="details" class="shot-info"></div>
<div class="center">
<div>
<div id="toggles">
</div>
<div id="playing-area">
<!-- inject:playingarea -->
<svg id="soccer-meerse-svg" xmlns="http://www.w3.org/2000/svg" width="100%" viewBox=" -1 -1 117 72">
<g id="transformations">
<clipPath id="clipBorder">
<path d=" M 0 0
L 115 0
L 115 70
L 0 70
Z" />
</clipPath>
<path id="background" d="
M 0 0
L 115 0
L 115 70
L 0 70
Z" stroke="transparent" fill="#036602"></path>
<path id="halfway-line" d="M 57.5 0 L 57.5 70" stroke-width="0.1389" stroke="white"></path>
<circle id="halfway-circle" cx="57.5" cy="35" r="10" fill="transparent" stroke-width="0.1389" stroke="white">
</circle>
<path id="outside-perimeter" d="
M 0 0
L 115 0
L 115 70
L 0 70
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<g id="left-goal-area">
<path id="left-eighteen-yd-box" d="
M 0 13
L 18 13
L 18 57
L 0 57
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="left-goal-area" d="
M 0 25
L 6 25
L 6 45
L 0 45
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="left-penalty-kick-mark" d="
M 12 34.666
L 12 35.333
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="left-goal-arc" d="
M 18 27
A 10 10 1 0 1 18 43
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="goal-line" d="
M 0 31
L 0 39" stroke-width="0.75" stroke="white"></path>
<path id="top-left-corner" d="
M 1 0
A 1 1 1 0 1 0 1
" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="top-right-corner" d="
M 0 69
A 1 1 0 0 1 1 70
" stroke-width="0.1389" stroke="white" fill="transparent"></path>
</g>
<g id="right-goal-area" transform="translate(115, 70) rotate(180)">
<path id="right-eighteen-yd-box" d="
M 0 13
L 18 13
L 18 57
L 0 57
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="right-goal-area" d="
M 0 25
L 6 25
L 6 45
L 0 45
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="right-penalty-kick-mark" d="
M 12 34.666
L 12 35.333
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="right-goal-arc" d="
M 18 27
A 10 10 1 0 1 18 43
Z" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="goal-line" d="
M 0 31
L 0 39" stroke-width="0.75" stroke="white"></path>
<path id="top-right-corner" d="
M 1 0
A 1 1 1 0 1 0 1
" stroke-width="0.1389" stroke="white" fill="transparent"></path>
<path id="top-right-corner" d="
M 0 69
A 1 1 0 0 1 1 70
" stroke-width="0.1389" stroke="white" fill="transparent"></path>
</g>
</g>
</svg>
<!-- endinject -->
</div>
<div class="center">
<div id="legend"></div>
</div>
</div>
</div>
</div>
<table id="shot-table" class="table shot-table"></table>
<div id="csv-upload-download"></div>
<div id="details-modal"></div>
<div id="delete-all-modal"></div>
<hr />
<script type="module" src="/setup.js"></script>
<script type="module">
import {
setup
} from "/setup.js";
setup("soccer-meerse");
</script>
<!-- bootstrap -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
</body>
<footer class="center">
<span>
Website built by An Nguyen primarily using D3.js. Source code and
details on how to use the app are available on
<a href="https://github.com/nguyenank/shot-plotter">Github</a>.
Contact me with bugs/feedback/suggestions/etc. on
<a href="https://twitter.com/nguyenank_">Twitter</a> or by
<a id="email" href="">email</a>.
</span>
</footer>

</html>
Loading

0 comments on commit d560a71

Please sign in to comment.