App.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <script setup>
  2. import { ref } from 'vue'
  3. const goDetail = (info) => {
  4. console.log(info)
  5. window.open(info.url, '_blank');
  6. }
  7. const navsData = ref([
  8. {
  9. typeName: '私有部署',
  10. urlList: [
  11. {
  12. logo: '/logos/drone.png',
  13. title: 'drone',
  14. desc: 'CI/CD自动化部署工具',
  15. url: 'https://drone.chuckchen.top',
  16. detail: null // markdown
  17. },
  18. {
  19. logo: '/logos/gogs.png',
  20. title: 'gogs',
  21. desc: 'gogs私有代码管理仓库',
  22. url: 'https://gogs.chuckchen.top',
  23. detail: null // markdown
  24. },
  25. {
  26. logo: '/logos/yapi.png',
  27. title: 'yapi',
  28. desc: 'api接口管理中心',
  29. url: 'https://yapi.chuckchen.top',
  30. detail: null // markdown
  31. },
  32. {
  33. logo: '/logos/registry-web.png',
  34. title: 'registry-web',
  35. desc: 'docker私有镜像仓库web管理',
  36. url: 'https://registry-web.chuckchen.top',
  37. detail: null // markdown
  38. },
  39. {
  40. logo: '/logos/bookstack.png',
  41. title: 'bookstack',
  42. desc: '私有图书馆、知识库',
  43. url: 'https://bookstack.chuckchen.top',
  44. detail: null // markdown
  45. },
  46. {
  47. logo: '/logos/verdaccio.svg',
  48. title: 'verdaccio',
  49. desc: '私有npm仓库',
  50. url: 'https://verdaccio.chuckchen.top',
  51. detail: null // markdown
  52. },
  53. ]
  54. },
  55. {
  56. typeName: '必备网站',
  57. urlList: [
  58. {
  59. logo: '/logos/github.png',
  60. title: 'Github',
  61. desc: '全球最大的代码托管平台',
  62. url: 'https://github.com',
  63. detail: null // markdown
  64. },
  65. ]
  66. }
  67. ])
  68. </script>
  69. <template>
  70. <div class="container">
  71. <div class="left">
  72. <div class="logo">分类菜单</div>
  73. <div class="navs">
  74. <div class="nav-item" v-for="item in navsData" :key="item.typeName">{{ item.typeName }}</div>
  75. </div>
  76. </div>
  77. <div class="right">
  78. <div class="r-top">
  79. <span style="color: #ba0a0a;">CHUCK</span>办公网址导航
  80. </div>
  81. <div class="r-bottom">
  82. <div class="content">
  83. <div v-for="item in navsData" :key="item.typeName">
  84. <div class="item-title">{{ item.typeName }}</div>
  85. <div class="url-list">
  86. <div class="list-item" v-for="info in item.urlList" :key="info.title" @click="goDetail(info)">
  87. <img :src="info.logo">
  88. <div class="info">
  89. <h3>{{ info.title }}</h3>
  90. <p>{{ info.desc }}</p>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. </template>
  100. <style>
  101. * {
  102. margin: 0;
  103. padding:0;
  104. }
  105. body,html {
  106. background: #f9f9f9;
  107. }
  108. </style>
  109. <style scoped>
  110. @media (max-width: 600px) {
  111. .left {
  112. display: none;
  113. }
  114. .right {
  115. margin-left: unset !important;
  116. }
  117. .list-item{
  118. width: 100% !important;
  119. }
  120. }
  121. .left{
  122. position: fixed;
  123. width: 300px;
  124. height: 100vh;
  125. background-color: #2c2e2f;
  126. box-sizing: border-box;
  127. color: #979898;
  128. }
  129. .logo{
  130. line-height: 80px;
  131. box-sizing: border-box;
  132. border-bottom: 1px solid #313437;
  133. text-align: center;
  134. font-size: 18px;
  135. font-weight: bold;
  136. }
  137. .navs{
  138. }
  139. .navs .nav-item{
  140. text-align: center;
  141. line-height: 50px;
  142. border-bottom: 1px solid #313437;
  143. transition: all .3s;
  144. cursor: pointer;
  145. }
  146. .navs .nav-item:hover,.navs .nav-item.active{
  147. color:white;
  148. }
  149. .right{
  150. margin-left: 300px;
  151. height: 100vh;
  152. overflow: hidden;
  153. }
  154. .r-top{
  155. position: fixed;
  156. width: 100%;
  157. height: 80px;
  158. background: white;
  159. display: flex;
  160. align-items: center;
  161. box-sizing: border-box;
  162. padding: 20px;
  163. font-size: 18px;
  164. font-weight: bold;
  165. }
  166. .r-bottom{
  167. height: calc(100vh - 80px);
  168. width: 100%;
  169. overflow-y: auto;
  170. margin-top:80px;
  171. padding: 20px;
  172. box-sizing: border-box;
  173. }
  174. .r-bottom .content{
  175. height: 200px;
  176. }
  177. .url-list{
  178. display: flex;
  179. flex-wrap: wrap;
  180. }
  181. .item-title{
  182. margin-top: 20px;
  183. margin-bottom: 20px;
  184. }
  185. .list-item{
  186. width: 24%;
  187. background:white;
  188. border:1px solid #e4ecf3;
  189. transition: all .3s;
  190. cursor: pointer;
  191. border-radius: 4px;
  192. padding:20px;
  193. box-sizing: border-box;
  194. display: flex;
  195. align-items: center;
  196. margin: 10px 0;
  197. color: #333;
  198. }
  199. .list-item:not(:nth-child(4n)) {
  200. margin-right: calc(4% / 3);
  201. }
  202. .list-item:hover{
  203. box-shadow: 0 10px 10px rgba(0,0,0,.1);
  204. }
  205. .list-item h3{
  206. font-size: 16px;
  207. }
  208. .list-item img{
  209. width: 10%;
  210. margin-right: 10px;
  211. }
  212. .list-item p{
  213. color:#979898;
  214. font-size:12px;
  215. margin-top: 5px;
  216. }
  217. </style>