pc端小卡片功能-原生JavaScript金融信息与节日日历

article/2025/8/12 20:57:36

代码如下

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>金融信息与节日日历</title><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"><style>* {margin: 0;padding: 0;box-sizing: border-box;font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;}body {background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);color: #333;line-height: 1.6;padding: 20px;min-height: 100vh;}.container {max-width: 1200px;margin: 0 auto;}header {display: flex;justify-content: space-between;align-items: center;margin-bottom: 25px;flex-wrap: wrap;gap: 15px;}.logo {display: flex;align-items: center;gap: 12px;}.logo h1 {font-size: 1.8rem;font-weight: 600;color: #2c3e50;}.logo i {font-size: 2.2rem;color: #3498db;}.date-display {background: #fff;padding: 10px 20px;border-radius: 12px;box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);font-size: 1.1rem;font-weight: 500;color: #2c3e50;}.dashboard {display: grid;grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));gap: 25px;margin-bottom: 30px;}.card {background: #fff;border-radius: 16px;box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);padding: 25px;transition: transform 0.3s ease, box-shadow 0.3s ease;}.card:hover {transform: translateY(-5px);box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);}.card-header {display: flex;justify-content: space-between;align-items: center;margin-bottom: 20px;padding-bottom: 15px;border-bottom: 1px solid #eee;}.card-title {font-size: 1.3rem;font-weight: 600;color: #2c3e50;}.card-link {color: #3498db;text-decoration: none;font-size: 0.9rem;font-weight: 500;}.card-link:hover {text-decoration: underline;}/* Weather Card */.weather-card {background: linear-gradient(135deg, #3498db 0%, #1a5f9e 100%);color: white;}.weather-card .card-title,.weather-card .card-link {color: rgba(255, 255, 255, 0.9);}.weather-content {display: flex;justify-content: space-between;align-items: center;}.weather-info h2 {font-size: 2.2rem;margin-bottom: 5px;}.weather-info p {margin-bottom: 8px;opacity: 0.9;}.weather-icon {font-size: 4.5rem;opacity: 0.9;}.rain-alert {background: rgba(255, 255, 255, 0.15);padding: 10px 15px;border-radius: 10px;margin-top: 15px;font-size: 0.95rem;}/* Market Card */.market-table {width: 100%;border-collapse: collapse;}.market-table th {text-align: left;font-weight: 600;color: #7f8c8d;font-size: 0.9rem;padding: 8px 0;border-bottom: 1px solid #eee;}.market-table td {padding: 10px 0;border-bottom: 1px solid #f5f7fa;}.market-table tr:last-child td {border-bottom: none;}.index-name {font-weight: 500;}.index-value {font-weight: 600;color: #2c3e50;}.positive {color: #27ae60;font-weight: 600;}.negative {color: #e74c3c;font-weight: 600;}/* Calendar Card */.calendar-header {display: flex;justify-content: space-between;align-items: center;margin-bottom: 20px;}.month-year {font-size: 1.2rem;font-weight: 600;color: #2c3e50;}.week-days {display: grid;grid-template-columns: repeat(7, 1fr);text-align: center;font-weight: 600;color: #7f8c8d;margin-bottom: 10px;}.calendar-grid {display: grid;grid-template-columns: repeat(7, 1fr);gap: 8px;}.calendar-day {height: 40px;display: flex;align-items: center;justify-content: center;border-radius: 10px;font-weight: 500;cursor: pointer;transition: all 0.2s ease;}.calendar-day:hover {background: #f0f7ff;}.other-month {color: #bdc3c7;}.today {background: #3498db;color: white;}.holiday {background: #e74c3c;color: white;position: relative;}.holiday::after {content: "";position: absolute;top: 3px;right: 3px;width: 6px;height: 6px;background: #f1c40f;border-radius: 50%;}/* Festival Card */.festival-card {background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);color: white;}.festival-card .card-title {color: rgba(255, 255, 255, 0.95);}.festival-name {font-size: 1.8rem;margin-bottom: 15px;text-align: center;}.customs-list {display: grid;grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));gap: 15px;margin-top: 20px;}.custom-item {background: rgba(255, 255, 255, 0.15);padding: 15px;border-radius: 12px;text-align: center;font-weight: 500;transition: transform 0.3s ease;}.custom-item:hover {transform: translateY(-3px);background: rgba(255, 255, 255, 0.25);}.custom-icon {font-size: 2rem;margin-bottom: 10px;display: block;}footer {text-align: center;margin-top: 30px;padding: 20px;color: #7f8c8d;font-size: 0.9rem;}@media (max-width: 768px) {.dashboard {grid-template-columns: 1fr;}header {flex-direction: column;align-items: flex-start;}}</style>
</head>
<body><div class="container"><header><div class="logo"><i class="fas fa-chart-line"></i><h1>金融信息与节日日历</h1></div><div class="date-display"><i class="fas fa-calendar-alt"></i> 2025531日 星期六</div></header><div class="dashboard"><!-- Weather Card --><div class="card weather-card"><div class="card-header"><h2 class="card-title">天气预报</h2><a href="#" class="card-link">查看完整预报 <i class="fas fa-arrow-right"></i></a></div><div class="weather-content"><div class="weather-info"><h2>福州市</h2><p>531日 早上好</p><p><i class="fas fa-temperature-high"></i> 27</p></div><div class="weather-icon"><i class="fas fa-sun"></i></div></div><div class="rain-alert"><i class="fas fa-cloud-rain"></i> 预计星期二将有4-6mm的降雨</div></div><!-- Market Card --><div class="card"><div class="card-header"><h2 class="card-title">金融市场</h2><a href="#" class="card-link">查看市场 <i class="fas fa-arrow-right"></i></a></div><table class="market-table"><thead><tr><th>指数名称</th><th>涨跌幅</th><th>点数</th></tr></thead><tbody><tr><td class="index-name">上证指数 000001</td><td class="negative">-0.47%</td><td class="index-value">3,347.49</td></tr><tr><td class="index-name">深证成指 399001</td><td class="negative">-0.85%</td><td class="index-value">10,040.63</td></tr><tr><td class="index-name">创业板指 399006</td><td class="negative">-0.96%</td><td class="index-value">1,993.19</td></tr><tr><td class="index-name">USD/CNY美元人民币</td><td class="positive">+0.19%</td><td class="index-value">7.1991</td></tr><tr><td class="index-name">恒生指数 HSI</td><td class="negative">-1.20%</td><td class="index-value">23,289.77</td></tr><tr><td class="index-name">中证1000 000852</td><td class="negative">-1.03%</td><td class="index-value">6,026.56</td></tr><tr><td class="index-name">富时中国A50 XIN9</td><td class="negative">-0.44%</td><td class="index-value">13,364.65</td></tr></tbody></table></div><!-- Calendar Card --><div class="card"><div class="card-header"><h2 class="card-title">日历</h2><a href="#" class="card-link">查看更多节日 <i class="fas fa-arrow-right"></i></a></div><div class="calendar-header"><div class="month-year">20255</div></div><div class="week-days"><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div><div class="calendar-grid"><div class="calendar-day other-month">26</div><div class="calendar-day other-month">27</div><div class="calendar-day other-month">28</div><div class="calendar-day other-month">29</div><div class="calendar-day other-month">30</div><div class="calendar-day today holiday">31 <span style="font-size:0.7rem;display:block;">端午</span></div><div class="calendar-day">1 <span style="font-size:0.7rem;display:block;">儿童节</span></div></div></div><!-- Festival Card --><div class="card festival-card"><div class="card-header"><h2 class="card-title">节日习俗</h2></div><div class="festival-name">端午节</div><p>端午节是中国的传统节日,为每年农历五月初五。端午节有吃粽子,赛龙舟,挂菖蒲、蒿草、艾叶,薰苍术、白芷,喝雄黄酒的习俗。</p><div class="customs-list"><div class="custom-item"><i class="custom-icon fas fa-dumpling"></i>吃粽子</div><div class="custom-item"><i class="custom-icon fas fa-herbal"></i>佩戴香囊</div><div class="custom-item"><i class="custom-icon fas fa-wine-glass"></i>饮雄黄酒</div><div class="custom-item"><i class="custom-icon fas fa-ship"></i>赛龙舟</div><div class="custom-item"><i class="custom-icon fas fa-leaf"></i>悬艾叶</div><div class="custom-item"><i class="custom-icon fas fa-seedling"></i>悬菖蒲</div></div></div></div><footer><p>© 2025 金融信息与节日日历 | 数据更新时间: 202553111:50</p></footer></div><script>// 简单的日期更新功能document.addEventListener('DOMContentLoaded', function() {const today = new Date();const options = { year: 'numeric', month: 'long', day: 'numeric', weekday: 'long' };const dateString = today.toLocaleDateString('zh-CN', options);// 更新页面中的日期显示const dateElements = document.querySelectorAll('.date-display');dateElements.forEach(el => {el.innerHTML = `<i class="fas fa-calendar-alt"></i> ${dateString}`;});// 添加日历点击事件const calendarDays = document.querySelectorAll('.calendar-day');calendarDays.forEach(day => {day.addEventListener('click', function() {calendarDays.forEach(d => d.classList.remove('selected'));this.classList.add('selected');});});});</script>
</body>
</html>

