Skip to content

Commit

Permalink
mc
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomayisjh committed Jan 25, 2024
0 parents commit 81347f3
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/mc.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added files/Plain Craft Launcher 2.exe
Binary file not shown.
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Xiaomayisjh's Minecraft Server</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Xiaomayisjh's Minecraft Server</h1>
<h2>bj3.mossfrp.cn:42031</h2>
<button class="copy-button" onclick="copyToClipboard()">Copy</button>
<div class="language-toggle">
<button onclick="switchLanguage('en')">English</button>
<button onclick="switchLanguage('zh')">中文</button>
</div>
<div id="description" class="description">
<!-- Description content will be updated dynamically -->
</div>
<button id="downloadButton" class="download-button" onclick="downloadServer()">Download PCL 2.0</button>
</div>
<script src="script.js"></script>
</body>
</html>
35 changes: 35 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const descriptions = {
en: "Welcome to the Minecraft server in Class 7! Explore our wonderful world. \nVersion 1.20.2 original, username only supports English and numbers.\nBackup Download:",
zh: "欢迎来到7班的Minecraft服务器!探索我们的精彩世界\n版本号1.20.2原版,用户名仅支持英文及数字\n备用下载:https://ltcat.lanzoum.com/b0aj6gsid(提取码:pcl2)"
};

function switchLanguage(language) {
document.getElementById('description').innerText = descriptions[language];
}

function downloadServer(url) {
// Add your download logic here
alert("Downloading...");
function downloadServer(url) {
const a = document.createElement('a');
a.href = url;
a.download = '文件名';
a.style.display = 'none';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}

downloadServer('https://gitee.com/xiaomayisjh/mc/raw/master/Plain%20Craft%20Launcher%202.exe');
}
function copyToClipboard() {
const h2 = document.querySelector('h2');
const range = document.createRange();
const selection = window.getSelection();
range.selectNodeContents(h2);
selection.removeAllRanges();
selection.addRange(range);
document.execCommand('copy');
selection.removeAllRanges();
alert('服务器地址已复制到剪贴板,请粘贴至多人游戏的"添加服务器"中');
}
40 changes: 40 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
text-align: center;
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.language-toggle button {
margin: 5px;
padding: 8px 16px;
font-size: 14px;
cursor: pointer;
}

.description {
margin-top: 20px;
}

.download-button {
margin-top: 20px;
padding: 10px 20px;
font-size: 18px;
background-color: #4caf50;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}

0 comments on commit 81347f3

Please sign in to comment.