diff --git a/src/assets/css/post-parser.css b/src/assets/css/post-parser.css index 7eb213d6..4b934842 100644 --- a/src/assets/css/post-parser.css +++ b/src/assets/css/post-parser.css @@ -182,45 +182,44 @@ /* 大别野卡片 */ :deep(.mys-post-villa-card) { position: relative; - display: flex; overflow: hidden; width: 800px; - height: auto; - flex-wrap: wrap; - justify-content: space-between; - padding: 20px; - border: 1px solid var(--common-shadow-1); + border: 1px solid var(--common-shadow-2); border-radius: 10px; - gap: 10px; -} - -:deep(.mys-post-villa-card-bg-before) { - position: absolute; - z-index: 2; - top: 120px; - right: 0; - width: 100%; - height: calc(100% - 120px); - background: linear-gradient(rgba(255, 255, 255, 0), #ffffff 80px, #ffffff); } :deep(.mys-post-villa-card-bg) { position: absolute; - z-index: 1; + top: -40px; + right: 0; + width: 100%; + border-radius: 10px; + object-fit: cover; +} + +:deep(.mys-post-villa-card-bg-before) { + position: absolute; top: 0; right: 0; width: 100%; height: 100%; + background: linear-gradient(rgba(255, 255, 255, 0) 40px, var(--box-bg-1) 140px); +} + +:deep(.mys-post-villa-card-flex) { + position: relative; + display: flex; + width: 100%; + flex-direction: column; + justify-content: space-between; + padding: 10px; border-radius: 10px; - background-position-y: 10px; - object-fit: cover; + gap: 10px; } :deep(.mys-post-villa-card-top) { - z-index: 3; display: flex; width: 100%; - height: 100px; flex-direction: row; align-items: center; justify-content: flex-start; @@ -235,13 +234,17 @@ :deep(.mys-post-villa-card-content) { display: flex; - height: 100px; + height: 80px; flex-direction: column; align-items: flex-start; justify-content: space-between; } :deep(.mys-post-villa-card-title) { + padding: 0 5px; + border-radius: 5px; + backdrop-filter: blur(5px); + background: var(--common-shadow-t-4); color: var(--common-text-title); font-family: var(--font-title); font-size: 20px; @@ -252,24 +255,28 @@ flex-direction: row; align-items: center; justify-content: flex-start; - gap: 10px; + padding: 0 5px; + border-radius: 5px; + backdrop-filter: blur(5px); + background: var(--common-shadow-t-2); + gap: 5px; } :deep(.mys-post-villa-card-desc-icon) { - width: 20px; - height: 20px; + width: 30px; + height: 30px; + border-radius: 50%; } :deep(.mys-post-villa-card-desc-text) { color: var(--common-text-content); + font-family: var(--font-text); font-size: 14px; } :deep(.mys-post-villa-card-mid) { - z-index: 3; display: flex; width: 100%; - height: 80px; flex-direction: row; align-items: center; justify-content: flex-start; @@ -277,23 +284,18 @@ } :deep(.mys-post-villa-card-tag) { - width: auto; - height: 40px; - padding: 5px; + padding: 2px 5px; border-radius: 5px; - margin: 5px; - background: #f4f4f4; - color: #999999; + background: var(--box-bg-2); + color: var(--box-text-2); font-family: var(--font-text); font-size: 12px; } :deep(.mys-post-villa-card-bottom) { - z-index: 3; width: 100%; - height: auto; font-family: var(--font-title); - font-size: 16px; + font-size: 20px; text-align: left; } diff --git a/src/plugins/Mys/utils/parsePost.ts b/src/plugins/Mys/utils/parsePost.ts index df82f2e0..9ff004a4 100644 --- a/src/plugins/Mys/utils/parsePost.ts +++ b/src/plugins/Mys/utils/parsePost.ts @@ -592,13 +592,15 @@ function parseVillaCard(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDiv div.classList.add("mys-post-div"); const villaCard = document.createElement("div"); villaCard.classList.add("mys-post-villa-card"); - const bgBefore = document.createElement("div"); - bgBefore.classList.add("mys-post-villa-card-bg-before"); - villaCard.appendChild(bgBefore); const bgImg = document.createElement("img"); bgImg.classList.add("mys-post-villa-card-bg"); bgImg.src = data.insert.villa_card.villa_cover; villaCard.appendChild(bgImg); + const bgBefore = document.createElement("div"); + bgBefore.classList.add("mys-post-villa-card-bg-before"); + villaCard.appendChild(bgBefore); + const flexDiv = document.createElement("div"); + flexDiv.classList.add("mys-post-villa-card-flex"); const topDiv = document.createElement("div"); topDiv.classList.add("mys-post-villa-card-top"); const topIcon = document.createElement("img"); @@ -623,7 +625,7 @@ function parseVillaCard(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDiv topContent.appendChild(topDesc); topDiv.appendChild(topIcon); topDiv.appendChild(topContent); - villaCard.appendChild(topDiv); + flexDiv.appendChild(topDiv); const midDiv = document.createElement("div"); midDiv.classList.add("mys-post-villa-card-mid"); const numberDiv = document.createElement("div"); @@ -636,11 +638,12 @@ function parseVillaCard(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDiv tagDiv.innerText = tag; midDiv.appendChild(tagDiv); }); - villaCard.appendChild(midDiv); + flexDiv.appendChild(midDiv); const bottomDiv = document.createElement("div"); bottomDiv.classList.add("mys-post-villa-card-bottom"); bottomDiv.innerText = data.insert.villa_card.villa_introduce; - villaCard.appendChild(bottomDiv); + flexDiv.appendChild(bottomDiv); + villaCard.appendChild(flexDiv); div.appendChild(villaCard); return div; }