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

文字光影扫过动效

列子1

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>光影扫过文字动效</title><style>body {display: flex;justify-content: center;align-items: center;min-height: 100vh;background-color: #222;margin: 0;font-family: 'Arial', sans-serif;}.text-container {position: relative;font-size: 5rem;font-weight: bold;color: #333;text-transform: uppercase;letter-spacing: 3px;}.text {position: relative;display: inline-block;}.light-overlay {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);background-size: 200% 100%;background-position: -100% 0;-webkit-background-clip: text;background-clip: text;color: transparent;animation: lightSweep 3s infinite ease-in-out;}@keyframes lightSweep {0% {background-position: -100% 0;}50% {background-position: 100% 0;}100% {background-position: -100% 0;}}</style>
</head>
<body>
<div class="text-container"><div class="text">光影扫过效果</div><div class="light-overlay">光影扫过效果</div>
</div>
</body>
</html>

例子2

<template><div class="wrapperStyle" :style="wrapperStyle" style="text-align:left;"><!-- <div>{{ item.textName }}</div> --><div class="text-container"><div class="text">{{ item.textName }}</div><div class="light-overlay">{{ item.textName }}</div></div></div>
</template><script setup>
const props = defineProps({item: {type: Object,default: {},},editOrPreview: {type: String,default: "edit",}
});
const { proxy } = getCurrentInstance();
const wrapperStyle = computed(() => {return proxy.componentStyle(props.item, props.editOrPreview);
});const radiantTextStyle       = computed(() => {return {radiantBackgroundColor:props.item.radiantBackgroundColor || 'transparent',}
});
</script><style lang="scss" scoped>
@import "@/views/lowCode/myMoveable/styles/custom-low-code.scss";.text-container {--radiant-background-color: v-bind(radiantTextStyle.radiantBackgroundColor);position: relative;// font-size: 5rem;// font-weight: bold;// color: #fff;// text-transform: uppercase;// letter-spacing: 3px;
}.text {position: relative;display: inline-block;
}.light-overlay {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: linear-gradient(90deg, transparent, var(--radiant-background-color), transparent);background-size: 200% 100%;background-position: -100% 0;-webkit-background-clip: text;background-clip: text;color: transparent;animation: lightSweep 3s infinite ease-in-out;
}@keyframes lightSweep {0% {background-position: -100% 0;}50% {background-position: 100% 0;}100% {background-position: -100% 0;}
}
</style>

相关文章:

  • GAEA情感坐标的技术架构与系统集成
  • KAG:通过知识增强生成提升专业领域的大型语言模型(二)
  • LIMS试验检测管理系统概要设计说明书,LIMS实验室系统建设方案
  • Go语言入门:目录与链接
  • make学习三:书写规则
  • 【质量管理】TRIZ(萃智)的工程系统进化法则
  • 交叉编译tcpdump静态编译单个文件
  • DHCP 服务器运行流程图
  • NHANES指标推荐:BUCR
  • uniapp-商城-40-shop 购物车 选好了 进行订单确认4 配送方式3 地址编辑
  • Spring_MVC 中的 JSON 数据处理与 REST 风格开发
  • 图论---最大流(Dinic)
  • Lua 第11部分 小插曲:出现频率最高的单词
  • 《MySQL 技术内幕-innoDB 存储引擎》笔记
  • 顶会招牌idea:机器学习+组合优化 优秀论文合集
  • 博物馆除湿控湿保卫战:M-5J1R 电解除湿科技如何重塑文物守护的未来
  • 服务器数据备份,服务器怎么备份数据呢?
  • 现代多核调度器的本质 调度三重奏
  • 设计模式--桥接模式详解
  • 1.1 道路结构特征
  • 汽车爆炸致俄军中将死亡嫌疑人被羁押,作案全过程披露
  • 这场迪图瓦纪念拉威尔的音乐会,必将成为乐迷反复品味的回忆
  • 上海质子重离子医院已收治8000例患者,基本覆盖国内常见恶性肿瘤
  • 专访|伊朗学者:美伊核谈不只是改革派立场,但伊朗不信任美国
  • 识味顺德︱顺德菜的醉系列与火滋味
  • 敲定!今年将制定金融法、金融稳定法