|
測試為x3.5 默認模板 x3.4未測試,總的來說效果并不是很滿意,有時間慢慢調整
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%, /* 左側淡化,降低亮度 */
- rgba(255, 255, 255, 0.5) 50%, /* 中間高亮,降低亮度 */
- rgba(255, 255, 255, 0.3) 75%, /* 右側淡化,降低亮度 */
- rgba(255, 255, 255, 0) 100% /* 完全透明 */
- );
- transform: rotate(-45deg);
- animation: flashlights 5s ease-in-out infinite; /* 5s 控制掃光速度,數值越大越慢 */
- z-index: 2; /* 確保偽元素在 Logo 上方 */
- filter: blur(10px); /* 添加模糊效果,使光線更柔和 */
- }
- @keyframes flashlights {
- 0% { left: -100%; top: -50px; }
- 100% { left: 100%; top: 100px; }
- }
- </style>
復制代碼
淺色背景
- <style>
- /* 有logo增加陰影效果 */
- /* 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%, /* 左側淡化 */
- rgba(255, 255, 255, 0.9) 50%, /* 中間高亮 */
- rgba(255, 255, 255, 0.6) 75%, /* 右側淡化 */
- rgba(255, 255, 255, 0) 100% /* 完全透明 */
- );
- transform: rotate(-45deg);
- animation: flashlights 2.5s ease-in-out infinite; /* 2.5s 控制掃光速度,數字越大越慢 */
- 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>
復制代碼
掃光速度:調整 animation: flashlights 1.5s ease-in 1s infinite; 中的 1.5s,數值越大速度越慢。
光帶亮度:調整 rgba(255, 255, 255, 0.8) 和 rgba(255, 255, 255, 1) 中的數值,控制光帶的亮度。
霧化效果:調整 box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); 中的參數,控制霧化的大小和透明度。
|
|