界面展示

在这里插入图片描述


http://www.hkcw.cn/article/kAiCoSNyrC.shtml

相关文章

Redis最佳实践——购物车优化详解

Redis在电商购物车高并发读写场景下的优化实践 一、购物车业务场景分析 典型操作特征 读/写比例 ≈ 8:2高峰QPS可达10万单用户最大商品数500操作类型&#xff1a;增删改查、全选/反选、数量修改 技术挑战 高并发下的数据一致性海量数据存储与快速访问实时价格计算与库存校验分…

[网页五子棋][对战模块]处理连接成功,通知玩家就绪,逻辑问题(线程安全,先手判定错误)

文章目录 处理连接成功通知玩家就绪逻辑图问题 1&#xff1a;线程安全问题 2&#xff1a;先手判定错误两边都是提示&#xff1a;轮到对方落子![image.png](https://i-blog.csdnimg.cn/img_convert/c570cd26eadbe87ed467bc4edaa7945e.png) 处理连接成功 实现 GameAPI 的 afterC…

Python训练打卡Day39

图像数据与显存 知识点回顾 图像数据的格式&#xff1a;灰度和彩色数据模型的定义显存占用的4种地方 模型参数梯度参数优化器参数数据批量所占显存神经元输出中间状态 batchisize和训练的关系 一、图像数据的格式 1.1灰度图像 作为图像数据&#xff0c;相较于结构化数据&#x…

