每日60秒新闻早报单页文字版的,这个很早就有了,最近有用户问我这个怎么实现,其实很简单的只是一个单页而已,这个是PHP版的会将头部图片缓存到本地然后在展示可防止接口信息泄露。
PHP接口源码
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>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
}
.container {
width: 90%;
max-width: 800px;
margin: 20px auto;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.header img {
width: 100%;
height: auto;
border-radius: 8px;
}
h1 {
text-align: center;
margin: 20px 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
background-color: #fff;
padding: 10px;
border-radius: 8px;
}
.weiyu {
text-align: center;
font-style: italic;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<img src="<?php echo $headImageFile; ?>">
</div>
<h1><?php echo $date; ?> 新闻早报</h1>
<ul>
<?php foreach ($news as $newsItem): ?>
<li><?php echo $newsItem; ?></li>
<?php endforeach; ?>
</ul>
<p class="weiyu"><?php echo $weiyu; ?></p>
</div>
</body>
</html>