test
This commit is contained in:
parent
bf80fbc281
commit
81fa9b8a4e
3
.gitignore
vendored
3
.gitignore
vendored
@ -14,7 +14,7 @@ obj/
|
||||
|
||||
# 忽略整個資料夾
|
||||
txt/
|
||||
themes/
|
||||
themes/superstar/*
|
||||
sounds/
|
||||
publish/
|
||||
news/
|
||||
@ -22,6 +22,5 @@ foods/
|
||||
db/
|
||||
|
||||
# 但保留 themes/superstar/_www 底下的所有內容
|
||||
!themes/superstar/
|
||||
!themes/superstar/_www/
|
||||
!themes/superstar/_www/**
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB |
@ -1,288 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Super Star</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
.container {
|
||||
text-align: center;
|
||||
margin: 20px;
|
||||
}
|
||||
.header {
|
||||
background: #D32F2F;
|
||||
padding: 10px 0;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
}
|
||||
.banner {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
margin: 0 auto 20px;
|
||||
}
|
||||
.banner img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.menu-toggle {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.menu {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 250px;
|
||||
background: white;
|
||||
transform: translateX(-250px);
|
||||
transition: transform 0.3s ease;
|
||||
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.menu.active {
|
||||
transform: translateX(0);
|
||||
}
|
||||
.menu ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.menu ul li {
|
||||
padding: 15px 20px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.menu ul li a {
|
||||
text-decoration: none;
|
||||
color: #333;
|
||||
display: block;
|
||||
}
|
||||
.menu ul li a:hover {
|
||||
background: #eee;
|
||||
}
|
||||
.container {
|
||||
margin: 20px;
|
||||
}
|
||||
.button-container {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.content {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 10px;
|
||||
padding: 10px 20px;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
justify-content: center;
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.content {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 400px) {
|
||||
.content {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: auto;
|
||||
max-width: 160px;
|
||||
}
|
||||
}
|
||||
.card {
|
||||
width: 100%;
|
||||
max-width: 180px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: linear-gradient(135deg, #FF4081, #FF4081);
|
||||
color: white;
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
}
|
||||
.card:hover {
|
||||
transform: scale(1.05); /* 增加按鈕的點擊反應 */
|
||||
}
|
||||
.card img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
.section {
|
||||
display: none;
|
||||
}
|
||||
.section.active {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">超級巨星 自助式KTV</div>
|
||||
|
||||
<!-- Add Banner -->
|
||||
<div class="banner">
|
||||
<img src="手機點歌/LOGO_721x211px.png" alt="超級巨星 Banner">
|
||||
</div>
|
||||
|
||||
<div class="menu-toggle">
|
||||
<svg height="32px" id="Layer_1" style="enable-background:new 0 0 32 32;" version="1.1" viewBox="0 0 32 32" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M4,10h24c0.553,0,1-0.447,1-1s-0.447-1-1-1H4c-0.553,0-1,0.447-1,1S3.447,10,4,10z"/><path d="M28,15H4c-0.553,0-1,0.447-1,1s0.447,1,1,1h24c0.553,0,1-0.447,1-1S28.553,15,28,15z"/><path d="M28,22H4c-0.553,0-1,0.447-1,1s0.447,1,1,1h24c0.553,0,1-0.447,1-1S28.553,22,28,22z"/></svg>
|
||||
</div>
|
||||
|
||||
<div class="menu">
|
||||
<ul>
|
||||
<li><a href="windows.html" class="menu-link">首頁</a></li>
|
||||
<li><a href="new-songs.html" class="menu-link">新歌快報</a></li>
|
||||
<li><a href="top-ranking.html" class="menu-link">熱門排行</a></li>
|
||||
<li><a href="search-singer.html" class="menu-link">歌星查詢</a></li>
|
||||
<li><a href="search-song.html" class="menu-link">歌名查詢</a></li>
|
||||
<li><a href="clicked-song.html" class="menu-link">已點歌曲</a></li>
|
||||
<!-- <!-- //<li><a href="my-favorite.html" class="menu-link">我的最愛</a></li> -->
|
||||
<li><a href="sound-control.html" class="menu-link">聲音控制</a></li>
|
||||
<li><a href="social-media.html" class="menu-link">社群媒體</a></li>
|
||||
<li><a href="love-message.html" class="menu-link">真情告白</a></li>
|
||||
<li><a href="mood-stickers.html" class="menu-link">心情貼圖</a></li>
|
||||
<!-- <li><a href="song-order.html" class="menu-link">輸入點歌序號</a></li>
|
||||
<li><a href="profile-settings.html" class="menu-link">會員資料設定</a></li>
|
||||
<li><a href="register.html" class="menu-link">註冊會員</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="button-container">
|
||||
<div class="content">
|
||||
<div class="card" onclick="location.href='new-songs.html'">
|
||||
<img src="手機點歌/首頁_工作區域 1.png" alt="New Song">
|
||||
</div>
|
||||
<div class="card" onclick="location.href='top-ranking.html'">
|
||||
<img src="手機點歌/首頁-02.png" alt="Top Ranking">
|
||||
</div>
|
||||
<div class="card" onclick="location.href='search-singer.html'">
|
||||
<img src="手機點歌/首頁-03.png" alt="Search Singer">
|
||||
</div>
|
||||
<div class="card" onclick="location.href='search-song.html'">
|
||||
<img src="手機點歌/首頁-04.png" alt="Search Song">
|
||||
</div>
|
||||
<div class="card" onclick="orderSongAndNavigate()">
|
||||
<img src="手機點歌/首頁-05.png" alt="Clicked Song">
|
||||
</div>
|
||||
<!-- <div class="card" onclick="location.href='my-favorite.html'">
|
||||
<img src="手機點歌/首頁-06.png" alt="My Favorite">
|
||||
</div> -->
|
||||
<div class="card" onclick="location.href='sound-control.html'">
|
||||
<img src="手機點歌/首頁-07.png" alt="Sound Control">
|
||||
</div>
|
||||
<div class="card" onclick="location.href='social-media.html'">
|
||||
<img src="手機點歌/首頁-08.png" alt="Social Media">
|
||||
</div>
|
||||
<div class="card" onclick="location.href='love-message.html'">
|
||||
<img src="手機點歌/首頁-09.png" alt="Social Media">
|
||||
</div>
|
||||
<div class="card" onclick="location.href='mood-stickers.html'">
|
||||
<img src="手機點歌/首頁-10.png" alt="Social Media">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var randomFolder = '4obx3kbi5ji'; // 這裡的 'abc123' 應由服務器生成並注入
|
||||
|
||||
// 獲取當前頁面的 URL
|
||||
var currentURL = window.location.href;
|
||||
|
||||
// 檢查是否包含正確的隨機亂碼
|
||||
if (!currentURL.includes('/' + randomFolder + '/')) {
|
||||
// 如果不包含正確的亂碼,顯示錯誤或跳轉到正確的頁面
|
||||
document.body.innerHTML = '<h1>403 Forbidden: Invalid Access</h1>';
|
||||
// 也可以重定向到正確的頁面
|
||||
// window.location.href = `http://${window.location.hostname}/${randomFolder}/index.html`;
|
||||
}
|
||||
|
||||
// 首先處理導航 - 確保最高優先級
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// 導航處理
|
||||
const menuLinks = document.querySelectorAll('.menu-link');
|
||||
menuLinks.forEach(link => {
|
||||
// 移除所有現有的事件監聽器
|
||||
const oldLink = link.cloneNode(true);
|
||||
link.parentNode.replaceChild(oldLink, link);
|
||||
|
||||
// 添加新的點擊處理
|
||||
oldLink.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
const href = this.getAttribute('href');
|
||||
if (href) {
|
||||
window.location.href = href;
|
||||
}
|
||||
}, true); // 使用捕獲階段
|
||||
});
|
||||
|
||||
// 菜單切換
|
||||
const menuToggle = document.querySelector('.menu-toggle');
|
||||
const menu = document.querySelector('.menu');
|
||||
|
||||
if (menuToggle && menu) {
|
||||
menuToggle.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
menu.classList.toggle('active');
|
||||
}, true);
|
||||
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!menu.contains(e.target) && !menuToggle.contains(e.target)) {
|
||||
menu.classList.remove('active');
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
});
|
||||
|
||||
function orderSongAndNavigate() {
|
||||
// 先發送 POST 請求到本機伺服器
|
||||
fetch('/ordered-song', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: null
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
console.log('Request successful:', data);
|
||||
// 請求成功後導向到 clicked-song.html
|
||||
location.href = 'clicked-song.html';
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('There was a problem with the request:', error);
|
||||
// 可以在這裡顯示錯誤信息或進行其他錯誤處理
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user