Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions frontend/googlefonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ import * as readline from 'readline';

const { GoogleFontsHelper } = await import('google-fonts-helper');
const readlineObject = readline.createInterface({
input: process.stdin,
output: process.stdout,
input: process.stdin,
output: process.stdout,
});

async function downloadFonts(url) {
await GoogleFontsHelper.download(url, {
base64: false,
overwriting: true,
outputDir: './frontend',
stylePath: 'css/site/base/fonts.css',
fontsDir: 'fonts',
fontsPath: '/frontend/fonts/',
});
console.log('\x1b[33m%s\x1b[0m', "Dont't forget to add 'fonts.css' to your 'main.css' file");
await GoogleFontsHelper.download(url, {
base64: false,
overwriting: true,
outputDir: './',
stylePath: 'css/site/base/fonts.css',
fontsDir: 'fonts',
fontsPath: '/fonts/',
});
console.log('\x1b[33m%s\x1b[0m', "Dont't forget to add 'fonts.css' to your 'main.css' file");
}

readlineObject.question('Google fonts URL: ', (url) => {
readlineObject.close();
if (GoogleFontsHelper.isValidURL(url)) {
console.log('Downloading Fonts...');
downloadFonts(url);
} else {
console.error('\x1b[1m\x1b[41m\x1b[37m%s\x1b[0m', 'Invalid URL');
}
readlineObject.close();
if (GoogleFontsHelper.isValidURL(url)) {
console.log('Downloading Fonts...');
downloadFonts(url);
} else {
console.error('\x1b[1m\x1b[41m\x1b[37m%s\x1b[0m', 'Invalid URL');
}
});
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@vitejs/plugin-basic-ssl": "^2.0.0",
"@vitejs/plugin-legacy": "^7.2.1",
"autoprefixer": "^10.4.22",
"google-fonts-helper": "^3.7.3",
"google-fonts-helper": "^2.0.1",
"postcss-cli": "^11.0.1",
"promise-polyfill": "^8.3.0",
"tailwindcss": "^4.1.0",
Expand Down
Loading