Skip to content
This repository was archived by the owner on Mar 26, 2023. It is now read-only.

Commit d893560

Browse files
netsvetochArtem Netsvetaev
andauthored
add shadows (#37)
Co-authored-by: Artem Netsvetaev <physphile@vk.com>
1 parent ae3bb37 commit d893560

7 files changed

Lines changed: 38 additions & 51 deletions

File tree

.eslintrc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
"env": {
33
"node": true
44
},
5-
"extends": [
6-
"plugin:vue/vue3-essential",
7-
"eslint:recommended",
8-
"@vue/eslint-config-prettier"
9-
],
5+
"extends": ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/eslint-config-prettier"],
106
"parserOptions": {
117
"parser": "@babel/eslint-parser",
128
"requireConfigFile": false
@@ -27,6 +23,6 @@
2723
}
2824
],
2925
"object-shorthand": "warn",
30-
"no-console": "warn"
26+
"no-debugger": "error"
3127
}
3228
}

.prettierrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"bracketSpacing": true,
55
"trailingComma": "all",
66
"semi": true,
7-
"printWidth": 80,
7+
"printWidth": 120,
88
"singleQuote": true,
99
"quoteProps": "consistent",
10-
"singleAttributePerLine": true
10+
"singleAttributePerLine": true,
11+
"endOfLine": "auto"
1112
}

src/microfrontend-layout.html

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from="/"
44
to="/timetable"
55
></redirect>
6-
<header style="position: fixed; top: 0; width: 100%">
6+
<header class="layout-toolbar">
77
<application name="@profcomff/toolbar-element"></application>
88
</header>
9-
<main style="min-height: 100vh; padding: 56px 0">
9+
<main class="layout-main">
1010
<route path="/timetable">
1111
<application name="@profcomff/timetable-webapp"></application>
1212
</route>
@@ -21,22 +21,13 @@
2121
</route>
2222

2323
<route default>
24-
<div
25-
style="
26-
display: flex;
27-
flex-flow: column;
28-
justify-content: center;
29-
width: 100%;
30-
min-height: 100vh;
31-
"
32-
>
24+
<div style="display: flex; flex-flow: column; justify-content: center; width: 100%; min-height: 100vh">
3325
<div style="margin: 0 10%">
3426
<p
3527
class="display-5"
3628
style="word-wrap: break-word"
3729
>
38-
Вы попали на страницу, которой еще не существует в
39-
приложении =(
30+
Вы попали на страницу, которой еще не существует в приложении =(
4031
</p>
4132
<p></p>
4233
<p class="display-6">
@@ -48,7 +39,7 @@
4839
</route>
4940
</main>
5041

51-
<nav style="position: fixed; bottom: 0; width: 100%">
42+
<nav class="layout-navbar">
5243
<application name="@profcomff/navbar-element"></application>
5344
</nav>
5445
</single-spa-router>

src/profcomff-root-config.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ import './scss/styles.scss';
22
import 'bootstrap';
33

44
import { registerApplication, start } from 'single-spa';
5-
import {
6-
constructApplications,
7-
constructRoutes,
8-
constructLayoutEngine,
9-
} from 'single-spa-layout';
5+
import { constructApplications, constructRoutes, constructLayoutEngine } from 'single-spa-layout';
106
import microfrontendLayout from './microfrontend-layout.html';
117
import { register } from 'register-service-worker';
128

@@ -17,9 +13,7 @@ function isLocalhost() {
1713
// [::1] is the IPv6 localhost address.
1814
window.location.hostname === '[::1]' ||
1915
// 127.0.0.1/8 is considered localhost for IPv4.
20-
window.location.hostname.match(
21-
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/,
22-
),
16+
window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/),
2317
);
2418
}
2519

@@ -45,22 +39,16 @@ if (!isLocalhost())
4539
console.log('Service worker has been registered:' + registration);
4640
},
4741
cached(registration) {
48-
console.log(
49-
'Content has been cached for offline use:' + registration,
50-
);
42+
console.log('Content has been cached for offline use:' + registration);
5143
},
5244
updatefound(registration) {
5345
console.log('New content is downloading:' + registration);
5446
},
5547
updated(registration) {
56-
console.log(
57-
'New content is available; please refresh:' + registration,
58-
);
48+
console.log('New content is available; please refresh:' + registration);
5949
},
6050
offline() {
61-
console.log(
62-
'No internet connection found. App is running in offline mode.',
63-
);
51+
console.log('No internet connection found. App is running in offline mode.');
6452
},
6553
error(error) {
6654
console.error('Error during service worker registration:', error);

src/scss/styles.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,22 @@
1111
user-select: none; /* Non-prefixed version, currently
1212
supported by Chrome, Edge, Opera and Firefox */
1313
}
14+
15+
.layout-main {
16+
min-height: 100vh;
17+
padding: 56px 0;
18+
}
19+
20+
.layout-toolbar {
21+
position: fixed;
22+
top: 0;
23+
width: 100%;
24+
box-shadow: 0 2px 4px rgba($color: #000000, $alpha: 0.5);
25+
}
26+
27+
.layout-navbar {
28+
position: fixed;
29+
bottom: 0;
30+
width: 100%;
31+
box-shadow: 0 -2px 4px rgba($color: #000000, $alpha: 0.5);
32+
}

src/service-worker.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { cleanupOutdatedCaches, precacheAndRoute } from 'workbox-precaching';
22
import { registerRoute } from 'workbox-routing';
3-
import {
4-
CacheFirst,
5-
StaleWhileRevalidate,
6-
NetworkFirst,
7-
} from 'workbox-strategies';
3+
import { CacheFirst, StaleWhileRevalidate, NetworkFirst } from 'workbox-strategies';
84
import { ExpirationPlugin } from 'workbox-expiration';
95
import { CacheableResponsePlugin } from 'workbox-cacheable-response';
106

webpack.config.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ module.exports = (webpackConfigEnv, argv) => {
1414
disableHtmlGeneration: true,
1515
});
1616

17-
let nonlocal_plugins = !webpackConfigEnv.local
18-
? [new InjectManifest({ swSrc: './src/service-worker.js' })]
19-
: [];
17+
let nonlocal_plugins = !webpackConfigEnv.local ? [new InjectManifest({ swSrc: './src/service-worker.js' })] : [];
2018

2119
return merge(defaultConfig, {
2220
module: {
@@ -53,16 +51,14 @@ module.exports = (webpackConfigEnv, argv) => {
5351
templateParameters: {
5452
local: webpackConfigEnv && webpackConfigEnv.local,
5553
production: webpackConfigEnv && webpackConfigEnv.production,
56-
development:
57-
webpackConfigEnv && webpackConfigEnv.development,
54+
development: webpackConfigEnv && webpackConfigEnv.development,
5855
orgName,
5956
},
6057
}),
6158
new WebpackPwaManifest({
6259
name: 'Твой физфак!',
6360
short_name: 'Твой ФФ!',
64-
description:
65-
'Приложение с сервисами для студентов и сотрудников физического факультета МГУ',
61+
description: 'Приложение с сервисами для студентов и сотрудников физического факультета МГУ',
6662
display: 'standalone',
6763
theme_color: '#00004b',
6864
background_color: '#00004b',

0 commit comments

Comments
 (0)