Skip to content

Commit 8f787f2

Browse files
committed
feat: add fold button for news
1 parent e685af1 commit 8f787f2

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

content/home/news.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ title: News
2323
* [01/25/2024] $10K Bug Bounty from Google v8CTF (V8/CVE-2023-6702).
2424
* [10/25/2023] We got 2nd place in [cyber security challenge 2023](https://sec-challenge.kr/main)!
2525
* [10/04/2023] $67K Bug Bounty from Google kernelCTF (Linux/CVE-2023-3390).
26-
<!--
2726
* [07/17/2023] QSYM got a Frontiers of Science Award from [ICSB](https://www.icbs.cn/)!
2827
* [06/06/2023] BaseComp is accepted to [Usenix Security'23](https://www.usenix.org/conference/usenixsecurity23)!
2928
* [01/19/2023] $7K Bug Bounty from Google (V8/CVE-2023-0696).
@@ -33,4 +32,43 @@ title: News
3332
* [06/11/2022] FuzzCoin is accepted to [RAID'22](https://raid2022.cs.ucy.ac.cy/index.html)!
3433
* [09/04/2021] DoLTEst is conditionally accepted to [Usenix Security'22](https://www.usenix.org/conference/usenixsecurity22)!
3534
* [07/21/2021] HardsHeap is conditionally accepted to [CCS'21](https://www.sigsac.org/ccs/CCS2021/)!
36-
-->
35+
36+
37+
<script>
38+
document.addEventListener("DOMContentLoaded", function () {
39+
const section = document.querySelector("#news");
40+
if (!section) return;
41+
42+
const list = section.querySelector("ul");
43+
if (!list) return;
44+
45+
const items = list.querySelectorAll("li");
46+
const moreLink = document.createElement("a");
47+
moreLink.href = "#";
48+
moreLink.textContent = "Show more";
49+
moreLink.style.marginTop = "10px";
50+
moreLink.style.display = "block";
51+
moreLink.style.cursor = "pointer";
52+
moreLink.style.textDecoration = "underline";
53+
54+
let isExpanded = false;
55+
56+
items.forEach((item, index) => {
57+
if (index >= 10) {
58+
item.style.display = "none";
59+
}
60+
});
61+
62+
moreLink.addEventListener("click", (e) => {
63+
e.preventDefault();
64+
isExpanded = !isExpanded;
65+
items.forEach((item, index) => {
66+
if (index >= 10) {
67+
item.style.display = isExpanded ? "block" : "none";
68+
}
69+
});
70+
moreLink.textContent = isExpanded ? "Show less" : "Show more";
71+
});
72+
list.parentNode.insertBefore(moreLink, list.nextSibling);
73+
});
74+
</script>

0 commit comments

Comments
 (0)