mirror of
https://github.com/wahyd4/TrendRadar.git
synced 2026-08-09 05:15:49 +10:00
1029 lines
44 KiB
HTML
1029 lines
44 KiB
HTML
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>热点新闻分析</title>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js" integrity="sha512-BNaRQnYJYiPSqHHDb58B0yaPfCu+Wgds8Gp/gU33kqBtgNS4tSPHuGibyoeqMV/TJlSKda6FXzoEyYGjTe+vXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
<style>
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
|
|
margin: 0;
|
|
padding: 16px;
|
|
background: #fafafa;
|
|
color: #333;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.container {
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
background: white;
|
|
border-radius: 12px;
|
|
overflow: hidden;
|
|
box-shadow: 0 2px 16px rgba(0,0,0,0.06);
|
|
}
|
|
|
|
.header {
|
|
background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
|
|
color: white;
|
|
padding: 32px 24px;
|
|
text-align: center;
|
|
position: relative;
|
|
}
|
|
|
|
.save-buttons {
|
|
position: absolute;
|
|
top: 16px;
|
|
right: 16px;
|
|
display: flex;
|
|
gap: 8px;
|
|
}
|
|
|
|
.save-btn {
|
|
background: rgba(255, 255, 255, 0.2);
|
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
|
color: white;
|
|
padding: 8px 16px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
transition: all 0.2s ease;
|
|
backdrop-filter: blur(10px);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.save-btn:hover {
|
|
background: rgba(255, 255, 255, 0.3);
|
|
border-color: rgba(255, 255, 255, 0.5);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.save-btn:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.save-btn:disabled {
|
|
opacity: 0.6;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.header-title {
|
|
font-size: 22px;
|
|
font-weight: 700;
|
|
margin: 0 0 20px 0;
|
|
}
|
|
|
|
.header-info {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 16px;
|
|
font-size: 14px;
|
|
opacity: 0.95;
|
|
}
|
|
|
|
.info-item {
|
|
text-align: center;
|
|
}
|
|
|
|
.info-label {
|
|
display: block;
|
|
font-size: 12px;
|
|
opacity: 0.8;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.info-value {
|
|
font-weight: 600;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.content {
|
|
padding: 24px;
|
|
}
|
|
|
|
.word-group {
|
|
margin-bottom: 40px;
|
|
}
|
|
|
|
.word-group:first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.word-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-bottom: 20px;
|
|
padding-bottom: 8px;
|
|
border-bottom: 1px solid #f0f0f0;
|
|
}
|
|
|
|
.word-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
|
|
.word-name {
|
|
font-size: 17px;
|
|
font-weight: 600;
|
|
color: #1a1a1a;
|
|
}
|
|
|
|
.word-count {
|
|
color: #666;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.word-count.hot { color: #dc2626; font-weight: 600; }
|
|
.word-count.warm { color: #ea580c; font-weight: 600; }
|
|
|
|
.word-index {
|
|
color: #999;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.news-item {
|
|
margin-bottom: 20px;
|
|
padding: 16px 0;
|
|
border-bottom: 1px solid #f5f5f5;
|
|
position: relative;
|
|
display: flex;
|
|
gap: 12px;
|
|
align-items: center;
|
|
}
|
|
|
|
.news-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.news-item.new::after {
|
|
content: "NEW";
|
|
position: absolute;
|
|
top: 12px;
|
|
right: 0;
|
|
background: #fbbf24;
|
|
color: #92400e;
|
|
font-size: 9px;
|
|
font-weight: 700;
|
|
padding: 3px 6px;
|
|
border-radius: 4px;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.news-number {
|
|
color: #999;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
min-width: 20px;
|
|
text-align: center;
|
|
flex-shrink: 0;
|
|
background: #f8f9fa;
|
|
border-radius: 50%;
|
|
width: 24px;
|
|
height: 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
align-self: flex-start;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.news-content {
|
|
flex: 1;
|
|
min-width: 0;
|
|
padding-right: 40px;
|
|
}
|
|
|
|
.news-item.new .news-content {
|
|
padding-right: 50px;
|
|
}
|
|
|
|
.news-header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
margin-bottom: 8px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.source-name {
|
|
color: #666;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.rank-num {
|
|
color: #fff;
|
|
background: #6b7280;
|
|
font-size: 10px;
|
|
font-weight: 700;
|
|
padding: 2px 6px;
|
|
border-radius: 10px;
|
|
min-width: 18px;
|
|
text-align: center;
|
|
}
|
|
|
|
.rank-num.top { background: #dc2626; }
|
|
.rank-num.high { background: #ea580c; }
|
|
|
|
.time-info {
|
|
color: #999;
|
|
font-size: 11px;
|
|
}
|
|
|
|
.count-info {
|
|
color: #059669;
|
|
font-size: 11px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.news-title {
|
|
font-size: 15px;
|
|
line-height: 1.4;
|
|
color: #1a1a1a;
|
|
margin: 0;
|
|
}
|
|
|
|
.news-link {
|
|
color: #2563eb;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.news-link:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.news-link:visited {
|
|
color: #7c3aed;
|
|
}
|
|
|
|
.new-section {
|
|
margin-top: 40px;
|
|
padding-top: 24px;
|
|
border-top: 2px solid #f0f0f0;
|
|
}
|
|
|
|
.new-section-title {
|
|
color: #1a1a1a;
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
margin: 0 0 20px 0;
|
|
}
|
|
|
|
.new-source-group {
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.new-source-title {
|
|
color: #666;
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
margin: 0 0 12px 0;
|
|
padding-bottom: 6px;
|
|
border-bottom: 1px solid #f5f5f5;
|
|
}
|
|
|
|
.new-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
padding: 8px 0;
|
|
border-bottom: 1px solid #f9f9f9;
|
|
}
|
|
|
|
.new-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.new-item-number {
|
|
color: #999;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
min-width: 18px;
|
|
text-align: center;
|
|
flex-shrink: 0;
|
|
background: #f8f9fa;
|
|
border-radius: 50%;
|
|
width: 20px;
|
|
height: 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.new-item-rank {
|
|
color: #fff;
|
|
background: #6b7280;
|
|
font-size: 10px;
|
|
font-weight: 700;
|
|
padding: 3px 6px;
|
|
border-radius: 8px;
|
|
min-width: 20px;
|
|
text-align: center;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.new-item-rank.top { background: #dc2626; }
|
|
.new-item-rank.high { background: #ea580c; }
|
|
|
|
.new-item-content {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.new-item-title {
|
|
font-size: 14px;
|
|
line-height: 1.4;
|
|
color: #1a1a1a;
|
|
margin: 0;
|
|
}
|
|
|
|
.error-section {
|
|
background: #fef2f2;
|
|
border: 1px solid #fecaca;
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.error-title {
|
|
color: #dc2626;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
margin: 0 0 8px 0;
|
|
}
|
|
|
|
.error-list {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
|
|
.error-item {
|
|
color: #991b1b;
|
|
font-size: 13px;
|
|
padding: 2px 0;
|
|
font-family: 'SF Mono', Consolas, monospace;
|
|
}
|
|
|
|
.footer {
|
|
margin-top: 32px;
|
|
padding: 20px 24px;
|
|
background: #f8f9fa;
|
|
border-top: 1px solid #e5e7eb;
|
|
text-align: center;
|
|
}
|
|
|
|
.footer-content {
|
|
font-size: 13px;
|
|
color: #6b7280;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.footer-link {
|
|
color: #4f46e5;
|
|
text-decoration: none;
|
|
font-weight: 500;
|
|
transition: color 0.2s ease;
|
|
}
|
|
|
|
.footer-link:hover {
|
|
color: #7c3aed;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.project-name {
|
|
font-weight: 600;
|
|
color: #374151;
|
|
}
|
|
|
|
@media (max-width: 480px) {
|
|
body { padding: 12px; }
|
|
.header { padding: 24px 20px; }
|
|
.content { padding: 20px; }
|
|
.footer { padding: 16px 20px; }
|
|
.header-info { grid-template-columns: 1fr; gap: 12px; }
|
|
.news-header { gap: 6px; }
|
|
.news-content { padding-right: 45px; }
|
|
.news-item { gap: 8px; }
|
|
.new-item { gap: 8px; }
|
|
.news-number { width: 20px; height: 20px; font-size: 12px; }
|
|
.save-buttons {
|
|
position: static;
|
|
margin-bottom: 16px;
|
|
display: flex;
|
|
gap: 8px;
|
|
justify-content: center;
|
|
flex-direction: column;
|
|
width: 100%;
|
|
}
|
|
.save-btn {
|
|
width: 100%;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<div class="save-buttons">
|
|
<button class="save-btn" onclick="saveAsImage()">保存为图片</button>
|
|
<button class="save-btn" onclick="saveAsMultipleImages()">分段保存</button>
|
|
</div>
|
|
<div class="header-title">热点新闻分析</div>
|
|
<div class="header-info">
|
|
<div class="info-item">
|
|
<span class="info-label">报告类型</span>
|
|
<span class="info-value">当日汇总</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-label">新闻总数</span>
|
|
<span class="info-value">195 条</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-label">热点新闻</span>
|
|
<span class="info-value">18 条</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-label">生成时间</span>
|
|
<span class="info-value">12-02 08:47</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<div class="word-group">
|
|
<div class="word-header">
|
|
<div class="word-info">
|
|
<div class="word-name">中国</div>
|
|
<div class="word-count hot">12 条</div>
|
|
</div>
|
|
<div class="word-index">1/7</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">1</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">抖音</span><span class="rank-num top">1</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://www.douyin.com/hot/2323217" target="_blank" class="news-link">中国男篮再负韩国</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">2</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">澎湃新闻</span><span class="rank-num top">2</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://m.thepaper.cn/newsDetail_forward_32077834" target="_blank" class="news-link">中国公民即日起可免签前往俄罗斯:相关搜索翻倍增长,有旅行社明年春节期间多款旅游产品售罄</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">3</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">财联社热门</span><span class="rank-num top">2</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://www.cls.cn/detail/2216490" target="_blank" class="news-link">美股收盘:三大指数“五连阳”戛然而止 中国资产逆势走强</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="word-group">
|
|
<div class="word-header">
|
|
<div class="word-info">
|
|
<div class="word-name">美国 日本 澳大利亚</div>
|
|
<div class="word-count hot">12 条</div>
|
|
</div>
|
|
<div class="word-index">2/7</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">1</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">今日头条</span><span class="rank-num top">1</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://www.toutiao.com/trending/7577974525254762538/" target="_blank" class="news-link">日本学者说高市“高支持率”不是民意</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">2</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">华尔街见闻</span><span class="rank-num top">1</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://wallstreetcn.com/articles/3760444" target="_blank" class="news-link">日本央行加息预期飙升,加密货币大跌,标普连涨终结,中概股逆市上涨,铜银钴走强</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">3</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">华尔街见闻</span><span class="rank-num top">3</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://wallstreetcn.com/articles/3760425" target="_blank" class="news-link">日本股债双杀!央行行长强烈暗示12月加息:希望将利率提高至0.75%再谈以后</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="word-group">
|
|
<div class="word-header">
|
|
<div class="word-info">
|
|
<div class="word-name">英伟达 NVIDIA 黄仁勋</div>
|
|
<div class="word-count ">4 条</div>
|
|
</div>
|
|
<div class="word-index">3/7</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">1</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">财联社热门</span><span class="rank-num high">4</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://www.cls.cn/detail/2216428" target="_blank" class="news-link">英伟达锁定EDA霸主!20亿美元入股新思科技扩大合作版图</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">2</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">微博</span><span class="rank-num high">5</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://s.weibo.com/weibo?q=%23%E8%8B%B1%E4%BC%9F%E8%BE%BE20%E4%BA%BF%E7%BE%8E%E5%85%83%E5%85%A5%E8%82%A1%E6%96%B0%E6%80%9D%E7%A7%91%E6%8A%80%23&t=31&band_rank=5&Refer=top" target="_blank" class="news-link">英伟达20亿美元入股新思科技</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">3</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">财联社热门</span><span class="rank-num ">7</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://www.cls.cn/detail/2216291" target="_blank" class="news-link">孙正义回应清仓英伟达:为了投AI,我是哭着卖的</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="word-group">
|
|
<div class="word-header">
|
|
<div class="word-info">
|
|
<div class="word-name">DeepSeek 特斯拉</div>
|
|
<div class="word-count ">3 条</div>
|
|
</div>
|
|
<div class="word-index">4/7</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">1</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">财联社热门</span><span class="rank-num top">1</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://www.cls.cn/detail/2216499" target="_blank" class="news-link">【早报】热门中概股逆势飘红,银价续创历史新高;DeepSeek发布两款新模型</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">2</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">华尔街见闻</span><span class="rank-num high">5</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://wallstreetcn.com/articles/3760468" target="_blank" class="news-link">开源最强!“拳打GPT 5”,“脚踢Gemini-3.0”,DeepSeek V3.2为何提升这么多?</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">3</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">华尔街见闻</span><span class="rank-num ">7</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://wallstreetcn.com/articles/3760461" target="_blank" class="news-link">DeepSeek发布V3.2系列模型,强化Agent能力,推理能力追平GPT-5</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="word-group">
|
|
<div class="word-header">
|
|
<div class="word-info">
|
|
<div class="word-name">ai 人工智能</div>
|
|
<div class="word-count ">3 条</div>
|
|
</div>
|
|
<div class="word-index">5/7</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">1</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">华尔街见闻</span><span class="rank-num top">2</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://wallstreetcn.com/articles/3760431" target="_blank" class="news-link">直接嵌入手机系统!豆包AI手机,帮你跨平台比价点外卖、自动回消息</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">2</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">财联社热门</span><span class="rank-num ">12</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://www.cls.cn/detail/2216521" target="_blank" class="news-link">苹果更换AI主管 白银年内涨幅突破100% | 环球市场</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">3</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">微博</span><span class="rank-num ">15</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://s.weibo.com/weibo?q=%E9%83%91%E6%81%BA%E4%B8%8A%E6%88%8F%E5%90%88%E5%BD%B1%20AI%E7%94%9F%E6%88%90&t=31&band_rank=15&Refer=top" target="_blank" class="news-link">郑恺上戏合影 AI生成</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="word-group">
|
|
<div class="word-header">
|
|
<div class="word-info">
|
|
<div class="word-name">谷歌 google gemini deepmind</div>
|
|
<div class="word-count ">2 条</div>
|
|
</div>
|
|
<div class="word-index">6/7</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">1</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">华尔街见闻</span><span class="rank-num ">9</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://wallstreetcn.com/articles/3760440" target="_blank" class="news-link">大摩大幅上调谷歌TPU产量预测:2027年达500万块,每50万块“外销”或增收130亿美元</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">2</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">财联社热门</span><span class="rank-num ">13</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://www.cls.cn/detail/2216460" target="_blank" class="news-link">百人初创公司Runway发布AI视频模型 生成质量超谷歌OpenAI竞品</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="word-group">
|
|
<div class="word-header">
|
|
<div class="word-info">
|
|
<div class="word-name">科技</div>
|
|
<div class="word-count ">1 条</div>
|
|
</div>
|
|
<div class="word-index">7/7</div>
|
|
</div>
|
|
<div class="news-item ">
|
|
<div class="news-number">1</div>
|
|
<div class="news-content">
|
|
<div class="news-header">
|
|
<span class="source-name">财联社热门</span><span class="rank-num ">6</span><span class="time-info">08时47分</span>
|
|
</div>
|
|
<div class="news-title"><a href="https://www.cls.cn/detail/2216325" target="_blank" class="news-link">光刻胶板块领涨科技股 国产龙头公司布局提速</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="footer">
|
|
<div class="footer-content">
|
|
由 <span class="project-name">TrendRadar</span> 生成 ·
|
|
<a href="https://github.com/sansan0/TrendRadar" target="_blank" class="footer-link">
|
|
GitHub 开源项目
|
|
</a>
|
|
<br>
|
|
<span style="color: #ea580c; font-weight: 500;">
|
|
发现新版本 3.4.1,当前版本 3.3.0
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
async function saveAsImage() {
|
|
const button = event.target;
|
|
const originalText = button.textContent;
|
|
|
|
try {
|
|
button.textContent = '生成中...';
|
|
button.disabled = true;
|
|
window.scrollTo(0, 0);
|
|
|
|
// 等待页面稳定
|
|
await new Promise(resolve => setTimeout(resolve, 200));
|
|
|
|
// 截图前隐藏按钮
|
|
const buttons = document.querySelector('.save-buttons');
|
|
buttons.style.visibility = 'hidden';
|
|
|
|
// 再次等待确保按钮完全隐藏
|
|
await new Promise(resolve => setTimeout(resolve, 100));
|
|
|
|
const container = document.querySelector('.container');
|
|
|
|
const canvas = await html2canvas(container, {
|
|
backgroundColor: '#ffffff',
|
|
scale: 1.5,
|
|
useCORS: true,
|
|
allowTaint: false,
|
|
imageTimeout: 10000,
|
|
removeContainer: false,
|
|
foreignObjectRendering: false,
|
|
logging: false,
|
|
width: container.offsetWidth,
|
|
height: container.offsetHeight,
|
|
x: 0,
|
|
y: 0,
|
|
scrollX: 0,
|
|
scrollY: 0,
|
|
windowWidth: window.innerWidth,
|
|
windowHeight: window.innerHeight
|
|
});
|
|
|
|
buttons.style.visibility = 'visible';
|
|
|
|
const link = document.createElement('a');
|
|
const now = new Date();
|
|
const filename = `TrendRadar_热点新闻分析_${now.getFullYear()}${String(now.getMonth() + 1).padStart(2, '0')}${String(now.getDate()).padStart(2, '0')}_${String(now.getHours()).padStart(2, '0')}${String(now.getMinutes()).padStart(2, '0')}.png`;
|
|
|
|
link.download = filename;
|
|
link.href = canvas.toDataURL('image/png', 1.0);
|
|
|
|
// 触发下载
|
|
document.body.appendChild(link);
|
|
link.click();
|
|
document.body.removeChild(link);
|
|
|
|
button.textContent = '保存成功!';
|
|
setTimeout(() => {
|
|
button.textContent = originalText;
|
|
button.disabled = false;
|
|
}, 2000);
|
|
|
|
} catch (error) {
|
|
const buttons = document.querySelector('.save-buttons');
|
|
buttons.style.visibility = 'visible';
|
|
button.textContent = '保存失败';
|
|
setTimeout(() => {
|
|
button.textContent = originalText;
|
|
button.disabled = false;
|
|
}, 2000);
|
|
}
|
|
}
|
|
|
|
async function saveAsMultipleImages() {
|
|
const button = event.target;
|
|
const originalText = button.textContent;
|
|
const container = document.querySelector('.container');
|
|
const scale = 1.5;
|
|
const maxHeight = 5000 / scale;
|
|
|
|
try {
|
|
button.textContent = '分析中...';
|
|
button.disabled = true;
|
|
|
|
// 获取所有可能的分割元素
|
|
const newsItems = Array.from(container.querySelectorAll('.news-item'));
|
|
const wordGroups = Array.from(container.querySelectorAll('.word-group'));
|
|
const newSection = container.querySelector('.new-section');
|
|
const errorSection = container.querySelector('.error-section');
|
|
const header = container.querySelector('.header');
|
|
const footer = container.querySelector('.footer');
|
|
|
|
// 计算元素位置和高度
|
|
const containerRect = container.getBoundingClientRect();
|
|
const elements = [];
|
|
|
|
// 添加header作为必须包含的元素
|
|
elements.push({
|
|
type: 'header',
|
|
element: header,
|
|
top: 0,
|
|
bottom: header.offsetHeight,
|
|
height: header.offsetHeight
|
|
});
|
|
|
|
// 添加错误信息(如果存在)
|
|
if (errorSection) {
|
|
const rect = errorSection.getBoundingClientRect();
|
|
elements.push({
|
|
type: 'error',
|
|
element: errorSection,
|
|
top: rect.top - containerRect.top,
|
|
bottom: rect.bottom - containerRect.top,
|
|
height: rect.height
|
|
});
|
|
}
|
|
|
|
// 按word-group分组处理news-item
|
|
wordGroups.forEach(group => {
|
|
const groupRect = group.getBoundingClientRect();
|
|
const groupNewsItems = group.querySelectorAll('.news-item');
|
|
|
|
// 添加word-group的header部分
|
|
const wordHeader = group.querySelector('.word-header');
|
|
if (wordHeader) {
|
|
const headerRect = wordHeader.getBoundingClientRect();
|
|
elements.push({
|
|
type: 'word-header',
|
|
element: wordHeader,
|
|
parent: group,
|
|
top: groupRect.top - containerRect.top,
|
|
bottom: headerRect.bottom - containerRect.top,
|
|
height: headerRect.height
|
|
});
|
|
}
|
|
|
|
// 添加每个news-item
|
|
groupNewsItems.forEach(item => {
|
|
const rect = item.getBoundingClientRect();
|
|
elements.push({
|
|
type: 'news-item',
|
|
element: item,
|
|
parent: group,
|
|
top: rect.top - containerRect.top,
|
|
bottom: rect.bottom - containerRect.top,
|
|
height: rect.height
|
|
});
|
|
});
|
|
});
|
|
|
|
// 添加新增新闻部分
|
|
if (newSection) {
|
|
const rect = newSection.getBoundingClientRect();
|
|
elements.push({
|
|
type: 'new-section',
|
|
element: newSection,
|
|
top: rect.top - containerRect.top,
|
|
bottom: rect.bottom - containerRect.top,
|
|
height: rect.height
|
|
});
|
|
}
|
|
|
|
// 添加footer
|
|
const footerRect = footer.getBoundingClientRect();
|
|
elements.push({
|
|
type: 'footer',
|
|
element: footer,
|
|
top: footerRect.top - containerRect.top,
|
|
bottom: footerRect.bottom - containerRect.top,
|
|
height: footer.offsetHeight
|
|
});
|
|
|
|
// 计算分割点
|
|
const segments = [];
|
|
let currentSegment = { start: 0, end: 0, height: 0, includeHeader: true };
|
|
let headerHeight = header.offsetHeight;
|
|
currentSegment.height = headerHeight;
|
|
|
|
for (let i = 1; i < elements.length; i++) {
|
|
const element = elements[i];
|
|
const potentialHeight = element.bottom - currentSegment.start;
|
|
|
|
// 检查是否需要创建新分段
|
|
if (potentialHeight > maxHeight && currentSegment.height > headerHeight) {
|
|
// 在前一个元素结束处分割
|
|
currentSegment.end = elements[i - 1].bottom;
|
|
segments.push(currentSegment);
|
|
|
|
// 开始新分段
|
|
currentSegment = {
|
|
start: currentSegment.end,
|
|
end: 0,
|
|
height: element.bottom - currentSegment.end,
|
|
includeHeader: false
|
|
};
|
|
} else {
|
|
currentSegment.height = potentialHeight;
|
|
currentSegment.end = element.bottom;
|
|
}
|
|
}
|
|
|
|
// 添加最后一个分段
|
|
if (currentSegment.height > 0) {
|
|
currentSegment.end = container.offsetHeight;
|
|
segments.push(currentSegment);
|
|
}
|
|
|
|
button.textContent = `生成中 (0/${segments.length})...`;
|
|
|
|
// 隐藏保存按钮
|
|
const buttons = document.querySelector('.save-buttons');
|
|
buttons.style.visibility = 'hidden';
|
|
|
|
// 为每个分段生成图片
|
|
const images = [];
|
|
for (let i = 0; i < segments.length; i++) {
|
|
const segment = segments[i];
|
|
button.textContent = `生成中 (${i + 1}/${segments.length})...`;
|
|
|
|
// 创建临时容器用于截图
|
|
const tempContainer = document.createElement('div');
|
|
tempContainer.style.cssText = `
|
|
position: absolute;
|
|
left: -9999px;
|
|
top: 0;
|
|
width: ${container.offsetWidth}px;
|
|
background: white;
|
|
`;
|
|
tempContainer.className = 'container';
|
|
|
|
// 克隆容器内容
|
|
const clonedContainer = container.cloneNode(true);
|
|
|
|
// 移除克隆内容中的保存按钮
|
|
const clonedButtons = clonedContainer.querySelector('.save-buttons');
|
|
if (clonedButtons) {
|
|
clonedButtons.style.display = 'none';
|
|
}
|
|
|
|
tempContainer.appendChild(clonedContainer);
|
|
document.body.appendChild(tempContainer);
|
|
|
|
// 等待DOM更新
|
|
await new Promise(resolve => setTimeout(resolve, 100));
|
|
|
|
// 使用html2canvas截取特定区域
|
|
const canvas = await html2canvas(clonedContainer, {
|
|
backgroundColor: '#ffffff',
|
|
scale: scale,
|
|
useCORS: true,
|
|
allowTaint: false,
|
|
imageTimeout: 10000,
|
|
logging: false,
|
|
width: container.offsetWidth,
|
|
height: segment.end - segment.start,
|
|
x: 0,
|
|
y: segment.start,
|
|
windowWidth: window.innerWidth,
|
|
windowHeight: window.innerHeight
|
|
});
|
|
|
|
images.push(canvas.toDataURL('image/png', 1.0));
|
|
|
|
// 清理临时容器
|
|
document.body.removeChild(tempContainer);
|
|
}
|
|
|
|
// 恢复按钮显示
|
|
buttons.style.visibility = 'visible';
|
|
|
|
// 下载所有图片
|
|
const now = new Date();
|
|
const baseFilename = `TrendRadar_热点新闻分析_${now.getFullYear()}${String(now.getMonth() + 1).padStart(2, '0')}${String(now.getDate()).padStart(2, '0')}_${String(now.getHours()).padStart(2, '0')}${String(now.getMinutes()).padStart(2, '0')}`;
|
|
|
|
for (let i = 0; i < images.length; i++) {
|
|
const link = document.createElement('a');
|
|
link.download = `${baseFilename}_part${i + 1}.png`;
|
|
link.href = images[i];
|
|
document.body.appendChild(link);
|
|
link.click();
|
|
document.body.removeChild(link);
|
|
|
|
// 延迟一下避免浏览器阻止多个下载
|
|
await new Promise(resolve => setTimeout(resolve, 100));
|
|
}
|
|
|
|
button.textContent = `已保存 ${segments.length} 张图片!`;
|
|
setTimeout(() => {
|
|
button.textContent = originalText;
|
|
button.disabled = false;
|
|
}, 2000);
|
|
|
|
} catch (error) {
|
|
console.error('分段保存失败:', error);
|
|
const buttons = document.querySelector('.save-buttons');
|
|
buttons.style.visibility = 'visible';
|
|
button.textContent = '保存失败';
|
|
setTimeout(() => {
|
|
button.textContent = originalText;
|
|
button.disabled = false;
|
|
}, 2000);
|
|
}
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
window.scrollTo(0, 0);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|