npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ddj-v2/realboard

v0.1.0

Published

Hydro OJ 即時滾動賽榜插件 Realboard - forked from HandsomeRun and based on Hydro onsite-toolkit (AGPL-3.0)

Readme

Realboard - HydroOJ 即時滾榜插件

項目來源說明: 本項目是基於 Hydro 官方 onsite-toolkit 的 fork 版本,遵循 GNU Affero General Public License v3.0 (AGPL-3.0) 開源協議。

這是一個為 HydroOJ 系統設計的插件,旨在提供一個功能豐富、動畫流暢的即時比賽排名展示板(滾榜)。它透過 WebSocket 接收即時的提交數據,並以動態、可視化的方式將其呈現給觀眾。

效果展示

  1. 進入

進入

  1. 封榜前+排名變化

封榜前+排名變化

  1. 封榜後

封榜后

✨ 主要功能

  • 雙階段提交流程:

    • A 階段 (Pending): 新的提交會首先進入一個獨立的"等待評測"區域,以橙黃色閃爍效果顯示,此時不影響隊伍的現有排名。
    • B 階段 (Final Verdict): 當評測結果返回後,對應的"等待評測"項會消失,同時最終結果會作為一個新的條目,從B區底部平滑滑入,並根據評測結果更新隊伍的排名和得分。
  • 分離的顯示區域:

    • B 區 (主榜單): 位於上方,用於展示獲得最終結果的提交。該區域可容納最多9條記錄,並帶有微妙的奇偶行背景色區分,視覺上清晰明了。
    • A 區 (等待區): 位於下方,同一時間只展示一個"等待評測"的提交,後續的提交會進入一個待處理隊列,依次顯示。
  • 流暢的動畫效果:

    • 使用 react-spring 驅動所有動畫,確保了流暢性和高性能。
    • 新的B階段條目會從榜單底部滑入指定位置,而不會干擾或"推開"已經存在的條目。
    • A階段到B階段的切換自然、無縫。
  • 完善的封榜邏輯 (Freeze):

    • 當比賽進入凍結時間後,所有新的提交雖然仍會顯示,但其最終結果會被標記為 FROZEN
    • 封榜後的提交不會影響隊伍在公開榜單上的排名、得分和罰時,完美模擬真實比賽的封榜場景。
  • 健壯的狀態管理:

    • 使用 React Hooks 和統一的狀態管理邏輯,確保即使在短時間內收到大量並發提交時,系統也能獨立、正確地處理每一個提交的狀態和動畫,避免了狀態錯亂或動畫異常。
    • 能夠正確處理重複提交已AC題目的情況(顯示提交結果但不影響分數)。
  • 技術棧:

    • 前端框架: React
    • 語言: TypeScript
    • 動畫庫: react-spring
    • 即時通信: WebSocket

🚀 如何使用

  1. 先執行 hydrooj addon create 命令(如果您還沒有執行過)。
  2. 將該插件放置於 HydroOJ 的 /root/.hydro/addons/ 目錄下。
  3. 進入 /root/.hydro/addons/realboard/ 目錄下,執行 yarn install 命令。
  4. 使用 pm2 restart hydrooj 重啟。
  5. 可以在 acm 賽制的 scoreboard 中看到,請確保您有看到隱藏榜單的權限 PERM_VIEW_CONTEST_HIDDEN_SCOREBOARD

⚙️ 配置項

目前,大部分配置項都在前端代碼中以常數的形式定義:

  • frontend/realboard.page.tsx:
    • MAX_QUEUE: B 區榜單可以顯示的最大條目數(當前為 9)。
    • FADEOUT_TIME: 條目在榜單上顯示的最長時間(默認為 5000 毫秒)。

您可以根據需要直接修改這些常數來調整滾榜的行為。

📄 版權和許可證

本項目由 fdhscpp 維護,fork 自 HandsomeRun/hydro-realboard,並基於 Hydro 官方 onsite-toolkit 開發,遵循 GNU Affero General Public License v3.0 (AGPL-3.0) 開源協議。

原始項目

Fork 來源

本項目的修改

本項目在原始 onsite-toolkit 的基礎上進行了以下主要改進:

  • 實現了雙階段提交流程(Pending 和 Final Verdict)
  • 新增了分離的顯示區域(A 區和 B 區)
  • 最佳化了動畫效果和使用者體驗
  • 完善了封榜邏輯

根據 AGPL-3.0 協議的要求,如果您在網路伺服器上執行本軟體的修改版本,您必須向該伺服器的使用者提供修改版本的原始碼。

版權聲明

  • Copyright (c) 2025 HandsomeRun
  • Copyright (c) 2026 fdhscpp (fork modifications)
  • Copyright (c) Hydro 開發團隊 (upstream onsite-toolkit)

🤝 貢獻

歡迎提交 Issue 和 Pull Request 來改進這個項目。請確保您的貢獻也遵循 AGPL-3.0 協議。