代码拉取完成,页面将自动刷新
<template>
<view class="gal-padding"
style="padding:30rpx;">
<view>
<text class="gal-block-text gal-h4 gal-color-gray">文本背景动画</text>
</view>
<view class="gal-margin-top-large">
<view>
<text class="demo staticBg">静态渐变文本</text>
</view>
</view>
<view class="gal-margin-top-large">
<view>
<text class="demo animateBG">动画背景文本</text>
</view>
</view>
</view>
</template>
<script>
export default {
}
</script>
<style>
.demo{
text-align:center;
line-height:100rpx;
font-size:88rpx;
display:block;
font-weight:bold;
}
.staticBg{
background-image:linear-gradient(to bottom, #39B55A , #8DC63E);
background-clip:text;
color: transparent;
}
.animateBG{
background-image:linear-gradient(to bottom, #39B55A , #8DC63E);
background-clip:text;
color: transparent;
background-image: url("https://img1.baidu.com/it/u=3496595466,3334896335&fm=26&fmt=auto&gp=0.jpg");
background-repeat:no-repeat;
background-size:600rpx auto;
animation: animateBG 5s infinite alternate;
}
@keyframes animateBG{
0%{background-position-x:-20%;}
100%{background-position-x:115%;}
}
</style>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。