diff --git a/Docker/dev/Dockerfile b/Docker/dev/Dockerfile new file mode 100644 index 0000000..572a6d2 --- /dev/null +++ b/Docker/dev/Dockerfile @@ -0,0 +1,21 @@ +FROM git.caliban.io/martin/node-python:10 +#FROM martind2000/node-python3:18 +ARG VERSION +ENV VERSION=${VERSION:-development} + +WORKDIR /app + +COPY ./Docker/start.sh ./package*.json ./rollup.config.js /app/ + +RUN mkdir -p /app/public /app/public/img + +# COPY ./src /app/src + +# COPY ./types /app/types + +RUN set -x && npm install + +RUN chmod +x /app/start.sh + + +ENTRYPOINT ["/app/start.sh"] diff --git a/Docker/start.sh b/Docker/start.sh new file mode 100644 index 0000000..3abeff2 --- /dev/null +++ b/Docker/start.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -ex + +# npm run dev + +# npm run start + +npx browserslist@latest --update-db + +npm run watch & + +while true; do sleep infinity; done \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..340d202 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3.5' + +services: + svelte-traintimes-src: + container_name: svelte-traintimes-src + build: + context: . + dockerfile: ./Docker/dev/Dockerfile + image: svelte-traintimes-src + logging: + options: + max-size: '1m' + max-file: '5' + # restart: always + # env_file: + # - .env + + volumes: + - ./src:/app/src + - ./public:/app/public + - ./fonts:/app/fonts \ No newline at end of file diff --git a/fonts/GothamNarrSSm-Bold.otf b/fonts/GothamNarrSSm-Bold.otf new file mode 100755 index 0000000..2be029a Binary files /dev/null and b/fonts/GothamNarrSSm-Bold.otf differ diff --git a/fonts/GothamNarrSSm-Book.otf b/fonts/GothamNarrSSm-Book.otf new file mode 100755 index 0000000..acb140a Binary files /dev/null and b/fonts/GothamNarrSSm-Book.otf differ diff --git a/fonts/GothamNarrSSm-Light.otf b/fonts/GothamNarrSSm-Light.otf new file mode 100755 index 0000000..ccbfa4b Binary files /dev/null and b/fonts/GothamNarrSSm-Light.otf differ diff --git a/fonts/GothamNarrSSm-Medium.otf b/fonts/GothamNarrSSm-Medium.otf new file mode 100755 index 0000000..389e2ba Binary files /dev/null and b/fonts/GothamNarrSSm-Medium.otf differ diff --git a/fonts/GothamSSm-Black.otf b/fonts/GothamSSm-Black.otf new file mode 100755 index 0000000..95aa773 Binary files /dev/null and b/fonts/GothamSSm-Black.otf differ diff --git a/fonts/GothamSSm-Bold.otf b/fonts/GothamSSm-Bold.otf new file mode 100755 index 0000000..3d624a6 Binary files /dev/null and b/fonts/GothamSSm-Bold.otf differ diff --git a/fonts/GothamSSm-Book.otf b/fonts/GothamSSm-Book.otf new file mode 100755 index 0000000..497df6e Binary files /dev/null and b/fonts/GothamSSm-Book.otf differ diff --git a/fonts/GothamSSm-Light.otf b/fonts/GothamSSm-Light.otf new file mode 100755 index 0000000..3430a31 Binary files /dev/null and b/fonts/GothamSSm-Light.otf differ diff --git a/fonts/GothamSSm-Medium.otf b/fonts/GothamSSm-Medium.otf new file mode 100755 index 0000000..8f4e1c2 Binary files /dev/null and b/fonts/GothamSSm-Medium.otf differ diff --git a/fonts/Roboto-normal-400.woff b/fonts/Roboto-normal-400.woff new file mode 100755 index 0000000..69c8825 Binary files /dev/null and b/fonts/Roboto-normal-400.woff differ diff --git a/fonts/Roboto_Condensed-normal-400.woff b/fonts/Roboto_Condensed-normal-400.woff new file mode 100755 index 0000000..90f54ea Binary files /dev/null and b/fonts/Roboto_Condensed-normal-400.woff differ diff --git a/fonts/Roboto_Mono-normal-400.woff b/fonts/Roboto_Mono-normal-400.woff new file mode 100755 index 0000000..c41382c Binary files /dev/null and b/fonts/Roboto_Mono-normal-400.woff differ diff --git a/fonts/Roboto_Slab-normal-400.woff b/fonts/Roboto_Slab-normal-400.woff new file mode 100755 index 0000000..7fa41d5 Binary files /dev/null and b/fonts/Roboto_Slab-normal-400.woff differ diff --git a/fonts/fujicons.css b/fonts/fujicons.css new file mode 100644 index 0000000..b83369f --- /dev/null +++ b/fonts/fujicons.css @@ -0,0 +1,323 @@ +@font-face { + font-family: 'Fujicons'; + font-style: normal; + font-weight: 400; + src: url(./fujicons.woff) format('woff'); + unicode-range: U+0-10FFFF; +} + + +.fa { + display: inline-block; + font: normal normal normal 14px/1 Fujicons; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/* makes the font 33% larger relative to the icon container */ +.fa-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.fa-2x { + font-size: 2em; +} +.fa-3x { + font-size: 3em; +} +.fa-4x { + font-size: 4em; +} +.fa-5x { + font-size: 5em; +} +.fa-fw { + width: 1.28571429em; + text-align: center; +} +.fa-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} +.fa-ul > li { + position: relative; +} +.fa-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} +.fa-li.fa-lg { + left: -1.85714286em; +} +.fa-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} +.fa-pull-left { + float: left; +} +.fa-pull-right { + float: right; +} +.fa.fa-pull-left { + margin-right: .3em; +} +.fa.fa-pull-right { + margin-left: .3em; +} +/* Deprecated as of 4.4.0 */ +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} +.fa-spin { + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} +.fa-pulse { + -webkit-animation: fa-spin 1s infinite steps(8); + animation: fa-spin 1s infinite steps(8); +} +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +.fa-rotate-90 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"; + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.fa-rotate-180 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.fa-rotate-270 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"; + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg); +} +.fa-flip-horizontal { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)"; + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.fa-flip-vertical { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; + -webkit-transform: scale(1, -1); + -ms-transform: scale(1, -1); + transform: scale(1, -1); +} +:root .fa-rotate-90, +:root .fa-rotate-180, +:root .fa-rotate-270, +:root .fa-flip-horizontal, +:root .fa-flip-vertical { + filter: none; +} +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fa-stack-1x { + line-height: inherit; +} +.fa-stack-2x { + font-size: 2em; +} +.fa-inverse { + color: #ffffff; +} + + +.fa-back:before { + content: ""; +} + +.fa-forward:before { + content: ""; +} + +.fa-globe:before { + content: "\EA12" +} + +.fa-up:before { + content: "\E925" +} + +.fa-down:before { + content: "\E922" +} + +.fa-work:before { + content: "\E998" +} + +.fa-home:before { + content: "\EA1E" +} + +.fa-refresh:before { + content: "\EA88" +} + + +.fa-menu:before { + content: "\EA68" +} + +.fa-star:before { + content: "\EAB3" +} + +.fa-star-filled:before { + content: "\EAB2" +} + +.fa-thick-arrow:before { + content: "\EA08" +} + +.fa-tick:before { + content: "\E9A4" +} + +.fa-cross:before { + content: "\E951" +} + +.fa-cross-circle:before { + content: "\E9D2" +} + +.fa-cross-circle-filled:before { + content: "\E9D1" +} + +.fa-alert:before { + content: "\E9ED" +} + +.fa-alert-filled:before { + content: "\E9EC" +} + +.fa-info:before { + content: "\E9EF" +} + +.fa-info-filled:before { + content: "\E9EE" +} + +.fa-bookmark:before { + content: "\E951" +} + +.fa-bookmark-filled:before { + content: "\E950" +} + +.fa-clockface:before { + content: "\E9AB" +} + +.fa-clockface-filled:before { + content: "\E9AA" +} + +.fa-twitter:before { + content: "\EAE5" +} + +.fa-cog:before { + content: "\EA9E" +} + +.fa-cog-solid:before { + content: "\EA11" +} + +.fa-foursquare:before { + content: "\EA0B" +} + + + + + + + + + + +/*full list*/ + +.fa-binoculars-solid:before { + content: "\E900" +} + +.fa-binoculars:before { + content: "\E901" +} + +.fa-check-circle-solid:before { + content: "\E902" +} + +.fa-check-circle:before { + content: "\E903" +} + +.fa-back-chevron:before { + content: "\E91F" +} + + diff --git a/fonts/fujicons.ttf b/fonts/fujicons.ttf new file mode 100755 index 0000000..a323b19 Binary files /dev/null and b/fonts/fujicons.ttf differ diff --git a/fonts/fujicons.woff b/fonts/fujicons.woff new file mode 100644 index 0000000..c41206c Binary files /dev/null and b/fonts/fujicons.woff differ diff --git a/fonts/gotham.css b/fonts/gotham.css new file mode 100644 index 0000000..ce9f10b --- /dev/null +++ b/fonts/gotham.css @@ -0,0 +1,39 @@ +@font-face { + font-family: 'Gotham'; + font-style: normal; + font-weight: 400; + src: url(GothamSSm-Book.otf) format('opentype'); + unicode-range: U+0-10FFFF; +} + +@font-face { + font-family: 'Gotham Light'; + font-style: normal; + font-weight: 400; + src: url(GothamSSm-Light.otf) format('opentype'); + unicode-range: U+0-10FFFF; +} + +@font-face { + font-family: 'Gotham Medium'; + font-style: normal; + font-weight: 400; + src: url(GothamSSm-Medium.otf) format('opentype'); + unicode-range: U+0-10FFFF; +} + +@font-face { + font-family: 'Gotham Bold'; + font-style: normal; + font-weight: 400; + src: url(GothamSSm-Bold.otf) format('opentype'); + unicode-range: U+0-10FFFF; +} + +@font-face { + font-family: 'Gotham Black'; + font-style: normal; + font-weight: 400; + src: url(GothamSSm-Black.otf) format('opentype'); + unicode-range: U+0-10FFFF; +} diff --git a/fonts/roboto-condensed.css b/fonts/roboto-condensed.css new file mode 100644 index 0000000..459c3c1 --- /dev/null +++ b/fonts/roboto-condensed.css @@ -0,0 +1,7 @@ +@font-face { + font-family: 'Roboto Condensed'; + font-style: normal; + font-weight: 400; + src: url(./Roboto_Condensed-normal-400.woff) format('woff'); + unicode-range: U+0-10FFFF; +} diff --git a/fonts/roboto.css b/fonts/roboto.css new file mode 100755 index 0000000..8c53312 --- /dev/null +++ b/fonts/roboto.css @@ -0,0 +1,32 @@ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: url(Roboto-normal-400.woff) format('woff'); + unicode-range: U+0-10FFFF; +} + +@font-face { + font-family: 'Roboto Condensed'; + font-style: normal; + font-weight: 400; + src: url(Roboto_Condensed-normal-400.woff) format('woff'); + unicode-range: U+0-10FFFF; +} + +@font-face { + font-family: 'Roboto Mono'; + font-style: normal; + font-weight: 400; + src: url(Roboto_Mono-normal-400.woff) format('woff'); + unicode-range: U+0-10FFFF; +} + +@font-face { + font-family: 'Roboto Slab'; + font-style: normal; + font-weight: 400; + src: url(Roboto_Slab-normal-400.woff) format('woff'); + unicode-range: U+0-10FFFF; +} + diff --git a/package.json b/package.json index 4b296ba..318b1ca 100755 --- a/package.json +++ b/package.json @@ -1,10 +1,22 @@ { "name": "svelte-app", "version": "1.0.0", + "watch": { + "rebuild": { + "patterns": ["src"], + "extensions": "js,svelte,css,scss", + "quiet": false, + "legacyWatch": true, + "delay": 2500, + "runOnChangeOnly": false + } + }, "scripts": { "build": "rollup -c", "dev": "rollup -c -w", - "start": "sirv public" + "start": "sirv public", + "rebuild" :"npm run build", + "watch": "npm-watch" }, "devDependencies": { "@rollup/plugin-commonjs": "^15.0.0", @@ -26,6 +38,7 @@ "axios": "^0.19.2", "localforage": "^1.9.0", "muicss": "^0.10.2", + "npm-watch": "^0.13.0", "redaxios": "^0.3.0", "rollup-plugin-replace": "^2.2.0", "sirv-cli": "^1.0.6", diff --git a/public/service-worker.js b/public/service-worker.js index 9fceb94..1dd1c34 100755 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -36,6 +36,7 @@ const filesToCache = [ self.addEventListener('install', function(e) { console.log('[ServiceWorker] Install'); + return; e.waitUntil( caches.open(cacheName).then(function(cache) { console.log('[ServiceWorker] Caching app shell'); diff --git a/src/components/Header.svelte b/src/components/Header.svelte index ce91e39..bd85658 100755 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -1,11 +1,16 @@
@@ -43,14 +55,16 @@
{#if buttonsVisible} -
+
- + diff --git a/src/components/TrainRoute.svelte b/src/components/TrainRoute.svelte index 867fcca..09146c6 100755 --- a/src/components/TrainRoute.svelte +++ b/src/components/TrainRoute.svelte @@ -87,7 +87,7 @@ // trainData = {...JSON.parse(d.data)}; trainData = {...d.data}; - console.log(trainData); + console.dir(trainData); }).catch((err) => { console.error('TrainRoute:getTrain', err); }) diff --git a/src/css/global/fixes.scss b/src/css/global/fixes.scss index e1a406d..7214dac 100755 --- a/src/css/global/fixes.scss +++ b/src/css/global/fixes.scss @@ -7,7 +7,7 @@ .betterInput { -background-color: deeppink; + // background-color: lime; padding-bottom: 6px !important; padding-top: 6px !important; diff --git a/src/css/traintimes.scss b/src/css/traintimes.scss index 0d3aa1d..4da89ad 100755 --- a/src/css/traintimes.scss +++ b/src/css/traintimes.scss @@ -1,4 +1,6 @@ -@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed'); +// @import url('https://fonts.googleapis.com/css?family=Roboto+Condensed'); +@import url('./fonts/roboto-condensed.css'); +@import url('./fonts/fujicons.css'); @import './nord.scss'; $navbar-height: 56px; diff --git a/src/pages/Settings.svelte b/src/pages/Settings.svelte index 904fdda..975cea0 100755 --- a/src/pages/Settings.svelte +++ b/src/pages/Settings.svelte @@ -14,6 +14,6 @@ -
- +
diff --git a/src/store/store.js b/src/store/store.js index 3d6d212..e0714ae 100755 --- a/src/store/store.js +++ b/src/store/store.js @@ -10,7 +10,12 @@ import axios from 'redaxios'; import { writable, get, derived } from 'svelte/store'; import localforage from 'localforage'; -const baseUrl = (__ENV__ === 'production') ? (`${location.protocol }//${ location.hostname}`) : 'http://localhost:8100'; + +// const baseUrl = (__ENV__ === 'production') ? (`${location.protocol }//${ location.hostname}`) : 'http://localhost:8100'; + +let portPart = (location.port) ? `:${location.port}` : ''; +let baseUrl = `${location.protocol }//${ location.hostname}${portPart}` + import Websocket from '../libs/websocket'; @@ -161,6 +166,32 @@ const state = { const post = get(this.routes).slice(id + 1); this.routes.set([...pre, ...post]); + }, + flipRoute(id) { + console.log('State:flipRoute:', id); + console.log('Route', get(this.routes)[id]); + + let origRoute = {...get(this.routes)[id]}; + + console.log('Origroute', origRoute); + + let newRoute = { + id: origRoute.id, + destStation: {...origRoute.startStation}, + startStation: {...origRoute.destStation}, + }; + + console.log({...origRoute.startStation}); + + let routes = get(this.routes); + + console.log("flipped route:", newRoute); + + routes[id] = {...newRoute}; + + this.routes.set(routes); + + }, async getTweets() { // console.log('>> getTweets'); @@ -240,7 +271,10 @@ const state = { }; -const webSocket = new Websocket(state); + +// const webSocket = new Websocket(state); +// disabled for the moment + localforage.getItem('twitterFollowing').then((value) => { console.log('localForage::twitterFollowing', value); @@ -320,6 +354,8 @@ state.twitterFollowing.subscribe((v) => { state.twitterFollowingList.set(list); }); +/* +No more twitter, disabled state.twitterFollowingList.subscribe((v) => { if (v.length === 0) return; console.log('twitterFollowingList', v.length); @@ -329,6 +365,7 @@ state.twitterFollowingList.subscribe((v) => { }); }); +*/ state.newTweets.subscribe((data) => { if (data.length === 0) return; console.log('>> newTweets', data.length);