好玩的水表电表

news2024/10/1 17:39:27

c34cededdfd6495b9edecf6901cd50a2.gif

<!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>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            background-color: #0a1f19;
            color: #ffffff;
            text-shadow: 1px 1px 1px #000000;
            text-align: center;
        }
        .meter-row,
        .date-row {
            width: 100%;
            margin: 20px auto;
            min-width: 420px;
            max-width: 600px;
            border-radius: 30px 30px 0 0px;
            padding: 12px;
            border-radius: 30px;
            box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2),
                0 0 1px 2px black,
                inset 0 2px 2px -2px white,
                inset 0 0 2px 9px #47434c,
                inset 0 0 2px 10px #ff0000;
        }
        .meter-row {
            display: flex;
        }
        .date-column {
            display: flex;
            align-items: center;
            justify-content: space-evenly;
            background-color: #144756;
            margin: 0 10px;
        }
        /*日期标题 */
        .date {
            transform: scale(1);
            margin: -180px 10px 0px -95px;
        }
        .year {
            position: relative;
            top: 35px;
            left: 6px;
            padding: 15px 16px 25px 12px;
            border-radius: 10px 10px 0 0;
            color: rgb(234, 255, 0);
            background-color: #ff0000;
        }
        h1 {
            position: absolute;
            border: 5px solid #333;
            width: 135px;
            line-height: 115px;
            font-size: 60px;
            letter-spacing: -3px;
            -webkit-text-fill-color: transparent;
            border-radius: 20px 10px 10px 10px;
            box-shadow: inset 4px 4px 4px rgba(255, 255, 255, 0.6), inset -4px -4px 5px rgba(0, 0, 0, 0.6);
        }
        .month1 {
            clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
            text-shadow: 1px 1px 1px #d1ec04;
            -webkit-text-stroke: #fffbfb 1px;
        }
        .month2 {
            clip-path: polygon(0% 50%, 100% 50%, 100% 100%, 0% 100%);
            transform: translateY(1px);
            z-index: 20;
            text-shadow: 1px 1px 1px #ff0303;
            -webkit-text-stroke: #ffffff 1px;
        }
        /*日期标题 结束*/
        .common-span {
            color: #ffff00;
            position: relative;
            border-radius: 3px;
            font-size: 30px;
            padding: 0 5px;
            font-weight: bold;
            box-shadow: inset -2px -2px 3px rgba(255, 255, 255, 0.589), inset 2px 2px 3px rgba(0, 0, 0, 0.6);
        }
        .common-span::before {
            content: "";
            background: linear-gradient(white, transparent 3%) 50% 50%/97% 97%,
                linear-gradient(rgba(255, 255, 255, 0.5), transparent 50%, transparent 80%, rgba(255, 255, 255, 0.5)) 50% 50%/97% 97%;
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            border-radius: 5px;
            transform: scale(0.9);
        }
        .common-h2 {
            background-color: #28a7462e;
            color: white;
            border-radius: 0 0 2px 2px;
        }
        /* 水表 */
        .water-meter {
            width: 90px;
            height: 90px;
            margin: 0 10px;
            border-radius: 75px;
            background: #e0f7fa;
            border: 5px solid #0288d1;
            position: relative;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
        }
        .water-meter h2 {
            color: white;
            background: linear-gradient(to top, #0091ea, #00bcd4);
            border-radius: 0 0 75px 75px;
        }
        .water-meter p {
            animation: backgroundChange2 10s infinite;
            margin: 4px;
            font-size: 25px;
            font-weight: bold;
            padding: 0 7px 3px 5px;
        }
        /* 电表 */
        .electric-meter {
            border: 5px solid #333;
            border-radius: 10px;
            background: #fff;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
        }
        .electric-meter h2 {
            background-color: #28a745;
            color: white;
            border-radius: 0 0 2px 2px;
        }
        .electric-meter p {
            margin: 4px;
            font-size: 25px;
            font-weight: bold;
            padding: 0 7px 3px 5px;
        }
        .water-meter p {
            animation: backgroundChange2 10s infinite;
        }
        .electric-meter p {
            animation: backgroundChange 10s infinite;
        }
        @keyframes backgroundChange2 {
            0%,
            10%,
            20%,
            30%,
            40%,
            50%,
            60%,
            70%,
            80%,
            90%,
            100% {
                box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0 1px 2px black,
                    inset 0 2px 2px -2px white, inset 0 0 2px 7px #47434c,
                    inset 0 0 2px 22px #ff0000;
                color: #cfd601;
                border-radius: 33px 33px 0 0;
            }
            5%,
            15%,
            25%,
            35%,
            45%,
            55%,
            65%,
            75%,
            85%,
            95% {
                box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0 1px 2px black,
                    inset 0 2px 2px -2px white, inset 0 0 2px 7px #47434c,
                    inset 0 0 2px 22px #f6ff00;
                color: #ffffff;
                border-radius: 30px 30px 0 0;
            }
        }
        @keyframes backgroundChange {
            0%,
            10%,
            20%,
            30%,
            40%,
            50%,
            60%,
            70%,
            80%,
            90%,
            100% {
                box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0 1px 2px black,
                    inset 0 2px 2px -2px white, inset 0 0 2px 7px #47434c,
                    inset 0 0 2px 22px #ff0000;
                color: #cfd601;
                border-radius: 2px;
            }
            5%,
            15%,
            25%,
            35%,
            45%,
            55%,
            65%,
            75%,
            85%,
            95% {
                box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.2), 0 0 1px 2px black,
                    inset 0 2px 2px -2px white, inset 0 0 2px 7px #47434c,
                    inset 0 0 2px 22px #f6ff00;
                color: #ffffff;
                border-radius: 5px;
            }
        }
        .remarks,
        .total-cost {
            background-color: #28a745;
            border-radius: 30px 30px 0 0;
            margin: 10px 10px 0 10px;
            padding-left: 50px;
        }
        .total-cost sub {
            background-color: #285ba79d;
            border-radius: 3px;
        }
        /* 备注 */
        .remarks {
            border-radius: 0 0 30px 30px;
        }
        .remarks b {
            color: #ffff00;
        }
        /* 备注 结束 */
        /* 下面的电表 */
        .meter {
            width: 300px;
            height: 150px;
            border: 5px solid #333;
            border-radius: 10px;
            background: linear-gradient(to bottom, #fff, #e6e6e6);
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
            position: relative;
            text-align: center;
            font-family: 'Arial', sans-serif;
        }
        .meter .dial {
            width: 80%;
            height: 80%;
            border: 3px solid #333;
            border-radius: 50%;
            position: absolute;
            top: 10%;
            left: 10%;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .needle {
            width: 2px;
            height: 40%;
            background: red;
            position: absolute;
            bottom: 50%;
            transform-origin: bottom;
            transition: transform 0.5s ease-out;
        }
        .reading {
            font-size: 24px;
            margin-top: 20px;
        }
        .button {
            padding: 10px 20px;
            margin-top: 20px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .button:hover {
            background-color: #218838;
        }
        .water-meter2 {
            width: 150px;
            height: 150px;
            border-radius: 75px;
            background: #e0f7fa;
            border: 10px solid #0288d1;
            position: relative;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
        }
        .water-level {
            position: absolute;
            bottom: -10px;
            left: 0%;
            width: 100%;
            background: linear-gradient(to top, #0091ea, #079aad);
            border-radius: 0 0 75px 75px;
            transition: height 0.3s ease;
            height: 0;
            animation: wave 1s infinite ease-in-out;
        }
        @keyframes wave {
            0% {
                background-position: 0% 0%;
            }
            100% {
                background-position: 100% 20%;
            }
        }
        .indicator {
            position: absolute;
            width: 10px;
            height: 10px;
            background: red;
            border-radius: 50%;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 10;
        }
        /* 添加波浪效果背景 */
        .water-level {
            position: absolute;
            bottom: -10px;
            left: 0%;
            width: 100%;
            background: linear-gradient(to top, #00bcd4, #00695c);
            /* 修改了颜色 */
            border-radius: 0 0 75px 75px;
            transition: height 0.3s ease;
            height: 0;
            animation: wave 1s infinite ease-in-out;
            background-size: 20% 20%;
            /* 背景大小用于波动效果 */
        }
    </style>
</head>
<body>
    <div class="date-row">
        <div class="total-cost">
            <sub>总房租0元</sub>
            <sub>总水费 0元</sub>
            <sub>总电费0元</sub>
            <sub>总合计 0元</sub>
        </div>
        <div class="date-column">
            <div class="date">
                <div class="year-month">
                    <sub class="year">2024年</sub>
                    <h1 class="month1">10月</h1>
                </div>
                <h1 class="month2">10月</h1>
            </div>
            <div class="water-meter">
                <p>71</p>
                <h2>水表</h2>
            </div>
            <div class="electric-meter">
                <p class="common-span">2600</p>
                <h2>电表</h2>
            </div>
        </div>
        <div class="remarks"><b>备注:</b><span>哔哩吧啦哔哩吧啦</span></div>
    </div>
    <div class="meter-row">
        <div class="meter">
            <div class="dial">
                <div class="needle" id="needle"></div>
            </div>
            <div class="reading" id="reading">0 kWh</div>
        </div>
        <div class="meter">
            <div class="reading" id="meterReading">0 kWh</div>
            <button class="button" onclick="increaseReading()">增加用电量</button>
        </div>
        <div class="water-meter2">
            <div class="water-level" style="height: 60%; animation: wave 1s infinite ease-in-out;"><span></span></div>
            <div class="indicator"></div>
        </div>
    </div>
</body>
<script>
    const needle = document.getElementById('needle');
    const reading = document.getElementById('reading');
    // 随机生成电表读数
    function updateMeter() {
        const value = Math.floor(Math.random() * 100); // 0-99 kWh
        const angle = (value / 100) * 180; // 转换为角度 (0-180度)
        needle.style.transform = `rotate(${-90 + angle}deg)`; // 调整方向
        reading.innerText = `${value} kWh`; // 更新读数
    }
    // 每隔2秒更新一次读数
    setInterval(updateMeter, 2000);
    let currentReading = 0;
    function increaseReading() {
        currentReading += Math.floor(Math.random() * 10) + 1; // 随机增加1到10之间的用电量
        document.getElementById('meterReading').innerText = currentReading + ' kWh';
    }
</script>
</html>

 

 

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

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

相关文章

视频——教学篇——12——定一个涨粉小目标,如何从0-10万粉?

文章目录 1、粉丝即正义。什么是粉丝价值&#xff1f;粉丝价值粉丝活跃度商业价值 2、找到账号目标和定位3、涨粉的基础是更新频率4、优质少更与良品多更的策略5、有播放却不涨粉&#xff1f;如何提高播放转粉率&#xff1f; 1、粉丝即正义。什么是粉丝价值&#xff1f; 在了解…

CTMO时代下的营销新力量:2+1链动模式AI智能名片商城小程序

在当今这个瞬息万变的商业世界里&#xff0c;营销领域正经历着一场深刻的变革。传统的CMO岗位似乎在时代的浪潮中逐渐失去了它的光芒&#xff0c;CTMO正在悄然取代传统CMO的岗位。 随着营销丛林现象的出现&#xff0c;企业面临着前所未有的挑战。许多企业发现&#xff0c;那些传…

【RockyLinux 9.4】CentOS也可以用。安装教程(使用U盘,避免踩坑简略版本)

一、制作一个镜像安装盘 1.下载镜像&#xff08;本教程使用9.4版本&#xff09; 官网&#xff1a; https://rockylinux.org/zh-CN 2.使用 UltraISO&#xff0c;制作写入硬盘镜像 二、调整相关参数&#xff0c;准备进入安装流程 1.关闭 Secure Boot&#xff08;BIOS 里面关…

【C++篇】揭开 C++ STL list 容器的神秘面纱:从底层设计到高效应用的全景解析(附源码)

文章目录 从零实现 list 容器&#xff1a;细粒度剖析与代码实现前言1. list 的核心数据结构1.1节点结构分析&#xff1a; 2. 迭代器设计与实现2.1 为什么 list 需要迭代器&#xff1f;2.2 实现一个简单的迭代器2.2.1 迭代器代码实现&#xff1a;2.2.2 解释&#xff1a; 2.3 测试…

【C++打怪之路Lv5】-- 类和对象(下)

&#x1f308; 个人主页&#xff1a;白子寰 &#x1f525; 分类专栏&#xff1a;C打怪之路&#xff0c;python从入门到精通&#xff0c;数据结构&#xff0c;C语言&#xff0c;C语言题集&#x1f448; 希望得到您的订阅和支持~ &#x1f4a1; 坚持创作博文(平均质量分82)&#…

基于MTK7981平台,学习了解理解SoC上电和boot流程

当SoC芯片流片回来后&#xff0c;并不是直接通电就可以使用的。需要进行上电复位&#xff0c;然后对SoC进行配置使其进入到正常工作状态&#xff0c;然后才能运行正常的程序和任务。这是一个比较复杂的过程&#xff0c;也是在芯片设计阶段&#xff0c;SoC需要重点考虑的问题。上…

机器人的性能指标

1. 负荷能力 负荷能力负荷能力是指机器人在满足其他性能要求的情况下,能够承载的负荷重量。例如,一台机器人的最大负荷能力可能远大于它的额定负荷能力,但是达到最大负荷时,机器人的工作精度可能会降低,可能无法准确地沿着预定的轨迹运动,或者产生额外的偏差。机器人的负荷量与…

如何确定光纤用几芯 用光纤与网线区别在哪里

光纤用几芯&#xff1f; 光纤芯数&#xff0c;主要和光纤连接的设备接口和设备的通信方式有关。一般来说&#xff0c;光纤中光芯的数量&#xff0c;为设备接口总数乘以2后&#xff0c;再加上10%&#xff5e;20&#xff05;的备用数量&#xff0c;而如果设备的通信方式有设备多…

Linux数据备份

1、Linux服务器中哪些数据需要备份 1&#xff09;Linux系统重要数据&#xff1a; ①/root/目录&#xff0c;管理员家目录 ②/home/目录&#xff0c;普通用户家目录 ③/etc/目录 &#xff0c;系统重要的配置文件保存目录 2&#xff09;安装服务的数据&#xff1a;例apache①…

新160个crackme -070-CodeFantasy-crackme

运行分析 需破解用户名和注册码点击注册无反应 PE分析 Delphi程序&#xff0c;32位&#xff0c;无壳 静态分析&动态调试 ida找到关键字符串&#xff0c;进入函数 动态调试关键函数&#xff0c;逻辑&#xff1a;对Names进行sub_408A68函数加密得到v14&#xff0c;若v14与Ser…

<<迷雾>> 第5章 从逻辑学到逻辑电路(4)--或门及其符号 示例电路

info::操作说明 鼠标单击开关切换开合状态 系统中使用一个类似箭头的形状表示或门 primary::在线交互操作链接 https://cc.xiaogd.net/?startCircuitLinkhttps://book.xiaogd.net/cyjsjdmw-examples/assets/circuit/cyjsjdmw-ch05-13-or-gate.txt 原图

使用TiDB企业版Lightning导入ORC文件到TiDB

作者&#xff1a; 数据源的TiDB学习之路 原文来源&#xff1a; https://tidb.net/blog/818f84f0 TiDB Lightning 是用于从静态文件导入 TB 级数据到 TiDB 集群的工具&#xff0c;常用于 TiDB 集群的初始化数据导入。在开源社区版本中&#xff0c;TiDB Lightning 支持以下文件…

疾风大模型气象,基于大模型预测未来天气的探索

引言 天气预测一直是科学领域的重要课题&#xff0c;影响着农业、航空、交通等多个行业。传统的天气预报依赖于数值天气预报&#xff08;Numerical Weather Prediction, NWP&#xff09;模型&#xff0c;这些模型基于物理定律和历史数据来模拟大气运动。然而&#xff0c;随着数…

LUCEDA IPKISS Tutorial 74:布尔运算去掉部分图层

案例分享&#xff1a;通过布尔运算&#xff0c;将版图部分图层挖空 所有代码如下&#xff1a; from si_fab import all as pdk from ipkiss3 import all as i3 import numpy as npclass grating_coupler(i3.PCell):_name_prefix "grating_coupler"r i3.Positive…

Spring Task 2024/9/30

Spring Task是Spring框架提供的任务调度工具&#xff0c;可以按照约定时间自动执行某个代码逻辑。 作用&#xff1a;定时自动执行某段java代码。 cron表达式 在线Cron表达式生成器 (qqe2.com)&#x1f448;在线生成网站 入门案例 SkyApplication 启动类 package com.sky;im…

对于 Vue CLI 项目如何引入Echarts以及动态获取数据

&#x1f680;个人主页&#xff1a;一颗小谷粒 &#x1f680;所属专栏&#xff1a;Web前端开发 很荣幸您能阅读我的文章&#xff0c;诚请评论指点&#xff0c;欢迎欢迎 ~ 目录 1、数据画卷—Echarts介绍 1.1 什么是Echarts&#xff1f; 1.2 Echarts官网地址 2、Vue CLI 项目…

【LeetCode】每日一题 2024_10_1 最低票价(记忆化搜索/DP)

前言 每天和你一起刷 LeetCode 每日一题~ 大家国庆节快乐呀~ LeetCode 启动&#xff01; 题目&#xff1a;最低票价 代码与解题思路 今天这道题是经典动态规划&#xff0c;我们定义 dfs(i) 表示从第 1 天到 第 i 天的最小花费&#xff0c;然后使用祖传的&#xff1a;从记忆…

ArduSub程序学习(11)--EKF实现逻辑⑤

状态更新和卡尔曼增益的计算我选择一个进行举例 1.SelectMagFusion SelectMagFusion 函数主要负责选择和处理磁力计&#xff08;磁传感器&#xff09;数据的融合过程。这在导航系统中尤为重要&#xff0c;因为磁力计用于提供航向&#xff08;偏航角&#xff09;的信息&#xf…

Hopcroft算法划分解释

//基于等价类的思想 split(S){foreach(character c)if(c can split s)split s into T1, ..., Tk }hopcroft()split all nodes into N, Awhile(set is still changes)split(s) 根据状态是否为终结状态划分为终结状态A&#xff0c;和非终结状态N 对这两个大集合&#xff0c;分别…

Acwing 组合计数

一个递推式&#xff1a; 从 a 个元素中选择 b 个&#xff0c;有多少种取法 C a b a ( a − 1 ) ⋯ ( a − b 1 ) 1 2 3 ⋯ b a ! b ! ( a − b ) ! C a − 1 b C a − 1 b − 1 从a个元素中选择b个&#xff0c;有多少种取法C_{a}^{b} \frac{a\times(a-1)\times\…