Skip to content

Commit

Permalink
Revert "feat: 适配手机端页面"
Browse files Browse the repository at this point in the history
This reverts commit cc96d9d.
  • Loading branch information
zhicbr committed Jan 24, 2025
1 parent c1ea7f1 commit 57148a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 77 deletions.
46 changes: 0 additions & 46 deletions css/mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,51 +83,5 @@
word-break: break-all;
}

/* Mobile menu */
.mobile-nav-toggle {
display: none;
}

.mobile-menu {
display: none;
position: fixed;
top: 60px;
right: 0;
background: var(--bg-color);
padding: 1rem;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
z-index: 1000;
}

.mobile-menu.active {
display: block;
}

.mobile-menu ul {
list-style: none;
padding: 0;
margin: 0;
}

.mobile-menu li {
margin: 0.5rem 0;
}

.mobile-menu a {
color: var(--text-color);
text-decoration: none;
font-size: 1rem;
}

@media (max-width: 768px) {
.mobile-nav-toggle {
display: block;
cursor: pointer;
padding: 0.5rem;
}

.nav-links {
display: none;
}
}
}
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>zhi的个人博客</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/mobile.css">
<link rel="stylesheet" href="css/dark.css" disabled id="dark-theme">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marked/lib/marked.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="shortcut icon" type="image/x-icon" href="/public/favicon.ico">

</head>
<body>
<header>
Expand All @@ -34,13 +34,14 @@

<footer>
<div class="footer-content">
<p>© 2025 我的个人博客</p>
<p>© 2025 我的个人博客
<!-- | 总访问量: <span id="visit-count">0</span> -->
</p>
</div>
</footer>

<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script type="module" src="js/main.js"></script>
<script src="js/mobile.js"></script>
</body>
</html>

Expand All @@ -56,4 +57,4 @@
(•ㅅ•) ||
/   づv
-->
-->
27 changes: 0 additions & 27 deletions js/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,7 @@ class MobileRouter {
document.head.appendChild(viewportMeta);
}

setupNavigation() {
const navToggle = document.createElement('div');
navToggle.className = 'mobile-nav-toggle';
navToggle.innerHTML = '<i class="fas fa-bars"></i>';
document.querySelector('.nav-content').appendChild(navToggle);

const mobileMenu = document.createElement('div');
mobileMenu.className = 'mobile-menu';
mobileMenu.innerHTML = `
<ul>
<li><a href="#home">首页</a></li>
<li><a href="#articles">文章</a></li>
<li><a href="#about">关于我</a></li>
</ul>
`;
document.body.appendChild(mobileMenu);

navToggle.addEventListener('click', () => {
mobileMenu.classList.toggle('active');
});

// Close menu when clicking outside
document.addEventListener('click', (e) => {
if (!navToggle.contains(e.target) && !mobileMenu.contains(e.target)) {
mobileMenu.classList.remove('active');
}
});
}

handleLocation() {
const hash = window.location.hash.slice(1) || 'home';
Expand Down

0 comments on commit 57148a4

Please sign in to comment.