当前位置: 首页 > news >正文

网站 html5node.js 做网站

网站 html5,node.js 做网站,郑州响应式建站,网站建设部分费用会计科目实现流光边框一般是用渐变背景加动画实现#xff0c;然后使用内部盒子遮挡内部空间#xff0c;达到边框流光的效果 思路#xff1a;背景渐变旋转动画 功能#xff1a; 自定义渐变#xff08;是否渐变不渐变没有流光效果#xff0c;渐变颜色#xff0c;渐变角…实现流光边框一般是用渐变背景加动画实现然后使用内部盒子遮挡内部空间达到边框流光的效果 思路背景渐变旋转动画 功能 自定义渐变是否渐变不渐变没有流光效果渐变颜色渐变角度渐变宽度自定义动画时间 1 基础实现 templateBox 测试 /Box /template script setup langts import Box from ./Box.vue; /script style scoped/styletemplatediv classboxdiv classcontentslot/slot/div/div /template script setup langts/script style scoped langscss .box {display: flex;justify-content: center;align-items: center;text-align: center;position: relative;width: 100%;height: 100%;padding: 5px;border-radius: 10px;overflow: hidden;:before {content: ;background-image: linear-gradient(120deg, #5ddcff, #3c67e3 40%, #4e00c2);position: absolute;z-index: 0;padding-left: 130%;padding-bottom: 130%;animation: rotate 8s linear infinite;}.content {height: 100%;width: 100%;display: flex;align-items: center;padding: 24px 20px;background: #f1d674;z-index: 2;border-radius: 6px;} } keyframes rotate {0% {transform: rotate(0deg);}100% {transform: rotate(360deg);} } /style 动图略 2 封装组件 2.1 圆形边框 使用mask属性使得中间部分背景不被遮挡 templatediv classbox :style{ width: width px, height: height px }slot/slot/div /template script setup langts const props defineProps({width: {type: Number, //容器宽default: 100,},height: {type: Number, //容器高default: 100,},colors: {//颜色数组type: Array,default: () [{color: #64dcfd,width: 0,},{color: #406cf1,width: 100,},{color: #4501ac,width: 101,},],},angle: {//渐变角度type: Number,default: 120,},borderWidth: {//流光边框宽度type: Number,default: 10,},gradient: {//是否渐变type: Boolean,default: true,},duration: {//动画时间type: String,default: 5s,}, });const background computed(() {const positions [];const colorsCopy JSON.parse(JSON.stringify(props.colors));colorsCopy.forEach((s, index) {const sum colorsCopy.slice(0, index).reduce((a, b) a b.width, 0);if (!props.gradient) {positions.push(sum);}positions.push(sum s.width);});return linear-gradient(${props.angle}deg, ${colorsCopy.map((s, index) {if (!props.gradient) {return ${s.color} ${positions[index]}px, ${s.color} ${positions[2 * index 1]}px;}return ${s.color} ${positions[index]}px;}).join(,)}); });const borderLR computed(() {return props.width / 2 - props.borderWidth px; }); const borderLRShink computed(() {return props.width / 2 - props.borderWidth - 1 px; }); /script style scoped langscss .box {display: flex;justify-content: center;align-items: center;position: relative;width: 100%;height: 100%;border-radius: 50%;overflow: hidden;:before {content: ;background-image: v-bind(background);position: absolute;width: 100%;height: 100%;border-radius: 50%;animation: rotate v-bind(duration) linear infinite;mask: radial-gradient(transparent,transparent v-bind(borderLRShink),#000 v-bind(borderLR));-webkit-mask: radial-gradient(transparent,transparent v-bind(borderLRShink),#000 v-bind(borderLR));} } keyframes rotate {0% {transform: rotate(0deg);}100% {transform: rotate(360deg);} } /style​​​​​​​ 2.2 矩形边框 使用伪元素自定义中间部分背景 templatediv classbox :style{ width: width px, height: height px }slot/slot/div /template script setup langts const props defineProps({width: {type: Number, //容器宽default: 100,},height: {type: Number, //容器高default: 100,},colors: {//颜色数组type: Array,default: () [{color: #64dcfd,width: 0,},{color: #406cf1,width: 100,},{color: #4501ac,width: 101,},],},angle: {//渐变角度type: Number,default: 120,},borderWidth: {//左右流光边框宽度type: [Array, Number],default: [20, 5],},gradient: {//是否渐变type: Boolean,default: true,},duration: {//动画时间type: String,default: 5s,},innerBackground: {//内部背景type: String,default: #FFF,}, });const background computed(() {const positions [];const colorsCopy JSON.parse(JSON.stringify(props.colors));colorsCopy.forEach((s, index) {const sum colorsCopy.slice(0, index).reduce((a, b) a b.width, 0);if (!props.gradient) {positions.push(sum);}positions.push(sum s.width);});return linear-gradient(${props.angle}deg, ${colorsCopy.map((s, index) {if (!props.gradient) {return ${s.color} ${positions[index]}px, ${s.color} ${positions[2 * index 1]}px;}return ${s.color} ${positions[index]}px;}).join(,)}); });const innerWidth computed(() {let doubleBorderWidth 0;if (Array.isArray(props.borderWidth)) {if (props.borderWidth.length 2) {doubleBorderWidth props.borderWidth[1] * 2;} else if (props.borderWidth.length 1) {doubleBorderWidth props.borderWidth[0] * 2;}} else {doubleBorderWidth props.borderWidth * 2;}return props.width - doubleBorderWidth px; }); const innerheight computed(() {let doubleBorderWidth 0;if (Array.isArray(props.borderWidth)) {if (props.borderWidth.length 2) {doubleBorderWidth props.borderWidth[0] * 2;} else if (props.borderWidth.length 1) {doubleBorderWidth props.borderWidth[0] * 2;}} else {doubleBorderWidth props.borderWidth * 2;}return props.height - doubleBorderWidth px; }); const colorSize computed(() {return (Math.ceil(Math.sqrt(props.width * props.width props.height * props.height)) px); }); /script style scoped langscss .box {display: flex;justify-content: center;align-items: center;position: relative;width: 100%;height: 100%;overflow: hidden;:before {content: ;background-image: v-bind(background);position: absolute;width: v-bind(colorSize);height: v-bind(colorSize);animation: rotate v-bind(duration) linear infinite;}:after {content: ;background: v-bind(innerBackground);position: absolute;z-index: 1;width: v-bind(innerWidth);height: v-bind(innerheight);} } keyframes rotate {0% {transform: rotate(0deg);}100% {transform: rotate(360deg);} } /style
http://www.dnsts.com.cn/news/80309.html

