diff --git a/package-lock.json b/package-lock.json index 425547c..44d84fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6977,6 +6977,19 @@ "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" }, + "history": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "requires": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^3.0.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^1.0.1" + } + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -6987,6 +7000,14 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "requires": { + "react-is": "^16.7.0" + } + }, "hoopy": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", @@ -9917,6 +9938,15 @@ "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" }, + "mini-create-react-context": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz", + "integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==", + "requires": { + "@babel/runtime": "^7.12.1", + "tiny-warning": "^1.0.3" + } + }, "mini-css-extract-plugin": { "version": "0.11.3", "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.3.tgz", @@ -12335,6 +12365,52 @@ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz", "integrity": "sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg==" }, + "react-router": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", + "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", + "requires": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.4.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "requires": { + "isarray": "0.0.1" + } + } + } + }, + "react-router-dom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", + "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", + "requires": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.2", + "react-router": "5.2.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + } + }, "react-scripts": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.0.tgz", @@ -12790,6 +12866,11 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" }, + "resolve-pathname": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", @@ -14526,6 +14607,16 @@ "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=" }, + "tiny-invariant": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", + "integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw==" + }, + "tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -14984,6 +15075,11 @@ "spdx-expression-parse": "^3.0.0" } }, + "value-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/package.json b/package.json index d341339..53113ab 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "axios": "^0.21.0", "react": "^17.0.1", "react-dom": "^17.0.1", + "react-router-dom": "^5.2.0", "react-scripts": "4.0.0", "web-vitals": "^0.2.4" }, diff --git a/public/index.html b/public/index.html index 2e82f81..b6ce43b 100644 --- a/public/index.html +++ b/public/index.html @@ -3,17 +3,13 @@ - - - - - + + + + + + + diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 0000000..534357f Binary files /dev/null and b/public/logo.png differ diff --git a/public/logo192.png b/public/logo192.png deleted file mode 100644 index fc44b0a..0000000 Binary files a/public/logo192.png and /dev/null differ diff --git a/public/logo512.png b/public/logo512.png deleted file mode 100644 index a4e47a6..0000000 Binary files a/public/logo512.png and /dev/null differ diff --git a/public/manifest.json b/public/manifest.json index 080d6c7..e94ef15 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,25 +1,20 @@ { - "short_name": "React App", - "name": "Create React App Sample", + "short_name": "Västtrafik", + "name": "Störningar i kollektivtrafiken", "icons": [ { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" }, { - "src": "logo192.png", + "src": "logo.png", "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" + "sizes": "135x135" } ], "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" + "display": "fullscreen", + "theme_color": "#01aaeb", + "background_color": "#f0f8fa" } diff --git a/src/App.css b/src/App.css index 221c2cf..b5c9af4 100644 --- a/src/App.css +++ b/src/App.css @@ -3,6 +3,7 @@ text-align: center; display: flex; flex-direction: column; + background: var(--colorBg); } .App-logo { diff --git a/src/App.js b/src/App.js index cb33b50..1ea951d 100644 --- a/src/App.js +++ b/src/App.js @@ -1,29 +1,37 @@ +import './variables.css'; import './App.css'; + import React, { Component } from 'react'; +import { BrowserRouter as Router, Route } from 'react-router-dom'; + import NavigationDrawer from './components/NavigationDrawer.js' -import Header from './components/Header.js' -import PageArea from './components/PageArea.js' import BottomMenu from './components/BottomMenu.js' import AccessToken from './components/AccessToken.js' import NearbyStation from './components/NearbyStation'; +import Tickets from './components/pages/Tickets.js'; +import TicketsBuy from './components/pages/TicketsBuy.js'; +import Travel from './components/pages/Travel.js'; +import TrafficInfo from './components/pages/TrafficInfo.js'; + +import './variables.css'; + class App extends Component { render() { return ( -
- {/* -
+ +
+ + + + + + + + + +
+
); } } diff --git a/src/classes/Departure.js b/src/classes/Departure.js new file mode 100644 index 0000000..6d5f1da --- /dev/null +++ b/src/classes/Departure.js @@ -0,0 +1,19 @@ +/* + Denna klass är en modell för avgångar. + + lineName : String (Linjenamnet) + destination : String (Exempelvis "Mot Heden") + time : String (Avgångstid) + info : String (Trafikinformation) +*/ + +class Departure { + constructor(lineName, destination, time, info) { + this.lineName = lineName; + this.destination = destination; + this.time = time; + this.info = info; + } +} + +export default Departure; \ No newline at end of file diff --git a/src/classes/Stop.js b/src/classes/Stop.js new file mode 100644 index 0000000..408729b --- /dev/null +++ b/src/classes/Stop.js @@ -0,0 +1,17 @@ +/* + Denna klass är en modell för hållplatser. + + name : String (Hållplatsens namn) + locations : String[] (Möjliga lägen) + departures : Departure[] (Avgångar från hållplatsen) +*/ + +class Stop { + constructor(name, locations, departures) { + this.name = name; + this.locations = locations; + this.departures = departures; + } +} + +export default Stop; \ No newline at end of file diff --git a/src/components/BottomMenu.js b/src/components/BottomMenu.js index aec7f52..e89f40f 100644 --- a/src/components/BottomMenu.js +++ b/src/components/BottomMenu.js @@ -1,13 +1,33 @@ -import './css/BottomMenu.css'; import React, { Component } from 'react'; +import { Link } from 'react-router-dom'; + +import MenuButton from './MenuButton'; + +import './css/BottomMenu.css'; +import ticketsIcon from '../img/tickets.svg'; +import ticketsBuyIcon from '../img/tickets+.svg'; +import travelIcon from '../img/tram.svg'; +import trafficIcon from '../img/traffic.svg'; class BottomMenu extends Component { render() { return (
- - - + + + + + + + + + + + + + + +
); } diff --git a/src/components/Header.js b/src/components/Header.js index ec3aae6..d27a838 100644 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -1,11 +1,13 @@ -import './css/Header.css'; import React, { Component } from 'react'; +import './css/Header.css'; +import navIcon from '../img/menu.svg' class Header extends Component { render() { return (
- + +

{this.props.title}

); } diff --git a/src/components/MainArea.js b/src/components/MainArea.js new file mode 100644 index 0000000..2ad5f6c --- /dev/null +++ b/src/components/MainArea.js @@ -0,0 +1,15 @@ +import React, { Component } from 'react'; + +import './css/MainArea.css'; + +class MainArea extends Component { + render() { + return ( +
+ {this.props.children} +
+ ); + } +} + +export default MainArea; \ No newline at end of file diff --git a/src/components/MenuButton.js b/src/components/MenuButton.js new file mode 100644 index 0000000..6bda14c --- /dev/null +++ b/src/components/MenuButton.js @@ -0,0 +1,23 @@ +import React, { Component } from 'react'; + +class MenuButton extends Component { + render() { + if (this.props.childOrderReverse) { + return ( + + ); + } else { + return ( + + ); + } + } +} + +export default MenuButton; \ No newline at end of file diff --git a/src/components/PageArea.js b/src/components/PageArea.js deleted file mode 100644 index 6b25283..0000000 --- a/src/components/PageArea.js +++ /dev/null @@ -1,12 +0,0 @@ -import './css/PageArea.css'; -import React, { Component } from 'react'; - -class PageArea extends Component { - render() { - return ( -
- ); - } -} - -export default PageArea; \ No newline at end of file diff --git a/src/components/StopTitle.js b/src/components/StopTitle.js new file mode 100644 index 0000000..d2bf05c --- /dev/null +++ b/src/components/StopTitle.js @@ -0,0 +1,19 @@ +import React, { Component } from 'react'; + +import './css/StopTitle.css'; + +class StopTitle extends Component { + render() { + return ( +
+

{this.props.stop.name}

+
+

{this.props.stop.locations[0]}

+ +
+
+ ); + } +} + +export default StopTitle; \ No newline at end of file diff --git a/src/components/TopMenu.js b/src/components/TopMenu.js new file mode 100644 index 0000000..ce19f18 --- /dev/null +++ b/src/components/TopMenu.js @@ -0,0 +1,15 @@ +import React, { Component } from 'react'; + +import './css/TopMenu.css'; + +class TopMenu extends Component { + render() { + return ( +
+ {this.props.children} +
+ ); + } +} + +export default TopMenu; \ No newline at end of file diff --git a/src/components/TrafficEntry.js b/src/components/TrafficEntry.js new file mode 100644 index 0000000..63829ea --- /dev/null +++ b/src/components/TrafficEntry.js @@ -0,0 +1,44 @@ +import React, { Component } from 'react'; + +import './css/TrafficInfo.css'; + +import busIcon from '../img/bus.svg'; +import warningIcon from '../img/warning.svg'; + +class TrafficEntry extends Component { + render() { + let trafficInfo = this.props.departure.info; + let lineInterference = trafficInfo != "" && trafficInfo != null; + let infoElem = <>; + + if (trafficInfo != "" && trafficInfo != null) + infoElem =

{trafficInfo} Visa mer

+ + return ( +
+
+
+ {this.props.departure.time} + {lineInterference && + + } +
+
+
+ {this.props.departure.lineName} + + {this.props.departure.destination} +
+ {infoElem} +
+
+ + {lineInterference && + + } +
+ ); + } +} + +export default TrafficEntry; \ No newline at end of file diff --git a/src/components/TrafficList.js b/src/components/TrafficList.js new file mode 100644 index 0000000..d96e079 --- /dev/null +++ b/src/components/TrafficList.js @@ -0,0 +1,34 @@ +import React, { Component } from 'react'; + +import TrafficEntry from './TrafficEntry.js'; + +import './css/TrafficInfo.css'; + +class TrafficList extends Component { + render() { + let entries = []; + + this.props.departures.forEach(departure => { + entries.push( + + ); + }); + + // Add separator between every element + const intersperse = (arr, sep) => arr.reduce((a,v)=>[...a,v,sep],[]).slice(0,-1); + entries = intersperse(entries, (
)); + + // Add separator after the last element + entries.push(
); + + return ( +
+ {entries.map(element => { + return element + })} +
+ ); + } +} + +export default TrafficList; \ No newline at end of file diff --git a/src/components/TripSelector.js b/src/components/TripSelector.js new file mode 100644 index 0000000..838f1b5 --- /dev/null +++ b/src/components/TripSelector.js @@ -0,0 +1,17 @@ +import React, { Component } from 'react'; + +class TripSelector extends Component { + render() { + return ( +
+ + +
+ + +
+ ); + } +} + +export default TripSelector; \ No newline at end of file diff --git a/src/components/css/BottomMenu.css b/src/components/css/BottomMenu.css index e227caa..baee283 100644 --- a/src/components/css/BottomMenu.css +++ b/src/components/css/BottomMenu.css @@ -1,18 +1,37 @@ #bottomMenu { width: 100%; - height: 8vh; - background: lightcoral; + height: 9vh; + min-height: 60px; + background: white; display: flex; justify-content: space-evenly; + border-top: 2px solid rgba(0, 0, 0, 0.05); +} + +#bottomMenu a { + display: contents; + text-decoration: none; } #bottomMenu button { background: none; border: none; font-size: 0.9em; - margin-bottom: 5px; flex-basis: calc(100%/3); display: flex; - align-items: flex-end; + flex-direction: column; + align-items: center; justify-content: space-evenly; +} + +#bottomMenu button:active { + background: rgba(0, 0, 0, 0.1); +} + +#bottomMenu button span { + color: black; +} + +#bottomMenu button img { + width: 25px; } \ No newline at end of file diff --git a/src/components/css/Header.css b/src/components/css/Header.css index 16482b5..4672c4c 100644 --- a/src/components/css/Header.css +++ b/src/components/css/Header.css @@ -1,5 +1,21 @@ header { width: 100vw; - height: 15vh; - background: burlywood; + display: flex; + flex-direction: row; + align-items: center; + padding: 15px 15px 15vh 15px; + top: 0; + background: linear-gradient(90deg, var(--colorVT1), var(--colorVT2)); +} + +#navBtn img { + height: 1.4em; +} + +#pageTitle { + font-size: 1.2em; + letter-spacing: 0.3px; + color: white; + font-family: 'Roboto Light', sans-serif; + padding: 0 0 0 25px; } \ No newline at end of file diff --git a/src/components/css/MainArea.css b/src/components/css/MainArea.css new file mode 100644 index 0000000..8e74147 --- /dev/null +++ b/src/components/css/MainArea.css @@ -0,0 +1,7 @@ +main { + width: 100vw; + flex: 1 1 auto; + display: flex; + flex-flow: column; + justify-content: space-evenly; +} \ No newline at end of file diff --git a/src/components/css/PageArea.css b/src/components/css/PageArea.css deleted file mode 100644 index 9d54cb6..0000000 --- a/src/components/css/PageArea.css +++ /dev/null @@ -1,4 +0,0 @@ -#pageArea { - width: 100vw; - flex: 1 1 auto; -} \ No newline at end of file diff --git a/src/components/css/StopTitle.css b/src/components/css/StopTitle.css new file mode 100644 index 0000000..3c80e0d --- /dev/null +++ b/src/components/css/StopTitle.css @@ -0,0 +1,39 @@ +#stopTitle { + text-align: left; + background: white; + border-radius: var(--borderRadius); + box-shadow: var(--boxShadow); + display: flex; + flex-direction: column; + justify-content: space-evenly; + padding: 0 5vw; +} + +#stopTitle h1, #stopTitle h3 { + font-weight: 100; +} + +#stopTitle div { + display: flex; + flex-direction: row; +} + +#stopTitle h3 { + color: rgba(0, 0, 0, 0.4); +} + +#stopTitle button { + width: auto; + height: 100%; + box-shadow: none; + background: rgba(0, 0, 0, 0.2); + display: block; + flex-flow: row; + margin-left: 10px; + padding: 0 2.5vw; + border-radius: calc(var(--topMenuHeight) / 15); +} + +#stopTitle button:active { + background: rgba(0, 0, 0, 0.3); +} \ No newline at end of file diff --git a/src/components/css/TopMenu.css b/src/components/css/TopMenu.css new file mode 100644 index 0000000..74b52d0 --- /dev/null +++ b/src/components/css/TopMenu.css @@ -0,0 +1,32 @@ +#topMenu { + width: 100vw; + height: var(--topMenuHeight); + margin-top: calc(var(--topMenuHeight) / -2); + display: inline-flex; + justify-content: space-evenly; +} + +#topMenu button { + width: var(--topMenuHeight); + height: calc(var(--topMenuHeight) / 1.3); + display: flex; + flex-flow: column; + justify-content: space-evenly; + background: white; + border-radius: calc(var(--topMenuHeight) / 15); + box-shadow: var(--boxShadow); +} + +#topMenu button:active { + background: rgb(235, 235, 235); +} + +#topMenu img { + width: 100%; + height: 40%; +} + +#topMenu button span { + width: 100%; + font-size: calc(var(--topMenuHeight) / 7); +} \ No newline at end of file diff --git a/src/components/css/TrafficInfo.css b/src/components/css/TrafficInfo.css new file mode 100644 index 0000000..088bc6c --- /dev/null +++ b/src/components/css/TrafficInfo.css @@ -0,0 +1,84 @@ +#trafficList { + height: 100%; + margin-top: 40px; + background: white; +} + +.trafficEntry { + display: flex; + flex-direction: column; + justify-content: space-evenly; + align-items: center; + width: 100vw; + padding: 6vw 0; + background: white; +} + +.trafficEntry div { + width: 90%; + display: flex; + flex-direction: row; + justify-content: space-evenly; + margin-bottom: 8px; +} + +.trafficEntry div p { + text-align: left; + font-size: 3.5vw; + padding: 3vw 0; +} + +.trafficEntry div div { + display: flex; + flex-direction: column; +} + +.timeColumn { + flex-basis: 15%; + justify-content: flex-start; + align-items: center; +} + +.timeColumn img { + width: 20px; +} + +.lineColumn { + flex-basis: 75%; +} + +.lineColumn img { + width: 30px; + margin-right: 10px; +} + +.trafficEntry div div div { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-end; +} + +.lineName { + background: var(--colorLine); + color: white; + font-size: 6vw; + font-weight: 100; + margin-right: 10px; + padding: 1vw 4vw; +} + +.destination { + font-size: 100%; + text-align: left; +} + +.trafficEntry button { + width: 90%; + font-size: 4vw; + font-weight: bold; + color: var(--colorVT1); + padding: 4vw 0; + border-radius: var(--borderRadius); + box-shadow: var(--boxShadow); +} \ No newline at end of file diff --git a/src/components/css/TripSelector.css b/src/components/css/TripSelector.css new file mode 100644 index 0000000..c760a1b --- /dev/null +++ b/src/components/css/TripSelector.css @@ -0,0 +1,32 @@ +form { + width: 65vw; + height: calc(var(--topMenuHeight)); + background: white; + display: flex; + flex-flow: row wrap; + justify-content: space-evenly; + align-items: center; + font-size: 15px; + padding: 1vw 2vw; + border-radius: var(--borderRadius); + box-shadow: var(--boxShadow); +} + +label { + flex-basis: 20%; + height: 15px; +} + +input { + flex-basis: 70%; + height: 15px; + border: none; +} + +hr { + --width: 90%; + + flex-basis: var(--width); + margin: 0 calc((100% - var(--width)) / 2); + opacity: 0.5; +} \ No newline at end of file diff --git a/src/components/pages/Tickets.js b/src/components/pages/Tickets.js new file mode 100644 index 0000000..b79a73b --- /dev/null +++ b/src/components/pages/Tickets.js @@ -0,0 +1,19 @@ +import React, { Component } from 'react'; + +import Header from '../Header.js'; +import MainArea from '../MainArea.js'; + +class Tickets extends Component { + render() { + return ( + <> +
+ +

Du har inga biljetter

+
+ + ); + } +} + +export default Tickets; \ No newline at end of file diff --git a/src/components/pages/TicketsBuy.js b/src/components/pages/TicketsBuy.js new file mode 100644 index 0000000..db3e092 --- /dev/null +++ b/src/components/pages/TicketsBuy.js @@ -0,0 +1,30 @@ +import React, { Component } from 'react'; + +import Header from '../Header.js'; +import TopMenu from '../TopMenu.js'; +import MenuButton from '../MenuButton.js'; +import MainArea from '../MainArea.js'; + +import clockIcon from '../../img/clock.svg'; +import calendarIcon from '../../img/calendar.svg'; +import recurringIcon from '../../img/redo.svg'; + +class TicketsBuy extends Component { + render() { + return ( + <> +
+ + + + + + +

Du har inga tidigare köp

+
+ + ); + } +} + +export default TicketsBuy; \ No newline at end of file diff --git a/src/components/pages/TrafficInfo.js b/src/components/pages/TrafficInfo.js new file mode 100644 index 0000000..803d04e --- /dev/null +++ b/src/components/pages/TrafficInfo.js @@ -0,0 +1,38 @@ +import React, { Component } from 'react'; + +import Header from '../Header.js'; +import TopMenu from '../TopMenu.js'; +import MainArea from '../MainArea.js'; +import StopTitle from '../StopTitle.js'; +import TrafficList from '../TrafficList.js'; + +import Stop from '../../classes/Stop.js'; +import Departure from '../../classes/Departure.js'; + +class TrafficInfo extends Component { + render() { + let testStop = + new Stop( + "Lemmingsgatan", + ["Läge A", "Läge B", "Läge C"], + [ + new Departure("519", "Mot Heden", "11:59", "Trafikolycka vid Partille Centrum."), + new Departure("58", "Mot Västra Eriksberg", "12:07") + ], + ); + + return ( + <> +
+ + + + + + + + ); + } +} + +export default TrafficInfo; \ No newline at end of file diff --git a/src/components/pages/Travel.js b/src/components/pages/Travel.js new file mode 100644 index 0000000..bf99ef9 --- /dev/null +++ b/src/components/pages/Travel.js @@ -0,0 +1,25 @@ +import React, { Component } from 'react'; + +import Header from '../Header.js'; +import TopMenu from '../TopMenu.js'; +import MainArea from '../MainArea.js'; +import TripSelector from '../TripSelector.js'; + +import '../css/TripSelector.css'; + +class Travel extends Component { + render() { + return ( + <> +
+ + + + + + + ); + } +} + +export default Travel; \ No newline at end of file diff --git a/src/fonts/roboto-light.ttf b/src/fonts/roboto-light.ttf new file mode 100644 index 0000000..d43e943 Binary files /dev/null and b/src/fonts/roboto-light.ttf differ diff --git a/src/img/bus.svg b/src/img/bus.svg new file mode 100644 index 0000000..c2c841e --- /dev/null +++ b/src/img/bus.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/img/calendar.svg b/src/img/calendar.svg new file mode 100644 index 0000000..670873d --- /dev/null +++ b/src/img/calendar.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/img/clock.svg b/src/img/clock.svg new file mode 100644 index 0000000..5ee5644 --- /dev/null +++ b/src/img/clock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/img/menu.svg b/src/img/menu.svg new file mode 100644 index 0000000..416f1f9 --- /dev/null +++ b/src/img/menu.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/img/redo.svg b/src/img/redo.svg new file mode 100644 index 0000000..c68d924 --- /dev/null +++ b/src/img/redo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/img/tickets+.svg b/src/img/tickets+.svg new file mode 100644 index 0000000..fa9f687 --- /dev/null +++ b/src/img/tickets+.svg @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/img/tickets.svg b/src/img/tickets.svg new file mode 100644 index 0000000..071a4c7 --- /dev/null +++ b/src/img/tickets.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/img/traffic.svg b/src/img/traffic.svg new file mode 100644 index 0000000..9f21c11 --- /dev/null +++ b/src/img/traffic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/img/tram.svg b/src/img/tram.svg new file mode 100644 index 0000000..2d919e3 --- /dev/null +++ b/src/img/tram.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/img/warning.svg b/src/img/warning.svg new file mode 100644 index 0000000..3395e7a --- /dev/null +++ b/src/img/warning.svg @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/src/index.css b/src/index.css index 1d0fe0a..1e44c32 100644 --- a/src/index.css +++ b/src/index.css @@ -3,6 +3,11 @@ src: url('fonts/roboto-regular.ttf') format('truetype'); /* Safari, Android, iOS */ } +@font-face { + font-family: 'Roboto Light'; + src: url('fonts/roboto-light.ttf') format('truetype'); /* Safari, Android, iOS */ +} + * { margin: 0; padding: 0; @@ -13,4 +18,13 @@ html, body, #root, #app { width: 100%; height: 100%; +} + +#root { + overflow: hidden; +} + +button { + background: none; + border: none; } \ No newline at end of file diff --git a/src/variables.css b/src/variables.css new file mode 100644 index 0000000..ca613a4 --- /dev/null +++ b/src/variables.css @@ -0,0 +1,10 @@ +:root { + --colorVT1: rgb(1, 170, 235); + --colorVT2: rgb(25, 212, 245); + --colorBg: rgb(240, 248, 250); + --colorLine: rgb(0, 108, 144); + + --topMenuHeight: 15vh; + --borderRadius: calc(var(--topMenuHeight) / 15); + --boxShadow: 0px 1px 5px -1px rgba(0, 0, 0, 0.3); +} \ No newline at end of file