AI编写的“黑科技风格、自动刷新”的看板页面

以下的 index.html 、 script.js 和 styles.css 文件,实现一个具有黑科技风格、自动刷新的能源管理系统实时监控看板。
在这里插入图片描述
在这里插入图片描述

html页面

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>工厂能源管理系统实时监控看板</title><!-- 引入 ECharts 文件 --><script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script><link rel="stylesheet" href="styles.css"><link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700&display=swap" rel="stylesheet">
</head>
<body><header><h1>工厂能源管理系统实时监控看板</h1><div id="timeDisplay"></div></header><div class="container"><div id="powerConsumptionChart" class="chart"></div><div id="energyTypeChart" class="chart"></div><div id="energyEfficiencyChart" class="chart"></div><div id="productionLineChart" class="chart"></div><div id="equipmentChart" class="chart"></div><div id="dailyPowerChart" class="chart"></div><div id="monthlyGasChart" class="chart"></div><div id="equipmentEfficiencyChart" class="chart"></div><div id="lineComparisonChart" class="chart"></div></div><script src="script.js"></script><script>// 显示当前时间function updateTime() {const timeDisplay = document.getElementById('timeDisplay');const now = new Date();const timeString = now.toLocaleString();timeDisplay.textContent = `当前时间: ${timeString}`;}// 初始显示时间updateTime();// 每秒更新一次时间setInterval(updateTime, 1000);// 1000 毫秒自动刷新图表setInterval(() => {if (window.initCharts) {window.initCharts();}}, 1000);</script>
</body>
</html>

javascript脚本


