231 lines
9.1 KiB
HTML
231 lines
9.1 KiB
HTML
<!--
|
|
* @Author: YwxApp <ywx@ywxapp.cn>
|
|
* @Description: 应用商店前台(公开,仅中心站)
|
|
-->
|
|
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>应用市场 - {$market_name}</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link href="/assets/layui/css/layui.css" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--brand: #4f46e5;
|
|
--brand-2: #7c3aed;
|
|
--ink: #1f2329;
|
|
--muted: #8a8f99;
|
|
--line: #eceef2;
|
|
--bg: #f5f6fa;
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin: 0; background: var(--bg); color: var(--ink);
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
.brandbar {
|
|
height: 56px; display: flex; align-items: center; gap: 10px;
|
|
padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line);
|
|
position: sticky; top: 0; z-index: 20;
|
|
}
|
|
.brandbar .logo {
|
|
width: 30px; height: 30px; border-radius: 8px;
|
|
background: linear-gradient(135deg, var(--brand), var(--brand-2));
|
|
display: grid; place-items: center; color: #fff; font-weight: 700;
|
|
}
|
|
.brandbar .name { font-weight: 600; font-size: 16px; }
|
|
.brandbar .nav { margin-left: auto; display: flex; gap: 22px; font-size: 14px; }
|
|
.brandbar .nav a { color: var(--muted); text-decoration: none; transition: color .2s; }
|
|
.brandbar .nav a:hover, .brandbar .nav a.on { color: var(--brand); }
|
|
|
|
.hero {
|
|
padding: 54px 24px 46px; text-align: center; color: #fff;
|
|
background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #9333ea 100%);
|
|
position: relative; overflow: hidden;
|
|
}
|
|
.hero::after {
|
|
content: ""; position: absolute; inset: 0;
|
|
background:
|
|
radial-gradient(420px 220px at 12% 0%, rgba(255,255,255,.18), transparent 60%),
|
|
radial-gradient(380px 200px at 88% 100%, rgba(255,255,255,.12), transparent 60%);
|
|
}
|
|
.hero h1 { margin: 0 0 10px; font-size: 32px; letter-spacing: .5px; position: relative; }
|
|
.hero p { margin: 0; opacity: .92; font-size: 15px; position: relative; }
|
|
|
|
.toolbar {
|
|
max-width: 1180px; margin: -26px auto 0; padding: 0 24px; position: relative; z-index: 5;
|
|
}
|
|
.toolbar .inner {
|
|
background: #fff; border-radius: 14px; box-shadow: 0 8px 30px rgba(31,35,41,.08);
|
|
padding: 14px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
|
|
}
|
|
.search {
|
|
flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px;
|
|
background: #f5f6fa; border-radius: 10px; padding: 9px 14px; color: var(--muted);
|
|
}
|
|
.search input {
|
|
border: 0; background: transparent; outline: none; flex: 1; font-size: 14px; color: var(--ink);
|
|
}
|
|
.cats { display: flex; gap: 8px; flex-wrap: wrap; }
|
|
.cat {
|
|
border: 1px solid var(--line); background: #fff; color: var(--muted);
|
|
border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .18s;
|
|
}
|
|
.cat:hover { border-color: var(--brand); color: var(--brand); }
|
|
.cat.on { background: var(--brand); border-color: var(--brand); color: #fff; }
|
|
|
|
.grid {
|
|
max-width: 1180px; margin: 28px auto 60px; padding: 0 24px;
|
|
display: grid; gap: 20px;
|
|
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
|
}
|
|
.card {
|
|
background: #fff; border-radius: 16px; border: 1px solid var(--line);
|
|
padding: 20px; display: flex; flex-direction: column; gap: 12px;
|
|
transition: transform .22s ease, box-shadow .22s ease, border-color .22s;
|
|
}
|
|
.card:hover {
|
|
transform: translateY(-6px);
|
|
box-shadow: 0 18px 40px rgba(79,70,229,.16);
|
|
border-color: transparent;
|
|
}
|
|
.card .head { display: flex; align-items: center; gap: 12px; }
|
|
.card .ava {
|
|
width: 52px; height: 52px; border-radius: 14px; flex: none;
|
|
background: #f0f1f5; object-fit: cover; display: grid; place-items: center;
|
|
font-weight: 700; color: var(--brand); font-size: 20px; overflow: hidden;
|
|
}
|
|
.card .ava img { width: 100%; height: 100%; object-fit: cover; }
|
|
.card .titles { min-width: 0; }
|
|
.card .titles .t { font-weight: 600; font-size: 16px; line-height: 1.3; }
|
|
.card .titles .a { color: var(--muted); font-size: 12px; margin-top: 2px; }
|
|
.card .desc {
|
|
color: #5b606b; font-size: 13px; line-height: 1.6; min-height: 42px;
|
|
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
|
|
}
|
|
.card .meta { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
|
|
.stars { color: #f5a623; letter-spacing: 1px; }
|
|
.stars .off { color: #e2e4ea; }
|
|
.dl { display: flex; align-items: center; gap: 5px; }
|
|
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
|
|
.price {
|
|
font-weight: 700; font-size: 16px; color: var(--brand);
|
|
}
|
|
.price.free { color: #16a34a; }
|
|
.tag {
|
|
font-size: 11px; color: var(--brand); background: rgba(79,70,229,.1);
|
|
border-radius: 6px; padding: 3px 8px;
|
|
}
|
|
.card .btn {
|
|
text-decoration: none; font-size: 13px; color: #fff;
|
|
background: linear-gradient(135deg, var(--brand), var(--brand-2));
|
|
padding: 8px 16px; border-radius: 9px; transition: opacity .2s, transform .1s;
|
|
}
|
|
.card .btn:hover { opacity: .9; }
|
|
.card .btn:active { transform: scale(.97); }
|
|
|
|
.empty { grid-column: 1 / -1; text-align: center; padding: 70px 0; color: var(--muted); }
|
|
.empty .ic { font-size: 48px; opacity: .5; }
|
|
.empty p { margin-top: 12px; }
|
|
|
|
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 26px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="brandbar">
|
|
<div class="logo">Y</div>
|
|
<div class="name">{$market_name}</div>
|
|
<div class="nav">
|
|
<a href="/appmall/store" class="on">应用市场</a>
|
|
<a href="/appmall/framework">主框架</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="hero">
|
|
<h1>发现优质扩展,一键点亮你的站点</h1>
|
|
<p>插件、模板、工具,覆盖建站全场景 · 由 {$market_name} 官方精选</p>
|
|
</div>
|
|
|
|
<div class="toolbar">
|
|
<div class="inner">
|
|
<div class="search">
|
|
<i class="layui-icon layui-icon-search"></i>
|
|
<input type="text" placeholder="搜索插件名称、作者或功能…" oninput="filterCards(this.value)">
|
|
</div>
|
|
<div class="cats" id="cats">
|
|
<span class="cat on" data-cat="">全部</span>
|
|
{foreach $categories as $c}
|
|
<span class="cat" data-cat="{$c}">{$c}</span>
|
|
{/foreach}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid" id="grid">
|
|
{if empty($list)}
|
|
<div class="empty">
|
|
<div class="ic"><i class="layui-icon layui-icon-template-1"></i></div>
|
|
<p>市场暂无插件,敬请期待。</p>
|
|
</div>
|
|
{else}
|
|
{foreach $list as $p}
|
|
<div class="card" data-name="{$p.name|lower}" data-author="{$p.author|lower}" data-cat="{$p.category}">
|
|
<div class="head">
|
|
<div class="ava">
|
|
{if $p.logo}
|
|
<img src="{$p.logo}" alt="{$p.title}">
|
|
{else}
|
|
{$p.title|substr=0,1}
|
|
{/if}
|
|
</div>
|
|
<div class="titles">
|
|
<div class="t">{$p.title}{if $p.version} <span style="font-weight:400;color:#aab;font-size:12px;">v{$p.version}</span>{/if}</div>
|
|
<div class="a">by {$p.author|default='官方'}</div>
|
|
</div>
|
|
</div>
|
|
<div class="desc">{$p.desc|default='暂无描述'}</div>
|
|
<div class="meta">
|
|
<span class="stars" title="评分 {$p.rating}">
|
|
{for start="1" end="6" name="i"}
|
|
{if $p.rating >= $i}<i class="layui-icon layui-icon-rate-solid"></i>{else/}<i class="layui-icon layui-icon-rate off"></i>{/if}
|
|
{/for}
|
|
</span>
|
|
<span class="dl"><i class="layui-icon layui-icon-download-circle"></i>{$p.downloads} 下载</span>
|
|
</div>
|
|
<div class="foot">
|
|
<div>
|
|
<span class="price {if $p.price==0}free{/if}">{$p.price_text}</span>
|
|
{if $p.category}<span class="tag">{$p.category}</span>{/if}
|
|
</div>
|
|
<a class="btn" href="/appmall/store/detail/{$p.name}">查看详情</a>
|
|
</div>
|
|
</div>
|
|
{/foreach}
|
|
{/if}
|
|
</div>
|
|
|
|
<footer>© {:date('Y')} {$market_name} · 由 YwxApp 框架强力驱动</footer>
|
|
|
|
<script>
|
|
function filterCards(kw) {
|
|
kw = (kw || '').toLowerCase().trim();
|
|
document.querySelectorAll('#grid .card').forEach(function (el) {
|
|
var hit = !kw || el.dataset.name.indexOf(kw) > -1 || el.dataset.author.indexOf(kw) > -1;
|
|
el.style.display = hit ? '' : 'none';
|
|
});
|
|
}
|
|
document.getElementById('cats').addEventListener('click', function (e) {
|
|
var cat = e.target.closest('.cat');
|
|
if (!cat) return;
|
|
document.querySelectorAll('#cats .cat').forEach(function (c) { c.classList.remove('on'); });
|
|
cat.classList.add('on');
|
|
var v = cat.dataset.cat;
|
|
document.querySelectorAll('#grid .card').forEach(function (el) {
|
|
el.style.display = (!v || el.dataset.cat === v) ? '' : 'none';
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|