Minecraft 下载 - 最新版本和历史版本
<!DOCTYPE html>
<html>
<head>
<title>Minecraft 下载页面</title>
<style>
/* 样式可以根据需要进行自定义 */
body {
font-family: Arial, sans-serif;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
h1 {
text-align: center;
color: #4CAF50;
font-size: 32px;
letter-spacing: 2px;
text-transform: uppercase;
}
.button {
display: inline-block;
padding: 10px 20px;
background-color: #4CAF50;
color: white;
text-decoration: none;
border-radius: 4px;
transition: background-color 0.3s;
margin-top: 10px;
}
.button:hover {
background-color: #45a049;
}
.dropdown-content {
display: none;
margin-top: 10px;
}
.dropdown-content a {
display: block;
padding: 10px;
text-decoration: none;
color: black;
font-size: 16px;
}
.slider {
width: 100%;
overflow: hidden;
position: relative;
margin-top: 20px;
}
.slider .slides {
display: flex;
transition: transform 0.3s ease-in-out;
}
.slider .slides img {
width: 100%;
}
.slider .prev,
.slider .next {
position: absolute;
top: 50%;
transform: translateY(-50%);
background-color: rgba(0, 0, 0, 0.5);
color: white;
padding: 10px;
text-decoration: none;
z-index: 1;
}
.slider .prev {
left: 10px;
}
.slider .next {
right: 10px;
}
</style>
<script>
// JavaScript部分用于实现下拉菜单的显示与隐藏
function toggleDropdown() {
var dropdown = document.getElementById("dropdown");
if (dropdown.style.display === "none" || dropdown.style.display === "") {
dropdown.style.display = "block";
} else {
dropdown.style.display = "none";
}
}
</script>
<script>
var slideIndex = 0;
var timer;
<pre><code>function showSlide(n) {
var slides = document.getElementsByClassName("slides")[0];
slides.style.transform = `translateX(-${n * 100}%)`;
}
function nextSlide() {
slideIndex++;
var slides = document.getElementsByClassName("slides")[0].getElementsByTagName("img");
if (slideIndex >= slides.length) {
slideIndex = 0;
}
showSlide(slideIndex);
}
function prevSlide() {
slideIndex--;
var slides = document.getElementsByClassName("slides")[0].getElementsByTagName("img");
if (slideIndex < 0) {
slideIndex = slides.length - 1;
}
showSlide(slideIndex);
}
function startTimer() {
timer = setInterval(nextSlide, 2000);
}
function resetTimer() {
clearInterval(timer);
startTimer();
}
document.addEventListener("DOMContentLoaded", function() {
showSlide(slideIndex);
startTimer();
});
document.addEventListener("keydown", function() {
resetTimer();
});
document.addEventListener("click", function() {
resetTimer();
});
</code></pre>
</script>
</head>
<body>
<div class="container">
<h1>Minecraft 下载</h1>
<pre><code><p>Minecraft</p>
<p><a>版本: 1.17.1</a><a>大小: 100 MB</a></p>
<a class="button" href="latest_version_download_link">下载</a>
<h2>历史版本下载</h2>
<button class="button" onclick="toggleDropdown()">选择版本</button>
<div id="dropdown" class="dropdown-content">
<a href="version1_download_link">1.16.5</a>
<a href="version2_download_link">1.15.2</a>
<a href="version3_download_link">1.14.4</a>
<!-- 添加更多历史版本的下载链接 -->
</div>
<h2>内容介绍</h2>
<p>这里可以写Minecraft的内容介绍。</p>
<h2>滑动浏览</h2>
<div class="slider">
<a class="prev" onclick="prevSlide()">&#10094;</a>
<div class="slides">
<img src="img/1.png" alt="Image 1">
<img src="img/2.png" alt="Image 2">
<img src="img/3.png" alt="Image 3">
<img src="img/4.png" alt="Image 4">
<img src="img/5.png" alt="Image 5">
</div>
<a class="next" onclick="nextSlide()">&#10095;</a>
</div>
</code></pre>
</div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/qcpb 著作权归作者所有。请勿转载和采集!