Skip to content

Commit

Permalink
Merge pull request #52 from beclab/fix/ui
Browse files Browse the repository at this point in the history
fix: update window scroller and optimize font library loading speed
  • Loading branch information
icebergtsn authored Nov 22, 2024
2 parents 791c745 + b61bdad commit 9381f7c
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 48 deletions.
21 changes: 21 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"autoprefixer": "^10.4.2",
"css-minimizer-webpack-plugin": "^7.0.0",
"dotenv": "^16.3.1",
"eslint": "^8.10.0",
"preload-webpack-plugin": "^3.0.0-beta.4",
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vue": "^9.0.0",
Expand Down
19 changes: 15 additions & 4 deletions frontend/quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ const { configure } = require('quasar/wrappers');
const dotenv = require('dotenv');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const PreloadWebpackPlugin = require('preload-webpack-plugin');

dotenv.config();

const path = require('path');

module.exports = configure(function (/* ctx */) {
module.exports = configure(function (ctx) {
return {
// https://v2.quasar.dev/quasar-cli-webpack/supporting-ts
supportTS: {
Expand Down Expand Up @@ -91,8 +92,18 @@ module.exports = configure(function (/* ctx */) {
// polyfillModulePreload: true,
// distDir

// extendViteConf (viteConf) {},
// viteVuePluginOptions: {},
extendWebpack(cfg) {
!ctx.dev &&
cfg.plugins.push(
new PreloadWebpackPlugin({
rel: 'preload',
include: 'allAssets',
fileWhitelist: [/.+MaterialSymbolsRounded.+/],
as: 'font'
})
);
},

chainWebpack(chain, { isClient, isServer }) {
chain.resolve.alias
.set('assets', path.resolve('src/assets'))
Expand Down Expand Up @@ -163,7 +174,7 @@ module.exports = configure(function (/* ctx */) {
}
: {
'/app-store': {
target: `https://market.${process.env.ACCOUNT}.myterminus.com`,
target: `https://market.${process.env.ACCOUNT_DOMAIN}`,
changeOrigin: true
}
}
Expand Down
93 changes: 52 additions & 41 deletions frontend/src/index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,57 @@
--reading-editable-line-length: 648px;
"
>
<head>
<title><%= productName %></title>
<meta charset="utf-8"/>
<meta name="description" content="<%= productDescription %>"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="referrer" content="no-referrer"/>
<meta name="msapplication-tap-highlight" content="no"/>
<meta
name="viewport"
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>"
/>
<head>
<title><%= productName %></title>
<meta charset="utf-8" />
<meta name="description" content="<%= productDescription %>" />
<meta name="format-detection" content="telephone=no" />
<meta name="referrer" content="no-referrer" />
<meta name="msapplication-tap-highlight" content="no" />
<meta
name="viewport"
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>"
/>

<link
rel="icon"
type="image/png"
sizes="128x128"
href="icons/market-128*128.png"
/>
<link
rel="icon"
type="image/png"
sizes="96x96"
href="icons/market-96*96.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="icons/market-32*32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="icons/market-16*16.png"
/>
<link rel="icon" type="image/ico" href="wise.ico"/>
</head>
<body>
<!-- DO NOT touch the following DIV -->
<div id="q-app"></div>
</body>
<link
rel="icon"
type="image/png"
sizes="128x128"
href="icons/market-128*128.png"
/>
<link
rel="icon"
type="image/png"
sizes="96x96"
href="icons/market-96*96.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="icons/market-32*32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="icons/market-16*16.png"
/>
<link rel="icon" type="image/ico" href="wise.ico" />
</head>
<body>
<!-- DO NOT touch the following DIV -->
<div id="q-app"></div>
</body>
</html>
<script>
if (navigator.platform.indexOf('Win') !== -1) {
document.body.classList.add('windows');
}
</script>
<style>
body.windows ::-webkit-scrollbar {
width: 0 !important;
height: 0 !important;
}
</style>
9 changes: 7 additions & 2 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4612,7 +4612,7 @@ html-minifier-terser@^7.2.0:
relateurl "^0.2.7"
terser "^5.15.1"

[email protected]:
html-webpack-plugin@>=3.0.0, html-webpack-plugin@5.6.0:
version "5.6.0"
resolved "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.0.tgz"
integrity sha512-iwaY4wzbe48AfKLZ/Cc8k0L+FKG6oSNRaZ8x5A/T/IVDGyXcbHncM9TdDa93wn0FsSm82FhTKW7f3vS61thXAw==
Expand Down Expand Up @@ -6497,6 +6497,11 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0:
picocolors "^1.0.1"
source-map-js "^1.2.0"

preload-webpack-plugin@^3.0.0-beta.4:
version "3.0.0-beta.4"
resolved "https://registry.npmjs.org/preload-webpack-plugin/-/preload-webpack-plugin-3.0.0-beta.4.tgz"
integrity sha512-6hhh0AswCbp/U4EPVN4fbK2wiDkXhmgjjgEYEmXa21UYwjYzCIgh3ZRMXM21ZPLfbQGpdFuSL3zFslU+edjpwg==

prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz"
Expand Down Expand Up @@ -8012,7 +8017,7 @@ webpack-sources@^3.2.3:
resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==

"webpack@^4.0.0 || ^5.0.0", "webpack@^4.1.0 || ^5.0.0-0", "webpack@^4.37.0 || ^5.0.0", webpack@^5, webpack@^5.0.0, webpack@^5.1.0, webpack@^5.20.0, webpack@^5.91.0, "webpack@>= 4", webpack@>=5:
"webpack@^4.0.0 || ^5.0.0", "webpack@^4.1.0 || ^5.0.0-0", "webpack@^4.37.0 || ^5.0.0", webpack@^5, webpack@^5.0.0, webpack@^5.1.0, webpack@^5.20.0, webpack@^5.91.0, "webpack@>= 4", webpack@>=4.0.0, webpack@>=5:
version "5.92.1"
resolved "https://registry.npmjs.org/webpack/-/webpack-5.92.1.tgz"
integrity sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA==
Expand Down

0 comments on commit 9381f7c

Please sign in to comment.