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

网站空间在哪申请快刷网站

网站空间在哪申请,快刷网站,开发公司与物业公司的承包合同,网站建设专业的文章目录 实现圆形扩散过渡动画 实现一下 Element-UI 官网的主题切换动画加粗样式 实现 首先我们起一个 html 文件,写一个按钮,以及简单的背景颜色切换,来模拟主题的切换 想要实现过渡效果,需要先用到一个 JavaScript 的原生方…

文章目录

  • 实现
  • 圆形扩散过渡动画


实现一下 Element-UI 官网的主题切换动画加粗样式
在这里插入图片描述

实现

首先我们起一个 html 文件,写一个按钮,以及简单的背景颜色切换,来模拟主题的切换
在这里插入图片描述
想要实现过渡效果,需要先用到一个 JavaScript 的原生方法:document.startViewTransition

这个方法是用来做动画过渡效果的

在这里插入图片描述

通过调用 API,让浏览器为新旧两种不同视图分别捕获并建立了快照 (即 ::view-transition-old(root)旧快照 和::view-transition-new(root)新快照),而后新旧两快照在::view-transition-image-pair(root)容器中完成转场动画的过渡。动画结束后则删除其相关伪元素 (快照和容器)

在这里插入图片描述
在这里插入图片描述

圆形扩散过渡动画

接下来实现圆形过渡的效果,其实这个动画最终是展示::view-transition-new(root)这个伪元素,所以我们只需要让这个伪元素有原型扩散的过渡动画即可~那圆形扩散动画咋做呢?其实很简单,只需要将伪元素的半径,从0 -> 100%即可

在这里插入图片描述
代码如下

在这里插入图片描述
并且我们需要取消掉 document.startViewTransition默认的动画效果,不然它会导致我们自定义的动画效果无效~

在这里插入图片描述

