From 0b3183a7fb2aea08c0394234178a0fcb75aaa2ae Mon Sep 17 00:00:00 2001 From: Romulus21 Date: Sat, 28 Mar 2020 18:16:58 +0100 Subject: [PATCH 01/21] add icon & fix display name --- resources/js/components/Nav.vue | 16 ++++++++++------ resources/js/components/TopBar.vue | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/resources/js/components/Nav.vue b/resources/js/components/Nav.vue index 0424b0c..05c3067 100644 --- a/resources/js/components/Nav.vue +++ b/resources/js/components/Nav.vue @@ -8,16 +8,20 @@
- - diff --git a/resources/js/components/TopBar.vue b/resources/js/components/TopBar.vue index d82982b..41c2658 100644 --- a/resources/js/components/TopBar.vue +++ b/resources/js/components/TopBar.vue @@ -1,6 +1,6 @@ @@ -24,6 +30,14 @@ meteo: null, } }, + methods : { + dateFormat(date) { + const d = new Date(date) + const dtf = new Intl.DateTimeFormat('fr', { year: '2-digit', month: 'short', day: '2-digit', hour: 'numeric' }) + const [{ value: mo },,{ value: da },,{ value: ye },,{value: ho }] = dtf.formatToParts(d) + return `${mo}/${da} - ${ho}h` + } + }, mounted() { let refreshMeteo = false @@ -34,7 +48,7 @@ refreshMeteo = true } this.loading = false - console.log('in storage', this.meteo, this.meteo.city.name) + console.log('in storage', this.meteo.list[0], this.meteo.list[0].dt_txt) } else { refreshMeteo = true } diff --git a/resources/sass/app.scss b/resources/sass/app.scss index 7b96008..ee5fc9f 100644 --- a/resources/sass/app.scss +++ b/resources/sass/app.scss @@ -7,13 +7,16 @@ @import "components/btn"; @import "components/elements"; @import "components/main"; +@import "components/boxes"; @import "components/nav"; @import "components/topbar"; @import "components/avatar"; @import "components/alert_box"; @import "components/search_box"; +@import "components/owfont-regular"; @import "pages/auth"; @import "pages/memos"; +@import "pages/meteo"; @import "pages/games/hangman"; diff --git a/resources/sass/components/boxes.scss b/resources/sass/components/boxes.scss new file mode 100644 index 0000000..3e861d4 --- /dev/null +++ b/resources/sass/components/boxes.scss @@ -0,0 +1,6 @@ +.card { + display: inline-block; + padding: 1rem; + box-shadow: 1px 1px 2px $grey; + border-radius: 2px; +} diff --git a/resources/sass/components/owfont-regular.scss b/resources/sass/components/owfont-regular.scss new file mode 100644 index 0000000..452afcb --- /dev/null +++ b/resources/sass/components/owfont-regular.scss @@ -0,0 +1,558 @@ +/*! + * owfont-regular 1.0.0 by Deniz Fuchidzhiev - http://websygen.com + * License - font: SIL OFL 1.1, css: MIT License + */ +/* FONT PATH + * -------------------------- */ +@font-face { + font-family: 'owfont'; + src: url('../fonts/owfont-regular.eot?v=1.0.0'); + src: url('../fonts/owfont-regular.eot?#iefix&v=1.0.0') format('embedded-opentype'), + url('../fonts/owfont-regular.woff') format('woff'), + url('../fonts/owfont-regular.ttf') format('truetype'), + url('../fonts/owfont-regular.svg#owf-regular') format('svg'); + font-weight: normal; + font-style: normal; +} +.owf { + display: inline-block; + font: normal normal normal 14px/1 owfont; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + transform: translate(0, 0); +} +/* makes the font 33% larger relative to the icon container */ +.owf-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.owf-2x { + font-size: 2em; +} +.owf-3x { + font-size: 3em; +} +.owf-4x { + font-size: 4em; +} +.owf-5x { + font-size: 5em; +} +.owf-fw { + width: 1.28571429em; + text-align: center; +} +.owf-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} +.owf-ul > li { + position: relative; +} +.owf-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} +.owf-li.owf-lg { + left: -1.85714286em; +} +.owf-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} +.owf-pull-right { + float: right; +} +.owf-pull-left { + float: left; +} +.owf.owf-pull-left { + margin-right: .3em; +} +.owf.owf-pull-right { + margin-left: .3em; +} + +/* owfont uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ + +/* Weather Condition Codes */ + +/* Thunderstorm - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* thunderstorm with light rain */ +.owf-200:before, +.owf-200-d:before, +.owf-200-n:before { + content: "\EB28"; +} +/* thunderstorm with rain */ +.owf-201:before, +.owf-201-d:before, +.owf-201-n:before { + content: "\EB29"; +} +/* thunderstorm with heavy rain */ +.owf-202:before, +.owf-202-d:before, +.owf-202-n:before { + content: "\EB2A"; +} +/* light thunderstorm */ +.owf-210:before, +.owf-210-d:before, +.owf-210-n:before { + content: "\EB32"; +} +/* thunderstorm */ +.owf-211:before, +.owf-211-d:before, +.owf-211-n:before { + content: "\EB33"; +} +/* heavy thunderstorm */ +.owf-212:before, +.owf-212-d:before, +.owf-212-n:before { + content: "\EB34"; +} +/* ragged thunderstorm */ +.owf-221:before, +.owf-221-d:before, +.owf-221-n:before { + content: "\EB3D"; +} +/* thunderstorm with light drizzle */ +.owf-230:before, +.owf-230-d:before, +.owf-230-n:before { + content: "\EB46"; +} +/* thunderstorm with drizzle */ +.owf-231:before, +.owf-231-d:before, +.owf-231-n:before { + content: "\EB47"; +} +/* thunderstorm with heavy drizzle */ +.owf-232:before, +.owf-232-d:before, +.owf-232-n:before { + content: "\EB48"; +} + +/* Drizzle - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* light intensity drizzle */ +.owf-300:before, +.owf-300-d:before, +.owf-300-n:before { + content: "\EB8C"; +} +/* drizzle */ +.owf-301:before, +.owf-301-d:before, +.owf-301-n:before { + content: "\EB8D"; +} +/* heavy intensity drizzle */ +.owf-302:before, +.owf-302-d:before, +.owf-302-n:before { + content: "\EB8E"; +} +/* light intensity drizzle rain */ +.owf-310:before, +.owf-310-d:before, +.owf-310-n:before { + content: "\EB96"; +} +/* drizzle rain */ +.owf-311:before, +.owf-311-d:before, +.owf-311-n:before { + content: "\EB97"; +} +/* heavy intensity drizzle rain */ +.owf-312:before, +.owf-312-d:before, +.owf-312-n:before { + content: "\EB98"; +} +/* shower rain and drizzle */ +.owf-313:before, +.owf-313-d:before, +.owf-313-n:before { + content: "\EB99"; +} +/* heavy shower rain and drizzle*/ +.owf-314:before, +.owf-314-d:before, +.owf-314-n:before { + content: "\EB9A"; +} +/* shower drizzle */ +.owf-321:before, +.owf-321-d:before, +.owf-321-n:before { + content: "\EBA1"; +} + +/* Rain - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* light rain */ +.owf-500:before, +.owf-500-d:before, +.owf-500-n:before { + content: "\EC54"; +} +/* moderate rain */ +.owf-501:before, +.owf-501-d:before, +.owf-501-n:before { + content: "\EC55"; +} +/* heavy intensity rain */ +.owf-502:before, +.owf-502-d:before, +.owf-502-n:before { + content: "\EC56"; +} +/* very heavy rain */ +.owf-503:before, +.owf-503-d:before, +.owf-503-n:before { + content: "\EC57"; +} +/* extreme rain */ +.owf-504:before, +.owf-504-d:before, +.owf-504-n:before { + content: "\EC58"; +} +/* freezing rain */ +.owf-511:before, +.owf-511-d:before, +.owf-511-n:before { + content: "\EC5F"; +} +/* light intensity shower rain */ +.owf-520:before, +.owf-520-d:before, +.owf-520-n:before { + content: "\EC68"; +} +/* shower rain */ +.owf-521:before, +.owf-521-d:before, +.owf-521-n:before { + content: "\EC69"; +} +/* heavy intensity shower rain */ +.owf-522:before, +.owf-522-d:before, +.owf-522-n:before { + content: "\EC6A"; +} +/* ragged shower rain */ +.owf-531:before, +.owf-531-d:before, +.owf-531-n:before { + content: "\EC73"; +} + +/* Snow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* light snow */ +.owf-600:before, +.owf-600-d:before, +.owf-600-n:before { + content: "\ECB8"; +} +/* snow */ +.owf-601:before, +.owf-601-d:before, +.owf-601-n:before { + content: "\ECB9"; +} +/* heavy snow */ +.owf-602:before, +.owf-602-d:before, +.owf-602-n:before { + content: "\ECBA"; +} +/* sleet */ +.owf-611:before, +.owf-611-d:before, +.owf-611-n:before { + content: "\ECC3"; +} +/* shower sleet */ +.owf-612:before, +.owf-612-d:before, +.owf-612-n:before { + content: "\ECC4"; +} +/* light rain and snow */ +.owf-615:before, +.owf-615-d:before, +.owf-615-n:before { + content: "\ECC7"; +} +/* rain and snow */ +.owf-616:before, +.owf-616-d:before, +.owf-616-n:before { + content: "\ECC8"; +} +/* light shower snow */ +.owf-620:before, +.owf-620-d:before, +.owf-620-n:before { + content: "\ECCC"; +} +/* shower snow */ +.owf-621:before, +.owf-621-d:before, +.owf-621-n:before { + content: "\ECCD"; +} +/* heavy shower snow */ +.owf-622:before, +.owf-622-d:before, +.owf-622-n:before { + content: "\ECCE"; +} + +/* Atmosphere - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* mist */ +.owf-701:before, +.owf-701-d:before, +.owf-701-n:before { + content: "\ED1D"; +} +/* smoke */ +.owf-711:before, +.owf-711-d:before, +.owf-711-n:before { + content: "\ED27"; +} +/* haze */ +.owf-721:before, +.owf-721-d:before, +.owf-721-n:before { + content: "\ED31"; +} +/* Sand/Dust Whirls */ +.owf-731:before, +.owf-731-d:before, +.owf-731-n:before { + content: "\ED3B"; +} +/* Fog */ +.owf-741:before, +.owf-741-d:before, +.owf-741-n:before { + content: "\ED45"; +} +/* sand */ +.owf-751:before, +.owf-751-d:before, +.owf-751-n:before { + content: "\ED4F"; +} +/* dust */ +.owf-761:before, +.owf-761-d:before, +.owf-761-n:before { + content: "\ED59"; +} +/* VOLCANIC ASH */ +.owf-762:before, +.owf-762-d:before, +.owf-762-n:before { + content: "\ED5A"; +} +/* SQUALLS */ +.owf-771:before, +.owf-771-d:before, +.owf-771-n:before { + content: "\ED63"; +} +/* TORNADO */ +.owf-781:before, +.owf-781-d:before, +.owf-781-n:before { + content: "\ED6D"; +} + +/* Clouds - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* sky is clear */ /* Calm */ +.owf-800:before, +.owf-800-d:before, +.owf-951:before, +.owf-951-d:before { + content: "\ED80"; +} +.owf-800-n:before, +.owf-951-n:before { + content: "\F168"; +} +/* few clouds */ +.owf-801:before, +.owf-801-d:before { + content: "\ED81"; +} +.owf-801-n:before { + content: "\F169"; +} +/* scattered clouds */ +.owf-802:before, +.owf-802-d:before { + content: "\ED82"; +} +.owf-802-n:before { + content: "\F16A"; +} +/* broken clouds */ +.owf-803:before, +.owf-803-d:before, +.owf-803-n:before { + content: "\ED83"; +} +/* overcast clouds */ +.owf-804:before, +.owf-804-d:before, +.owf-804-n:before { + content: "\ED84"; +} + +/* Extreme - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* tornado */ +.owf-900:before, +.owf-900-d:before, +.owf-900-n:before { + content: "\EDE4"; +} +/* tropical storm */ +.owf-901:before, +.owf-901-d:before, +.owf-901-n:before { + content: "\EDE5"; +} +/* hurricane */ +.owf-902:before, +.owf-902-d:before, +.owf-902-n:before { + content: "\EDE6"; +} +/* cold */ +.owf-903:before, +.owf-903-d:before, +.owf-903-n:before { + content: "\EDE7"; +} +/* hot */ +.owf-904:before, +.owf-904-d:before, +.owf-904-n:before { + content: "\EDE8"; +} +/* windy */ +.owf-905:before, +.owf-905-d:before, +.owf-905-n:before { + content: "\EDE9"; +} +/* hail */ +.owf-906:before, +.owf-906-d:before, +.owf-906-n:before { + content: "\EDEA"; +} + +/* Additional - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +/* Setting */ +.owf-950:before, +.owf-950-d:before, +.owf-950-n:before { + content: "\EE16"; +} +/* Light breeze */ +.owf-952:before, +.owf-952-d:before, +.owf-952-n:before { + content: "\EE18"; +} +/* Gentle Breeze */ +.owf-953:before, +.owf-953-d:before, +.owf-953-n:before { + content: "\EE19"; +} +/* Moderate breeze */ +.owf-954:before, +.owf-954-d:before, +.owf-954-n:before { + content: "\EE1A"; +} +/* Fresh Breeze */ +.owf-955:before, +.owf-955-d:before, +.owf-955-n:before { + content: "\EE1B"; +} +/* Strong Breeze */ +.owf-956:before, +.owf-956-d:before, +.owf-956-n:before { + content: "\EE1C"; +} +/* High wind, near gale */ +.owf-957:before, +.owf-957-d:before, +.owf-957-n:before { + content: "\EE1D"; +} +/* Gale */ +.owf-958:before, +.owf-958-d:before, +.owf-958-n:before { + content: "\EE1E"; +} +/* Severe Gale */ +.owf-959:before, +.owf-959-d:before, +.owf-959-n:before { + content: "\EE1F"; +} +/* Storm */ +.owf-960:before, +.owf-960-d:before, +.owf-960-n:before { + content: "\EE20"; +} +/* Violent Storm */ +.owf-961:before, +.owf-961-d:before, +.owf-961-n:before { + content: "\EE21"; +} +/* Hurricane */ +.owf-962:before, +.owf-962-d:before, +.owf-962-n:before { + content: "\EE22"; +} diff --git a/resources/sass/pages/meteo.scss b/resources/sass/pages/meteo.scss new file mode 100644 index 0000000..a5beba1 --- /dev/null +++ b/resources/sass/pages/meteo.scss @@ -0,0 +1,6 @@ +.meteo { + width: 25rem; + &-date { + font-size: 1.2rem; + } +} diff --git a/resources/sass/setup/_fonts.scss b/resources/sass/setup/_fonts.scss index 917b3fe..ce46521 100644 --- a/resources/sass/setup/_fonts.scss +++ b/resources/sass/setup/_fonts.scss @@ -12,3 +12,4 @@ body { font-size: 1.6rem; color: $font; } + diff --git a/resources/sass/setup/_positions.scss b/resources/sass/setup/_positions.scss index 1281660..5223c93 100644 --- a/resources/sass/setup/_positions.scss +++ b/resources/sass/setup/_positions.scss @@ -47,6 +47,10 @@ $base: 1rem; justify-content: space-between; } +.flex-shrink { + flex-shrink: 0; +} + .w-100{ width: 100%; } @@ -62,6 +66,10 @@ $base: 1rem; } @for $i from 0 through 5 { + .flex-#{$i} { + flex: $i; + } + .m-#{$i} { margin: $i * $base; } @@ -122,3 +130,15 @@ $base: 1rem; .z-10 { z-index: 10; } + +.text-left { + text-align: left; +} + +.text-right { + text-align: right; +} + +.text-center { + text-align: center; +} diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index c24914b..47d9614 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -1,4 +1,4 @@ - +search_bo From 7b5d332efe53d5484d67a4fbf48a026784e2c994 Mon Sep 17 00:00:00 2001 From: Romulus21 Date: Sat, 4 Apr 2020 10:47:15 +0200 Subject: [PATCH 16/21] fix coquille --- resources/views/layouts/app.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 47d9614..c24914b 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -1,4 +1,4 @@ -search_bo + From 555080e8bea96eb6aa7350436490bfdd8cf81d37 Mon Sep 17 00:00:00 2001 From: Romulus21 Date: Sat, 4 Apr 2020 11:02:04 +0200 Subject: [PATCH 17/21] fix Api key meteo --- app/Http/Controllers/MeteoController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/MeteoController.php b/app/Http/Controllers/MeteoController.php index 24c0f86..8d8def7 100644 --- a/app/Http/Controllers/MeteoController.php +++ b/app/Http/Controllers/MeteoController.php @@ -9,7 +9,10 @@ class MeteoController extends Controller public function index() { $idCity = 2995971; - $url = 'https://api.openweathermap.org/data/2.5/forecast?id='.$idCity.'&appid='.env('OPEN_WEATHER_MAP_API_KEY').'&units=metric&lang=fr'; + $apiKey = env('OPEN_WEATHER_MAP_API_KEY'); + echo 'API Key OpenWeatherMaps'.$apiKey; + $params = '&units=metric&lang=fr'; + $url = 'https://api.openweathermap.org/data/2.5/forecast?id='.$idCity.'&appid='.$apiKey.$params; $client = new \GuzzleHttp\Client(); $promise = $client->requestAsync('GET', $url); From bf67d4d2d1b617a7a49d377b3ed6570c1815a4e9 Mon Sep 17 00:00:00 2001 From: Romulus21 Date: Sat, 4 Apr 2020 11:09:07 +0200 Subject: [PATCH 18/21] fix Api key meteo --- app/Http/Controllers/MeteoController.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Http/Controllers/MeteoController.php b/app/Http/Controllers/MeteoController.php index 8d8def7..a778ef9 100644 --- a/app/Http/Controllers/MeteoController.php +++ b/app/Http/Controllers/MeteoController.php @@ -9,8 +9,7 @@ class MeteoController extends Controller public function index() { $idCity = 2995971; - $apiKey = env('OPEN_WEATHER_MAP_API_KEY'); - echo 'API Key OpenWeatherMaps'.$apiKey; + $apiKey = env('OPEN_WEATHER_MAP_API_KEY', ''); $params = '&units=metric&lang=fr'; $url = 'https://api.openweathermap.org/data/2.5/forecast?id='.$idCity.'&appid='.$apiKey.$params; $client = new \GuzzleHttp\Client(); From 9c6c77117138013643f43f7ead2f57aa2915b8ee Mon Sep 17 00:00:00 2001 From: Romulus21 Date: Sat, 4 Apr 2020 11:19:30 +0200 Subject: [PATCH 19/21] add config file portal to fix env error maybe --- app/Http/Controllers/MeteoController.php | 2 +- config/portal.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 config/portal.php diff --git a/app/Http/Controllers/MeteoController.php b/app/Http/Controllers/MeteoController.php index a778ef9..00c8ffd 100644 --- a/app/Http/Controllers/MeteoController.php +++ b/app/Http/Controllers/MeteoController.php @@ -9,7 +9,7 @@ class MeteoController extends Controller public function index() { $idCity = 2995971; - $apiKey = env('OPEN_WEATHER_MAP_API_KEY', ''); + $apiKey = config('portal.open_weather_map_api_key'); $params = '&units=metric&lang=fr'; $url = 'https://api.openweathermap.org/data/2.5/forecast?id='.$idCity.'&appid='.$apiKey.$params; $client = new \GuzzleHttp\Client(); diff --git a/config/portal.php b/config/portal.php new file mode 100644 index 0000000..36f1e66 --- /dev/null +++ b/config/portal.php @@ -0,0 +1,5 @@ + env('OPEN_WEATHER_MAP_API_KEY'), +]; From a8dd4cb7c645026305bd335c6ddc55c7b02595f6 Mon Sep 17 00:00:00 2001 From: Romulus21 Date: Sat, 4 Apr 2020 11:47:48 +0200 Subject: [PATCH 20/21] add SVG Icon --- package.json | 1 + resources/js/app.js | 3 +++ resources/js/components/Nav.vue | 19 +++---------------- resources/js/components/TopBar.vue | 16 ++++------------ resources/sass/components/nav.scss | 2 ++ resources/sass/components/topbar.scss | 11 +++++++++++ resources/svg/games.svg | 4 ++++ resources/svg/logo.svg | 12 ++++++++++++ resources/svg/logout.svg | 4 ++++ resources/svg/memos.svg | 8 ++++++++ resources/svg/params.svg | 4 ++++ resources/svg/search.svg | 3 +++ webpack.mix.js | 11 ++--------- 13 files changed, 61 insertions(+), 37 deletions(-) create mode 100644 resources/svg/games.svg create mode 100644 resources/svg/logo.svg create mode 100644 resources/svg/logout.svg create mode 100644 resources/svg/memos.svg create mode 100644 resources/svg/params.svg create mode 100644 resources/svg/search.svg diff --git a/package.json b/package.json index 3d6007e..8b5b78a 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "vuex": "^3.1.3" }, "dependencies": { + "laravel-mix-svg-vue": "^0.2.6", "markdown-it": "^10.0.0" } } diff --git a/resources/js/app.js b/resources/js/app.js index a6aca2e..d5a8523 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -2,6 +2,9 @@ import Vue from 'vue' import router from './router' import App from './components/App' import store from './store' +import SvgVue from 'svg-vue'; + +Vue.use(SvgVue); require('./bootstrap'); diff --git a/resources/js/components/Nav.vue b/resources/js/components/Nav.vue index 05c3067..bb6de90 100644 --- a/resources/js/components/Nav.vue +++ b/resources/js/components/Nav.vue @@ -1,28 +1,15 @@