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

软件开发需要用什么软件自动seo系统

软件开发需要用什么软件,自动seo系统,app开发公司网站,专题网站建设自查整改报告实现效果: 加入帧动画前: 普通的静态页面 加入帧动画后: 可以看到,加入帧动画后,页面效果还是比较丝滑的。 技术实现 加入animation动画类 先用 **scss **定义三种动画类: .withAnimation {.fade1 {ani…

实现效果:

加入帧动画前:

1695911105187.gif

普通的静态页面

加入帧动画后:

1695946149547.gif

可以看到,加入帧动画后,页面效果还是比较丝滑的。

技术实现

加入animation动画类

先用 **scss **定义三种动画类:

.withAnimation {.fade1 {animation: fadeInDown1 1s;}.fade2 {animation: fadeInDown2 1.25s;}.fade3 {animation: fadeInDown2 1.5s;}
}@keyframes fadeInDown1 {0% {transform: translate3d(0, 40px, 0);opacity: 0;}22% {transform: translate3d(0, 40px, 0);opacity: 0;}100% {-webkit-transform: none;transform: none;opacity: 1;}
}
@keyframes fadeInDown2 {0% {transform: translate3d(0, 40px, 0);opacity: 0;}44% {transform: translate3d(0, 40px, 0);opacity: 0;}100% {-webkit-transform: none;transform: none;opacity: 1;}
}
@keyframes fadeInDown3 {0% {transform: translate3d(0, 40px, 0);opacity: 0;}66% {transform: translate3d(0, 40px, 0);opacity: 0;}100% {-webkit-transform: none;transform: none;opacity: 1;
}

注意:.fade类前面需要有.withAnimation,作为接下来实现帧动画,添加.withAnimation .fade类帧动画的工具。

加入IntersectionObserver监听

IntersectionObserver

先简单过一下IntersectionObserver的使用:

var observer = new IntersectionObserver(callback,options);

IntersectionObserver支持两个参数:

  1. callback是当被监听元素的可见性变化时,触发的回调函数
  2. options是一个配置参数,可选,有默认的属性值
//初始化一个实例
var observer = new IntersectionObserver(changes => {for (const change of changes) {console.log(change.time);// Timestamp when the change occurred// 当可视状态变化时,状态发送改变的时间戳// 对比时间为,实例化的时间,// 比如,值为1000时,表示在IntersectionObserver实例化的1秒钟之后,触发该元素的可视性变化console.log(change.rootBounds);// Unclipped area of root// 根元素的矩形区域信息,即为getBoundingClientRect方法返回的值console.log(change.boundingClientRect);// target.boundingClientRect()// 目标元素的矩形区域的信息console.log(change.intersectionRect);// boundingClientRect, clipped by its containing block ancestors,// and intersected with rootBounds// 目标元素与视口(或根元素)的交叉区域的信息console.log(change.intersectionRatio);// Ratio of intersectionRect area to boundingClientRect area// 目标元素的可见比例,即intersectionRect占boundingClientRect的比例,// 完全可见时为1,完全不可见时小于等于0console.log(change.target);// the Element target// 被观察的目标元素,是一个 DOM 节点对象// 当前可视区域正在变化的元素}
}, {});// Watch for intersection events on a specific target Element.
// 对元素target添加监听,当target元素变化时,就会触发上述的回调
observer.observe(target);// Stop watching for intersection events on a specific target Element.
// 移除一个监听,移除之后,target元素的可视区域变化,将不再触发前面的回调函数
observer.unobserve(target);// Stop observing threshold events on all target elements.
// 停止所有的监听
observer.disconnect();

实现

页面组件中加入IntersectionObserver

  useEffect(() => {const options = {rootMargin: '0px',threshold: 0.2 // 指定交叉比例为 20% 时触发回调函数};const observer = new IntersectionObserver(([entry]) => {// ...}, options);}, []);

监听dom元素的进入,添加对应class

fadeClass类的添加

  • 确保父元素加入了fadeClass类,便于后续对加动画的dom元素进行锁定
  • 子元素添加对应的fade动画类
      <div className={cName([styles.rootFront,'fadeClass'])}><p className={cName([styles.text1, styles.fade1])}>123</p><p className={cName([styles.text2, styles.fade2])}>123</p><p className={cName([styles.text3, styles.fade3])}>123</p></div>

cName()是classnames中给dom元素添加多个class的方法,也可以用其他方法实现。

  • 引入:“import cName from ‘classnames’”
  • 依赖:npm i classnames

IntersectionObserver监听fadeClass元素的进入

  useEffect(() => {const elements = document.querySelectorAll('.fadeClass');const options = {rootMargin: '0px',threshold: 0.2 // 指定交叉比例为 20% 时触发回调函数};const observer = new IntersectionObserver(([entry]) => {if (entry.isIntersecting) {entry.target.classList.add(styles.withAnimation);}// 进入时添加withAnimation类}, options);elements.forEach((dom) => {observer.observe(dom);//每个元素,添加聆听事件});}, []);

不出意外,到这来就基本实现完成了,其他动画效果实现类似。

http://www.hkea.cn/news/939928/

相关文章:

  • 谁做网站市场营销专业
  • 慈溪外贸公司网站网络营销就业前景和薪水
  • 电商网站建设实训报告长沙网站seo推广公司
  • 阿里云ecs怎么建网站吉林网站seo
  • 企业营销型网站建设的可行性西安竞价托管
  • 做网站如何适应分辨率网站分析培训班
  • 现在币圈有那些私募网站做的好百度推广账号登陆入口
  • 旅游网站图片营销公司排名
  • 做服务器的网站都有哪些搜狗关键词排名此会zjkwlgs
  • php动态网站开发 唐四薪 答案b站引流推广网站
  • 长沙3天2晚自由行攻略论述搜索引擎优化的具体措施
  • 外汇局网站做结汇申报被逆冬seo课程欺骗了
  • 网站运营配置免费网站在线观看人数在哪直播
  • 什么网站做一手房好系统优化的例子
  • wordpress 插入wordseo排名点击工具
  • 网站推广易网宣seo的主要分析工具
  • 安徽网站定制最大免费广告发布平台
  • 怎么查网站有没有做404公司宣传网页怎么做
  • 靠谱营销网站开发选哪家seo的优点和缺点
  • 企业网站建设论文文献综述百度推广的广告真实可信吗
  • 企业网站优化方式广州最新消息今天
  • 旅游网站开发的意义seo优化方案案例
  • 山东做网站的公司seo数据分析哪些方面
  • 做网站用哪几个端口 比较好百度贴吧官网网页
  • 弹幕网站是怎么做的百度在线翻译
  • 独立网站域名代发关键词包收录
  • 如何建立门户网站百度可以发布广告吗
  • 网站开发毕设文献郑州网站优化顾问
  • 青海建设银行的官方网站自己制作网页的网站
  • 网站建设的图片叠加步骤过程2021年搜索引擎排名