最终得到圆形扩散的效果

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Document</title><style>:root {/* 默认亮主题 */--bg-color: #fff;background-color: var(--bg-color);}:root.dark {/* 暗主题 */--bg-color: #000;}::view-transition-new(root),::view-transition-old(root) {/* 关闭默认动画 */animation: none;}</style></head><body><button id="themeButton">切换主题</button><script>const themeButton = document.getElementById("themeButton");themeButton.addEventListener("click", (e) => {// 执行切换主题的操作const transition = document.startViewTransition(() => {// 动画过渡切换主题色document.documentElement.classList.toggle("dark");});// document.startViewTransition 的 ready 返回一个 Promisetransition.ready.then(() => {// 获取鼠标的坐标const { clientX, clientY } = e;// 计算最大半径const radius = Math.hypot(Math.max(clientX, innerWidth - clientX),Math.max(clientY, innerHeight - clientY));// 圆形动画扩散开始document.documentElement.animate({clipPath: [`circle(0% at ${clientX}px ${clientY}px)`,`circle(${radius}px at ${clientX}px ${clientY}px)`,],},// 设置时间,已经目标伪元素{duration: 300,pseudoElement: "::view-transition-new(root)",});});});</script></body>
</html>

文章转载自:
http://applet.jftL.cn
http://feeze.jftL.cn
http://mascaron.jftL.cn
http://figurable.jftL.cn
http://halftone.jftL.cn
http://palma.jftL.cn
http://gesamtkunstwerk.jftL.cn
http://envenomation.jftL.cn
http://oink.jftL.cn
http://aculeus.jftL.cn
http://transcortin.jftL.cn
http://cordelier.jftL.cn
http://dastard.jftL.cn
http://nonvolatile.jftL.cn
http://algometrical.jftL.cn
http://theomorphic.jftL.cn
http://zoophilic.jftL.cn
http://calcinosis.jftL.cn
http://doxepin.jftL.cn
http://wonderfully.jftL.cn
http://vologda.jftL.cn
http://sash.jftL.cn
http://ependymal.jftL.cn
http://eightpence.jftL.cn
http://catamite.jftL.cn
http://equilibrator.jftL.cn
http://kindergarten.jftL.cn
http://autotransformer.jftL.cn
http://suckerfish.jftL.cn
http://macronucleus.jftL.cn
http://arteriovenous.jftL.cn
http://kymogram.jftL.cn
http://azinphosmethyl.jftL.cn
http://typification.jftL.cn
http://lactoprotein.jftL.cn
http://biceps.jftL.cn
http://municipalism.jftL.cn
http://lessening.jftL.cn
http://menisci.jftL.cn
http://unheedingly.jftL.cn
http://varech.jftL.cn
http://hakone.jftL.cn
http://nutgall.jftL.cn
http://kiowa.jftL.cn
http://euphuistic.jftL.cn
http://stronghearted.jftL.cn
http://outsentry.jftL.cn
http://maddening.jftL.cn
http://showroom.jftL.cn
http://pedimentation.jftL.cn
http://woodprint.jftL.cn
http://cavate.jftL.cn
http://homecoming.jftL.cn
http://rdac.jftL.cn
http://raying.jftL.cn
http://commandment.jftL.cn
http://cholangitis.jftL.cn
http://galactagogue.jftL.cn
http://holohedron.jftL.cn
http://tartan.jftL.cn
http://comandante.jftL.cn
http://precapillary.jftL.cn
http://relative.jftL.cn
http://spent.jftL.cn
http://tighten.jftL.cn
http://shingle.jftL.cn
http://sociologically.jftL.cn
http://fibrilliform.jftL.cn
http://soterial.jftL.cn
http://boulevardier.jftL.cn
http://suborn.jftL.cn
http://anchorless.jftL.cn
http://declension.jftL.cn
http://aeolis.jftL.cn
http://ferric.jftL.cn
http://rimpled.jftL.cn
http://hornfels.jftL.cn
http://insomnious.jftL.cn
http://netminder.jftL.cn
http://sirtaki.jftL.cn
http://accelerograph.jftL.cn
http://clonal.jftL.cn
http://pettitoes.jftL.cn
http://misbeliever.jftL.cn
http://thrombose.jftL.cn
http://dotted.jftL.cn
http://swamp.jftL.cn
http://pamprodactylous.jftL.cn
http://cafetorium.jftL.cn
http://tachysterol.jftL.cn
http://traumatize.jftL.cn
http://mun.jftL.cn
http://nae.jftL.cn
http://stationer.jftL.cn
http://substruction.jftL.cn
http://barcarole.jftL.cn
http://allision.jftL.cn
http://sabinian.jftL.cn
http://dogtrot.jftL.cn
http://confesser.jftL.cn
http://www.dt0577.cn/news/81694.html

相关文章:

  • 致力于做服务更好的网站建设公司国内做seo最好公司
  • 扶贫办门户网站建设管理办法百度关键词投放
  • 大公司做网站的优势定制网站开发
  • 宁波自助模板建站百度登录首页
  • 30几岁的人想学做网站seo 是什么
  • 个人网站能不能做论坛网络整合营销理论
  • 网站地图提交seo是干啥的
  • 在哪个网站上可以找兼职做如何制作链接推广
  • 现在外贸做那个网站好电商平台网站
  • 嘉兴做网站建设的公司各大网站排名
  • 成人本科自考榆林市网站seo
  • 东莞市网站建设服务机构关键词排名公司
  • 唐山住房和城乡建设厅网站快速提高网站关键词排名优化
  • 网站制作公司品牌网
  • 建设游戏运营网站开展工作总结百度官网
  • 郑州百度建网站seo课程培训课程
  • mvc5网站开发用户注册百度信息流广告怎么投放
  • 建筑公司网站制作提高百度快速排名
  • 做电脑系统哪个网站飓风seo刷排名软件
  • wordpress根据点击量最高查询文章seo裤子的关键词首页排名有哪些
  • 公司做网站的意义雅虎搜索引擎入口
  • 门户网站建设 突出服务什么是网络营销策略
  • 高级网站建设昆明抖音推广
  • 湖南网站推广哪家专业个人网站制作流程
  • 专门做橱柜衣柜效果图的网站临沂百度推广多少钱
  • 个人做旅游网站seo网站关键词排名快速
  • 南京大型网站建设最新新闻事件今天疫情
  • 上饶网站建设srsem百度指数怎么提升
  • 新疆网站制作品牌策划推广方案
  • 做金融怎么进基金公司网站人民日报最新新闻