// 模拟数据
const mockData = {powerConsumption: [{ time: '00:00', value: 120 },{ time: '01:00', value: 110 },{ time: '02:00', value: 105 },{ time: '03:00', value: 98 },{ time: '04:00', value: 90 },{ time: '05:00', value: 85 },{ time: '06:00', value: 95 },{ time: '07:00', value: 110 },{ time: '08:00', value: 130 },{ time: '09:00', value: 150 },{ time: '10:00', value: 160 },{ time: '11:00', value: 165 },{ time: '12:00', value: 160 }],energyType: [{ name: '电力', value: 700 },{ name: '天然气', value: 300 },{ name: '蒸汽', value: 200 }],energyEfficiency: [{ time: '00:00', value: 0.85 },{ time: '01:00', value: 0.86 },{ time: '02:00', value: 0.84 },{ time: '03:00', value: 0.83 },{ time: '04:00', value: 0.82 },{ time: '05:00', value: 0.81 },{ time: '06:00', value: 0.83 },{ time: '07:00', value: 0.85 },{ time: '08:00', value: 0.87 },{ time: '09:00', value: 0.89 },{ time: '10:00', value: 0.9 },{ time: '11:00', value: 0.91 },{ time: '12:00', value: 0.9 }], productionLines: [{ name: '生产线1', power: 300, gas: 150 },{ name: '生产线2', power: 250, gas: 120 },{ name: '生产线3', power: 350, gas: 180 }],equipments: [{ name: '设备A', power: 120, gas: 60 },{ name: '设备B', power: 100, gas: 50 },{ name: '设备C', power: 130, gas: 70 },{ name: '设备D', power: 100, gas: 50 }],dailyPower: [{ day: '周一', power: 1000 },{ day: '周二', power: 1100 },{ day: '周三', power: 1050 },{ day: '周四', power: 1200 },{ day: '周五', power: 1300 },{ day: '周六', power: 800 },{ day: '周日', power: 700 }],monthlyGas: [{ month: '1月', gas: 3000 },{ month: '2月', gas: 3200 },{ month: '3月', gas: 3500 },{ month: '4月', gas: 3300 },{ month: '5月', gas: 3600 },{ month: '6月', gas: 3400 },{ month: '7月', gas: 3700 },{ month: '8月', gas: 3800 },{ month: '9月', gas: 3500 },{ month: '10月', gas: 3600 },{ month: '11月', gas: 3400 },{ month: '12月', gas: 3300 }],equipmentEfficiency: [{ name: '设备A', efficiency: 0.85 },{ name: '设备B', efficiency: 0.88 },{ name: '设备C', efficiency: 0.9 },{ name: '设备D', efficiency: 0.87 }],lineComparison: [{ name: '生产线1', power: 300, gas: 150 },{ name: '生产线2', power: 250, gas: 120 },{ name: '生产线3', power: 350, gas: 180 }]
};// 初始化用电量图表
function initPowerConsumptionChart() {const chartDom = document.getElementById('powerConsumptionChart');const myChart = echarts.init(chartDom);const option = {title: {text: '电力消耗图表',textStyle: {color: '#fff'}},tooltip: {trigger: 'axis'},xAxis: {type: 'category',data: mockData.powerConsumption.map(item => item.time)},yAxis: {type: 'value'},series: [{data: mockData.powerConsumption.map(item => item.value),type: 'line'}]};myChart.setOption(option);
}// 初始化能源类型图表
function initEnergyTypeChart() {const chartDom = document.getElementById('energyTypeChart');const myChart = echarts.init(chartDom);const option = {title: {text: '能源类型图表',textStyle: {color: '#fff'}},tooltip: {trigger: 'item'},series: [{name: '能源类型',type: 'pie',radius: '50%',data: mockData.energyType,emphasis: {itemStyle: {shadowBlur: 10,shadowOffsetX: 0,shadowColor: 'rgba(0, 0, 0, 0.5)'}}}]};myChart.setOption(option);
}// 初始化能源效率图表
function initEnergyEfficiencyChart() {const chartDom = document.getElementById('energyEfficiencyChart');const myChart = echarts.init(chartDom);const option = {title: {text: '能源效率图表',textStyle: {color: '#fff'}},tooltip: {trigger: 'axis'},xAxis: {type: 'category',data: mockData.energyEfficiency.map(item => item.time)},yAxis: {type: 'value',min: 0.8,max: 0.95},series: [{data: mockData.energyEfficiency.map(item => item.value),type: 'line'}]};myChart.setOption(option);
}// 初始化生产线图表
function initProductionLineChart() {const chartDom = document.getElementById('productionLineChart');const myChart = echarts.init(chartDom);const option = {title: {text: '按生产线统计电力和气使用量',textStyle: {color: '#fff'}},tooltip: {trigger: 'axis'},xAxis: {type: 'category',data: mockData.productionLines.map(item => item.name)},yAxis: {type: 'value'},series: [{data: mockData.productionLines.map(item => item.power),type: 'bar'}]};myChart.setOption(option);
}// 初始化设备图表
function initEquipmentChart() {const chartDom = document.getElementById('equipmentChart');const myChart = echarts.init(chartDom);const option = {title: {text: '按设备统计电力和气使用量',textStyle: {color: '#fff'}},tooltip: {trigger: 'axis'},xAxis: {type: 'category',data: mockData.equipments.map(item => item.name)},yAxis: {type: 'value'},series: [{data: mockData.equipments.map(item => item.power),type: 'bar'}]};myChart.setOption(option);
}// 新增每日电力使用量图表
function initDailyPowerChart() {const chartDom = document.getElementById('dailyPowerChart');const myChart = echarts.init(chartDom);const option = {title: {text: '每日电力使用量',textStyle: {color: '#fff'}},tooltip: {trigger: 'axis'},xAxis: {type: 'category',data: mockData.dailyPower.map(item => item.day)},yAxis: {type: 'value'},series: [{data: mockData.dailyPower.map(item => item.power),type: 'bar'}]};myChart.setOption(option);
}// 新增每月气使用量图表
function initMonthlyGasChart() {const chartDom = document.getElementById('monthlyGasChart');const myChart = echarts.init(chartDom);const option = {title: {text: '每月气使用量',textStyle: {color: '#fff'}},tooltip: {trigger: 'axis'},xAxis: {type: 'category',data: mockData.monthlyGas.map(item => item.month)},yAxis: {type: 'value'},series: [{data: mockData.monthlyGas.map(item => item.gas),type: 'line'}]};myChart.setOption(option);
}// 新增设备效率图表
function initEquipmentEfficiencyChart() {const chartDom = document.getElementById('equipmentEfficiencyChart');const myChart = echarts.init(chartDom);const option = {title: {text: '设备效率',textStyle: {color: '#fff'}},tooltip: {trigger: 'item'},xAxis: {type: 'category',data: mockData.equipmentEfficiency.map(item => item.name)},yAxis: {type: 'value',min: 0.8,max: 0.95},series: [{data: mockData.equipmentEfficiency.map(item => item.efficiency),type: 'bar'}]};myChart.setOption(option);
}// 新增生产线对比图表
function initLineComparisonChart() {const chartDom = document.getElementById('lineComparisonChart');const myChart = echarts.init(chartDom);const option = {title: {text: '生产线电力和气对比',textStyle: {color: '#fff'}},tooltip: {trigger: 'axis',axisPointer: {type: 'cross',crossStyle: {color: '#999'}}},legend: {data: ['电力', '气']},xAxis: {type: 'category',data: mockData.lineComparison.map(item => item.name)},yAxis: {type: 'value'},series: [{name: '电力',type: 'bar',data: mockData.lineComparison.map(item => item.power)},{name: '气',type: 'bar',data: mockData.lineComparison.map(item => item.gas)}]};myChart.setOption(option);
}// 更新初始化所有图表的函数
function initCharts() {initPowerConsumptionChart();initEnergyTypeChart();initEnergyEfficiencyChart();initProductionLineChart();initEquipmentChart();initDailyPowerChart();initMonthlyGasChart();initEquipmentEfficiencyChart();initLineComparisonChart();
}// 页面加载完成后初始化图表
window.onload = initCharts;

