home.blade.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. {{-- resources/views/wiki/home.blade.php --}}
  2. @extends('wiki.layouts.app')
  3. @section('wiki-content')
  4. <div class="wiki-home-container">
  5. {{-- 中央法轮图 --}}
  6. <div class="dharma-wheel-wrapper">
  7. <img src="{{ asset('images/dharma-wheel.svg') }}" alt="Dharma Wheel" class="dharma-wheel-img">
  8. </div>
  9. {{-- 欢迎标题 --}}
  10. <div class="wiki-welcome-title">
  11. <h1 class="display-4 fw-bold text-primary mb-2">佛教百科</h1>
  12. <p class="text-muted">探索佛法智慧 · 开启觉悟之门</p>
  13. </div>
  14. {{-- 搜索框组件 --}}
  15. <div class="wiki-search-wrapper">
  16. <x-wiki.search-box
  17. :action="route('library.search')"
  18. placeholder="搜索佛法词条、经典、人物..."
  19. button-text="搜索"
  20. size="lg" />
  21. </div>
  22. {{-- 热门搜索标签 --}}
  23. @isset($hotTags)
  24. <div class="wiki-hot-tags">
  25. <span class="text-muted me-2">热门:</span>
  26. @foreach($hotTags as $tag)
  27. <a href="{{ route('library.search', ['q' => $tag, 'type' => 'wiki']) }}" class="badge bg-secondary-light text-dark me-1 text-decoration-none">
  28. {{ $tag }}
  29. </a>
  30. @endforeach
  31. </div>
  32. @endisset
  33. {{-- 分隔横线 + 语言选择器 --}}
  34. <div class="wiki-language-section">
  35. <div class="divider">
  36. <span class="divider-text">以您的语言阅读佛教百科</span>
  37. </div>
  38. <div class="language-tags">
  39. @foreach($languages as $lang)
  40. <a href="{{ route('library.wiki.index', ['lang' => $lang['code']]) }}"
  41. class="language-tag {{ ($currentLang ?? 'zh-Hans') === $lang['code'] ? 'active' : '' }}">
  42. {{ $lang['name'] }}
  43. </a>
  44. @endforeach
  45. </div>
  46. </div>
  47. {{-- 统计信息 --}}
  48. @isset($stats)
  49. <div class="wiki-stats">
  50. <span class="text-muted">
  51. 📚 {{ number_format($stats['total_articles'] ?? 0) }} 词条
  52. @if(isset($stats['today_updates']))
  53. · 🆕 今日更新 {{ $stats['today_updates'] }}
  54. @endif
  55. @if(isset($stats['contributors']))
  56. · 👥 {{ number_format($stats['contributors']) }} 位贡献者
  57. @endif
  58. </span>
  59. </div>
  60. @endisset
  61. </div>
  62. @endsection
  63. @push('styles')
  64. <style>
  65. .wiki-home-container {
  66. display: flex;
  67. flex-direction: column;
  68. align-items: center;
  69. justify-content: center;
  70. min-height: calc(100vh - 300px);
  71. padding: 3rem 1.5rem;
  72. background: linear-gradient(135deg, #fef9f0 0%, #fff9f5 100%);
  73. border-radius: 1rem;
  74. margin: 1rem;
  75. }
  76. .dharma-wheel-wrapper {
  77. margin-bottom: 1.5rem;
  78. animation: subtle-float 3s ease-in-out infinite;
  79. }
  80. .dharma-wheel-img {
  81. width: 140px;
  82. height: auto;
  83. filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.1));
  84. transition: transform 0.3s ease;
  85. }
  86. .dharma-wheel-img:hover {
  87. transform: scale(1.05);
  88. }
  89. .wiki-welcome-title {
  90. text-align: center;
  91. margin-bottom: 2rem;
  92. }
  93. .wiki-welcome-title h1 {
  94. background: linear-gradient(135deg, #8b5e3c 0%, #c49a6c 100%);
  95. -webkit-background-clip: text;
  96. -webkit-text-fill-color: transparent;
  97. background-clip: text;
  98. font-weight: 700;
  99. }
  100. .wiki-search-wrapper {
  101. width: 100%;
  102. max-width: 640px;
  103. margin: 0 auto 1.5rem;
  104. }
  105. .wiki-hot-tags {
  106. text-align: center;
  107. margin-bottom: 3rem;
  108. font-size: 0.9rem;
  109. }
  110. .wiki-hot-tags .badge {
  111. padding: 0.4rem 0.8rem;
  112. transition: all 0.2s ease;
  113. background-color: #f0e6d8;
  114. color: #5a3a2a;
  115. font-weight: 500;
  116. }
  117. .wiki-hot-tags .badge:hover {
  118. background-color: #c49a6c;
  119. color: white;
  120. transform: translateY(-2px);
  121. }
  122. /* 分隔横线样式 */
  123. .wiki-language-section {
  124. width: 100%;
  125. max-width: 800px;
  126. margin: 1rem auto 2rem;
  127. }
  128. .divider {
  129. display: flex;
  130. align-items: center;
  131. text-align: center;
  132. margin-bottom: 2rem;
  133. }
  134. .divider::before,
  135. .divider::after {
  136. content: '';
  137. flex: 1;
  138. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  139. }
  140. .divider::before {
  141. margin-right: 1.5rem;
  142. }
  143. .divider::after {
  144. margin-left: 1.5rem;
  145. }
  146. .divider-text {
  147. font-size: 0.95rem;
  148. color: #8b7355;
  149. letter-spacing: 1px;
  150. font-weight: 500;
  151. white-space: nowrap;
  152. }
  153. /* 语言标签样式 */
  154. .language-tags {
  155. display: flex;
  156. flex-wrap: wrap;
  157. justify-content: center;
  158. gap: 0.75rem;
  159. }
  160. .language-tag {
  161. display: inline-block;
  162. padding: 0.5rem 1.25rem;
  163. background-color: #f5f0ea;
  164. color: #5a3a2a;
  165. text-decoration: none;
  166. border-radius: 30px;
  167. font-size: 0.9rem;
  168. font-weight: 500;
  169. transition: all 0.25s ease;
  170. border: 1px solid transparent;
  171. }
  172. .language-tag:hover {
  173. background-color: #e8ddd0;
  174. transform: translateY(-2px);
  175. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  176. color: #3a2518;
  177. }
  178. .language-tag.active {
  179. background: linear-gradient(135deg, #8b5e3c 0%, #6b4226 100%);
  180. color: white;
  181. border-color: #8b5e3c;
  182. box-shadow: 0 2px 8px rgba(139, 94, 60, 0.3);
  183. }
  184. .language-tag.active:hover {
  185. background: linear-gradient(135deg, #9b6e4c 0%, #7b5236 100%);
  186. transform: translateY(-2px);
  187. }
  188. .wiki-stats {
  189. text-align: center;
  190. font-size: 0.875rem;
  191. margin-top: 1rem;
  192. padding-top: 1.5rem;
  193. border-top: 1px solid rgba(0, 0, 0, 0.08);
  194. }
  195. @keyframes subtle-float {
  196. 0%,
  197. 100% {
  198. transform: translateY(0px);
  199. }
  200. 50% {
  201. transform: translateY(-6px);
  202. }
  203. }
  204. /* 移动端适配 */
  205. @media (max-width: 768px) {
  206. .wiki-home-container {
  207. min-height: calc(100vh - 200px);
  208. padding: 2rem 1rem;
  209. margin: 0.5rem;
  210. }
  211. .dharma-wheel-img {
  212. width: 100px;
  213. }
  214. .wiki-welcome-title h1 {
  215. font-size: 1.8rem;
  216. }
  217. .wiki-welcome-title p {
  218. font-size: 0.9rem;
  219. }
  220. .wiki-search-wrapper {
  221. max-width: 100%;
  222. }
  223. .divider-text {
  224. font-size: 0.85rem;
  225. white-space: normal;
  226. text-align: center;
  227. }
  228. .divider::before,
  229. .divider::after {
  230. margin-right: 1rem;
  231. margin-left: 1rem;
  232. }
  233. .language-tag {
  234. padding: 0.4rem 1rem;
  235. font-size: 0.85rem;
  236. }
  237. .language-tags {
  238. gap: 0.6rem;
  239. }
  240. }
  241. /* 暗色模式适配 */
  242. @media (prefers-color-scheme: dark) {
  243. .wiki-home-container {
  244. background: linear-gradient(135deg, #2a2418 0%, #1f1b14 100%);
  245. }
  246. .wiki-welcome-title h1 {
  247. background: linear-gradient(135deg, #d4a574 0%, #e8c4a0 100%);
  248. -webkit-background-clip: text;
  249. -webkit-text-fill-color: transparent;
  250. }
  251. .wiki-welcome-title p {
  252. color: #a89880;
  253. }
  254. .wiki-hot-tags .badge {
  255. background-color: #3a3025;
  256. color: #d4c4b0;
  257. }
  258. .wiki-hot-tags .badge:hover {
  259. background-color: #c49a6c;
  260. color: #1f1b14;
  261. }
  262. .divider::before,
  263. .divider::after {
  264. border-bottom-color: rgba(255, 255, 255, 0.15);
  265. }
  266. .divider-text {
  267. color: #b8a88a;
  268. }
  269. .language-tag {
  270. background-color: #3a3025;
  271. color: #d4c4b0;
  272. }
  273. .language-tag:hover {
  274. background-color: #4a3e30;
  275. color: #f0e0c0;
  276. }
  277. .language-tag.active {
  278. background: linear-gradient(135deg, #c49a6c 0%, #a07850 100%);
  279. color: #1f1b14;
  280. }
  281. .wiki-stats {
  282. border-top-color: rgba(255, 255, 255, 0.1);
  283. }
  284. }
  285. </style>
  286. @endpush