Skip to content

Commit

Permalink
Merge branch 'clean-menu'
Browse files Browse the repository at this point in the history
  • Loading branch information
Josiah committed Jun 21, 2017
2 parents 1bef025 + 0e79c56 commit 2491417
Show file tree
Hide file tree
Showing 50 changed files with 989 additions and 840 deletions.
21 changes: 19 additions & 2 deletions web/app/views/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,25 @@
<!DOCTYPE html>
<html>
<head>
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16">
<title>Road Quality</title>

<link rel="apple-touch-icon" sizes="57x57" href="/assets/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/assets/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/assets/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/assets/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/assets/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/assets/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/assets/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/assets/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/assets/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/assets/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png">
<link rel="manifest" href="/assets/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/assets/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,400,600,700" />
<link rel="stylesheet" href="/assets/stylesheets/main.css" />
Expand Down
1 change: 1 addition & 0 deletions web/elm-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"elm-lang/html": "2.0.0 <= v < 3.0.0",
"elm-lang/http": "1.0.0 <= v < 2.0.0",
"elm-lang/navigation": "2.1.0 <= v < 3.0.0",
"elm-lang/svg": "2.0.0 <= v < 3.0.0",
"evancz/url-parser": "2.0.1 <= v < 3.0.0",
"lukewestby/elm-http-builder": "5.1.0 <= v < 6.0.0",
"mdgriffith/elm-style-animation": "3.5.5 <= v < 4.0.0",
Expand Down
Binary file added web/public/favicon/android-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/android-icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/android-icon-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/android-icon-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/android-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/android-icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-114x114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-57x57.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-72x72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon-precomposed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions web/public/favicon/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
Binary file added web/public/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/favicon.ico
Binary file not shown.
41 changes: 41 additions & 0 deletions web/public/favicon/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
Binary file added web/public/favicon/ms-icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/ms-icon-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/ms-icon-310x310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/favicon/ms-icon-70x70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions web/public/img/arrow-left.svg

This file was deleted.

4 changes: 0 additions & 4 deletions web/public/img/arrow-right.svg
Diff not rendered.
3 changes: 0 additions & 3 deletions web/public/img/check.svg
Diff not rendered.
Binary file removed web/public/img/marker.png
Diff not rendered.
Binary file removed web/public/img/start-marker.png
Diff not rendered.
File renamed without changes
Binary file added web/public/img/surface-quality-vert.png
Binary file added web/public/img/traffic-safety-vert.png
File renamed without changes
Binary file added web/public/img/user.png
4 changes: 0 additions & 4 deletions web/public/img/x.svg
Diff not rendered.
46 changes: 38 additions & 8 deletions web/public/javascripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let cursorOverPoint = null;
let isDragging = false;
let viewOnly = true;
let popup;
let showingLayer;

// STORE SESSION
app.ports.storeSession.subscribe(function(session) {
Expand Down Expand Up @@ -39,7 +40,7 @@ app.ports.up.subscribe(function(authed) {
container: "MainView",
style: "mapbox://styles/mapbox/light-v9",
center: [-79.412190, 43.667632],
zoom: 10
zoom: 12
});

canvas = map.getCanvasContainer();
Expand All @@ -50,27 +51,56 @@ app.ports.up.subscribe(function(authed) {
map.on("mousedown", onMapMouseDown);
map.on("mouseup", onMapMouseUp);

map.on('load', function () {
showingLayer = "SurfaceQuality";
map.on("load", function () {
map.addLayer({
"id": "mini_segments",
"id": "SurfaceQuality",
"type": "line",
"source": {
type: 'vector',
tiles: ['https://tiles.roadquality.org/surface_quality/{z}/{x}/{y}.pbf']
type: "vector",
tiles: ["https://tiles.roadquality.org/surface_quality/{z}/{x}/{y}.pbf"]
},
"source-layer": "surface_mini_segments",
"paint": {
"line-color": {
"type": "identity",
"property": "colour"
"type": "identity",
"property": "colour"
},
"line-width": 1.5
"line-width": 2
}
});
});
}, 100);
});

app.ports.setLayer.subscribe(function(layer) {
if (showingLayer === layer) {
return;
} else if (map.getLayer(layer)) {
map.setLayoutProperty(showingLayer, "visibility", "none");
map.setLayoutProperty(layer, "visibility", "visible");
} else if (layer === "TrafficSafety") {
map.setLayoutProperty(showingLayer, "visibility", "none");
map.addLayer({
"id": "TrafficSafety",
"type": "line",
"source": {
type: "vector",
tiles: ["https://tiles.roadquality.org/traffic/{z}/{x}/{y}.pbf"]
},
"source-layer": "traffic_mini_segments",
"paint": {
"line-color": {
"type": "identity",
"property": "colour"
},
"line-width": 2
}
});
}
showingLayer = layer;
});

app.ports.routeCreate.subscribe(function() {
viewOnly = false;
map.on("click", onMapClick);
Expand Down
9 changes: 8 additions & 1 deletion web/src/Data/Map.elm
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
module Data.Map exposing (CycleRoute, decodeCycleRoute, Point, decodePoint, encodePoint, SurfaceType(..), PathType(..), Segment, decodeSegment, CreateSegmentForm, encodeCreateSegmentForm)
module Data.Map exposing (MapLayer(..), CycleRoute, decodeCycleRoute, Point, decodePoint, encodePoint, SurfaceType(..), PathType(..), Segment, decodeSegment, CreateSegmentForm, encodeCreateSegmentForm)

import Json.Decode as Decode exposing (Decoder)
import Json.Decode.Pipeline as Pipeline exposing (decode, required)
import Json.Encode as Encode exposing (Value)
import Util exposing ((=>))


type MapLayer
= PlainMap
| SurfaceQuality
| TrafficSafety
| SegmentsView


type alias CycleRoute =
{ distance : Float
, polyline : String
Expand Down
2 changes: 1 addition & 1 deletion web/src/Data/UserPhoto.elm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ photoToUrl : UserPhoto -> String
photoToUrl (UserPhoto maybeUrl) =
case maybeUrl of
Nothing ->
"https://static.productionready.io/images/smiley-cyrus.jpg"
"/assets/img/user.png"

Just url ->
url
2 changes: 1 addition & 1 deletion web/src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ updatePage page msg model =
}
=> Cmd.batch
[ Ports.storeSession Nothing
, Route.modifyUrl Route.Home
, Route.modifyUrl Route.Login
]

cmd =
Expand Down
Loading

0 comments on commit 2491417

Please sign in to comment.