feat: auto-detect preview image format (jpg/png/webp/gif)
This commit is contained in:
@@ -289,10 +289,11 @@ const PageDashboard = {
|
||||
const isAll = supported === 'all';
|
||||
const compatLabel = isAll ? '全' : '限';
|
||||
const compatClass = isAll ? 'badge-info' : 'badge-warning';
|
||||
const preview = `/dashboard/${theme.id}/preview.jpg`;
|
||||
const preview = theme.preview_ext ? `/dashboard/${theme.id}/preview.${theme.preview_ext}` : '';
|
||||
const bgStyle = preview ? `background-image:url(${preview});background-size:cover;background-position:center` : '';
|
||||
return `
|
||||
<div class="glass-card theme-card" data-theme-id="${theme.id}">
|
||||
<div class="theme-card-preview" style="background-image:url(${preview});background-size:cover;background-position:center">${icon}</div>
|
||||
<div class="theme-card-preview" style="${bgStyle}">${preview?'':icon}</div>
|
||||
<div class="theme-card-info">
|
||||
<div class="theme-card-name">${theme.name || 'Unnamed'}</div>
|
||||
<div class="theme-card-meta">
|
||||
|
||||
Reference in New Issue
Block a user