vue数字翻牌效果

news/2024/9/20 10:14:27

// 翻牌器组件 countFlop.vue

<template>
<div class="count-flop" :key="compKey">
<div :class="item!='.'?'count-flop-box':'count-flop-point'" v-for="(item, index) in value" :key="index">
<div v-if="item!='.'" class="count-flop-content" :class="['rolling_' + item]">
<div v-for="(item2,index2) in numberList" :key="index2" class="count-flop-num">{{item2}}</div>
</div>
<div v-else class="count-flop-content">.</div>
</div>
<div v-if="suffix" class="count-flop-box">{{suffix}}</div>
</div>
</template>
<script>
export default {
data() {
return {
value: [],
numberList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
compKey: 0
};
},
props: ["val","suffix"],
watch: {
val() {
this.value = this.val.toString().split("");
this.compKey += 1;
}
},
created() {
this.value = this.val.toString().split("");
},
};
</script>
<style scoped>
@font-face {
font-family: "UnidreamLED";
src: url("../../static/fonts/UnidreamLED.ttf") format("truetype");
}
.count-flop {
display: inline-block;
font-size: 0;
height: 80px;
line-height: 80px;
font-size: 36px;
color: #4898f1;
font-size: 0;
}
.count-flop > div {
position: relative;
display: inline-block;
overflow: hidden;
height: 100%;
}
.count-flop-box {
margin-right: 7px;
width: 40px;
line-height: 80px;
color: #60EAFF;
position: relative;
font-size: 36px;
}
.count-flop-box:last-child {
margin: 0;
}
.count-flop-box::after, .count-flop-box::before {
display: inline-block;
content: "";
width: 40px;
height: 38px;
background: rgba(56,160,214,0.5);
position: absolute;
left: 0;
}
.count-flop-box::after {
top: 0;
}
.count-flop-box::before {
bottom: 0;
}
.count-flop-point {
margin-right: 5px;
width: 10px;
}
.count-flop-content {
font-family: "UnidreamLED", "Helvetica Neue", Helvetica, Arial, sans-serif;
text-align: center;
position: absolute;
left: 0;
top: 0;
width: 100%;
animation-fill-mode: forwards !important;
font-size: 46px;
}
.rolling_0 {
animation: rolling_0 2.1s ease;
}
@keyframes rolling_0 {
from {
transform: translateY(-90%);
}
to {
transform: translateY(0);
}
}
.rolling_1 {
animation: rolling_1 3s ease;
}
@keyframes rolling_1 {
from {
transform: translateY(0);
}
to {
transform: translateY(-10%);
}
}
.rolling_2 {
animation: rolling_2 2.1s ease;
}
@keyframes rolling_2 {
from {
transform: translateY(0);
}
to {
transform: translateY(-20%);
}
}
.rolling_3 {
animation: rolling_3 3s ease;
}
@keyframes rolling_3 {
from {
transform: translateY(0);
}
to {
transform: translateY(-30%);
}
}
.rolling_4 {
animation: rolling_4 2.1s ease;
}
@keyframes rolling_4 {
from {
transform: translateY(0);
}
to {
transform: translateY(-40%);
}
}
.rolling_5 {
animation: rolling_5 3s ease;
}
@keyframes rolling_5 {
from {
transform: translateY(0);
}
to {
transform: translateY(-50%);
}
}
.rolling_6 {
animation: rolling_6 2.1s ease;
}
@keyframes rolling_6 {
from {
transform: translateY(0);
}
to {
transform: translateY(-60%);
}
}
.rolling_7 {
animation: rolling_7 3.1s ease;
}
@keyframes rolling_7 {
from {
transform: translateY(0);
}
to {
transform: translateY(-70%);
}
}
.rolling_8 {
animation: rolling_8 2.1s ease;
}
@keyframes rolling_8 {
from {
transform: translateY(0);
}
to {
transform: translateY(-80%);
}
}
.rolling_9 {
animation: rolling_9 3.6s ease;
}
@keyframes rolling_9 {
from {
transform: translateY(0);
}
to {
transform: translateY(-90%);
}
}
</style>

引用:

<countFlop :val="total" suffix="户"/>

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ryyt.cn/news/62436.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

Amazon Bedrock 模型微调实践(二):数据准备篇

本博客内容翻译自作者于 2024 年 9 月在亚马逊云科技开发者社区发表的同名博客: “Mastering Amazon Bedrock Custom Models Fine-tuning (Part 2): Data Preparation for Fine-tuning”亚马逊云科技开发者社区为开发者们提供全球的开发技术资源。这里有技术文档、开发案例、技…

Spark(一)概述

基本概念Spark是一种基于内存的快速、通用、可扩展的大数据分析计算引擎Spark vs HadoopSpark和Hadoop的根本差异是多个作业之间的数据通信问题:Spark多个作业之间数据通信是基于内存,而Hadoop是基于磁盘Hadoop Spark类型 分布式基础平台, 包含计算, 存储, 调度 分布式计算工…

基于语义增强的少样本检测,突破新类别偏见 | ICIP24

Few-shot目标检测(FSOD)旨在在有限标注实例的情况下检测新颖对象,在近年取得了显著进展。然而,现有方法仍然存在偏见表示问题,特别是在极低标注情况下的新颖类别。在微调过程中,一种新颖类别可能会利用来自相似基础类别的知识来构建自己的特征分布,导致分类混淆和性能下…

如何解决Warning: include(): Failed opening file_path for inclusion问题

解决方法检查文件路径确认文件路径是否正确无误,包括路径中的每个目录和文件名。验证文件是否存在使用file_exists()函数检查文件是否真的存在于指定路径上。检查文件权限确认文件具有足够的权限供当前用户读取。可以使用chmod命令修改文件权限:bashchmod 644 file_path确认文…

如何解决Unknown column column_name in field list问题

当遇到 "Unknown column column_name in field list" 这类错误时,通常表明 SQL 查询中引用了一个不存在的列。这类错误通常会给出具体的列名和出错的位置。下面是一些详细的解决步骤: 解决方法:检查 SQL 查询:确认 SQL 查询中引用的列名是否正确。检查拼写错误或…

最小圆覆盖(html)

最小圆覆盖问题是什么呢?就是指在二维平面上有一堆点,然后我们要求一个最小半径的圆能够将所有点全部都包住,这就是最小圆覆盖问题。 最小覆盖圆的性质 性质1:最小覆盖圆是唯一的 证明:我们假设有两个圆O1,O2,他们半径都是r,都是最小覆盖圆,那么所有的点一定在两圆的…

如何解决You have an error in your SQL syntax

当遇到 "You have an error in your SQL syntax" 这类错误时,通常表明 SQL 语句存在语法错误。这类错误通常会给出具体的错误位置和可能的原因。下面是一些详细的解决步骤: 解决方法:查看错误提示:错误提示通常会显示具体的 SQL 语句和出错的位置。例如: You ha…

网络安全C10-2024.9.15-Nmap、Xray、Nessus和AWVS使用扫描

1、安装并使用Nmap扫描一个地址(本机、VPS、虚拟机环境都可以),提供扫描结果截图nmap下载安装: https://nmap.org/download#windowsnmap概述: Nmap(“Network Mapper<网络映射器>”)是一款开放源代码的网络探测和安全审核的工具。 Nmap输出的是扫描目标的列表,以…