MediaWiki:Common.css: Difference between revisions

From yangwa
No edit summary
No edit summary
Line 1: Line 1:
/* === 首页专用样式:将顶部导航栏移到底部 === */
/* === 首页样式:干净顶部 + 鼠标悬停显示导航 === */


/* 1. 把顶部区域移到底部 */
/* 1. 首页导航栏初始隐藏,鼠标移入顶部再显示 */
body.page-Main_Page #mw-head-base,
body.page-Main_Page #mw-head-base,
body.page-Main_Page #mw-head,
body.page-Main_Page #p-personal,
body.page-Main_Page #p-personal,
body.page-Main_Page #mw-panel {
body.page-Main_Page #mw-panel,
  position: fixed !important;
body.page-Main_Page #mw-page-base,
  top: auto !important;
body.page-Main_Page #mw-head {
  bottom: 0 !important;
   opacity: 0;
  width: 100%;
   pointer-events: none;
  z-index: 999;
   transition: opacity 0.4s ease;
  background-color: #f8f9fa;
  padding: 10px 20px;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
   display: flex !important;
   justify-content: space-between;
   align-items: center;
}
}


/* 2. 避免内容被导航遮住 */
body.page-Main_Page:hover #mw-head-base,
body.page-Main_Page #content {
body.page-Main_Page:hover #p-personal,
   margin-bottom: 140px !important;
body.page-Main_Page:hover #mw-panel,
body.page-Main_Page:hover #mw-page-base,
body.page-Main_Page:hover #mw-head {
   opacity: 1;
  pointer-events: auto;
}
}


/* 3. 隐藏首页的大标题(Main Page) */
/* 2. 隐藏首页标题“Main Page” */
body.page-Main_Page .firstHeading {
body.page-Main_Page .firstHeading {
   display: none !important;
   display: none !important;
}
}


/* 4. 隐藏 logo 旁边的 wiki 名字 */
/* 3. 隐藏 logo 右侧的 wiki 名字 */
body.page-Main_Page .mw-logo-wordmark {
body.page-Main_Page .mw-logo-wordmark {
   display: none !important;
   display: none !important;
}
}


/* 5. 可选:测试首页是否成功加载了 CSS */
/* 4. 可选:设置首页背景色(如你喜欢淡色) */
body.page-Main_Page {
body.page-Main_Page {
   background-color: #fffff5 !important; /* 淡米色背景,测试用 */
   background-color: #121212 !important; /* 暗色主题背景,可改为 #fefefe */
  color: #eeeeee;
}
}

Revision as of 01:10, 12 April 2025

/* === 首页样式:干净顶部 + 鼠标悬停显示导航 === */

/* 1. 首页导航栏初始隐藏,鼠标移入顶部再显示 */
body.page-Main_Page #mw-head-base,
body.page-Main_Page #p-personal,
body.page-Main_Page #mw-panel,
body.page-Main_Page #mw-page-base,
body.page-Main_Page #mw-head {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

body.page-Main_Page:hover #mw-head-base,
body.page-Main_Page:hover #p-personal,
body.page-Main_Page:hover #mw-panel,
body.page-Main_Page:hover #mw-page-base,
body.page-Main_Page:hover #mw-head {
  opacity: 1;
  pointer-events: auto;
}

/* 2. 隐藏首页标题“Main Page” */
body.page-Main_Page .firstHeading {
  display: none !important;
}

/* 3. 隐藏 logo 右侧的 wiki 名字 */
body.page-Main_Page .mw-logo-wordmark {
  display: none !important;
}

/* 4. 可选:设置首页背景色(如你喜欢淡色) */
body.page-Main_Page {
  background-color: #121212 !important; /* 暗色主题背景,可改为 #fefefe */
  color: #eeeeee;
}