打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模板:PageBanner/styles.css:修订间差异

来自Blockland Wiki
无编辑摘要
无编辑摘要
第1行: 第1行:
/* --- 1. 暴力隐藏 Citizen 自带的页面标题 --- */
/* --- 1. 隐藏 Citizen 原生标题 --- */
/* 只要用了这个模板,原来的标题就会消失 */
.mw-body-header {
.mw-body-header {
     display: none !important;
     display: none !important;
}
}


/* --- 2. PageBanner 容器 --- */
/* --- 2. Banner 主容器 --- */
.page-banner {
.page-banner {
     /* 核心:用负边距抵消 Citizen 的内边距,强制全宽 */
    position: relative;
     margin: -1.5rem -1.5rem 2rem -1.5rem;
     /* 高度 */
    height: 450px;
    /* 抵消顶部边距 */
     margin-top: -1.5rem;
    margin-bottom: 2rem;
    z-index: 1;
}
 
/* --- 3. 背景层(修正版) --- */
.page-banner-bg {
    position: absolute;
    top: 0;
    height: 100%;
      
      
     /* 高度:霸气一点,默认 450px 或 屏幕的一半 */
     /* 逃逸逻辑:撑满屏幕 */
     height: 50vh;  
     width: 100vw;
     min-height: 400px;
     left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
      
      
    position: relative;
     background-size: cover;
     background-size: cover;
     background-position: center center;
     background-position: center;
      
     z-index: -1;
    /* 弹性布局:让文字水平垂直居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
   
    overflow: hidden;
    border-radius: 0 0 8px 8px; /* 底部给点圆角,看着舒服 */
}
}


/* --- 3. 黑色遮罩 (保证白字看得清) --- */
/* === 核心修复:用伪元素模拟“渐隐遮罩” === */
.page-banner-mask {
/* 这一层盖在图片上,从透明渐变到页面背景色 */
.page-banner-bg::after {
    content: "";
     position: absolute;
     position: absolute;
     top: 0; left: 0; width: 100%; height: 100%;
     top: 0;
     background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    /* Citizen 皮肤变量:--color-surface-1 是正文背景色 */
    /* 意思是:上部透明,下部渐变到背景色,实现“融入”效果 */
     background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, var(--color-surface-1, #ffffff) 100%);
}
}


/* --- 4. 文字内容 --- */
/* --- 4. 内容层 --- */
.page-banner-text {
.page-banner-content {
     position: relative;
     position: relative;
    height: 100%;
    max-width: 100%;
   
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 靠下 */
    align-items: flex-start;  /* 靠左 */
   
    padding-bottom: 80px;
     z-index: 2;
     z-index: 2;
    text-align: center;
    width: 90%;
    color: #fff;
    text-shadow: 0 4px 8px rgba(0,0,0,0.8);
}
}


/* 大标题 (对应你要求的当地语言名称) */
/* --- 5. 文字样式 --- */
.page-banner-title {
.page-banner-local {
     font-size: 3.5rem;
    font-family: 'Linux Libertine', 'Georgia', serif;
     font-weight: 800;
     font-size: 4em;
     line-height: 1.2;
     font-weight: 900;
    font-family: 'Linux Libertine', 'Georgia', serif; /* 衬线体才有史诗感 */
    color: #ffffff;
     line-height: 1.1;
     margin: 0;
     margin: 0;
    /* 加强阴影,防止在浅色图上看不清 */
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}
.page-banner-en {
    font-family: sans-serif;
    font-size: 1.8em;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 5px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}
}


/* 适配手机 */
/* 移动端适配 */
@media screen and (max-width: 720px) {
@media screen and (max-width: 720px) {
     .page-banner { margin: -1rem -1rem 1.5rem -1rem; height: 35vh; }
     .page-banner { height: 300px; }
     .page-banner-title { font-size: 2.2rem; }
    .page-banner-local { font-size: 2.5em; }
     .page-banner-en { font-size: 1.2em; }
}
}

2026年1月30日 (五) 16:27的版本

/* --- 1. 隐藏 Citizen 原生标题 --- */
.mw-body-header {
    display: none !important;
}

/* --- 2. Banner 主容器 --- */
.page-banner {
    position: relative;
    /* 高度 */
    height: 450px; 
    /* 抵消顶部边距 */
    margin-top: -1.5rem; 
    margin-bottom: 2rem;
    z-index: 1;
}

/* --- 3. 背景层(修正版) --- */
.page-banner-bg {
    position: absolute;
    top: 0;
    height: 100%;
    
    /* 逃逸逻辑:撑满屏幕 */
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    
    background-size: cover;
    background-position: center;
    z-index: -1;
}

/* === 核心修复:用伪元素模拟“渐隐遮罩” === */
/* 这一层盖在图片上,从透明渐变到页面背景色 */
.page-banner-bg::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Citizen 皮肤变量:--color-surface-1 是正文背景色 */
    /* 意思是:上部透明,下部渐变到背景色,实现“融入”效果 */
    background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, var(--color-surface-1, #ffffff) 100%);
}

/* --- 4. 内容层 --- */
.page-banner-content {
    position: relative;
    height: 100%;
    max-width: 100%; 
    
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 靠下 */
    align-items: flex-start;   /* 靠左 */
    
    padding-bottom: 80px; 
    z-index: 2;
}

/* --- 5. 文字样式 --- */
.page-banner-local {
    font-family: 'Linux Libertine', 'Georgia', serif; 
    font-size: 4em;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    margin: 0;
    /* 加强阴影,防止在浅色图上看不清 */
    text-shadow: 0 4px 15px rgba(0,0,0,0.8); 
}

.page-banner-en {
    font-family: sans-serif;
    font-size: 1.8em;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
    margin-top: 5px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

/* 移动端适配 */
@media screen and (max-width: 720px) {
    .page-banner { height: 300px; }
    .page-banner-local { font-size: 2.5em; }
    .page-banner-en { font-size: 1.2em; }
}