Skip to content

Commit

Permalink
Merge pull request #26 from beclab/feat/search
Browse files Browse the repository at this point in the history
fix: Optimize font loading and replace img
  • Loading branch information
wushuangs authored Aug 8, 2024
2 parents 7dde32c + 1b6a42a commit 4ee1216
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/update-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@ jobs:
run: |
npm install
- run: npm i -g @quasar/cli
- name: Install fonttools
run: pip3 install fonttools brotli
- name: Download fonttools Files
run: |
pwd
curl -L -o fonttools.zip https://cdn.bttcdn.com/common/fonttools.zip
unzip fonttools.zip
- name: Python Icon
run: pwd; cd ./fonttools; sudo node python-icon.js
- name: subset Icon
run: |
sudo chmod 755 fonttools
cd ./fonttools
./subset_font.sh nyTnjDwKNJ_190FjzaqkNCeE.woff2 unicodes.txt MaterialSymbolsRounded.woff2 ../packages/frontend/src/assets/fonts
- name: Build
run: npm run app:build
- name: Build and push
Expand Down
13 changes: 6 additions & 7 deletions packages/frontend/quasar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ module.exports = configure(function (ctx) {

boot: ['i18n', 'axios', 'smartEnginEntrance'],

css: ['app.scss', 'fonts.scss'],
css: [
'app.scss',
'fonts.scss',
ctx.dev ? 'font.dev.scss' : 'font.pro.scss'
],

extras: [
'roboto-font', // optional, you are not bound to it
'material-icons', // optional, you are not bound to it
'bootstrap-icons',
'themify',
'material-icons',
'material-symbols-outlined',
'material-symbols-rounded'
'material-icons' // optional, you are not bound to it
],

vendor: {
Expand Down
Binary file not shown.
Binary file modified packages/frontend/src/assets/search-wise-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/frontend/src/css/font.dev.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@font-face {
font-display: block;
font-family: 'Material Symbols Rounded';
font-style: normal;
font-weight: 100 700;
src: url('../assets/fonts/nyTnjDwKNJ_190FjzaqkNCeE.woff2') format('woff2');
}
7 changes: 7 additions & 0 deletions packages/frontend/src/css/font.pro.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@font-face {
font-display: block;
font-family: 'Material Symbols Rounded';
font-style: normal;
font-weight: 100 700;
src: url('../assets/fonts/MaterialSymbolsRounded.woff2') format('woff2');
}

0 comments on commit 4ee1216

Please sign in to comment.