-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
--- | ||
layout: default | ||
--- | ||
<div class="splash"> | ||
<div class="splash-content"> | ||
<img src="{{ '/assets/images/logo.png' | relative_url }}" alt="Project Logo"> | ||
<h1>ChinaComX</h1> | ||
<p>Exploring beyond the Silk Road</p> | ||
<a href="#posts" class="scroll-down">↓</a> | ||
</div> | ||
</div> | ||
<section id="posts" class="content"> | ||
<div class="container"> | ||
<h2>Latest Posts</h2> | ||
{% for post in site.posts %} | ||
<article> | ||
<h3><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h3> | ||
<p>{{ post.excerpt }}</p> | ||
</article> | ||
{% endfor %} | ||
</div> | ||
</section> | ||
<!DOCTYPE html> | ||
<html lang="en" class="home"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>{{ page.title | default: site.title }}</title> | ||
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}"> | ||
</head> | ||
<body class="home"> | ||
{% include header.html %} | ||
<main> | ||
{{ content }} | ||
</main> | ||
{% include footer.html %} | ||
<script src="{{ '/assets/js/main.js' | relative_url }}"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
document.addEventListener("DOMContentLoaded", function() { | ||
const header = document.getElementById("header"); | ||
window.addEventListener("scroll", function() { | ||
if (window.scrollY > 0) { | ||
header.classList.add("show"); | ||
} else { | ||
header.classList.remove("show"); | ||
} | ||
}); | ||
if (document.body.classList.contains('home')) { | ||
window.addEventListener("scroll", function() { | ||
if (window.scrollY > 0) { | ||
header.classList.remove("hide"); | ||
header.classList.add("show"); | ||
} else { | ||
header.classList.remove("show"); | ||
header.classList.add("hide"); | ||
} | ||
}); | ||
} else { | ||
header.classList.add("show"); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters