- 積分
- 1849
- 金幣
- 10 個(gè)
- 社區(qū)幣
- 0 元
已臻大成
- 貢獻(xiàn)
- 12 點(diǎn)
- 金幣
- 10 個(gè)
|
測(cè)試為x3.5 默認(rèn)模板 x3.4未測(cè)試,總的來說效果并不是很滿意,有時(shí)間慢慢調(diào)整
1、深色頂部或者logo
/template/default/common/header.htm
查找</head>
上面添加
- <style>
- /* 深色背景 */
- /* Logo 掃光特效 */
- .hdc h2 a {
- overflow: hidden;
- display: block;
- position: relative;
- }
- .hdc h2 a:before {
- content: "";
- position: absolute;
- top: -50px;
- left: -100%;
- width: 200%; /* 增加寬度,確保掃光覆蓋范圍 */
- height: 20px; /* 光帶的高度 */
- background: linear-gradient(
- 90deg,
- rgba(255, 255, 255, 0) 0%,
- rgba(255, 255, 255, 0.3) 25%, /* 左側(cè)淡化,降低亮度 */
- rgba(255, 255, 255, 0.5) 50%, /* 中間高亮,降低亮度 */
- rgba(255, 255, 255, 0.3) 75%, /* 右側(cè)淡化,降低亮度 */
- rgba(255, 255, 255, 0) 100% /* 完全透明 */
- );
- transform: rotate(-45deg);
- animation: flashlights 5s ease-in-out infinite; /* 5s 控制掃光速度,數(shù)值越大越慢 */
- z-index: 2; /* 確保偽元素在 Logo 上方 */
- filter: blur(10px); /* 添加模糊效果,使光線更柔和 */
- }
- @keyframes flashlights {
- 0% { left: -100%; top: -50px; }
- 100% { left: 100%; top: 100px; }
- }
- </style>
復(fù)制代碼
淺色背景
- <style>
- /* 有l(wèi)ogo增加陰影效果 */
- /* Logo 掃光特效 */
- .hdc h2 a {
- overflow: hidden;
- display: block;
- position: relative;
- }
- .hdc h2 a:before {
- content: "";
- position: absolute;
- top: -50px;
- left: -100%;
- width: 200%; /* 增加寬度,確保掃光覆蓋范圍 */
- height: 20px; /* 光帶的高度 */
- background: linear-gradient(
- 90deg,
- rgba(255, 255, 255, 0) 0%,
- rgba(255, 255, 255, 0.6) 25%, /* 左側(cè)淡化 */
- rgba(255, 255, 255, 0.9) 50%, /* 中間高亮 */
- rgba(255, 255, 255, 0.6) 75%, /* 右側(cè)淡化 */
- rgba(255, 255, 255, 0) 100% /* 完全透明 */
- );
- transform: rotate(-45deg);
- animation: flashlights 2.5s ease-in-out infinite; /* 2.5s 控制掃光速度,數(shù)字越大越慢 */
- z-index: 2; /* 確保偽元素在 Logo 上方 */
- filter: blur(10px); /* 添加模糊效果,使光線更柔和 */
- }
- @keyframes flashlights {
- 0% { left: -100%; top: -50px; }
- 100% { left: 100%; top: 100px; }
- }
- /* 為 Logo 添加陰影 */
- .hdc h2 a img {
- position: relative; /* 確保陰影生效 */
- filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3)); /* 添加陰影 */
- z-index: 1; /* 確保 Logo 在偽元素下方 */
- }
- </style>
復(fù)制代碼
掃光速度:調(diào)整 animation: flashlights 1.5s ease-in 1s infinite; 中的 1.5s,數(shù)值越大速度越慢。
光帶亮度:調(diào)整 rgba(255, 255, 255, 0.8) 和 rgba(255, 255, 255, 1) 中的數(shù)值,控制光帶的亮度。
霧化效果:調(diào)整 box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); 中的參數(shù),控制霧化的大小和透明度。
|
|