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.pswp.cn/diannao/79785.shtml
繁體地址,請注明出處:http://hk.pswp.cn/diannao/79785.shtml
英文地址,請注明出處:http://en.pswp.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 接口…