Skip to content

Commit

Permalink
mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
nate-parrott committed Dec 8, 2017
1 parent cb552bf commit 7ee4316
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 15 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<meta name="twitter:creator" content="@nateparrott">
<meta name="twitter:title" content="NYC Subway Travel Time Map">
<meta name="twitter:image" content="http://subway.nateparrott.com/og.png">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="http://d3js.org/d3.v4.min.js"></script>
<style>
html, body {
Expand Down Expand Up @@ -108,6 +109,20 @@
#timePicker li:hover {
text-decoration: underline;
}
@media screen and (max-width: 500px) {
.stop {
stroke-width: 22px;
}
#info {
width: auto;
right: 2vh;
top: auto;
bottom: 2vh;
max-height: 20vh;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
}
</style>
<script src="subway.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
Expand Down
3 changes: 1 addition & 2 deletions map.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ let zoomed = () => {
container.attr("transform", d3.event.transform);
container.selectAll('.stop').attr('r', (2.0 / d3.event.transform.k));
container.selectAll('.home').attr('r', (3.0 / d3.event.transform.k));

}
let zoom = d3.zoom()
.scaleExtent([0.7, 4])
.scaleExtent([0.7, 5])
.on("zoom", zoomed);
svg.call(zoom);

Expand Down

0 comments on commit 7ee4316

Please sign in to comment.