From 864fb56705ae20455c7d2542460f6ca3bd1209ed Mon Sep 17 00:00:00 2001 From: Xander Johnson Date: Sun, 18 Feb 2018 02:48:01 -0800 Subject: [PATCH] Added some rudimentary stuff for a date selection modal, and some more react stuff for passing around the dates as props/state. --- .babelrc | 3 +- .eslintrc.js | 3 +- package.json | 12 +- src/css/stylish.css | 110 ++++- src/index.html | 34 +- src/js/app.jsx | 49 ++- src/js/components/dates/DateSelector.jsx | 29 +- src/js/components/dates/Dates.jsx | 15 +- src/js/components/map.jsx | 98 ++--- src/js/components/parser.js | 10 +- src/js/components/util.js | 57 ++- src/js/mapper.js | 489 ----------------------- 12 files changed, 303 insertions(+), 606 deletions(-) delete mode 100644 src/js/mapper.js diff --git a/.babelrc b/.babelrc index 4ffef06..e7b1f28 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,4 @@ { - "presets": ["env", "react"] + "presets": ["env", "react"], + "plugins": ["transform-class-properties"], } diff --git a/.eslintrc.js b/.eslintrc.js index 5d97614..b09ad01 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,5 +2,6 @@ module.exports = { extends: "airbnb", env: { "browser": true - } + }, + parser: "babel-eslint" } diff --git a/package.json b/package.json index 2e58551..6e659ea 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,13 @@ "name": "sf-shows", "devDependencies": { "babel-core": "^6.26.0", + "babel-eslint": "^7.2.3", "babel-loader": "^7.1.2", + "babel-plugin-transform-class-properties": "^6.24.1", "babel-preset-env": "^1.6.1", "babel-preset-react": "^6.24.1", "css-loader": "^0.28.9", - "eslint": "^4.16.0", + "eslint": "^4.18.0", "eslint-config-airbnb": "^16.1.0", "eslint-plugin-import": "^2.8.0", "eslint-plugin-jsx-a11y": "^6.0.3", @@ -19,13 +21,17 @@ }, "scripts": { "dev": "webpack-dev-server", - "build": "webpack" + "build": "webpack", + "lint": "./node_modules/.bin/eslint src/js/**" }, "dependencies": { "jquery": "^3.3.1", + "lodash": "^4.17.5", "mapbox-gl": "^0.44.0", + "mapboxgl-spiderifier": "^1.0.3", + "prop-types": "^15.6.0", "react": "^16.2.0", "react-dom": "^16.2.0", - "prop-types": "^15.6.0" + "react-nouislider": "^2.0.1" } } diff --git a/src/css/stylish.css b/src/css/stylish.css index 4a4dbbf..19db7a1 100644 --- a/src/css/stylish.css +++ b/src/css/stylish.css @@ -33,9 +33,10 @@ body { #date-selector-container { display: grid; + justify-content: center; grid-template-rows: repeat(5, 25px); - grid-template-columns: 50% 50%; - grid-auto-flow: columns; + grid-template-columns: 25% 25%; + grid-auto-flow: column; grid-auto-columns: 50% 50%; margin-left: 50px; } @@ -109,18 +110,11 @@ body { margin: 0; } -.map-overlay .listing a { - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - color: #404; - text-decoration: none; -} - -.map-overlay .listing a:last-child { - border: none; -} -.map-overlay .listing a:hover { - background: #f0f0f0; +.map-overlay .listing p:hover { + border: #0095ff; + border-style: groove; + margin: 2px; } #see-list-button { @@ -132,6 +126,90 @@ body { } +/* Modal stuff */ + +.modal { + position: fixed; /* Stay in place */ + z-index: 1; /* Sit on top */ + padding-top: 100px; /* Location of the box */ + left: 0; + top: 0; + width: 100%; /* Full width */ + height: 100%; /* Full height */ + overflow: auto; /* Enable scroll if needed */ + background-color: rgb(0,0,0); /* Fallback color */ + background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ +} + +/* Modal Content */ +.modal-content { + position: relative; + background-color: #fefefe; + margin: auto; + padding: 0; + border: 1px solid #888; + width: 80%; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); + -webkit-animation-name: animatetop; + -webkit-animation-duration: 0.4s; + animation-name: animatetop; + animation-duration: 0.4s +} + +/* Add Animation */ +@-webkit-keyframes animatetop { + from {top:-300px; opacity:0} + to {top:0; opacity:1} +} + +@keyframes animatetop { + from {top:-300px; opacity:0} + to {top:0; opacity:1} +} + +/* The Close Button */ +.close-filter-modal { + color: white; + float: right; + font-size: 28px; + font-weight: bold; +} + +.close-filter-modal:hover, +.close-filter-modal:focus { + color: #000; + text-decoration: none; + cursor: pointer; +} + +.modal-header { + padding: 5px ; + background-color: #5cb85c; + color: white; + height: 35px; + font-size: 20px; +} + +.modal-body {padding: 2px 16px;} + +.modal-footer { + padding: 2px 16px; + background-color: #5cb85c; + color: white; +} + +#filterModal .buttons { + display: flex; + justify-content: space-evenly; + padding: 20px; + text-align: center; +} + +#filterModal .buttons a { + margin: 20px; +} + + /* Media */ @media only screen and (max-device-width: 480px) { @@ -140,7 +218,7 @@ body { display: none; } - #see-list-button { + #see-list-button-mobile { position: absolute; display: block; left: 0px; @@ -169,4 +247,8 @@ body { font-size: 64px; } + #filterModal .buttons { + display: flex; + flex-direction: column; + } } diff --git a/src/index.html b/src/index.html index 3df7cb8..5114862 100644 --- a/src/index.html +++ b/src/index.html @@ -14,7 +14,7 @@ -
+
@@ -30,17 +30,39 @@ -
- +
-
+