MediaWiki:Common.js

来自赛尔号精灵图鉴
225940114留言 | 贡献2025年5月10日 (六) 16:35的版本
跳转到导航 跳转到搜索

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */
$(function () {
  // 只在条目页面生效,不影响首页/编辑页等
  if (mw.config.get("wgNamespaceNumber") === 0) {
    $('<a href="/index.php/首页" id="return-home-button">← 返回首页</a>')
      .appendTo('body');
  }
});

<style>
.stat-calc {
  background: rgba(255,255,255,0.8);
  padding: 15px;
  border-radius: 10px;
  max-width: 600px;
  margin: 0 auto;
  font-family: sans-serif;
}
.config-block {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.config-block label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.stat-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.stat-table th, .stat-table td {
  border: 1px solid #ccc;
  padding: 5px;
  text-align: center;
}
.stat-table input {
  width: 60px;
}
.result {
  font-weight: bold;
  color: #FF6600;
}
#calc-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}
#calc-btn:hover {
  background: #45a049;
}
</style>
👥 当前在线人数:65