And the css:
/* Adapted from Minimal theme by @kepano */
/* Required by @kepane, this is his `buy me a coffee` page https://www.buymeacoffee.com/kepano */
/* MIT License
/*********covercards2***********/
:root{
--cards2-width: 100px;/* 主要图片的大小 */
}
@media (max-width: 400px) {
:root{
--cards2-width: 400px;
}
}
@media (max-width: 300px) {
:root{
--cards2-width: 300px;
}
}
@media (max-width: 300px) {
:root{
--cards2-width: 300px;
}
}
img[alt^="bookcover"] {
border-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.theme-light progress::-webkit-progress-bar {
background: #cccccc;
}
.theme-dark progress::-webkit-progress-bar {
background: #1a1919;
}
.cards2 progress{
position: absolute;
width: var(--cards2-width);
margin-top: -10px;
margin-left: calc(var(--cards2-width) /2 * -1);
overflow: hidden;
height: 4px;
}
.cards2 progress.yellow::-moz-progress-bar {
background: #e78f0c;
}
.cards2 progress.yellow::-webkit-progress-value {
border-radius: 1em;
background: #e78f0c;
}
.cards2 progress.hot::-moz-progress-bar {
background: #fa7131dc;
}
.cards2 progress.hot::-webkit-progress-value {
border-radius: 1em;
background: #fa7131dc;
}
.cards2 table.dataview tbody {
display:flex;
margin-left: -0.8em;
width: 40%;
flex-flow: wrap;
}
@media (max-width:1120px) {
.cards2 table.dataview tbody {
margin-left: -40px;
padding: 0 40px
}
}
@media (max-width:960px) {
.cards2 table.dataview tbody {
margin-left: -30px;
padding: 0 30px
}
}
@media (max-width:460px) {
.cards2 table.dataview tbody {
padding: 0px;
margin-left: -20px;
}
}
.cards2 table.dataview>tbody>tr {
display: block;
width:var(--cards2-width);
height: auto;
margin-left: 1.4em;
margin-bottom: 1em;
background-color:transparent;
}
@media (max-width:1120px) {
.cards2 table.dataview>tbody>tr {
margin-left: 40px
}
}
@media (max-width:960px) {
.cards2 table.dataview>tbody>tr {
margin-left: 30px
}
}
@media (max-width:460px) {
.cards2 table.dataview>tbody>tr {
margin-left: 20px;
margin-bottom: 20px
}
}
.cards2 .dataview.table-view-table button {
text-align: left;
padding-left: 0.8em;
}
.cards2 table.dataview tbody>tr>td:first-child,
.markdown-source-view.mod-cm6.cards2 .dataview.table-view-table>tbody>tr>td:first-child {
width: 400px;/* 背景框的宽度 */
height: 200px;/* 背景框的高度 */
display: block;
box-shadow: 0 2px 16px rgba(0, 0, 0, .1);
position: relative;
padding: 20;
border-radius: 12px;/* 背景框的圆角 */
}
.cards2 table.dataview tbody>tr>td img {
vertical-align: top;
width: 100%;
height: calc(var(--cards2-width) / 0.7 );
background-color:var(--background-secondary);
-o-object-fit: cover;
object-fit: cover;/* 这个取消掉的话就是强行撑满 */
border-radius: 12px;/* 内部图片圆角 */
}
/* 背景左边的投影样式 */
.cards2 table.dataview tbody>tr>td:first-child:after{
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
/*left: 0;*/
background-image: linear-gradient(90deg, hsla(0, 0%, 63.1%, .25), rgba(21, 21, 20, .1) 1%, hsla(0, 0%, 100%, .15) 4%, hsla(0, 0%, 58%, .1) 8%, hsla(0, 0%, 89%, 0) 57%, rgba(223, 218, 218, .03) 91%, rgba(223, 218, 218, .05) 98%, hsla(0, 0%, 100%, .1));
box-shadow: inset 0 0 0 0 rgba(0, 0, 0, .1);
}
.cards2 table.dataview tbody>tr>td:not(:first-child),
.markdown-source-view.mod-cm6.cards2 .dataview.table-view-table>tbody>tr>td:not(:first-child) {
text-align: center;
padding: 5;
margin-top: 4px;
font-size: 15px;
color: var(--text-muted);
line-height: 18px;
overflow: hidden;
display: -webkit-box;
display: -moz-box;
-webkit-line-clamp: 2;
-moz-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
-webkit-text-size-adjust: auto;
box-orient: vertical;
height: auto;
font-size: 16px;
line-height: 1.1;
white-space: nowrap;
text-overflow: ellipsis;
}
.cards2 table.dataview tbody>tr>td button {
font-size: 12px;
background-color: transparent;
padding: 0;
}
.cards2 table.dataview tbody>tr>td:nth-child(2) {
margin-top: 10px;
}
.cards2 table.dataview tbody>tr>td:nth-child(3) {
-webkit-text-stroke: 0.25px ;
}
/*------------*/
.cards2 table.dataview thead {
user-select: none;
width: 160px;
display: block;
float: right;
position: relative;
text-align: right;
padding-bottom: 4px
}
.cards2 table.dataview thead:before {
content: '';
background-repeat: no-repeat;
cursor: var(--cursor);
text-align: right;
padding: 4px 10px;
margin-bottom: 2px;
border-radius: 5px;
font-weight: 500;
font-size: var(--font-adaptive-small);
}
.cards2 table.dataview thead:before {
opacity: .25;
background-position: center center;
background-size: 18px;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="white" d="M49.792 33.125l-5.892 5.892L33.333 28.45V83.333H25V28.45L14.438 39.017L8.542 33.125L29.167 12.5l20.625 20.625zm41.667 33.75L70.833 87.5l-20.625 -20.625l5.892 -5.892l10.571 10.567L66.667 16.667h8.333v54.883l10.567 -10.567l5.892 5.892z"></path></svg>');
}
.theme-light .cards2 table.dataview thead:before {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="black" d="M49.792 33.125l-5.892 5.892L33.333 28.45V83.333H25V28.45L14.438 39.017L8.542 33.125L29.167 12.5l20.625 20.625zm41.667 33.75L70.833 87.5l-20.625 -20.625l5.892 -5.892l10.571 10.567L66.667 16.667h8.333v54.883l10.567 -10.567l5.892 5.892z"></path></svg>');
}
.cards2 table.dataview thead:hover:before {
opacity: .5;
}
.cards2 table.dataview thead>tr {
position: absolute;
display: none;
z-index: 9;
border: 1px solid var(--background-modifier-border);
background-color: var(--background-secondary);
box-shadow: 0 2px 8px var(--background-modifier-box-shadow);
padding: 6px;
border-radius: 6px;
flex-direction: column;
margin: 0;
width: 100%;
}
.cards2 table.dataview thead:hover>tr{
display: flex;
}
.cards2 table.dataview thead>tr>th{
display: block;
background-color: var(--background-primary);
padding: 3px 30px 3px 6px!important;
border-radius: 5px;
width: 100%;
font-weight: 400;
color: var(--text-muted);
border: none;
font-size: var(--font-adaptive-small);
}
.cards2 table.dataview thead>tr>th[sortable-style=sortable-asc],
.cards2 table.dataview thead>tr>th[sortable-style=sortable-desc] {
color: var(--text-normal)
}
.cards2 table.dataview thead>tr>th:hover {
color: var(--text-normal);
background-color: var(--background-secondary);
}
:is(.markdown-source-view,.markdown-preview-view,.markdown-rendered).cards2 .block-language-dataview table {
box-shadow: none;
}