Skip to content

Commit

Permalink
支持 .webm 图片
Browse files Browse the repository at this point in the history
  • Loading branch information
liufei-ereach committed Sep 10, 2024
1 parent 2fdcb1b commit 19b8df0
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion js/dist/admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/admin.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions js/src/admin/components/StoreGoodsDetailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,21 @@ export default class StoreGoodsDetailModal extends Modal {
this.iconList.map((item) => {
return (
<div className="icon-frame inlineBlock" onclick={() => this.selectIconItem(item.attributes.url)}>
<img className="icon-size" src={item.attributes.url}/>
<img className="icon-size" src={item.attributes.url}
style={item.attributes.url.slice(-5) === '.webm' ? 'display: none' : ''}/>
<video autoplay loop muted playsinline className="icon-size"
style={item.attributes.url.slice(-5) === '.webm' ? '' : 'display: none'}>
<source src={item.attributes.url} type="video/webm"/>
</video>
</div>
)
})
}
</div>
{!this.loading && this.iconList.length===0 && (
{!this.loading && this.iconList.length === 0 && (
<div>
<div style="font-size:1.4em;color: var(--muted-more-color);text-align: center;line-height: 100px;">{app.translator.trans("mattoid-store.lib.list-empty")}</div>
<div
style="font-size:1.4em;color: var(--muted-more-color);text-align: center;line-height: 100px;">{app.translator.trans("mattoid-store.lib.list-empty")}</div>
</div>
)}

Expand Down
7 changes: 6 additions & 1 deletion js/src/admin/components/StoreListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ export default class StoreListItem extends Component {
</div>
</div>
<div className="rightAligned icon-size">
<img className="icon-size" src={this.storeData.icon}/>
<img className="icon-size" src={this.storeData.icon}
style={this.storeData.icon.slice(-5) === '.webm' ? 'display: none' : ''}/>
<video autoplay loop muted playsinline className="icon-size"
style={this.storeData.icon.slice(-5) === '.webm' ? '' : 'display: none'}>
<source src={this.storeData.icon} type="video/webm"/>
</video>
</div>
</div>
)
Expand Down
8 changes: 4 additions & 4 deletions js/src/forum/components/component/StoreItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ export default class StoreItem extends Component {
</div>
</div>
<div className="spacing center">
<img className="icon-size" src={this.params.icon()}
style={this.params.icon().slice(-5) === '.webm' ? 'display: none' : ''}/>
<img className="icon-size" src={this.storeData.icon}
style={this.storeData.icon.slice(-5) === '.webm' ? 'display: none' : ''}/>
<video autoplay loop muted playsinline className="icon-size"
style={this.params.icon().slice(-5) === '.webm' ? '' : 'display: none'}>
<source src={this.params.icon()} type="video/webm"/>
style={this.storeData.icon.slice(-5) === '.webm' ? '' : 'display: none'}>
<source src={this.storeData.icon} type="video/webm"/>
</video>
</div>
</div>
Expand Down

0 comments on commit 19b8df0

Please sign in to comment.