show.blade.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. @extends('library.layouts.app')
  2. @section('title', $anthology['title'] . ' · 巴利书库')
  3. @push('styles')
  4. <link rel="preconnect" href="https://fonts.googleapis.com">
  5. <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500&display=swap" rel="stylesheet">
  6. <style>
  7. :root {
  8. --sf: #c8860a;
  9. --sf-light: #f5e6c8;
  10. --sf-pale: #fdf8f0;
  11. --ink: #1a1208;
  12. --ink-soft: #4a3f2f;
  13. --ink-muted: #8a7a68;
  14. --bdr: #e8ddd0;
  15. --card-bg: #fffdf9;
  16. }
  17. body { background: var(--sf-pale) !important; font-family: 'Noto Sans SC', sans-serif; }
  18. /* Breadcrumb bar */
  19. .anthology-breadcrumb-bar {
  20. background: rgba(255,255,255,.55);
  21. border-bottom: 1px solid var(--bdr);
  22. padding: .5rem 0;
  23. }
  24. .anthology-breadcrumb-bar .breadcrumb { margin: 0; font-size: .78rem; }
  25. .anthology-breadcrumb-bar .breadcrumb-item a { color: var(--sf); text-decoration: none; }
  26. .anthology-breadcrumb-bar .breadcrumb-item.active { color: var(--ink-muted); }
  27. .anthology-breadcrumb-bar .breadcrumb-item+.breadcrumb-item::before { color: var(--ink-muted); }
  28. /* Hero */
  29. .anthology-hero {
  30. background: linear-gradient(135deg, var(--ink) 0%, #2d2010 100%);
  31. padding: 2.5rem 0;
  32. }
  33. .hero-inner { display: flex; gap: 2.25rem; align-items: flex-start; }
  34. /* Book cover */
  35. .book-cover-3d {
  36. width: 155px;
  37. min-width: 155px;
  38. height: 215px;
  39. border-radius: 3px 9px 9px 3px;
  40. display: flex;
  41. flex-direction: column;
  42. align-items: center;
  43. justify-content: center;
  44. padding: 1.25rem .9rem;
  45. position: relative;
  46. overflow: hidden;
  47. box-shadow: -4px 0 0 rgba(0,0,0,.3), -6px 4px 14px rgba(0,0,0,.4), 4px 4px 18px rgba(0,0,0,.3);
  48. flex-shrink: 0;
  49. }
  50. .book-cover-3d img {
  51. position: absolute; inset: 0;
  52. width: 100%; height: 100%;
  53. object-fit: cover;
  54. }
  55. .book-cover-3d::before {
  56. content: '';
  57. position: absolute;
  58. left: 0; top: 0; bottom: 0;
  59. width: 13px;
  60. background: linear-gradient(to right, rgba(0,0,0,.4), rgba(0,0,0,.1));
  61. border-radius: 3px 0 0 3px;
  62. z-index: 2;
  63. }
  64. .book-cover-3d::after {
  65. content: '';
  66. position: absolute; inset: 0;
  67. background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(255,255,255,.015) 8px, rgba(255,255,255,.015) 9px);
  68. z-index: 1;
  69. }
  70. .book-text-wrap { position: relative; z-index: 3; text-align: center; }
  71. .book-title-text {
  72. font-family: 'Noto Serif SC', serif;
  73. font-size: 1.05rem;
  74. font-weight: 600;
  75. color: #fff;
  76. line-height: 1.65;
  77. letter-spacing: .13em;
  78. word-break: break-all;
  79. }
  80. .book-divider { width: 32px; height: 1px; background: var(--sf); margin: .65rem auto; }
  81. .book-sub-text { font-size: .65rem; color: rgba(255,255,255,.5); letter-spacing: .06em; line-height: 1.5; }
  82. /* Hero right */
  83. .hero-content { flex: 1; min-width: 0; }
  84. .hero-title {
  85. font-family: 'Noto Serif SC', serif;
  86. font-size: 1.75rem;
  87. font-weight: 700;
  88. color: #fff;
  89. line-height: 1.3;
  90. margin-bottom: .4rem;
  91. }
  92. .hero-subtitle { font-size: .88rem; color: rgba(255,255,255,.45); font-style: italic; letter-spacing: .04em; margin-bottom: 1.1rem; }
  93. .hero-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.3rem; }
  94. .hero-tag {
  95. font-size: .72rem; padding: 2px 9px; border-radius: 20px;
  96. background: rgba(200,134,10,.2); color: var(--sf);
  97. border: 1px solid rgba(200,134,10,.3);
  98. }
  99. .hero-info-row { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-bottom: 1.3rem; }
  100. .hi-item { display: flex; align-items: center; gap: .45rem; }
  101. .hi-label { font-size: .72rem; color: rgba(255,255,255,.4); letter-spacing: .04em; display: block; }
  102. .hi-value { font-size: .83rem; color: rgba(255,255,255,.82); display: block; }
  103. .hi-avatar {
  104. width: 26px; height: 26px; border-radius: 50%;
  105. display: flex; align-items: center; justify-content: center;
  106. font-size: .68rem; font-weight: 700; flex-shrink: 0;
  107. }
  108. .hero-desc { font-size: .85rem; color: rgba(255,255,255,.6); line-height: 1.85; margin-bottom: 1.6rem; max-width: 600px; }
  109. .btn-read-primary {
  110. background: var(--sf); color: var(--ink);
  111. font-weight: 700; font-size: .88rem;
  112. padding: .55rem 1.6rem; border-radius: 6px; border: none;
  113. cursor: pointer; text-decoration: none;
  114. display: inline-flex; align-items: center; gap: .45rem;
  115. transition: background .2s, transform .15s;
  116. }
  117. .btn-read-primary:hover { background: #dea020; color: var(--ink); transform: translateY(-1px); }
  118. .btn-outline-hero {
  119. background: transparent; color: rgba(255,255,255,.7);
  120. font-size: .85rem; padding: .5rem 1.3rem;
  121. border-radius: 6px; border: 1px solid rgba(255,255,255,.2);
  122. cursor: pointer; text-decoration: none;
  123. display: inline-flex; align-items: center; gap: .4rem;
  124. transition: all .2s; margin-left: .65rem;
  125. }
  126. .btn-outline-hero:hover { border-color: rgba(255,255,255,.5); color: #fff; }
  127. /* Section card */
  128. .sec-card { background: var(--card-bg); border: 1px solid var(--bdr); border-radius: 10px; overflow: hidden; margin-bottom: 1.3rem; }
  129. .sec-header {
  130. padding: .85rem 1.4rem; border-bottom: 1px solid var(--bdr);
  131. display: flex; align-items: center; gap: .55rem;
  132. }
  133. .sec-bar { width: 3px; height: 15px; background: var(--sf); border-radius: 2px; flex-shrink: 0; }
  134. .sec-title { font-family: 'Noto Serif SC', serif; font-size: .9rem; font-weight: 600; color: var(--ink-soft); letter-spacing: .04em; }
  135. .sec-count {
  136. margin-left: auto; font-size: .75rem; color: var(--ink-muted);
  137. background: var(--sf-light); padding: 2px 8px; border-radius: 10px;
  138. }
  139. /* About */
  140. .sec-body { padding: 1.15rem 1.4rem; font-size: .855rem; color: var(--ink-soft); line-height: 1.95; }
  141. .sec-body p { margin-bottom: .8rem; }
  142. .sec-body p:last-child { margin-bottom: 0; }
  143. /* TOC */
  144. .toc-ul { list-style: none; padding: .35rem 0; margin: 0; }
  145. .toc-ul li a {
  146. display: flex; align-items: center;
  147. padding: .65rem 1.4rem;
  148. text-decoration: none;
  149. border-bottom: 1px solid rgba(232,221,208,.5);
  150. transition: background .15s;
  151. }
  152. .toc-ul li:last-child a { border-bottom: none; }
  153. .toc-ul li a:hover { background: var(--sf-pale); }
  154. .toc-num { font-size: .72rem; color: var(--ink-muted); width: 26px; flex-shrink: 0; }
  155. .toc-name { font-size: .855rem; color: var(--ink-soft); flex: 1; line-height: 1.4; }
  156. .toc-ul li a:hover .toc-name { color: var(--sf); }
  157. .toc-arrow { color: var(--bdr); font-size: .85rem; }
  158. .toc-ul li a:hover .toc-arrow { color: var(--sf); }
  159. /* Sidebar */
  160. .sb-card { background: var(--card-bg); border: 1px solid var(--bdr); border-radius: 10px; overflow: hidden; margin-bottom: 1.15rem; }
  161. .sb-head {
  162. padding: .8rem 1.2rem; border-bottom: 1px solid var(--bdr);
  163. font-family: 'Noto Serif SC', serif; font-size: .875rem;
  164. font-weight: 600; color: var(--ink-soft); letter-spacing: .04em;
  165. display: flex; align-items: center; gap: .45rem;
  166. }
  167. .sb-head::before { content: ''; display: block; width: 3px; height: 13px; background: var(--sf); border-radius: 2px; }
  168. .smeta-row { display: flex; padding: .7rem 1.2rem; border-bottom: 1px solid var(--bdr); font-size: .8rem; align-items: flex-start; gap: .45rem; }
  169. .smeta-row:last-child { border-bottom: none; }
  170. .smeta-label { color: var(--ink-muted); min-width: 65px; flex-shrink: 0; }
  171. .smeta-value { color: var(--ink-soft); font-weight: 500; }
  172. .smeta-value a { color: var(--sf); text-decoration: none; }
  173. .smeta-value a:hover { text-decoration: underline; }
  174. /* Author card */
  175. .author-block { display: flex; align-items: center; gap: .8rem; padding: 1.1rem 1.2rem; }
  176. .author-av-lg {
  177. width: 48px; height: 48px; border-radius: 50%;
  178. display: flex; align-items: center; justify-content: center;
  179. font-size: .95rem; font-weight: 700; flex-shrink: 0;
  180. }
  181. .author-av-img {
  182. width: 48px; height: 48px; border-radius: 50%;
  183. object-fit: cover; flex-shrink: 0;
  184. }
  185. .hi-avatar {
  186. width: 26px; height: 26px; border-radius: 50%;
  187. display: flex; align-items: center; justify-content: center;
  188. font-size: .68rem; font-weight: 700; flex-shrink: 0;
  189. }
  190. .hi-avatar-img {
  191. width: 26px; height: 26px; border-radius: 50%;
  192. object-fit: cover; flex-shrink: 0;
  193. }
  194. .author-block-name { font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: .18rem; }
  195. .author-block-stats { font-size: .75rem; color: var(--ink-muted); }
  196. .author-bio { font-size: .78rem; color: var(--ink-muted); line-height: 1.65; padding: 0 1.2rem 1.1rem; border-top: 1px solid var(--bdr); padding-top: .9rem; }
  197. /* Related */
  198. .related-ul { list-style: none; padding: 0; margin: 0; }
  199. .related-ul li a {
  200. display: flex; align-items: center; gap: .7rem;
  201. padding: .7rem 1.2rem; border-bottom: 1px solid var(--bdr);
  202. text-decoration: none; transition: background .15s;
  203. }
  204. .related-ul li:last-child a { border-bottom: none; }
  205. .related-ul li a:hover { background: var(--sf-pale); }
  206. .related-cover-mini {
  207. width: 34px; height: 46px; border-radius: 2px 5px 5px 2px;
  208. display: flex; align-items: center; justify-content: center;
  209. font-size: .6rem; color: rgba(255,255,255,.8);
  210. font-family: 'Noto Serif SC', serif;
  211. flex-shrink: 0; text-align: center; line-height: 1.3;
  212. }
  213. .related-t { font-size: .8rem; color: var(--ink-soft); font-weight: 500; margin-bottom: .18rem; line-height: 1.3; }
  214. .related-ul li a:hover .related-t { color: var(--sf); }
  215. .related-a { font-size: .7rem; color: var(--ink-muted); }
  216. @media (max-width: 900px) {
  217. .hero-inner { flex-direction: column; align-items: center; }
  218. .book-cover-3d { height: 170px; }
  219. }
  220. </style>
  221. @endpush
  222. @section('content')
  223. {{-- Breadcrumb --}}
  224. <div class="anthology-breadcrumb-bar">
  225. <div class="container-xl">
  226. <ol class="breadcrumb">
  227. <li class="breadcrumb-item"><a href="{{ route('library.home') }}">首页</a></li>
  228. <li class="breadcrumb-item"><a href="{{ route('library.anthology.index') }}">文集</a></li>
  229. <li class="breadcrumb-item active">{{ $anthology['title'] }}</li>
  230. </ol>
  231. </div>
  232. </div>
  233. {{-- Hero --}}
  234. <div class="anthology-hero">
  235. <div class="container-xl">
  236. <div class="hero-inner">
  237. {{-- 3D Book Cover --}}
  238. <div class="book-cover-3d" style="{{ $anthology['cover_image'] ? '' : 'background: ' . $anthology['cover_gradient'] }}">
  239. @if($anthology['cover_image'])
  240. <img src="{{ $anthology['cover_image'] }}" alt="{{ $anthology['title'] }}">
  241. @else
  242. <div class="book-text-wrap">
  243. <div class="book-title-text">{{ $anthology['title'] }}</div>
  244. <div class="book-divider"></div>
  245. <div class="book-sub-text">{{ $anthology['subtitle'] ?? '' }}</div>
  246. </div>
  247. @endif
  248. </div>
  249. {{-- Content --}}
  250. <div class="hero-content">
  251. <div class="hero-title">{{ $anthology['title'] }}</div>
  252. @if(!empty($anthology['subtitle']))
  253. <div class="hero-subtitle">{{ $anthology['subtitle'] }}</div>
  254. @endif
  255. @if(!empty($anthology['tags']))
  256. <div class="hero-tags">
  257. @foreach($anthology['tags'] as $tag)
  258. <span class="hero-tag">{{ $tag }}</span>
  259. @endforeach
  260. </div>
  261. @endif
  262. <div class="hero-info-row">
  263. <div class="hi-item">
  264. @if(!empty($anthology['author']['avatar']))
  265. <img src="{{ $anthology['author']['avatar'] }}" class="hi-avatar-img" alt="">
  266. @else
  267. <div class="hi-avatar" style="background: {{ $anthology['author']['color'] }}; color: #fff">
  268. {{ $anthology['author']['initials'] }}
  269. </div>
  270. @endif
  271. <div>
  272. <span class="hi-label">作者</span>
  273. <span class="hi-value">{{ $anthology['author']['name'] }}</span>
  274. </div>
  275. </div>
  276. <div class="hi-item">
  277. <div>
  278. <span class="hi-label">最后更新</span>
  279. <span class="hi-value">{{ $anthology['updated_at'] }}</span>
  280. </div>
  281. </div>
  282. <div class="hi-item">
  283. <div>
  284. <span class="hi-label">章节数</span>
  285. <span class="hi-value">{{ $anthology['children_number'] }} 章节</span>
  286. </div>
  287. </div>
  288. <div class="hi-item">
  289. <div>
  290. <span class="hi-label">创建时间</span>
  291. <span class="hi-value">{{ $anthology['created_at'] }}</span>
  292. </div>
  293. </div>
  294. </div>
  295. @if(!empty($anthology['description']))
  296. <div class="hero-desc">{{ $anthology['description'] }}</div>
  297. @endif
  298. <div>
  299. @if(!empty($anthology['articles']))
  300. <a href="{{ route('library.anthology.read', ['anthology' => $anthology['id'], 'article' => $anthology['articles'][0]['id']]) }}" class="btn-read-primary">
  301. <i class="ti ti-book-2"></i>
  302. 在线阅读
  303. </a>
  304. @endif
  305. <a href="{{ config('mint.server.dashboard_base_path') }}/workspace/anthology/{{ $anthology['id'] }}" class="btn-outline-hero">
  306. <i class="ti ti-pencil"></i>
  307. 在编辑器中打开
  308. </a>
  309. </div>
  310. </div>
  311. </div>
  312. </div>
  313. </div>
  314. {{-- Body --}}
  315. <div class="page-body" style="background: var(--sf-pale);">
  316. <div class="container-xl">
  317. <div class="row mt-2">
  318. {{-- Left --}}
  319. <div class="col-lg-8">
  320. {{-- About --}}
  321. @if(!empty($anthology['about']))
  322. <div class="sec-card">
  323. <div class="sec-header">
  324. <div class="sec-bar"></div>
  325. <div class="sec-title">关于本文集</div>
  326. </div>
  327. <div class="sec-body">
  328. @foreach(explode("\n", $anthology['about']) as $para)
  329. @if(trim($para))
  330. <p>{{ trim($para) }}</p>
  331. @endif
  332. @endforeach
  333. </div>
  334. </div>
  335. @endif
  336. {{-- TOC --}}
  337. <div class="sec-card">
  338. <div class="sec-header">
  339. <div class="sec-bar"></div>
  340. <div class="sec-title">目录</div>
  341. <div class="sec-count">{{ $anthology['children_number'] }} 章节</div>
  342. </div>
  343. <ul class="toc-ul">
  344. @foreach($anthology['articles'] as $article)
  345. <li>
  346. <a href="{{ route('library.anthology.read', ['anthology' => $anthology['id'], 'article' => $article['id']]) }}">
  347. <span class="toc-num">{{ str_pad($article['order'], 2, '0', STR_PAD_LEFT) }}</span>
  348. <span class="toc-name">{{ $article['title'] }}</span>
  349. <span class="toc-arrow">›</span>
  350. </a>
  351. </li>
  352. @endforeach
  353. </ul>
  354. </div>
  355. </div>{{-- /col --}}
  356. {{-- Sidebar --}}
  357. <div class="col-lg-4">
  358. {{-- Meta --}}
  359. <div class="sb-card">
  360. <div class="sb-head">文集信息</div>
  361. <div class="smeta-row">
  362. <span class="smeta-label">作者</span>
  363. <span class="smeta-value"><a href="#">{{ $anthology['author']['name'] }}</a></span>
  364. </div>
  365. @if(!empty($anthology['language']))
  366. <div class="smeta-row">
  367. <span class="smeta-label">语言</span>
  368. <span class="smeta-value">{{ $anthology['language'] }}</span>
  369. </div>
  370. @endif
  371. <div class="smeta-row">
  372. <span class="smeta-label">章节</span>
  373. <span class="smeta-value">{{ $anthology['children_number'] }} 章节</span>
  374. </div>
  375. <div class="smeta-row">
  376. <span class="smeta-label">创建</span>
  377. <span class="smeta-value">{{ $anthology['created_at'] }}</span>
  378. </div>
  379. <div class="smeta-row">
  380. <span class="smeta-label">更新</span>
  381. <span class="smeta-value">{{ $anthology['updated_at'] }}</span>
  382. </div>
  383. @if(!empty($anthology['category']))
  384. <div class="smeta-row">
  385. <span class="smeta-label">分类</span>
  386. <span class="smeta-value">{{ $anthology['category'] }}</span>
  387. </div>
  388. @endif
  389. </div>
  390. {{-- Author --}}
  391. <div class="sb-card">
  392. <div class="sb-head">作者</div>
  393. <div class="author-block">
  394. @if(!empty($anthology['author']['avatar']))
  395. <img src="{{ $anthology['author']['avatar'] }}" class="author-av-img" alt="">
  396. @else
  397. <div class="author-av-lg" style="background: {{ $anthology['author']['color'] }}; color: #fff">
  398. {{ $anthology['author']['initials'] }}
  399. </div>
  400. @endif
  401. <div>
  402. <div class="author-block-name">{{ $anthology['author']['name'] }}</div>
  403. <div class="author-block-stats">
  404. @if($anthology['author']['article_count'])
  405. {{ $anthology['author']['article_count'] }} 篇文章
  406. @endif
  407. </div>
  408. </div>
  409. </div>
  410. @if(!empty($anthology['author']['bio']))
  411. <div class="author-bio">{{ $anthology['author']['bio'] }}</div>
  412. @endif
  413. </div>
  414. {{-- Related --}}
  415. @if($related->count())
  416. <div class="sb-card">
  417. <div class="sb-head">相关文集</div>
  418. <ul class="related-ul">
  419. @foreach($related as $rel)
  420. <li>
  421. <a href="{{ route('library.anthology.show', $rel['id']) }}">
  422. <div class="related-cover-mini" style="background: {{ $rel['cover_gradient'] }}">
  423. {{ mb_substr($rel['title'], 0, 4) }}
  424. </div>
  425. <div>
  426. <div class="related-t">{{ $rel['title'] }}</div>
  427. <div class="related-a">{{ $rel['author_name'] }}</div>
  428. </div>
  429. </a>
  430. </li>
  431. @endforeach
  432. </ul>
  433. </div>
  434. @endif
  435. </div>
  436. </div>
  437. </div>
  438. </div>
  439. @endsection