相关文章:

  • 慧聪网de网站建设策略网站开发环境和运行环境
  • 做网站备案什么意思wordpress影院主题
  • html5网站下载Python能开发WordPress
  • 网站开发所需费用明细怎么网站开发
  • 漂亮的网站单页建设银行个人网站
  • 浙江昆仑建设集团网站征婚网站建设
  • 专业做网站咨询旅游网站论文摘要
  • wap建站系统开源河北省建设监理协会网站
  • 环保网站建设方案商务网站的功能
  • 开发一个小网站多少钱wordpress模板文件修改插件
  • 中国购物网站排行榜住房和城乡建设部网站准考证
  • 电子网站搜索引擎怎么做互联网排名前十名的公司
  • 模板网站建设咨询建设部网站1667号
  • 网页设计版面划分网站seo优化软件
  • 有源码手机怎么搭建网站东莞推广就莞用服务平台
  • 郑州网站建设汉狮wordpress文章自动采集发布
  • 专业的聊城网站建设创建网站要多长时间
  • 西丽网站建设设计徐州专业网站制作
  • 网站建设需要桂ajax吗阿里云网站怎么备案域名
  • 国外网站备案吗修改WordPress文章发布模板
  • 游戏网站规划方案seo推广优势
  • 网站开发赚钱吗网站制作建设模板
  • 做视频网站免费观看爱郑州专业网站建设公司首选
  • 建设网站公司选哪家好网站在正在建设中
  • 专业中山建网站公司wordpress首页底部模板修改
  • 网站外链建设工作计划北京vi设计案例分析
  • 做网站没有按照合同履行淘宝代运营
  • 淄博网站制作定制升级福州建站服务管理
  • 措勤网站建设成都手机模板建站
  • 福州自助建设网站网站渗透案例