wenBaoJiaYuan.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <?php
  2. // 轮播图数据 - 修改为单张图片
  3. $carouselItems = [
  4. [
  5. "image" => "/images/test-header-5.png",
  6. "alt" => "文保家园"
  7. ]
  8. ];
  9. // 文保家园数据
  10. $wenBaoJiaYuan = [
  11. [
  12. "title" => "厦门市文化遗产保护中心关于开展2025年文物保护志愿者招募的通知",
  13. "date" => "2025-12-10"
  14. ],
  15. [
  16. "title" => "厦门市文化遗产保护中心关于开展2025年文物保护志愿者招募的通知",
  17. "date" => "2025-12-10"
  18. ],
  19. [
  20. "title" => "厦门市文化遗产保护中心关于开展2025年文物保护志愿者招募的通知",
  21. "date" => "2025-12-10"
  22. ],
  23. [
  24. "title" => "厦门市文化遗产保护中心关于开展2025年文物保护志愿者招募的通知",
  25. "date" => "2025-12-10"
  26. ],
  27. [
  28. "title" => "厦门市文化遗产保护中心关于开展2025年文物保护志愿者招募的通知",
  29. "date" => "2025-12-10"
  30. ],
  31. [
  32. "title" => "厦门市文化遗产保护中心关于开展2025年文物保护志愿者招募的通知",
  33. "date" => "2025-12-10"
  34. ],
  35. [
  36. "title" => "厦门市文化遗产保护中心关于开展2025年文物保护志愿者招募的通知",
  37. "date" => "2025-12-10"
  38. ],
  39. [
  40. "title" => "厦门市文化遗产保护中心关于开展2025年文物保护志愿者招募的通知",
  41. "date" => "2025-12-10"
  42. ],
  43. [
  44. "title" => "厦门市文化遗产保护中心关于开展2025年文物保护志愿者招募的通知",
  45. "date" => "2025-12-10"
  46. ]
  47. ];
  48. // 分页数据
  49. $totalPages = 5;
  50. $currentPage = 1;
  51. ?>
  52. <!DOCTYPE html>
  53. <html lang="zh-CN">
  54. <head>
  55. <meta charset="UTF-8">
  56. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  57. <title>厦门市文化遗产保护中心 - 文保家园</title>
  58. <link rel="stylesheet" href="/css/fonts.css">
  59. <link rel="stylesheet" href="/css/fontawesome.min.css">
  60. <link rel="stylesheet" href="/css/bootstrap.min.css">
  61. <link rel="stylesheet" href="/css/swiper-bundle.min.css">
  62. <link rel="stylesheet" href="/css/style.css">
  63. <script src="/js/jquery-3.7.1.js"></script>
  64. <script src="/js/bootstrap.bundle.js"></script>
  65. <script src="/js/swiper-bundle.min.js"></script>
  66. </head>
  67. <body>
  68. <?php include __DIR__ . '/components/navbar.php'; ?>
  69. <!-- 轮播图 -->
  70. <div class="swiper mySwiper" style="width: 100%; height: 400px;">
  71. <div class="swiper-wrapper">
  72. <?php foreach ($carouselItems as $item): ?>
  73. <div class="swiper-slide">
  74. <img src="<?php echo $item['image']; ?>" alt="<?php echo $item['alt']; ?>" style="width: 100%; height: 100%; object-fit: cover;">
  75. </div>
  76. <?php endforeach; ?>
  77. </div>
  78. <div class="swiper-pagination"></div>
  79. <div class="swiper-button-prev"></div>
  80. <div class="swiper-button-next"></div>
  81. </div>
  82. <!-- 主要内容 -->
  83. <div class="main-content">
  84. <div class="container">
  85. <div class="row">
  86. <!-- 左侧导航 -->
  87. <div class="col col-sm-12 col-md-3 col-lg-3">
  88. <div class="sidebar">
  89. <div class="title">
  90. <h2>文保家园</h2>
  91. </div>
  92. <ul class="sidebar-menu">
  93. <li><a href="#">文化遗产知识库<i class="fa fa-arrow-right"></i></a></li>
  94. </ul>
  95. </div>
  96. </div>
  97. <!-- 右侧内容 -->
  98. <div class="col col-sm-12 col-md-9 col-lg-9">
  99. <div class="content">
  100. <div class="section-title">
  101. <h2 class="icon">文保家园</h2>
  102. <nav aria-label="breadcrumb">
  103. <ol class="breadcrumb">
  104. <li class="breadcrumb-item"><a href="/">首页</a></li>
  105. <li class="breadcrumb-item active" aria-current="page">文保家园</li>
  106. </ol>
  107. </nav>
  108. </div>
  109. <!-- 文章列表 -->
  110. <div class="news-list">
  111. <?php foreach ($wenBaoJiaYuan as $item): ?>
  112. <div class="news-item">
  113. <a href="./xinWenXiangQing.php?id=<?php echo $item['title']; ?>" class="title"><?php echo $item['title']; ?></a>
  114. <span class="date"><?php echo $item['date']; ?></span>
  115. </div>
  116. <?php endforeach; ?>
  117. </div>
  118. <!-- 分页 -->
  119. <nav aria-label="List Page navigation">
  120. <ul class="pagination mt-4">
  121. <?php for ($i = 1; $i <= $totalPages; $i++): ?>
  122. <li class="<?php echo $i == $currentPage ? 'active' : ''; ?>"><a href="?page=<?php echo $i?>"><?php echo $i; ?></a></li>
  123. <?php endfor; ?>
  124. </ul>
  125. </nav>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. <?php include __DIR__ . '/components/footer.php'; ?>
  132. <script>
  133. $(document).ready(function() {
  134. // 初始化 Swiper
  135. const swiper = new Swiper(".mySwiper", {
  136. slidesPerView: 1,
  137. spaceBetween: 30,
  138. loop: true,
  139. pagination: {
  140. el: ".swiper-pagination",
  141. clickable: true,
  142. },
  143. navigation: {
  144. nextEl: ".swiper-button-next",
  145. prevEl: ".swiper-button-prev",
  146. },
  147. autoplay: {
  148. delay: 5000,
  149. disableOnInteraction: false,
  150. },
  151. });
  152. });
  153. </script>
  154. </body>
  155. </html>