pycharm打印时不换行,方便对比观察

原来&#xff1a; 优化&#xff1a; import torch torch.set_printoptions(linewidth200) 优化结果&#xff1a;

Practice 2025.6.1—— 二叉树进阶面试题(2)

文章目录 二叉树进阶面试题(2)Leetcode_144 二叉树的前序遍历(使用非递归)Leetcode_94 二叉树的中序遍历(使用非递归)Leetcode_145 二叉树的后序遍历(使用非递归) 二叉树进阶面试题(2) 本篇文章将继续进行二叉树的进阶面试题的讲解&#xff0c;其中&#xff0c;本部分将重点针…

DOCKER使用记录

1、拉取镜像 直接使用docker pull <image>&#xff0c;大概率会出现下面的报错信息&#xff1a; (base) jetsonyahboom:~$ docker pull ubuntu:18.04 Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while …

Vert.x学习笔记-EventLoop与Context的关系

Vert.x学习笔记 1. EventLoop 的核心作用2. Context 的核心作用3. EventLoop 与 Context 的关系1. 事件循环&#xff08;EventLoop&#xff09;的核心职责2. 上下文&#xff08;Context&#xff09;的核心职责3. 事件循环与上下文的关系&#xff08;1&#xff09;一对一绑定&am…

LTSPICE仿真电路:(三十一)HOWLAND电流源

1.HOWLAND电流源 推导过程&#xff1a;这个运放是正负反馈都存在&#xff0c;但负反馈是大于正反馈的&#xff0c;因正反馈多出一个Rload&#xff0c;所以可以使用虚短续断&#xff0c;运放的U等于U-&#xff0c;负反馈处得出Uout与U-的关系&#xff0c;再利用正相端节点电流算…

LLaMA-Factory - 批量推理(inference)的脚本

scripts/vllm_infer.py 是 LLaMA-Factory 团队用于批量推理&#xff08;inference&#xff09;的脚本&#xff0c;基于 vLLM 引擎&#xff0c;支持高效的并行推理。它可以对一个数据集批量生成模型输出&#xff0c;并保存为 JSONL 文件&#xff0c;适合大规模评测和自动化测试。…

引擎下线缺陷检测系统ENAgent

引擎下线缺陷检测系统ENAgent采用信号处理技术以及人工智能技术对引擎生产线下线的各种引擎在生产线上进行缺陷实时检测&#xff0c;通过振动信号、声纹信号等信号融合集成&#xff0c;在线实时判断其是否存在缺陷以及进行故障诊断。ENAgent系统采用全Python语言&#xff0c;以…

