diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss
index ff084fa35..b4f859ca7 100644
--- a/app/src/assets/scss/business/_av.scss
+++ b/app/src/assets/scss/business/_av.scss
@@ -292,7 +292,6 @@
}
&-cover {
- height: 168px;
border-bottom: 1px solid var(--b3-border-color);
background-color: var(--b3-theme-surface);
border-radius: var(--b3-border-radius) var(--b3-border-radius) 0 0;
@@ -300,6 +299,28 @@
transition: background 100ms ease-out;
position: relative;
cursor: pointer;
+
+ &--0 {
+ aspect-ratio: 16/9;
+ }
+ &--1 {
+ aspect-ratio: 9/16;
+ }
+ &--2 {
+ aspect-ratio: 4/3;
+ }
+ &--3 {
+ aspect-ratio: 3/4;
+ }
+ &--4 {
+ aspect-ratio: 3/2;
+ }
+ &--5 {
+ aspect-ratio: 2/3;
+ }
+ &--6 {
+ aspect-ratio: 1;
+ }
}
&-img {
diff --git a/app/src/protyle/render/av/gallery/render.ts b/app/src/protyle/render/av/gallery/render.ts
index bf99c0d5f..084fae936 100644
--- a/app/src/protyle/render/av/gallery/render.ts
+++ b/app/src/protyle/render/av/gallery/render.ts
@@ -71,7 +71,7 @@ export const renderGallery = (options: {
} else if (item.coverContent) {
galleryHTML += `
`;
} else {
- galleryHTML += '';
+ galleryHTML += ``;
}
}
galleryHTML += ``;
diff --git a/app/src/protyle/render/av/gallery/util.ts b/app/src/protyle/render/av/gallery/util.ts
index f412149a5..dcda78103 100644
--- a/app/src/protyle/render/av/gallery/util.ts
+++ b/app/src/protyle/render/av/gallery/util.ts
@@ -180,7 +180,7 @@ export const getCardAspectRatio = (ratio: number) => {
case 4:
return "3:2";
case 5:
- return "3:2";
+ return "2:3";
case 6:
return "1:1";
}
@@ -197,25 +197,27 @@ export const setGalleryRatio = (options: {
const avID = options.nodeElement.getAttribute("data-av-id");
const blockID = options.nodeElement.getAttribute("data-node-id");
const targetNameElement = options.target.querySelector(".b3-menu__accelerator");
- menu.addItem({
- iconHTML: "",
- checked: options.view.cardAspectRatio === 0,
- label: "16:9",
- click() {
- transaction(options.protyle, [{
- action: "setAttrViewCardAspectRatio",
- avID,
- blockID,
- data: 0
- }], [{
- action: "setAttrViewCardAspectRatio",
- avID,
- blockID,
- data: options.view.cardSize
- }]);
- options.view.cardAspectRatio = 0;
- targetNameElement.textContent = getCardAspectRatio(0);
- }
+ [0, 1, 2, 3, 4, 5, 6].forEach(ratio => {
+ menu.addItem({
+ iconHTML: "",
+ checked: options.view.cardAspectRatio === ratio,
+ label: getCardAspectRatio(ratio),
+ click() {
+ transaction(options.protyle, [{
+ action: "setAttrViewCardAspectRatio",
+ avID,
+ blockID,
+ data: ratio
+ }], [{
+ action: "setAttrViewCardAspectRatio",
+ avID,
+ blockID,
+ data: options.view.cardAspectRatio
+ }]);
+ options.view.cardAspectRatio = ratio;
+ targetNameElement.textContent = getCardAspectRatio(ratio);
+ }
+ });
});
const rect = options.target.getBoundingClientRect();
menu.open({x: rect.left, y: rect.bottom});