246 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			246 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <!--
 | |
|  * @Author: zhp
 | |
|  * @Date: 2024-06-05 09:48:37
 | |
|  * @LastEditTime: 2024-07-22 13:37:48
 | |
|  * @LastEditors: zhp
 | |
|  * @Description:
 | |
| -->
 | |
| <!--
 | |
|     filename: Container.vue
 | |
|     author: liubin
 | |
|     date: 2024-04-09 10:44:09
 | |
|     description:
 | |
| -->
 | |
| 
 | |
| <template>
 | |
|   <div class="copilot-container">
 | |
|     <!-- refresh btn  -->
 | |
|     <button
 | |
|       v-if="0"
 | |
|       style="
 | |
|         appearance: none;
 | |
|         outline: none;
 | |
|         border: none;
 | |
|         background: none;
 | |
|         color: #fff;
 | |
|         cursor: pointer;
 | |
|         position: absolute;
 | |
|         top: 8px;
 | |
|         right: 8px;
 | |
|       "
 | |
|       @click="$emit('refresh')"
 | |
|     >rotate
 | |
|       <svg
 | |
|         xmlns="http://www.w3.org/2000/svg"
 | |
|         fill="none"
 | |
|         viewBox="0 0 24 24"
 | |
|         stroke-width="1.5"
 | |
|         stroke="currentColor"
 | |
|         style="width: 24px; height: 24px"
 | |
|       >
 | |
|         <path
 | |
|           stroke-linecap="round"
 | |
|           stroke-linejoin="round"
 | |
|           d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"
 | |
|         />
 | |
|       </svg>
 | |
|     </button>
 | |
|     <!-- decoration  -->
 | |
|     <div class="corner tl"></div>
 | |
|     <div class="corner tr"></div>
 | |
|     <div class="corner bl"></div>
 | |
|     <div class="corner br"></div>
 | |
|     <!-- content  -->
 | |
|     <div
 | |
|       class="container-head"
 | |
|       :class="[side == 'left' ? 'gradient-to-right' : 'gradient-to-left']"
 | |
|     >
 | |
|       <Icon  :icon="icon"></Icon>
 | |
|       <h2 class="container-title">{{ title }}</h2>
 | |
|     </div>
 | |
|     <div
 | |
|       class="container-body"
 | |
|       :class="[
 | |
|         side == 'left' ? 'body-gradient-to-right' : 'body-gradient-to-left',
 | |
|       ]"
 | |
|     >
 | |
|       <slot />
 | |
|     </div>
 | |
|   </div>
 | |
| </template>
 | |
| 
 | |
| <script>
 | |
| import ContainerIconVue from "./ContainerIcon.vue";
 | |
| export default {
 | |
|   name: "DashboardContainer",
 | |
|   components: {
 | |
|     Icon: ContainerIconVue,
 | |
|   },
 | |
|   props: {
 | |
|     side: {
 | |
|       type: String,
 | |
|       default: "left",
 | |
|     },
 | |
|     icon: {
 | |
|       type: String,
 | |
|       default: "cube",
 | |
|     },
 | |
|     title: {
 | |
|       type: String,
 | |
|       default: "Default Title",
 | |
|     },
 | |
|   },
 | |
|   data() {
 | |
|     return {};
 | |
|   },
 | |
|   computed: {},
 | |
|   methods: {},
 | |
| };
 | |
| </script>
 | |
| 
 | |
| <style scoped lang="scss">
 | |
| 
 | |
| 
 | |