css样式


/* 全局样式 */
* {box-sizing: border-box;margin: 0;padding: 0;
}body {font-family: 'Orbitron', sans-serif;background-color: #000;color: #0f0;min-height: 100vh;overflow-x: hidden;
}/* 表头样式 */
header {background-color: rgba(0, 0, 0, 0.8);padding: 20px 0;box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);border-bottom: 2px solid #0f0;display: flex;flex-direction: column;align-items: center;gap: 10px;
}header h1 {text-align: center;font-size: 2.5rem;text-shadow: 0 0 15px #0f0, 0 0 30px #0f0;letter-spacing: 3px;animation: neonGlow 1.5s ease-in-out infinite alternate;
}@keyframes neonGlow {from {text-shadow: 0 0 10px #0f0, 0 0 20px #0f0, 0 0 30px #0f0;}to {text-shadow: 0 0 20px #0f0, 0 0 40px #0f0, 0 0 60px #0f0;}
}/* 时间显示样式 */
#timeDisplay {text-align: center;font-size: 1.2rem;text-shadow: 0 0 10px #0f0;
}/* 图表容器样式 */
.container {display: grid;grid-template-columns: repeat(3, 1fr);gap: 30px;padding: 30px;
}.chart {background-color: rgba(0, 0, 0, 0.6);border-radius: 10px;border: 2px solid #0f0;box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);height: 400px;transition: all 0.3s ease;position: relative;overflow: hidden;
}.chart::before {content: '';position: absolute;top: -50%;left: -50%;width: 200%;height: 200%;background: linear-gradient(45deg, rgba(0, 255, 0, 0.1), rgba(0, 255, 0, 0.3));transform-origin: bottom right;animation: rotate 6s linear infinite;opacity: 0.3;
}.chart::after {content: '';position: absolute;inset: 4px;background: #000;border-radius: 10px;
}.chart:hover {transform: translateY(-10px);box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
}@keyframes rotate {0% {transform: rotate(0deg);}100% {transform: rotate(360deg);}
}/* 图表内容区域,确保内容显示在遮罩之上 */
.chart > * {position: relative;z-index: 10;
}

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

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

相关文章

Vim使用完全指南:从基础到高效编辑

