Skip to content

Commit

Permalink
card image change size to 288
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-ivanovvv committed Nov 6, 2023
1 parent 8dadd49 commit deab42f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
6 changes: 3 additions & 3 deletions controllers/element.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ export default class Element {
await File.remove(dir, "cover");
await File.write(cover, dir, `cover.${extention}`);

const webp190 = await sharp(buf, { animated: true })
const webp288 = await sharp(buf, { animated: true })
.webp()
// .resize(190, 288, { fit: "cover", withoutEnlargement: true })
.resize(288, 288, { fit: "inside" })
.resize(288, 288, { fit: "inside", withoutEnlargement: true })
.toBuffer();
await File.write(webp190, dir, "cover@webp190.webp");
await File.write(webp288, dir, "cover@webp288.webp");
}

if (style.size) {
Expand Down
6 changes: 3 additions & 3 deletions controllers/page.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ export default class Page {
await File.remove(dir, "cover");
await File.write(cover, dir, `cover.${extention}`);

const webp190 = await sharp(buf, { animated: true })
const webp288 = await sharp(buf, { animated: true })
.webp()
// .resize(190, 288, { fit: "cover", withoutEnlargement: true })
.resize(288, 288, { fit: "inside" })
.resize(288, 288, { fit: "inside", withoutEnlargement: true })
.toBuffer();
await File.write(webp190, dir, "cover@webp190.webp");
await File.write(webp288, dir, "cover@webp288.webp");
}

if (style.size) {
Expand Down
6 changes: 0 additions & 6 deletions controllers/profile.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ export default class Profile {
.resize(64, 64, { fit: "cover", withoutEnlargement: true })
.toBuffer();
await File.write(webp64, dir, "avatar@webp64.webp");

const webp190 = await sharp(buf, { animated: true })
.webp()
.resize(190, 190, { fit: "cover", withoutEnlargement: true })
.toBuffer();
await File.write(webp190, dir, "avatar@webp190.webp");
}

if (style.size) {
Expand Down
3 changes: 3 additions & 0 deletions templates/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
color: var(--color);
border-color: var(--color);
}
.button * {
margin: 0;
}
.button_delete {
--color: var(--red);
}
Expand Down
2 changes: 1 addition & 1 deletion templates/card/cardElement.eta
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% const mode = it.mode || 'webp190' %>
<% const mode = it.mode || 'webp288' %>

<div
class="card card-element">
Expand Down
2 changes: 1 addition & 1 deletion templates/card/cardPage.eta
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% const mode = it.mode || 'webp190' %>
<% const mode = it.mode || 'webp288' %>

<a
href="/page/<%= page.page_id %>"
Expand Down

0 comments on commit deab42f

Please sign in to comment.