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

网站建设 目的现在c 做网站用什么框架

网站建设 目的,现在c 做网站用什么框架,珠海品牌网站建,wordpress 商业版权介绍: 当数字变化时#xff0c;只改变变化的数字位#xff0c;其余的不变#xff0c;可以递增、递减、骤变、负数也可以#xff0c;但是样式要根据具体的项目需求去改#xff1b; 效果1、增加数字#xff1a; 效果2、减少数字#xff1a; 使用方法#xff1a; te…介绍: 当数字变化时只改变变化的数字位其余的不变可以递增、递减、骤变、负数也可以但是样式要根据具体的项目需求去改 效果1、增加数字 效果2、减少数字 使用方法 templateAnimatNumber :datadata / /templatescript setup // 引入动画 import AnimatNumber from ./components/AnimatNumber.vue;const data ref(0);setInterval(() {data.value - 30; }, 2000); /scriptstyle langscss/style 组件代码(vue3) templatediv classnum-wrapdiv v-for(item, index) in computedData :keyindex classnum-itemdiv classnum-inner refnumInnerRefdiv classprev{{ item.newValue }}/divdiv classcurrent{{ item.oldValue }}/divdiv classnext{{ item.oldValue }}/div/div/div/div /templatescript setup // 数字滚动效果 import { onBeforeUnmount, watch, ref, nextTick } from vue;const props defineProps({// 传进来的数据 number、string的number都可以data: {type: [Number, String],default: 999},// 动画持续时间 number、string的number都可以 最低1000msduration: {type: [Number, String],default: 500},// 基本的高度 所有的动画移动距离都是和这个有关的确保这个值和css的$height一样否则有问题baseHeight: {type: Number,default: 50} });const numInnerRef ref();// raf演示器 const setTimeoutPolyfill (func, delay) {let startTime Date.now();let rafId;function animationFrameCallback() {const currentTime Date.now();const timeElapsed currentTime - startTime;if (timeElapsed delay) {func();} else {rafId requestAnimationFrame(animationFrameCallback);}}rafId requestAnimationFrame(animationFrameCallback);// 返回一个取消函数return () cancelAnimationFrame(rafId); };/* 推演公式新 旧1001 - 10001002 - 10011003 - 10021004 - 10031005 - 1004 */const newArr ref([]); const oldArr ref([]); const computedData ref(props.data.toString().split().map((item, index) ({ index, oldValue: item, newValue: item })) ); const lock ref(false); // 延时器 const timer ref({timerOne: null,timerTwo: null });watch(() props.data,(newVal, oldVal) {if (${newVal}.length ! ${oldVal}.length) {lock.value false;}if (!lock.value) {computedData.value props.data.toString().split().map((item, index) ({ index, oldValue: item, newValue: item }));lock.value true;}newArr.value newVal.toString().split().map((item, index) ({ index, value: item }));oldArr.value oldVal.toString().split().map((item, index) ({ index, value: item }));/*如果newArr的长度大于于oldArr的长度则需要给oldArr从前面增加newArr.length - oldArr.length的长度的{ index, oldValue: -, newValue: newValueItem }, 同时更新oldArr没有新增的index*/// 新值和老值差const differLength newArr.value.length - oldArr.value.length;if (newArr.value.length oldArr.value.length) {for (let i 0; i differLength; i) {oldArr.value.unshift({ index: i, value: - });}// 重新设置indexoldArr.value.forEach((item, index) (item.index index));}// 改变的数字的索引集合const indexArr [];newArr.value.forEach(item {if (item.value ! oldArr.value[item.index].value) {indexArr.push(item.index);}});nextTick(() {indexArr.forEach(diffIndex {numInnerRef.value[diffIndex].children[0].innerHTML newArr.value[diffIndex].value;numInnerRef.value[diffIndex].children[0].animate([{ top: ${-props.baseHeight}px }, { top: 0 }],{duration: props.duration,fill: forwards});numInnerRef.value[diffIndex].children[1].animate([{ top: 0 }, { top: ${props.baseHeight}px }],{duration: props.duration,fill: forwards});timer.value.timerOne setTimeoutPolyfill(() {numInnerRef.value[diffIndex].children[2].innerHTML oldArr.value[diffIndex].value;timer.value.timerTwo setTimeoutPolyfill(() {numInnerRef.value[diffIndex].children[1].innerHTML newArr.value[diffIndex].value;}, props.duration);numInnerRef.value[diffIndex].children[2].style.top ${-props.baseHeight}px;}, props.duration);});});},{ deep: true } );// 卸载 onBeforeUnmount(() {timer.value.timerOne timer.value.timerOne();timer.value.timerTwo timer.value.timerTwo(); }); /scriptstyle langscss scoped $width: 50px; $height: 50px; .num-wrap {margin-top: 200px;display: flex;gap: 10px;.num-item {width: $width;height: $height;border: 1px solid #000;border-radius: 8px;font-size: 20px;font-weight: 600;position: relative;overflow: hidden;color: #0dfbff;background: rgba(0, 13, 23, 0.5);.num-inner {position: relative;width: $width;height: $height;}.prev,.current,.next {width: $width;height: $height;text-align: center;line-height: $width;position: absolute;}.prev {top: -$height;}.current {top: 0;}.next {top: $height;}} } /style
http://www.hkea.cn/news/14583533/

相关文章:

  • 怎样申请免费网站域名室内设计公司名字起名大全
  • 广州做模板网站的公司wordpress 4.7.3 慢
  • 南约社区网站建设郴州网站建设解决方案
  • 苍山做网站买了一个域名如何做网站
  • 网站维护界面门户网站模块
  • 免费黄页网站百度小程序怎么进入
  • 外贸公司网站案例wordpress主题 虎嗅
  • 河南省网上商城采购平台seo wordpress
  • 专业提供深圳网站设计公司计算机网站建设和维护
  • 怎么在在慧聪网上做网站推广江西省城乡和住房建设部网站
  • 做类似美团的网站吗wordpress商城视频教程
  • 海外域名提示风险网站吗wordpress 小公举
  • 网络推广培训在哪里uc浏览器关键词排名优化
  • 哈尔滨住房和城乡建设厅网站网站建设方法牜金手指下拉覀
  • 简述网站设计流程wordpress商城制作
  • 网站开发项目书专业网站建设组织
  • 微信公众号php网站开发设计最好的网站
  • 深圳网站建设q479185700強网站建设投票主题
  • 网站建设目的分析wordpress专题修改
  • 网站设计语言有哪些地推拉新app推广怎么做
  • 做童鞋的一些外贸网站调用wordpress编辑器
  • 用淘宝做公司网站企业营销型网站设计
  • 沈阳网站外包公司普集网站制作
  • 网站策划方案论文工业设计本科生作品集
  • 安康市网站开发无锡网站建设推广服务
  • 南京太阳宫网站建设合工大智能院网站建设
  • 深圳微商城网站制作费用作文网课
  • 火车头采集网站做返利网站怎麼
  • 河南省住房与城乡建设部网站大兴网站开发
  • 模板手机网站建设中铁三局招聘事件