【量化交易学习】布林线(BOLL)指标

目录 1. 布林线&#xff08;BOLL&#xff09;指标定义与构成1.1 定义1.2 布林线的构成 2. BOLL&#xff08;布林线&#xff09;的应用场景3. BOLL指标的研判标准3.1 BOLL指标中的上、中、下轨线的意义3.2 BOLL指标中的上、中、下轨线之间的关系3.3 K线和布林线上、中、下轨之间…

ArcGIS Pro 创建渔网格网过大,只有几个格网的解决方案

之前用ArcGIS Pro创建渔网的时候&#xff0c;发现创建出来格网过大&#xff0c;只有几个格网。 后来查阅资料&#xff0c;发现是坐标不对&#xff0c;导致设置格网大小时单位为度&#xff0c;而不是米&#xff0c;因此需要进行坐标系转换&#xff0c;网上有很多资料讲了ArcGIS …

java27

1.IO流 FileOutPutStream字节输出流基本用法&#xff1a; 一次性写入一个字符串的内容&#xff1a; 注意&#xff1a;\r或者\n表示把普通的r或者n的字符转义成回车的意思&#xff0c;所以不需要\\ FileInputStream字节输入流基本用法 -1在ASCII码里面对应的符号&#xff1a; 不…

Windows设置之RDP文件用户密码

1、远程桌面另存为rdp文件 2、编辑rdp文件&#xff0c;添加用户名密码信息 username:s:<用户名> password 51:b:<加密后的密码> 3、<加密后的密码>通过PowerShell命令或者 ("<密码>" | ConvertTo-SecureString -AsPlainText -Force) | Conve…

day025-网络基础-DNS与ARP协议

文章目录 1. DNS服务1.1 DNS解析流程1.2 查看本地DNS缓存&#xff08;Windows&#xff09;1.3 查看详细DNS解析流程1.4 排查DNS故障 2. 面试题&#xff1a;用户访问网站过程2.1 抓包 3. ARP协议3.1 命令查看3.2 抓包 4. ICMP协议4.1 禁用ping 5. 踩坑记录1. **为什么解析域名时…

SEO长尾关键词优化实战

内容概要 在长尾关键词优化实践中&#xff0c;系统化的策略设计与执行路径直接影响流量获取效率与转化质量。本文从行业竞争度评估切入&#xff0c;通过多维指标拆解目标关键词的流量价值与操作成本&#xff0c;帮助从业者建立科学的资源分配模型&#xff1b;同时聚焦用户搜索…

复杂业务场景下 JSON 规范设计:Map<String,Object>快速开发 与 ResponseEntity精细化控制HTTP 的本质区别与应用场景解析

Moudle 1 Json使用示例 在企业开发中&#xff0c;构造 JSON 格式数据的方式需兼顾 可读性、兼容性、安全性和开发效率&#xff0c;以下是几种常用方式及适用场景&#xff1a; 一、直接使用 Map / 对象转换&#xff08;简单场景&#xff09; 通过 键值对集合&#xff08;如 M…

Oracle正则表达式学习

目录 一、正则表达简介 二、REGEXP_LIKE(x,匹配项) 三、REGEXP_INSTR 四、REGEXP_SUBSTR 五、REGEXP_REPLACE 一、正则表达简介 相关网址&#xff1a; https://cloud.tencent.com/developer/article/1456428 https://www.cnblogs.com/lxl57610/p/8227599.html https://…

【HW系列】—溯源与定位—Windows入侵排查

文章目录 实在不会手动&#xff0c;打开一个杀毒软件&#xff0c;全盘扫描一、入侵排查思路与流程1. 常见应急响应事件分类2. 入侵排查流程图 二、Windows账户安全排查&#xff08;D盾&#xff0c;微步沙箱&#xff09;1. 正常账户 vs 黑客账户区别2. 自动账户排查3. 隐藏账户与…

【机器学习基础】机器学习入门核心:Jaccard相似度 (Jaccard Index) 和 Pearson相似度 (Pearson Correlation)

机器学习入门核心&#xff1a;Jaccard相似度 &#xff08;Jaccard Index&#xff09; 和 Pearson相似度 &#xff08;Pearson Correlation&#xff09; 一、算法逻辑Jaccard相似度 (Jaccard Index)**Pearson相似度 (Pearson Correlation)** 二、算法原理与数学推导1. Jaccard相…