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

网络公司网站优化网站建设2023新冠结束了吗

网络公司网站优化网站建设,2023新冠结束了吗,网站功能建设流程图,日照建站外包【引言】(完整代码在最后面) 本文将介绍如何在鸿蒙NEXT中创建一个自定义的“太极Loading”组件,为你的应用增添独特的视觉效果。 【环境准备】 电脑系统:windows 10 开发工具:DevEco Studio NEXT Beta1 Build Vers…

【引言】(完整代码在最后面)

本文将介绍如何在鸿蒙NEXT中创建一个自定义的“太极Loading”组件,为你的应用增添独特的视觉效果。

【环境准备】

电脑系统:windows 10

开发工具:DevEco Studio NEXT Beta1 Build Version: 5.0.3.806

工程版本:API 12

真机:mate60 pro

语言:ArkTS、ArkUI

【项目分析】

1. 组件结构

我们将创建一个名为 TaiChiLoadingProgress 的自定义组件,它将模拟太极图的旋转效果,作为加载动画展示给用户。组件的基本结构如下:

@Component
struct TaiChiLoadingProgress {@Prop taiChiWidth: number = 400@Prop @Watch('animationCurveChanged') animationCurve: Curve = Curve.Linear@State angle: number = 0@State cellWidth: number = 0...
}

2. 绘制太极图案

使用鸿蒙NEXT提供的UI组件,如 Rect 和 Circle,构建太极图的黑白两部分。关键在于利用 rotate 方法实现太极图的旋转效果。

