vue星空背景组件

embedded/2025/2/15 18:16:29/

组件

javascript"><template><div class="starlit_sky"><div class="layer1"></div><div class="layer2"></div><div class="layer3"></div><slot name="contentmain"></slot></div>
</template><script >
/*** 这是一个星空背景组件* 如果在使用时,需要使用插槽,则需要在插槽中添加teleport标签,并设置name属性为contentmain (v-slot:contentmain)*/
</script><style lang="scss" scoped>
@import url('./index.scss');
</style>

scss代码

.starlit_sky {width: 100vw;height: 100vh;background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);overflow: hidden;
}
.contentmain-style {position: absolute;width: 100vw;height: 100vh;left: 0;right: 0;
}
@function getShadows($n) {$shadows: '#{random(100)}vw #{random(100)}vh #fff';@for $i from 2 through $n {$shadows: '#{$shadows}, #{random(100)}vw #{random(100)}vh #fff';}@return unquote($shadows);
}
$duration: 400s;
$count: 1000;
@for $i from 1 through 3 {$duration: floor($duration/ 2);$count: floor($count/2);.layer#{$i} {$size: #{$i}px;position: fixed;width: $size;height: $size;border-radius: 50%;background: #fff;box-shadow: getShadows($count);animation: moveup $duration linear infinite;&::after {content: '';position: fixed;left: 0;top: 100vh;width: $size;height: $size;border-radius: inherit;box-shadow: inherit;}}
}@keyframes moveup {100% {transform: translateY(-100vh);}
}

父组件的调用

javascript"><template><StarlitSky><template v-slot:contentmain></template></StarlitSky>
</template><script setup>
import {defineAsyncComponent} from 'vue';
const StarlitSky = defineAsyncComponent(()=>import('../../components/starlitSky/index.vue'))
</script>
<style lang="less" scoped>
</style>

http://www.ppmy.cn/embedded/162474.html

相关文章

【工具】在idea运行go后端

场景&#xff1a;从gitee仓库下载一个go语言前后端分离项目&#xff0c;想跑通前后端 ---------------------------------------------------------------------------------------------------------------------- 后端 1.下载插件 在idea的setting里面输入go&#xff0c;…

如何实现对 ELK 各组件的监控?试试 Metricbea

上一章基于 Filebeat 的日志收集使用Filebeat收集文件中的日志&#xff0c;而Metricbeat则是收集服务器存活性监测和系统指标的指标。 1. Filebeat和Metricbeat的区别 特性FilebeatHeartbeat作用收集和转发日志监测服务可用性数据来源服务器上的日志文件远程主机、API、服务主…

21爬虫:使用playwright接管本地已经登录淘宝的浏览器并查找python相关店铺信息

1.playwright如何接管本地浏览器 &#xff08;1&#xff09;首先找到电脑上安装的Chrome浏览器可执行程序的完整路径&#xff1a; Mac电脑上可执行程序的完整路径为&#xff1a; /Applications/Google Chrome.app/Contents/MacOS/Google Chrome windows系统的电脑上查找可执行…

【C语言】C语言 停车场管理系统的设计与实现(源码)【独一无二】

&#x1f449;博__主&#x1f448;&#xff1a;米码收割机 &#x1f449;技__能&#x1f448;&#xff1a;C/Python语言 &#x1f449;专__注&#x1f448;&#xff1a;专注主流机器人、人工智能等相关领域的开发、测试技术。 系列文章目录 目录 系列文章目录一、设计要求二、设…

网络安全防范

实践内容 学习总结 PDR&#xff0c;$$P^2$$DR安全模型。 防火墙&#xff08;Firewall&#xff09;&#xff1a; 网络访问控制机制&#xff0c;布置在网际间通信的唯一通道上。 不足&#xff1a;无法防护内部威胁&#xff0c;无法阻止非网络传播形式的病毒&#xff0c;安全策略…

无人机遥感图像拼接软件有哪些?无人机遥感图像采集流程;遥感图像拼接的一般流程

无人机遥感图像拼接软件主要用于将多张无人机拍摄的图像拼接成一张完整的大图。以下是常见的几款软件&#xff1a; 1. Pix4Dmapper 特点&#xff1a;自动化处理&#xff0c;支持多光谱和热成像数据 适用场景&#xff1a;农业、测绘、建筑等 2. Agisoft Metashape 特点&#xff…

RAG科普文!检索增强生成的技术全景解析

RAG 相关技术的八个主题&#xff1a;https://pub.towardsai.net/a-taxonomy-of-retrieval-augmented-generation-a39eb2c4e2ab 增强生成 (RAG) 是塑造应用生成式 AI 格局的关键技术。Lewis 等人在其开创性论文中提出了一个新概念面向知识密集型 NLP 任务的检索增强生成之后&…

Oracle EBS 11i R12 更改form颜色

前言 Oracle EBS 默认的form颜色为蓝色。目前大部分使用Oracle EBS的企业均已蓝色做为生产环境的颜色。在运维或者测试的过程中&#xff0c;必然需要多个测试环境。如&#xff1a;开发测试、系统测## 二级标题试等。单单靠form上的提示词进行区别&#xff0c;往往不适用于企业…