| .copilot-container {
 | |
|   height: 0;
 | |
|   flex: 1;
 | |
|   display: flex;
 | |
|   flex-direction: column;
 | |
|   position: relative;
 | |
|   box-shadow: inset 0 0 20px 1px #fff1;
 | |
|   border-right: .13vw solid;
 | |
|     // border-image: linear-gradient(to bottom,transparent 10%,
 | |
|     //   #024798 20%,
 | |
|     //   transparent 90%) 1;
 | |
|     border-image: linear-gradient(to bottom, transparent 10%, rgba(5, 138, 237, 1) 30%, rgba(2, 82, 215, 0.24) 90%)1;
 | |
|     box-sizing: border-box;
 | |
|     backdrop-filter: blur(4px);
 | |
| 
 | |
|     &::before {
 | |
|       content: "";
 | |
|       position: absolute;
 | |
|       display: inline-block;
 | |
|       height: 92%;
 | |
|       width: 0.13vw;
 | |
|       border-radius: 2px;
 | |
|       top: 0%;
 | |
|       left: 0;
 | |
|       background: radial-gradient(circle at center,
 | |
|           #1481fd 2%,
 | |
|           #024798 90%,
 | |
|           transparent);
 | |
|       z-index: 1;
 | |
|     }
 | |
| 
 | |
|   &::after {
 | |
|     content: "";
 | |
|     position: absolute;
 | |
|     display: inline-block;
 | |
|     width: 95%;
 | |
|     height: 0.31415vh;
 | |
|     border-radius: 2px;
 | |
|     left: 6%;
 | |
|     bottom: 0;
 | |
|     background: linear-gradient(to left, transparent 60%, #4197f9 98%, transparent 98%);
 | |
|     z-index: 0;
 | |
|   }
 | |
| 
 | |
|   .container-head {
 | |
|     // height: 40px;
 | |
|     height: 3.8vh;
 | |
|     padding: 8px;
 | |
|     display: flex;
 | |
|     align-items: center;
 | |
|     gap: 8px;
 | |
| 
 | |
|     .container-title {
 | |
|       font-size: 1vw;
 | |
|       line-height: 1.39vw;
 | |
|       font-weight: normal;
 | |
|       letter-spacing: 2px;
 | |
|     }
 | |
|   }
 | |
| 
 | |
|   .container-body {
 | |
|     padding: 12px;
 | |
|     display: flex;
 | |
|     flex-direction: column;
 | |
|     flex: 1;
 | |
|     height: 0;
 | |
|   }
 | |
| 
 | |
|   .corner {
 | |
|     z-index: 1;
 | |
|     position: absolute;
 | |
|     // width: 16px;
 | |
|     // height: 16px;
 | |
|     width: 0.7vw;
 | |
|       height: 0.7vw;
 | |
|   }
 | |
| 
 | |
|   .corner.tl {
 | |
|     border-top: 2px solid #0175dc;
 | |
|     border-left: 2px solid #0175dc;
 | |
|     top: 0;
 | |
|     left: 0;
 | |
|   }
 | |
| 
 | |
|   .corner.tr {
 | |
|     top: 0;
 | |
|     right: 0;
 | |
|     border-top: 2px solid #0175dc;
 | |
|     border-right: 2px solid #0175dc;
 | |
|   }
 | |
| 
 | |
|   .corner.bl {
 | |
|     // width: 20px;
 | |
|     // height: 20px;
 | |
|     width: 1.064vw;
 | |
|     height: 1.064vw;
 | |
|     bottom: 0;
 | |
|     left: 0;
 | |
|     // border-left: 10px solid #0175dc;
 | |
|     // border-bottom: 10px solid #0175dc;
 | |
|     // border-top: 10px solid transparent;
 | |
|     // border-right: 10px solid transparent;
 | |
|     border-left: 0.532vw solid #0175dc;
 | |
|     border-bottom: 0.532vw solid #0175dc;
 | |
|     border-top: 0.532vw solid transparent;
 | |
|     border-right: 0.532vw solid transparent;
 | |
|   }
 | |
| 
 | |
|   .corner.br {
 | |
|     bottom: 0;
 | |
|     right: 0;
 | |
|     // width: 20px;
 | |
|     // height: 20px;
 | |
|     width: 1.064vw;
 | |
|     height: 1.064vw;
 | |
|     // border-left: 10px solid transparent;
 | |
|     // border-bottom: 10px solid #0175dc;
 | |
|     // border-top: 10px solid transparent;
 | |
|     // border-right: 10px solid #0175dc;
 | |
|     border-left: 0.532vw solid transparent;
 | |
|     border-bottom: 0.532vw solid #0175dc;
 | |
|     border-top: 0.532vw solid transparent;
 | |
|     border-right: 0.532vw solid #0175dc;
 | |
|   }
 | |
| 
 | |
|   .gradient-to-right {
 | |
|     background: linear-gradient(to right, #0c3f68cc, transparent);
 | |
|   }
 | |
| 
 | |
|   .gradient-to-left {
 | |
|     background: linear-gradient(to left, #0c3f68cc, transparent);
 | |
|   }
 | |
| 
 | |
|   .body-gradient-to-right {
 | |
|     background: linear-gradient(to right, #0003, transparent);
 | |
|   }
 | |
| 
 | |
|   .body-gradient-to-left {
 | |
|     background: linear-gradient(to left, #0003, transparent);
 | |
|   }
 | |
| }
 | |
| </style>
 |