diff --git a/package-lock.json b/package-lock.json index 74b6a04..026a6f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6969,6 +6969,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", @@ -6979,6 +6992,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", @@ -9909,6 +9930,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", @@ -12327,6 +12357,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", @@ -12782,6 +12858,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", @@ -14518,6 +14599,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", @@ -14976,6 +15067,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 f7be157..006782f 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "@testing-library/user-event": "^12.2.2", "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.js b/src/App.js index 4d2f271..81cfc52 100644 --- a/src/App.js +++ b/src/App.js @@ -1,25 +1,31 @@ +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 Tickets from './components/pages/Tickets.js'; +import TicketsBuy from './components/pages/TicketsBuy.js'; +import Travel from './components/pages/Travel.js'; + class App extends Component { render() { return ( -
- {/* -
+ +
+ + + + + + + + +
+
); } } diff --git a/src/components/BottomMenu.js b/src/components/BottomMenu.js index aec7f52..afdf4f9 100644 --- a/src/components/BottomMenu.js +++ b/src/components/BottomMenu.js @@ -1,13 +1,28 @@ -import './css/BottomMenu.css'; import React, { Component } from 'react'; +import { Link } from 'react-router-dom'; + +import BottomMenuButton from './BottomMenuButton'; + +import './css/BottomMenu.css'; +import ticketsIcon from '../img/tickets.svg'; +import ticketsBuyIcon from '../img/tickets+.svg'; +import travelIcon from '../img/tram.svg'; class BottomMenu extends Component { render() { return (
- - - + + + + + + + + + + +
); } diff --git a/src/components/BottomMenuButton.js b/src/components/BottomMenuButton.js new file mode 100644 index 0000000..04cf455 --- /dev/null +++ b/src/components/BottomMenuButton.js @@ -0,0 +1,19 @@ +import React, { Component } from 'react'; +import './css/BottomMenu.css'; + +class BottomMenuButton extends Component { + constructor(props) { + super(props); + } + + render(label, icon) { + return ( + + ); + } +} + +export default BottomMenuButton; \ No newline at end of file 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..f5a3246 --- /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 ( +
+
+
+ ); + } +} + +export default MainArea; \ 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/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..0ffe297 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; + position: fixed; + top: 0; +} + +#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..32504ee --- /dev/null +++ b/src/components/css/MainArea.css @@ -0,0 +1,11 @@ +main { + width: 100vw; + flex: 1 1 auto; + background: var(--colorBg); +} + +#topSection { + width: 100%; + height: 15vh; + background: linear-gradient(90deg, var(--colorVT1), var(--colorVT2)); +} \ 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/pages/Tickets.js b/src/components/pages/Tickets.js new file mode 100644 index 0000000..3e14766 --- /dev/null +++ b/src/components/pages/Tickets.js @@ -0,0 +1,17 @@ +import React, { Component } from 'react'; + +import Header from '../Header.js' +import MainArea from '../MainArea.js' + +class Tickets extends Component { + render() { + return ( + <> +
+ + + ); + } +} + +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..6343e13 --- /dev/null +++ b/src/components/pages/TicketsBuy.js @@ -0,0 +1,17 @@ +import React, { Component } from 'react'; + +import Header from '../Header.js' +import MainArea from '../MainArea.js' + +class TicketsBuy extends Component { + render() { + return ( + <> +
+ + + ); + } +} + +export default TicketsBuy; \ 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..930c7bc --- /dev/null +++ b/src/components/pages/Travel.js @@ -0,0 +1,17 @@ +import React, { Component } from 'react'; + +import Header from '../Header.js' +import MainArea from '../MainArea.js' + +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/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/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/index.css b/src/index.css index 1d0fe0a..60de5e1 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,9 @@ html, body, #root, #app { width: 100%; height: 100%; +} + +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..20427b5 --- /dev/null +++ b/src/variables.css @@ -0,0 +1,5 @@ +:root { + --colorVT1: rgb(1, 170, 235); + --colorVT2: rgb(25, 212, 245); + --colorBg: rgb(240, 248, 250); +} \ No newline at end of file