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

网站建设重庆最加科技网络媒体广告代理

网站建设重庆最加科技,网络媒体广告代理,什么网站做谷歌联盟好,行业排名查询网站AI不会取代人类,被取代的是不会使用AI 的人 0%~100% 是动画运动的时长,通过约定多1/4的时间Y轴的位置,来控制动画的停留。 /* 通过间隔做 暂停 */ keyframes ad_move {0% {transform: translateY(0px);}25%{transform: translateY(0px);}50%…

AI不会取代人类,被取代的是不会使用AI 的人

0%~100% 是动画运动的时长,通过约定多1/4的时间Y轴的位置,来控制动画的停留。

/* 通过间隔做 暂停 */
@keyframes ad_move {0% {transform: translateY(0px);}25%{transform: translateY(0px);}50%{transform: translateY(calc(var(--y)/2));}75%{transform: translateY(calc(var(--y)/2));}100% {transform: translateY(var(--y));}
}

好消息是,写完啦。
坏消息是👇
请添加图片描述
那translate 总支持吧。
于是,我迅速安装了animejs,并自信的写了两种方式

animeRef.current = anime({targets: el,// translateY: [0, -2 * height],translateY: [{ value: 0, duration: 1000, delay: 750, easing: 'linear' },{ value: -height, duration: 1000, delay: 1750, easing: 'linear' },{ value: -2 * height, duration: 1000, delay: 2750, easing: 'linear' },],// keyframes: [//   { translateY: 0 },//   { translateY: 0 },//   { translateY: -height },//   { translateY: -height },//   { translateY: -2 * height }// ],duration: 8000,loop: true,easing: 'linear'})

😭,结果被告知

Native 的组件(如 View、Text)并非 DOM 元素,且其样式系统与 Web 的 CSS 有本质差异。
Anime.js 是一个基于浏览器 DOM 和 CSS 的 Web 动画库

好吧,从控制台看,我看着是div呀。
😭,只得老老实实的使用 react-native-reanimated,在短时间内实现我的需求,是有点费事儿的。

最近流行一句:不会被取代的人是,会使用AI的人。

于是,deepseek 两秒帮我写完了。

import { View, Text } from 'components/ui';
import React from 'react';
import { useEffect, useMemo } from 'react';
import { useWindowDimensions, ViewProps } from 'react-native';
import Animated, {useSharedValue,withTiming,withDelay,withSequence,Easing,withRepeat
} from 'react-native-reanimated';const height = 64const MyView = React.forwardRef((props: ViewProps, ref: React.LegacyRef<View>) => {const { width } = useWindowDimensions();const height = 64return (<View ref={ref} {...props}><View style={{ height: `${height}px` }} className='bg-pink-600 w-full'><Text>山上有樱名为良,树本无形只待春</Text></View><View style={{ height: `${height}px` }} className='bg-pink-200'><Text>山上有樱名为良,树本无形只待春</Text></View><View style={{ height: `${height}px` }} className='bg-pink-600'><Text>山上有樱名为良,树本无形只待春</Text></View><View style={{ height: `${height}px` }} className='bg-pink-200'><Text>山上有樱名为良,树本无形只待春</Text></View></View>);}
);const AnimatedView = Animated.createAnimatedComponent(MyView);export function Test2() {const { width } = useWindowDimensions();const sharedValue = useSharedValue(0);useEffect(() => {if (!height) return;// 定义动画的总距离const totalDistance = -2 * height;// 定义每 1/2 的距离const halfDistance = totalDistance / 2;// 使用 withSequence 实现分段动画const animation = withSequence(// 暂停 2 秒withDelay(2000, withTiming(0, { duration: 0 })), // 保持当前位置// 第一段动画:运动 1/2withTiming(halfDistance, {duration: 2000, // 4 秒完成 1/2 的距离easing: Easing.linear,}),// 暂停 2 秒withDelay(2000, withTiming(halfDistance, { duration: 0 })), // 保持当前位置// 第二段动画:运动剩余的 1/2withTiming(totalDistance, {duration: 2000, // 4 秒完成剩余的 1/2 的距离easing: Easing.linear,}));// 使用 withRepeat 实现循环sharedValue.value = withRepeat(animation, -1, false);}, [height, sharedValue]);return (<View className='w-full'><View style={{ height: `${height}px`, overflow: 'hidden' }} className='w-full'><AnimatedView style={{ transform: [{ translateY: sharedValue }] }} /></View></View>);
}
http://www.dtcms.com/wzjs/408158.html

相关文章:

  • 如何免费制作网站公司网站设计模板
  • 广东建设银行网站首页查询网站
  • 和韩国做贸易的网站无锡网络推广外包
  • 台州手机网站建设网络推广公司如何做
  • 网站推广免费渠道鞍山做网站的公司
  • 抓取网站urlseo关键词排名优化怎样
  • 提供郑州网站建设员工培训内容
  • 导购网站如何做淘宝客曼联目前积分榜
  • 建设网站成本html模板网站
  • 那个网站的公众后推广做的好常州免费网站建站模板
  • wordpress主题特色功能推荐一个seo优化软件
  • 公司要做网站去哪里百度公司地址
  • 莱芜网站seo电商推广联盟
  • 做网站模板平台搜索图片
  • 有了主机如何做网站百度合伙人官网app
  • javaweb建设网站网络营销运营方案
  • 中央政府门户网站新闻发稿公司
  • dreamweaver 打开网站搜索引擎排名原理
  • 网站的链接结构怎么做百度推广登录官网入口
  • 网站建设在哪里推广关键字搜索引擎
  • 模板网站的弊端如何做网页设计
  • 做排名出租网站培训心得体会300字
  • 免费制作网页网站河南网站建设制作
  • 公司网站建设及维护万能推广app
  • 导购网站怎么做有特色seo引擎优化
  • 网站建设流程和费用google浏览器官网下载
  • 国际网站哪里做百度指数移动版
  • 同城做鸡网站搜索引擎优化的作用
  • 关于做网站电话销售seo 排名 优化
  • 网页生成pdf保存到哪里了青岛seo关键词优化公司