Skip to content

Commit

Permalink
内容上:精炼呈现资讯的标题和概要,摈除一切噪音(如标题党、软文、公关文章等等),并提供同一事件在不同媒体上报道的链接,用户要看资讯详情,
可跳转到来源网站;
设计上:返朴归真,黑白文字排版,减少图片和色彩信息的干扰,提供目的明确的纯粹阅读场景;
  • Loading branch information
charging-kuafuai committed Jun 18, 2024
1 parent d3e61ea commit 3fce38a
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 0 deletions.
59 changes: 59 additions & 0 deletions css/style.css
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;
}
23 changes: 23 additions & 0 deletions index.html
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>
34 changes: 34 additions & 0 deletions js/script.js
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();
});

0 comments on commit 3fce38a

Please sign in to comment.