Vim使用完全指南&#xff1a;从基础到高效编辑 一、Vim简介与基本概念 Vim&#xff08;Vi IMproved&#xff09;是从vi发展出来的一个功能强大的文本编辑器&#xff0c;以其高效性和灵活性著称&#xff0c;特别适合程序开发和系统管理任务。与常规文本编辑器不同&#xff0c;…

时序约束高级进阶使用详解三:Create_Clock

目录 一、前言 二、设计示例 2.1 设计代码 2.2 schematic 2.3 no overwriteing 2.4 约束到非时钟引脚 三、Create_clock应用 3.1 时钟输入端口 3.2 7系列高速收发器输出管脚 3.3 部分原语的输出管脚 3.4 主时钟路径上创建主时钟 3.5 虚拟时钟 3.6 差分时钟的约束 …

箱线图(盒须图)QCPStatiBox

一、QCPStatisticalBox 概述 QCPStatisticalBox 是 QCustomPlot 中用于绘制箱线图(盒须图)的类&#xff0c;可以显示数据的五个关键统计量&#xff1a;最小值、第一四分位数(Q1)、中位数、第三四分位数(Q3)和最大值&#xff0c;以及可能的异常值。 二、主要属性 属性类型描述…

人形机器人马拉松:北京何以孕育“领跑者”?

“机器人每跑一小步&#xff0c;都是人类科技的一大步”&#xff0c;这句对阿姆斯特朗登月名言的仿写&#xff0c;恰如其分地诠释了全球首场人形机器人半程马拉松赛事的里程碑意义。 2025年4月19日&#xff0c;北京亦庄半程马拉松暨人形机器人半程马拉松圆满结束。在总长21.09…

基于Python的推荐算法的电影推荐系统的设计

标题:基于Python的推荐算法的电影推荐系统的设计与实现 内容:1.摘要 本文围绕基于Python的推荐算法的电影推荐系统展开研究。背景在于随着电影数量的急剧增加&#xff0c;用户在海量电影中找到符合自身喜好的影片变得困难。目的是设计并实现一个高效准确的电影推荐系统&#x…

【深度学习】详解矩阵乘法、点积,内积,外积、哈达玛积极其应用|tensor系列02

博主简介&#xff1a;努力学习的22级计算机科学与技术本科生一枚&#x1f338;博主主页&#xff1a; Yaoyao2024往期回顾&#xff1a;【深度学习】你真的理解张量了吗&#xff1f;|标量、向量、矩阵、张量的秩|01每日一言&#x1f33c;: “脑袋想不明白的&#xff0c;就用脚想”…

面试常用基础算法

目录 快速排序归并排序堆排序 n n n皇后问题最大和子数组爬楼梯中心扩展法求最长回文子序列分割回文串动态规划求最长回文子序列最长回文子串单调栈双指针算法修改 分割回文串滑动窗口栈 快速排序 #include <iostream> #include <algorithm>using namespace std;…

相对路径和绝对路径解析

在 Linux/Unix 和文件系统中&#xff0c;绝对路径和相对路径是描述文件或目录位置的两种方式&#xff0c;它们的核心区别在于路径的起点和使用场景。以下是详细对比&#xff1a; 目录 1. 定义与起点 2. 符号与语法 3. 使用场景 4. 实际示例 示例 1&#xff1a;定位文件 示…

【算法数据结构】leetcode37 解数独

37. 解数独 - 力扣&#xff08;LeetCode&#xff09; 题目描述&#xff1a; 题目要求每一行 &#xff0c;每一列&#xff0c;每个3*3 的子框只能出现一次。每个格子的数字范围1-9. 需要遍历每个空格填入可能的数字&#xff0c;并验证符合规则。如果符合就填入&#xff0c;不符…

Vector的学习

vector简介 vector的相关文档对于想深入了解的同学可以参考这个文档进行学习。 vector是表示可变大小数组的序列容器。 就像数组一样&#xff0c;vector也采用的连续存储空间来存储元素。也就是意味着可以采用下标对vector的元素进行访问&#xff0c;和数组一样高效。但是又不…

Vue常用指令入门

