模板:IdeologyCompass/styles.css:修订间差异
来自Blockland Wiki
更多操作
创建页面,内容为“→容器:强制正方形 (兼容写法): .ideology-compass { display: block; position: relative; width: 100%; height: 0; padding-bottom: 100%; →核心:用padding撑开高度,保持1:1: box-sizing: border-box; →边框: border: 1px solid #a2a9b1; border: 1px solid var(--border-color-base, #a2a9b1); →背景色: background-color: #ffffff; background-color: var(--background-color-surface,…” |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
/* | /* 容器:卡片式设计 */ | ||
.ideology-compass { | .ideology-compass { | ||
display: block; | display: block; | ||
| 第5行: | 第5行: | ||
width: 100%; | width: 100%; | ||
height: 0; | height: 0; | ||
padding-bottom: 100%; | padding-bottom: 100%; | ||
box-sizing: border-box; | box-sizing: border-box; | ||
/* | /* 背景透明 */ | ||
background-color: transparent; | |||
/* | /* 字体优化:回退到安全字体 */ | ||
font-family: sans-serif; | |||
font-weight: bold; | |||
margin: 0 auto; | |||
/* | /* ==== 修复 1:把变量改成简单的十六进制颜色 ==== */ | ||
/* 原来的写法被拦截了,现在用纯灰色 (#eeeeee) 画网格,安全稳过 */ | |||
background-image: | background-image: | ||
linear-gradient(to right | linear-gradient(to right, #eeeeee 1px, transparent 1px), | ||
linear-gradient(to bottom | linear-gradient(to bottom, #eeeeee 1px, transparent 1px); | ||
background-size: | background-size: 20% 20%; | ||
background-position: center; | background-position: center; | ||
} | } | ||
/* | /* 坐标轴:Y轴 (中心竖线) */ | ||
.ideology-compass::before { | |||
content: ''; | |||
position: absolute; | |||
top: 5%; | |||
bottom: 5%; | |||
left: 50%; | |||
width: 2px; | |||
/* 修复:用简单的颜色 */ | |||
background: #333333; | |||
opacity: 0.5; | |||
transform: translateX(-50%); | |||
z-index: 0; | |||
} | |||
/* 坐标轴:X轴 (中心横线) */ | |||
.ideology-compass::after { | |||
content: ''; | |||
position: absolute; | |||
left: 5%; | |||
right: 5%; | |||
top: 50%; | |||
height: 2px; | |||
/* 修复:用简单的颜色 */ | |||
background: #333333; | |||
opacity: 0.5; | |||
transform: translateY(-50%); | |||
z-index: 0; | |||
} | |||
/* 轴线标签 */ | |||
.compass-label { | .compass-label { | ||
position: absolute; | position: absolute; | ||
font-size: 0. | font-size: 0.75em; | ||
font-weight: | font-weight: 800; | ||
color: # | text-transform: uppercase; | ||
letter-spacing: 1px; | |||
color: #888888; | |||
/* ==== 修复 2:删掉了 pointer-events: none; (这是第54行的报错原因) ==== */ | |||
text-shadow: 0 0 2px #ffffff; | |||
z-index: 1; | z-index: 1; | ||
} | } | ||
.compass-label.top { top: 0; left: 50%; transform: translateX(-50%); } | |||
.compass-label.top { top: | .compass-label.bottom { bottom: 0; left: 50%; transform: translateX(-50%); } | ||
.compass-label.bottom { bottom: | /* 旋转文字需要 block 属性支持 */ | ||
.compass-label.left { top: 50%; left: | .compass-label.left { top: 50%; left: 0; transform: translateY(-50%) rotate(-90deg); display: block; } | ||
.compass-label.right { top: 50%; right: | .compass-label.right { top: 50%; right: 0; transform: translateY(-50%) rotate(90deg); display: block; } | ||
/* 定位点容器 */ | /* 定位点容器 */ | ||
.compass-point { | .compass-point { | ||
position: absolute; | position: absolute; | ||
transform: translate(-50%, -50%); | transform: translate(-50%, -50%); | ||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
| 第53行: | 第86行: | ||
justify-content: center; | justify-content: center; | ||
z-index: 10; | z-index: 10; | ||
width: auto; | width: auto; | ||
} | } | ||
/* | /* 那个点 */ | ||
.compass-dot { | .compass-dot { | ||
display: block; | display: block; | ||
width: | width: 14px; | ||
height: | height: 14px; | ||
background-color: #3366cc; | background-color: #3366cc; /* 默认蓝 */ | ||
border: 2px solid #ffffff; | border: 2px solid #ffffff; | ||
border-radius: 50%; | border-radius: 50%; | ||
box-shadow: 0 0 8px rgba(0,0,0,0.3); | |||
} | } | ||
/* | /* 文字标签:气泡风格 */ | ||
.compass-text { | .compass-text { | ||
display: block; | display: block; | ||
margin-top: | margin-top: 6px; | ||
font-size: 0. | font-size: 0.8em; | ||
font-weight: bold; | |||
padding: 2px 6px; | |||
padding: 2px | |||
background-color: #ffffff; | background-color: #ffffff; | ||
border: 1px solid #cccccc; | |||
border-radius: 10px; | |||
box-shadow: 0 2px 4px rgba(0,0,0,0.1); | |||
/* | /* 防止文字竖排爆炸 */ | ||
white-space: nowrap; | |||
} | } | ||
2026年2月11日 (三) 15:32的版本
/* 容器:卡片式设计 */
.ideology-compass {
display: block;
position: relative;
width: 100%;
height: 0;
padding-bottom: 100%;
box-sizing: border-box;
/* 背景透明 */
background-color: transparent;
/* 字体优化:回退到安全字体 */
font-family: sans-serif;
font-weight: bold;
margin: 0 auto;
/* ==== 修复 1:把变量改成简单的十六进制颜色 ==== */
/* 原来的写法被拦截了,现在用纯灰色 (#eeeeee) 画网格,安全稳过 */
background-image:
linear-gradient(to right, #eeeeee 1px, transparent 1px),
linear-gradient(to bottom, #eeeeee 1px, transparent 1px);
background-size: 20% 20%;
background-position: center;
}
/* 坐标轴:Y轴 (中心竖线) */
.ideology-compass::before {
content: '';
position: absolute;
top: 5%;
bottom: 5%;
left: 50%;
width: 2px;
/* 修复:用简单的颜色 */
background: #333333;
opacity: 0.5;
transform: translateX(-50%);
z-index: 0;
}
/* 坐标轴:X轴 (中心横线) */
.ideology-compass::after {
content: '';
position: absolute;
left: 5%;
right: 5%;
top: 50%;
height: 2px;
/* 修复:用简单的颜色 */
background: #333333;
opacity: 0.5;
transform: translateY(-50%);
z-index: 0;
}
/* 轴线标签 */
.compass-label {
position: absolute;
font-size: 0.75em;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 1px;
color: #888888;
/* ==== 修复 2:删掉了 pointer-events: none; (这是第54行的报错原因) ==== */
text-shadow: 0 0 2px #ffffff;
z-index: 1;
}
.compass-label.top { top: 0; left: 50%; transform: translateX(-50%); }
.compass-label.bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
/* 旋转文字需要 block 属性支持 */
.compass-label.left { top: 50%; left: 0; transform: translateY(-50%) rotate(-90deg); display: block; }
.compass-label.right { top: 50%; right: 0; transform: translateY(-50%) rotate(90deg); display: block; }
/* 定位点容器 */
.compass-point {
position: absolute;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 10;
width: auto;
}
/* 那个点 */
.compass-dot {
display: block;
width: 14px;
height: 14px;
background-color: #3366cc; /* 默认蓝 */
border: 2px solid #ffffff;
border-radius: 50%;
box-shadow: 0 0 8px rgba(0,0,0,0.3);
}
/* 文字标签:气泡风格 */
.compass-text {
display: block;
margin-top: 6px;
font-size: 0.8em;
font-weight: bold;
padding: 2px 6px;
background-color: #ffffff;
border: 1px solid #cccccc;
border-radius: 10px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
/* 防止文字竖排爆炸 */
white-space: nowrap;
}