-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
内容上:精炼呈现资讯的标题和概要,摈除一切噪音(如标题党、软文、公关文章等等),并提供同一事件在不同媒体上报道的链接,用户要看资讯详情, 可跳转到来源网站; 设计上:返朴归真,黑白文字排版,减少图片和色彩信息的干扰,提供目的明确的纯粹阅读场景;
- Loading branch information
1 parent
d3e61ea
commit 3fce38a
Showing
3 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
font-size: 16px; | ||
line-height: 1.5; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
header { | ||
background-color: #333; | ||
color: #fff; | ||
padding: 10px; | ||
} | ||
|
||
nav ul { | ||
list-style-type: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
nav ul li { | ||
display: inline; | ||
margin-right: 10px; | ||
} | ||
|
||
nav ul li a { | ||
color: #fff; | ||
text-decoration: none; | ||
} | ||
|
||
main { | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 20px; | ||
} | ||
|
||
#industryNews { | ||
width: 70%; | ||
} | ||
|
||
#industryNews .newsItem { | ||
margin-bottom: 20px; | ||
} | ||
|
||
#industryNews .newsItem h2 { | ||
font-size: 20px; | ||
margin-bottom: 10px; | ||
} | ||
|
||
#industryNews .newsItem p { | ||
font-size: 16px; | ||
margin-bottom: 5px; | ||
} | ||
|
||
#industryNews .newsItem a { | ||
font-size: 14px; | ||
color: #333; | ||
text-decoration: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Industry News</title> | ||
<link rel="stylesheet" type="text/css" href="css/style.css"> | ||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | ||
<script src="js/script.js"></script> | ||
</head> | ||
<body> | ||
<header> | ||
<nav> | ||
<ul> | ||
<li><a href="#">Home</a></li> | ||
<li><a href="#">About</a></li> | ||
<li><a href="#">Contact</a></li> | ||
</ul> | ||
</nav> | ||
</header> | ||
<main> | ||
<div id="industryNews"></div> | ||
</main> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
$(document).ready(function() { | ||
// Function to make API request and display industry news | ||
function getIndustryNews() { | ||
$.ajax({ | ||
url: '/api/industry-information', | ||
method: 'GET', | ||
success: function(response) { | ||
displayIndustryNews(response.industryInformation); | ||
}, | ||
error: function(error) { | ||
console.log('Error:', error); | ||
} | ||
}); | ||
} | ||
|
||
// Function to display industry news on the page | ||
function displayIndustryNews(news) { | ||
var industryNewsContainer = $('#industryNews'); | ||
industryNewsContainer.empty(); | ||
|
||
news.forEach(function(item) { | ||
var newsItem = $('<div>').addClass('newsItem'); | ||
var title = $('<h2>').text(item.title); | ||
var summary = $('<p>').text(item.summary); | ||
var sourceLink = $('<a>').attr('href', item.source).text('Read More'); | ||
|
||
newsItem.append(title, summary, sourceLink); | ||
industryNewsContainer.append(newsItem); | ||
}); | ||
} | ||
|
||
// Call the function to get industry news on page load | ||
getIndustryNews(); | ||
}); |