|
|
如下是没有动态效果的代码:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.bdworld {
background: #8b0000; /* 深红衬托主广告条 */
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
padding: 12px;
}
/* 主广告条容器:20:1 宽高比,大红色背景,金色光晕 */
.banner {
width: 100%;
max-width: 2000px; /* 模拟8K宽度 (2000px是示例,比例保持20:1) */
aspect-ratio: 20 / 1;
background: #e60012; /* 正宗中国大红 */
/* 喜庆金色光晕 + 极简科技底纹 */
background-image:
radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.25) 0%, transparent 40%),
radial-gradient(circle at 80% 50%, rgba(255, 215, 0, 0.2) 0%, transparent 45%),
repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 2px, transparent 2px, transparent 8px);
border-radius: 4px; /* 轻微圆角,更现代 */
box-shadow: 0 10px 25px rgba(0,0,0,0.3);
/* 内边距保证文字不贴边 */
padding: 0 2.5%;
/* 弹性布局,左中右分栏,垂直居中 */
display: flex;
align-items: center;
justify-content: space-between;
/* 相对定位用于放置伪元素底纹 */
position: relative;
color: #fff; /* 基础文字白色,部分单独设置金色 */
overflow: hidden; /* 隐藏超出部分,保持边界干净 */
}
/* 二进制/代码底纹 (极淡科技氛围) */
.banner::after {
content: "0101 CSP 1010 J/S 1100 金牌 0101 CSP 1010 J/S 1100 0101";
position: absolute;
bottom: 5%;
right: 2%;
font-family: 'Courier New', monospace;
font-size: clamp(8px, 1.2vw, 18px);
color: rgba(255, 255, 255, 0.1);
white-space: nowrap;
pointer-events: none;
transform: rotate(-2deg);
letter-spacing: 2px;
z-index: 0;
}
/* 左侧 金牌图标 + 主标题 */
.left {
display: flex;
align-items: center;
gap: 1.2vw;
z-index: 2;
flex-shrink: 0;
}
/* 金牌图标 (金色) */
.medal-icon {
font-size: clamp(24px, 4vh, 60px);
color: #FFD700; /* 金色 */
filter: drop-shadow(0 2px 5px rgba(218, 165, 32, 0.6));
background: rgba(255,255,240,0.1);
border-radius: 50%;
padding: 0.2em;
}
/* 左侧标题组 (两行) */
.title-group {
display: flex;
flex-direction: column;
justify-content: center;
line-height: 1.2;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.title-line1 {
font-size: clamp(14px, 2.2vw, 38px);
font-weight: 700;
color: #ffffff;
letter-spacing: 0.5px;
white-space: nowrap;
}
.title-line2 {
font-size: clamp(14px, 2vw, 34px);
font-weight: 800;
color: #FFD700; /* 金色 */
white-space: nowrap;
text-shadow: 0 0 8px #ffb347;
}
/* 中部 师资亮点 (两行) */
.center {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
z-index: 2;
flex-shrink: 1;
padding: 0 1vw;
line-height: 1.2;
text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}
.teacher-line1 {
font-size: clamp(12px, 1.8vw, 32px);
font-weight: 600;
color: #ffffff;
white-space: nowrap;
}
.teacher-line2 {
font-size: clamp(12px, 1.8vw, 32px);
font-weight: 700;
color: #FFD700; /* 金色 */
white-space: nowrap;
border-bottom: 2px solid rgba(255,215,0,0.5);
padding-bottom: 2px;
}
/* 右侧 电话区域 */
.right {
display: flex;
align-items: center;
gap: 0.8vw;
z-index: 2;
flex-shrink: 0;
background: rgba(255, 255, 255, 0.08);
padding: 0.4vh 1.2vw;
border-radius: 50px;
backdrop-filter: blur(1px);
border: 1px solid rgba(255,215,0,0.3);
}
.phone-icon {
font-size: clamp(16px, 2.5vh, 44px);
color: #FFD700;
}
.phone-number {
font-size: clamp(14px, 2.2vw, 40px);
font-weight: 700;
color: #ffffff;
letter-spacing: 1px;
font-family: 'DIN 1451', 'Arial Black', 'Helvetica Neue', sans-serif;
white-space: nowrap;
text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
/* 最右侧可加微型金牌印章 (装饰) */
.gold-stamp {
margin-left: 0.5vw;
width: clamp(20px, 3.5vh, 45px);
height: clamp(20px, 3.5vh, 45px);
background: #FFD700;
color: #e60012;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: 900;
font-size: clamp(10px, 1.8vh, 24px);
transform: rotate(10deg);
box-shadow: 0 0 10px #ffcc00;
border: 2px solid #fff;
flex-shrink: 0;
font-family: 'Microsoft YaHei', sans-serif;
}
/* 响应式微调:极端窄屏时隐藏印章,缩小间隙 */
@media (max-width: 800px) {
.gold-stamp {
display: none;
}
.left {
gap: 0.8vw;
}
.right {
padding: 0.2vh 1vw;
}
}
@media (max-width: 600px) {
.title-line1, .title-line2, .teacher-line1, .teacher-line2, .phone-number {
white-space: normal; /* 允许换行以防万一,但比例决定了基本不会 */
}
.banner {
padding: 0 1%;
}
}
/* 模拟8K极致清晰,抗锯齿 */
.banner, .banner * {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</style>
<div class="bdworld">
<!-- 广告条主体:20:1 比例,大红色背景,金色装饰,信息完整 -->
<div class="banner">
<!-- 左侧: 金牌图标 + 淮安信息学奥赛名称 (两行) -->
<div class="left">
<i class="fas fa-medal medal-icon"></i> <!-- 金牌/奖章图标 -->
<div class="title-group">
<div class="title-line1">淮安信息学奥赛</div>
<div class="title-line2">CSP J/S 金牌培训班</div>
</div>
</div>
<!-- 中部: 计算机学会教授 · 全程教学 (两行) -->
<div class="center">
<div class="teacher-line1">计算机学会教授</div>
<div class="teacher-line2">全程教学</div>
</div>
<!-- 右侧: 电话 + 号码 + 金牌小印章(装饰) -->
<div class="right">
<i class="fas fa-phone-alt phone-icon"></i>
<span class="phone-number">153-6663-3222</span>
<!-- 极简金牌印章,呼应“金牌”二字,增加喜庆精致感 -->
<div class="gold-stamp">金</div>
</div>
</div>
</div>
<!-- 注:比例为20:1,背景大红色,所有关键信息均包含。电话已按易读格式加连字符。 -->
|
|