1. v-for 作用&#xff1a;用于遍历对象或数组 注意&#xff1a;需要提供key属性&#xff0c;可以提高性能和避免渲染错误&#xff0c;值通常为index或item.id <li v-for"(item, index) in items" :key"index">{{ item }} </li>2. v-if,v-el…

在机器视觉检测中为何选择线阵工业相机?

线阵工业相机&#xff0c;顾名思义是成像传感器呈“线”状的。虽然也是二维图像&#xff0c;但极宽&#xff0c;几千个像素的宽度&#xff0c;而高度却只有几个像素的而已。一般在两种情况下使用这种相机&#xff1a; 1. 被测视野为细长的带状&#xff0c;多用于滚筒上检测的问…

线性DP:最长上升子序列(子序列可不连续,子数组必须连续)

目录 Q1&#xff1a;简单遍历 Q2&#xff1a;变式&#xff08;加大数据量&#xff09; Q1&#xff1a;简单遍历 Dp问题 状态表示 f(i,j) 集合所有以第i个数结尾的上升子序列集合-f(i,j)的值存的是什么序列长度最大值max- 状态计算 &#xff08;其实质是集合的划分&#xff09;…

【Web前端技术】第二节—HTML标签(上)

hello&#xff01;好久不见—— 做出一个属于自己的网站&#xff01; 云边有个稻草人-个人主页 Web前端技术—本篇文章所属专栏 目录 一、HTML 语法规范 1.1 基本语法概述 1.2 标签关系 二、HTML 基本结构标签 2.1 第一个 HTML 网页 2.2 基本结构标签总结 三、网页开发…

论文降重GPT指令-实侧有效从98%降低到8%

步骤1&#xff1a;文本接收 指令&#xff1a; 请用户提供需要优化的文本内容。 对文本进行初步分析&#xff0c;识别文本的基本结构和风格。 操作&#xff1a; 接收并分析用户提交的文本。 步骤2&#xff1a;文本优化 2.1 连接词处理 指令&#xff1a; 删除或替换连接词&#x…

Jsp技术入门指南【九】详细讲解JSTL

Jsp技术入门指南【九】详细讲解JSTL 前言一、什么是JSTL&#xff1f;&#xff08;JavaServer Pages Standard Tag Library&#xff09;二、使用JSTL前的准备三、核心标签库常用标签详解1. <c:out>&#xff1a;输出内容&#xff08;替代<% %>&#xff09;2. <c:i…

Linux操作系统--进程的创建和终止

目录 1.进程创建 1.1fork()函数初识 1.2写时拷贝 1. 提升系统效率 2. 隔离错误影响 3. 支持并行计算 2.进程终止&#xff1a; 2.1进程退出场景&#xff1a; 2.2进程常见退出方法&#xff1a; 2.3_exit()系统调用接口 2.4exit函数 2.5return退出 1.进程创建 1.1for…

OSPF综合实验——企业边界路由器、LSA收敛

IP划分粗略记号&#xff0c;方便后续配置 配置IP和环回--->ISP的IP配置和cheat认证---->配置OSPF和RIP---->企业边界路由网段汇总---->特殊区域---> 缺省路由&#xff0c;重分发---->nat配置---->实现全网通 路由器配置IP和环回地址 <Huawei>sys…

Java【网络原理】(4)HTTP协议

目录 1.前言 2.正文 2.1自定义协议 2.2HTTP协议 2.2.1抓包工具 2.2.2请求响应格式 2.2.2.1URL 2.2.2.2urlencode 2.2.3认识方法 2.2.3.1GET与POST 2.2.3.2PUT与DELETE 2.2.4请求头关键属性 3.小结 1.前言 哈喽大家好啊&#xff0c;今天来继续给大家带来Java中网络…

Android学习总结之APK打包流程

一、预处理阶段&#xff08;编译前准备&#xff09; 1. AIDL 文件处理&#xff08;进程间通信基础&#xff09; 流程&#xff1a; 用于实现 Android 系统中不同进程间的通信&#xff08;IPC&#xff09;。在项目构建时&#xff0c;AIDL 编译器会将 .aidl 文件编译为 Java 接口…