让DeepSeek帮我写一辈子代码吧😭
反反复复让DeepSeek帮我修改首页关于跳转开往的按钮样式和下面的倒计时,原来是这么一串代码(有一堆错误):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
p.main {text-align:center;}
</style>
</head>
<body>
<a href="https://www.travellings.cn/go.html" target="_blank" rel="noopener noreferrer"><font size=3"><b><p class="main">🚇|开往</p></b></font></a>
<p class="main">距离2025年湖南中考还有
<div id="countdown"></div>
<script>
// 目标日期
var targetDate = new Date("2025-06-18T00:00:00");
// 更新倒计时
function updateCountdown() {
var now = new Date();
var timeLeft = targetDate - now;
// 计算剩余的天、小时、分钟和秒
var days = Math.floor(timeLeft / (1000 * 60 * 60 * 24));
var hours = Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((timeLeft % (1000 * 60)) / 1000);
// 更新页面上的倒计时显示
document.getElementById("countdown").innerHTML = days + "天 " + hours + "小时 " + minutes + "分钟 " + seconds + "秒";
// 每秒钟更新一次倒计时
setTimeout(updateCountdown, 1000);
}
// 启动倒计时
updateCountdown();
</script>
</body>
</html>
到现在这样子(部分展示):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
/* 独立容器样式 */
.countdown-module {
--primary-color: #2196f3;
--hover-bg: rgba(33, 150, 243, 0.1); /* 改为半透明蓝色 */
margin: 10px 0;
display: block;
width: 100%;
}
/* 继承字体家族但保留自定义属性 */
.countdown-module .module-body {
text-align: center;
display: inline-flex;
flex-direction: column;
align-items: center;
gap: 4px;
max-width: 300px;
width: 100%;
margin: 0 auto;
font-family: inherit;
}
/* 倒计时显示 */
.countdown-module #countdown {
font-size: 1.1em !important;
font-weight: bold !important;
height: 1.2em;
opacity: 0;
transition: opacity 0.3s;
}
.countdown-module.loaded #countdown {
opacity: 1;
}
/* 标题样式 */
.countdown-module .module-title {
font-size: 1.1em !important;
font-weight: bold !important;
margin: 0;
font-family: inherit;
}
/* 链接样式 */
.countdown-module .module-link {
display: inline-block;
padding: 4px 12px;
border-radius: 8px;
border: 1px solid var(--primary-color);
transition: all 0.3s ease;
text-decoration: none;
margin: 4px 0;
background: transparent;
}
.countdown-module .module-link p {
font-size: 1.3em !important;
font-weight: bold !important;
color: var(--primary-color);
margin: 0;
font-family: inherit;
}
/* 悬停效果修改 */
.countdown-module .module-link:hover {
background: var(--hover-bg);
border-color: rgba(33, 150, 243, 0.4);
}
……
还让他写了个暂时不需要倒计时的代码(部分展示):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.countdown-module {
--primary-color: #2196f3;
--hover-bg: #bbdefb;
margin: 10px 0;
display: block;
width: 100%;
}
.countdown-module .module-body {
text-align: center;
display: inline-flex;
flex-direction: column;
align-items: center;
gap: 4px;
max-width: 300px;
width: 100%;
margin: 0 auto;
font-family: inherit;
}
.countdown-module .module-title {
font-size: 1.1em !important;
font-weight: bold !important;
margin: 0;
color: #666; /* 新增文字颜色 */
padding: 8px 0;
}
.countdown-module .module-link {
display: inline-block;
padding: 4px 12px;
border-radius: 8px;
border: 1px solid var(--primary-color);
transition: background 0.3s;
text-decoration: none;
margin: 4px 0;
}
.countdown-module .module-link p {
font-size: 1.3em !important;
font-weight: bold !important;
color: var(--primary-color);
margin: 0;
}
……
</html>
被他感动了😭
让DeepSeek帮我写一辈子代码吧😭
https://feng1026.top/shuoshuo/202505260055.html