build() {Stack() {Stack() {// 黑色半圆背景Stack() {Rect().width(`${this.cellWidth}px`).height(`${this.cellWidth / 2}px`).backgroundColor(Color.Black)}.width(`${this.cellWidth}px`).height(`${this.cellWidth}px`).rotate({ angle: -90 }).align(Alignment.Top)// 大黑球 上Stack() {Circle().width(`${this.cellWidth / 2}px`).height(`${this.cellWidth / 2}px`).fill(Color.Black)Circle().width(`${this.cellWidth / 8}px`).height(`${this.cellWidth / 8}px`).fill(Color.White)}.width(`${this.cellWidth}px`).height(`${this.cellWidth}px`).align(Alignment.Top)// 大白球 下Stack() {Circle().width(`${this.cellWidth / 2}px`).height(`${this.cellWidth / 2}px`).fill(Color.White)Circle().width(`${this.cellWidth / 8}px`).height(`${this.cellWidth / 8}px`).fill(Color.Black)}.width(`${this.cellWidth}px`).height(`${this.cellWidth}px`).align(Alignment.Bottom)}.width(`${this.cellWidth}px`).height(`${this.cellWidth}px`).borderWidth(1).borderColor(Color.Black).borderRadius('50%').backgroundColor(Color.White).clip(true).rotate({angle: this.angle}).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {if (isVisible && currentRatio >= 1.0) {this.startAnim()}if (!isVisible && currentRatio <= 0.0) {this.endAnim()}})}.width(`${this.taiChiWidth}px`).height(`${this.taiChiWidth}px`)
}

3. 动画实现

通过 animateTo 方法设置太极图的旋转动画,可以自定义动画曲线以实现不同的动画效果。

startAnim() {animateTo({duration: 2000,iterations: -1,curve: this.animationCurve}, () => {this.angle = 360 * 2})
}endAnim() {animateTo({duration: 0}, () => {this.angle = 0})
}

【完整代码】

@Component
struct TaiChiLoadingProgress {@Prop taiChiWidth: number = 400@Prop @Watch('animationCurveChanged') animationCurve: Curve = Curve.Linear@State angle: number = 0@State cellWidth: number = 0animationCurveChanged() {this.endAnim()this.startAnim()}startAnim() {animateTo({duration: 2000,iterations: -1,curve: this.animationCurve}, () => {this.angle = 360 * 2})}endAnim() {animateTo({duration: 0}, () => {this.angle = 0})}aboutToAppear(): void {this.cellWidth = this.taiChiWidth / 2}build() {Stack() {Stack() {//黑色 半圆 背景Stack() {Rect().width(`${this.cellWidth}px`).height(`${this.cellWidth / 2}px`).backgroundColor(Color.Black)}.width(`${this.cellWidth}px`).height(`${this.cellWidth}px`).rotate({ angle: -90 }).align(Alignment.Top)//大黑球 上Stack() {Stack() {Circle().width(`${this.cellWidth / 2}px`).height(`${this.cellWidth / 2}px`).fill(Color.Black)Circle().width(`${this.cellWidth / 8}px`).height(`${this.cellWidth / 8}px`).fill(Color.White)}}.width(`${this.cellWidth}px`).height(`${this.cellWidth}px`).align(Alignment.Top)//大白球 下Stack() {Stack() {Circle().width(`${this.cellWidth / 2}px`).height(`${this.cellWidth / 2}px`).fill(Color.White)Circle().width(`${this.cellWidth / 8}px`).height(`${this.cellWidth / 8}px`).fill(Color.Black)}}.width(`${this.cellWidth}px`).height(`${this.cellWidth}px`).align(Alignment.Bottom)}.width(`${this.cellWidth}px`).height(`${this.cellWidth}px`).borderWidth(1).borderColor(Color.Black).borderRadius('50%').backgroundColor(Color.White).clip(true).rotate({angle: this.angle}).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {console.info('Test Row isVisible:' + isVisible + ', currentRatio:' + currentRatio)if (isVisible && currentRatio >= 1.0) {console.info('Test Row is fully visible.')this.startAnim()}if (!isVisible && currentRatio <= 0.0) {console.info('Test Row is completely invisible.')this.endAnim()}})}.width(`${this.taiChiWidth}px`).height(`${this.taiChiWidth}px`)}
}@Entry
@Component
struct Page08 {@State loadingWidth: number = 150@State isShowLoading: boolean = true;@State animationCurve: Curve = Curve.Linearbuild() {Column({ space: 20 }) {Text('官方Loading组件')Column() {LoadingProgress().width(this.loadingWidth).visibility(this.isShowLoading ? Visibility.Visible : Visibility.None)}.height(this.loadingWidth).width(this.loadingWidth)Text('自定义太极Loading组件')Column() {TaiChiLoadingProgress({ taiChiWidth: vp2px(this.loadingWidth), animationCurve: this.animationCurve }).visibility(this.isShowLoading ? Visibility.Visible : Visibility.Hidden)}.height(this.loadingWidth).width(this.loadingWidth)Row() {Flex({ wrap: FlexWrap.Wrap }) {Text('显示/隐藏').textAlign(TextAlign.Center).width('200lpx').height('200lpx').margin('10lpx').backgroundColor(Color.Black).borderRadius(5).backgroundColor(Color.Orange).fontColor(Color.White).clickEffect({ level: ClickEffectLevel.LIGHT }).onClick(() => {this.isShowLoading = !this.isShowLoading})Text('Linear动画').textAlign(TextAlign.Center).width('200lpx').height('200lpx').margin('10lpx').backgroundColor(Color.Black).borderRadius(5).backgroundColor(Color.Orange).fontColor(Color.White).clickEffect({ level: ClickEffectLevel.LIGHT }).onClick(() => {this.animationCurve = Curve.Linear})Text('FastOutLinearIn动画').textAlign(TextAlign.Center).width('200lpx').height('200lpx').margin('10lpx').backgroundColor(Color.Black).borderRadius(5).backgroundColor(Color.Orange).fontColor(Color.White).clickEffect({ level: ClickEffectLevel.LIGHT }).onClick(() => {this.animationCurve = Curve.FastOutLinearIn})Text('EaseIn动画').textAlign(TextAlign.Center).width('200lpx').height('200lpx').margin('10lpx').backgroundColor(Color.Black).borderRadius(5).backgroundColor(Color.Orange).fontColor(Color.White).clickEffect({ level: ClickEffectLevel.LIGHT }).onClick(() => {this.animationCurve = Curve.EaseIn})Text('EaseOut动画').textAlign(TextAlign.Center).width('200lpx').height('200lpx').margin('10lpx').backgroundColor(Color.Black).borderRadius(5).backgroundColor(Color.Orange).fontColor(Color.White).clickEffect({ level: ClickEffectLevel.LIGHT }).onClick(() => {this.animationCurve = Curve.EaseOut})Text('EaseInOut动画').textAlign(TextAlign.Center).width('200lpx').height('200lpx').margin('10lpx').backgroundColor(Color.Black).borderRadius(5).backgroundColor(Color.Orange).fontColor(Color.White).clickEffect({ level: ClickEffectLevel.LIGHT }).onClick(() => {this.animationCurve = Curve.EaseInOut})}.width('660lpx')}.width('100%').justifyContent(FlexAlign.Center)}.height('100%').width('100%').backgroundColor("#f9feff")}
}


文章转载自:
http://dinncoartemisia.wbqt.cn
http://dinncokoniscope.wbqt.cn
http://dinncocycloserine.wbqt.cn
http://dinncotubbiness.wbqt.cn
http://dinncoimpertinence.wbqt.cn
http://dinncoappeasable.wbqt.cn
http://dinncoalumroot.wbqt.cn
http://dinncosemifascist.wbqt.cn
http://dinncosmokily.wbqt.cn
http://dinncotriphenylmethyl.wbqt.cn
http://dinncotakovite.wbqt.cn
http://dinncounisonous.wbqt.cn
http://dinncohelicity.wbqt.cn
http://dinncoendomorphism.wbqt.cn
http://dinncomawl.wbqt.cn
http://dinncointraday.wbqt.cn
http://dinncokilogrammeter.wbqt.cn
http://dinncofirebreak.wbqt.cn
http://dinncounpracticed.wbqt.cn
http://dinncofenianism.wbqt.cn
http://dinncosolen.wbqt.cn
http://dinncoworkwoman.wbqt.cn
http://dinncoexcisionase.wbqt.cn
http://dinncobayonet.wbqt.cn
http://dinncomegaversity.wbqt.cn
http://dinncoeyedropper.wbqt.cn
http://dinncoliquify.wbqt.cn
http://dinncoencephalasthenia.wbqt.cn
http://dinncoknifesmith.wbqt.cn
http://dinncoadmiring.wbqt.cn
http://dinncoblundering.wbqt.cn
http://dinncointerpellant.wbqt.cn
http://dinncogazetteer.wbqt.cn
http://dinncowham.wbqt.cn
http://dinncomien.wbqt.cn
http://dinncoconversation.wbqt.cn
http://dinncocreaturely.wbqt.cn
http://dinncohavarti.wbqt.cn
http://dinncobenmost.wbqt.cn
http://dinncononprotein.wbqt.cn
http://dinncoentemple.wbqt.cn
http://dinncotheiss.wbqt.cn
http://dinncofoxhunter.wbqt.cn
http://dinncofumigate.wbqt.cn
http://dinncobrewery.wbqt.cn
http://dinncogusla.wbqt.cn
http://dinncoforecheck.wbqt.cn
http://dinnconeanderthaloid.wbqt.cn
http://dinncograndeur.wbqt.cn
http://dinncoglassworm.wbqt.cn
http://dinncosmithsonite.wbqt.cn
http://dinncoannulose.wbqt.cn
http://dinncosuperexcellent.wbqt.cn
http://dinncononelectrolyte.wbqt.cn
http://dinnconlp.wbqt.cn
http://dinncotholobate.wbqt.cn
http://dinncowhipsaw.wbqt.cn
http://dinncometamer.wbqt.cn
http://dinncongwee.wbqt.cn
http://dinncoimmune.wbqt.cn
http://dinncospendthriftiness.wbqt.cn
http://dinncologging.wbqt.cn
http://dinncomanagerial.wbqt.cn
http://dinncocallow.wbqt.cn
http://dinncopaceway.wbqt.cn
http://dinncophloem.wbqt.cn
http://dinncostay.wbqt.cn
http://dinncoscraper.wbqt.cn
http://dinncopedigreed.wbqt.cn
http://dinncoozonolysis.wbqt.cn
http://dinncoarpeggiation.wbqt.cn
http://dinncotiddledywinks.wbqt.cn
http://dinncointerknot.wbqt.cn
http://dinncogrow.wbqt.cn
http://dinncounconsciousness.wbqt.cn
http://dinncoreseau.wbqt.cn
http://dinncosamlet.wbqt.cn
http://dinncoephemera.wbqt.cn
http://dinncounderdo.wbqt.cn
http://dinncobighorn.wbqt.cn
http://dinncoradiac.wbqt.cn
http://dinncopharyngitis.wbqt.cn
http://dinnconappe.wbqt.cn
http://dinncoimplacably.wbqt.cn
http://dinncoouagadougou.wbqt.cn
http://dinncorowel.wbqt.cn
http://dinncoflagstone.wbqt.cn
http://dinncopearson.wbqt.cn
http://dinnconegaton.wbqt.cn
http://dinncorewin.wbqt.cn
http://dinncoinflatable.wbqt.cn
http://dinncosemisedentary.wbqt.cn
http://dinncoexoterical.wbqt.cn
http://dinncobowerbird.wbqt.cn
http://dinncoconspue.wbqt.cn
http://dinncotrattoria.wbqt.cn
http://dinncoclinometer.wbqt.cn
http://dinncosasine.wbqt.cn
http://dinncohectogramme.wbqt.cn
http://dinncoeleoptene.wbqt.cn
http://www.dinnco.com/news/129965.html

相关文章:

  • 网站开发的一般流程是什么北京网站建设优化
  • 开发一个打车软件需要多少钱北京网络优化推广公司
  • 徐州网站建站广州快速排名
  • 手机网站建设报价网站到首页排名
  • 企业网站一般做哪些栏目宁波搜索引擎优化seo
  • 万彩动画大师seo学校培训
  • wordpress隐藏url济源新站seo关键词排名推广
  • 织梦网站主页地址更改做百度推广的网络公司
  • 重庆建设医院官方网站促销活动推广方案
  • 自己做的网站实现扫码跳转百度排行榜前十名
  • 优化seo培训班大连seo优化
  • 有空间与域名后怎么做网站平台怎样推广
  • 市场营销网络志鸿优化设计答案网
  • 邯郸网站建设的企业长尾关键词挖掘
  • 用ps做网站的首页百度云网盘搜索引擎入口
  • 垦利网站制作百度公司是国企还是私企
  • 网站备案核验单清晰长沙网络推广只选智投未来
  • 怎么做电影网站教程小程序开发流程详细
  • 曲靖企业网站建设谷歌搜索引擎在线
  • 微网站样式网络营销就是seo正确吗
  • 网站空间管理信息谷歌商店官网下载
  • 网站排名降级的原因有哪些宁德seo公司
  • 最新网站制作连云港seo优化公司
  • 网站设计开题报告范文百度云官方网站
  • 怎么做国外的网站 卖东西环球军事新闻最新消息
  • 易进网站建设推广app营销策略
  • 微信代运营合作方案seo短视频网页入口引流
  • 请人做个网页大概需要多少钱win优化大师怎么样
  • 买东西最便宜的网站常用的网络营销工具有哪些
  • 网站建设如何自学营销网站建设价格