diff --git a/src/backend/routes/PublicRouter.ts b/src/backend/routes/PublicRouter.ts
index 028290b0..8ffe6b05 100644
--- a/src/backend/routes/PublicRouter.ts
+++ b/src/backend/routes/PublicRouter.ts
@@ -35,7 +35,7 @@ export class PublicRouter {
let selectedLocale = req.locale;
if (req.cookies && req.cookies[CookieNames.lang]) {
if (
- Config.Server.languages.indexOf(req.cookies[CookieNames.lang]) !== -1
+ Config.Server.languages.indexOf(req.cookies[CookieNames.lang]) !== -1
) {
selectedLocale = req.cookies[CookieNames.lang];
}
@@ -48,14 +48,14 @@ export class PublicRouter {
// index.html should not be cached as it contains template that can change
const renderIndex = (req: Request, res: Response, next: NextFunction) => {
ejs.renderFile(
- path.join(ProjectPath.FrontendFolder, req.localePath, 'index.html'),
- res.tpl,
- (err, str) => {
- if (err) {
- return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, err.message));
- }
- res.send(str);
+ path.join(ProjectPath.FrontendFolder, req.localePath, 'index.html'),
+ res.tpl,
+ (err, str) => {
+ if (err) {
+ return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, err.message));
}
+ res.send(str);
+ }
);
};
@@ -94,12 +94,12 @@ export class PublicRouter {
}) as unknown as ClientConfig;
// Escaping html tags, like
confCopy.Server.customHTMLHead =
- confCopy.Server.customHTMLHead
- .replace(/&/g, '&')
- .replace(//g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, ''');
+ confCopy.Server.customHTMLHead
+ .replace(/&/g, '&')
+ .replace(//g, '>')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''');
res.tpl.Config = confCopy;
res.tpl.customHTMLHead = Config.Server.customHTMLHead;
const selectedTheme = Config.Gallery.Themes.availableThemes.find(th => th.name === Config.Gallery.Themes.selectedTheme)?.theme || '';
@@ -140,8 +140,8 @@ export class PublicRouter {
'photo'
],
start_url:
- Config.Server.publicUrl === '' ? '.' : Config.Server.publicUrl,
- background_color: '#212529',
+ Config.Server.publicUrl === '' ? '.' : Config.Server.publicUrl,
+ background_color: '#000000',
theme_color: '#000000',
});
});
@@ -163,62 +163,63 @@ export class PublicRouter {
vBs[2] = icon_size;
vBs[3] = icon_size;
+ const getCanvasSize = () => Math.max(vBs[2], vBs[3]);
+
const addPadding = (p: number) => {
if (p <= 0) {
return;
}
- const size = Math.max(vBs[2], vBs[3]);
+ const size = getCanvasSize();
vBs[0] -= size * (p / 2);
vBs[1] -= size * (p / 2);
vBs[2] += size * (p);
vBs[3] += size * (p);
};
- const circle_size = icon_size * 1.38;
addPadding(0.38);
addPadding(paddingPercent);
- const canvasMid = {
- x: vBs[2] / 2 + vBs[0],
- y: vBs[3] / 2 + vBs[1],
+ const canvasSize = getCanvasSize();
+ const canvasStart = {
+ x: vBs[0],
+ y: vBs[1]
};
-
return '';
+ ' xmlns="http://www.w3.org/2000/svg"' +
+ ' viewBox="' + vBs.join(' ') + '">' +
+ (theme === 'auto' ? ('') :
+ (theme != null ?
+ ('')
+ : '')) +
+ `