diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 6764e1e6..a3e4b6d8 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -8,6 +8,8 @@ class HomeController extends Controller { public function __invoke() { + session()->put('menu', 'dashboard'); + return \Inertia::render('Home', []); } } diff --git a/app/Http/Middleware/InertiaShareMiddleware.php b/app/Http/Middleware/InertiaShareMiddleware.php index 746e795d..8df2485a 100644 --- a/app/Http/Middleware/InertiaShareMiddleware.php +++ b/app/Http/Middleware/InertiaShareMiddleware.php @@ -23,6 +23,7 @@ class InertiaShareMiddleware ]); \Inertia::share([ + 'menu' => session()->get('menu'), 'errors' => function () { return Session::get('errors') ? Session::get('errors')->getBag('default')->getMessages() diff --git a/package.json b/package.json index d11dd374..52f6ebca 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,10 @@ "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", - "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" + "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", + "img": "rm -R public/img && cd resources/img/svg && svg-sprite -s --symbol-dest=sprite *.svg && mv sprite/svg/sprite.symbol.svg ../sprite.svg && rm -R sprite && cd ../../../ && cp -R resources/img public/img" + + }, "devDependencies": { "laravel-mix": "^6.0.1", diff --git a/public/mix-manifest.json b/public/mix-manifest.json index d32f6439..6c2301fe 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,5 +1,6 @@ { "/js/app.js": "/js/app.js", + "/css/app.css": "/css/app.css", "/img/dpsg.gif": "/img/dpsg.gif", - "/css/app.css": "/css/app.css" + "/img/sprite.svg": "/img/sprite.svg" } diff --git a/resources/img/sprite.svg b/resources/img/sprite.svg new file mode 100644 index 00000000..e8cda8dd --- /dev/null +++ b/resources/img/sprite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/img/svg/loss.svg b/resources/img/svg/loss.svg new file mode 100644 index 00000000..5d085712 --- /dev/null +++ b/resources/img/svg/loss.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/img/svg/user.svg b/resources/img/svg/user.svg new file mode 100644 index 00000000..7c4d97ec --- /dev/null +++ b/resources/img/svg/user.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/js/app.js b/resources/js/app.js index cbcb6ba9..4d1c009c 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -3,11 +3,13 @@ import { App, plugin } from '@inertiajs/inertia-vue' import 'font-awesome/css/font-awesome.css'; import Echo from 'laravel-echo'; window.io = require('socket.io-client'); +import Sprite from './components/Sprite.js'; import FText from './components/FText.vue'; Vue.use(plugin) Vue.component('f-text', FText); +Vue.component('sprite', Sprite); const el = document.getElementById('app') diff --git a/resources/js/components/Sprite.js b/resources/js/components/Sprite.js new file mode 100644 index 00000000..9af1d805 --- /dev/null +++ b/resources/js/components/Sprite.js @@ -0,0 +1,17 @@ +export default { + props: { + src: { required: true, type: String } + }, + render: function(createElement) { + var attr = this.$attrs.class ? this.$attrs.class : ''; + return createElement('svg', { + class: attr + ' fill-current' + }, [ + createElement('use', { + 'attrs': { + 'xlink:href': `/img/sprite.svg#${this.$props.src}` + } + }, '') + ] ) + } +}; diff --git a/resources/js/layouts/App.vue b/resources/js/layouts/App.vue index 55eb3bdc..c24668fd 100644 --- a/resources/js/layouts/App.vue +++ b/resources/js/layouts/App.vue @@ -1,12 +1,32 @@ + + diff --git a/resources/js/layouts/_VLink.vue b/resources/js/layouts/_VLink.vue new file mode 100644 index 00000000..1673510a --- /dev/null +++ b/resources/js/layouts/_VLink.vue @@ -0,0 +1,18 @@ + + + diff --git a/resources/js/views/Home.vue b/resources/js/views/Home.vue index 30074746..b384f399 100644 --- a/resources/js/views/Home.vue +++ b/resources/js/views/Home.vue @@ -1,11 +1,14 @@