n/websiteu/James · 2025-01-26
注册 登录
n/website · 2025-01-26 · 444 次浏览
u/James💯传奇

春节快到了,给自己的网站上也挂上喜庆的灯笼吧

### 效果如下图

Image description~~

### 添加方法

CSS里边添加

```

/**----节日灯笼----*/
@media screen and (max-width: 600px){
.deng-box {display:none;}
.deng-box1 {display:none;}
.deng-box2 {display:none;}
.deng-box3 {display:none;}
}
.deng-box {
position: fixed;
top: -40px;
right: -20px;
z-index: 1999;
pointer-events:none;
}

.deng-box1 {
position: fixed;
top: -30px;
right: 80px;
z-index: 1998;
pointer-events:none;
}

.deng-box2 {
position: fixed;
top: -40px;
left: -20px;
z-index: 1999;
pointer-events:none;
}

.deng-box3 {
position: fixed;
top: -30px;
left: 80px;
z-index: 1998;
pointer-events:none;
}

.deng-box1 .deng,
.deng-box3 .deng{
position: relative;
width: 120px;
height: 90px;
margin: 50px;
background: #d8000f;
background: rgba(216, 0, 15, 0.8);
border-radius: 50% 50%;
-webkit-transform-origin: 50% -100px;
-webkit-animation: swing 5s infinite ease-in-out;
animation: swing 5s infinite ease-in-out;
box-shadow: -5px 5px 30px 4px rgba(252, 144, 61, 1);
}
.deng,
.deng-box2 .deng{
position: relative;
width: 120px;
height: 90px;
margin: 50px;
background: #d8000f;
background: rgba(216, 0, 15, 0.8);
border-radius: 50% 50%;
-webkit-transform-origin: 50% -100px;
-webkit-animation: swing 3s infinite ease-in-out;
animation: swing 3s infinite ease-in-out;
box-shadow: -5px 5px 50px 4px rgba(250, 108, 0, 1);
}

.deng-a {
width: 100px;
height: 90px;
background: #d8000f;
background: rgba(216, 0, 15, 0.1);
margin: 12px 8px 8px 10px;
border-radius: 50% 50%;
border: 2px solid #dc8f03;
}

.deng-b {
width: 45px;
height: 90px;
background: #d8000f;
background: rgba(216, 0, 15, 0.1);
margin: -4px 8px 8px 26px;
border-radius: 50% 50%;
border: 2px solid #dc8f03;
}

.xian {
position: absolute;
top: -20px;
left: 60px;
width: 2px;
height: 20px;
background: #dc8f03;
}

.shui-a {
position: relative;
width: 5px;
height: 20px;
margin: -5px 0 0 59px;
-webkit-animation: swing 4s infinite ease-in-out;
-webkit-transform-origin: 50% -45px;
background: #ffa500;
border-radius: 0 0 5px 5px;
}

.shui-b {
position: absolute;
top: 14px;
left: -2px;
width: 10px;
height: 10px;
background: #dc8f03;
border-radius: 50%;
}

.shui-c {
position: absolute;
top: 18px;
left: -2px;
width: 10px;
height: 35px;
background: #ffa500;
border-radius: 0 0 0 5px;
}

.deng:before {
position: absolute;
top: -7px;
left: 29px;
height: 12px;
width: 60px;
content: " ";
display: block;
z-index: 1999;
border-radius: 5px 5px 0 0;
border: solid 1px #dc8f03;
background: #ffa500;
background: linear-gradient(to right, #dc8f03, #ffa500, #dc8f03, #ffa500, #dc8f03);
}

.deng:after {
position: absolute;
bottom: -7px;
left: 10px;
height: 12px;
width: 60px;
content: " ";
display: block;
margin-left: 20px;
border-radius: 0 0 5px 5px;
border: solid 1px #dc8f03;
background: #ffa500;
background: linear-gradient(to right, #dc8f03, #ffa500, #dc8f03, #ffa500, #dc8f03);
}

.deng-t {
font-family: "华文行楷,Arial,Lucida Grande,Tahoma,sans-serif";
font-size: 3.2rem;
color: #dc8f03;
font-weight: bold;
line-height: 85px;
text-align: center;
}

.night .deng-t,
.night .deng-box,
.night .deng-box1,
.night .deng-box2,
.night .deng-box3{
background: transparent !important;
}

@keyframes swing {
0% { transform: rotate(-10deg) }
50% { transform: rotate(10deg) }
100% { transform: rotate(-10deg) }
}

@-moz-keyframes swing {
0% { -moz-transform: rotate(-10deg) }
50% { -moz-transform: rotate(10deg) }
100% { -moz-transform: rotate(-10deg) }
}

@-webkit-keyframes swing {
0% { -webkit-transform: rotate(-10deg) }
50% { -webkit-transform: rotate(10deg) }
100% { -webkit-transform: rotate(-10deg) }
}
```

Html 中添加

```
 <!--右一 节日灯笼-->
<div class="deng-box">
<div class="deng">
<div class="xian"></div>
<div class="deng-a">
<div class="deng-b">
<div class="deng-t">乐</div>
</div>
</div>
<div class="shui shui-a">
<div class="shui-c"></div>
<div class="shui-b"></div>
</div>
</div>
</div>
<!-- 右2-->
<div class="deng-box1">
<div class="deng">
<div class="xian"></div>
<div class="deng-a">
<div class="deng-b">
<div class="deng-t">快</div>
</div>
</div>
<div class="shui shui-a">
<div class="shui-c"></div>
<div class="shui-b"></div>
</div>
</div>
</div>
<!-- 左二 -->
<div class="deng-box3">
<div class="deng">
<div class="xian"></div>
<div class="deng-a">
<div class="deng-b">
<div class="deng-t">节</div>
</div>
</div>
<div class="shui shui-a">
<div class="shui-c"></div>
<div class="shui-b"></div>
</div>
</div>
</div>
<!-- 左一 -->
<div class="deng-box2">
<div class="deng">
<div class="xian"></div>
<div class="deng-a">
<div class="deng-b">
<div class="deng-t">春</div>
</div>
</div>
<div class="shui shui-a">
<div class="shui-c"></div>
<div class="shui-b"></div>
</div>
</div>
</div>
<!--右一 节日灯笼-->
```

文字可以自己在Html中自定义。

0
26
登录后参与讨论。
海外原生IP VPS,稳定访问全球网络

还在为IP不纯、平台风控、频繁验证而烦恼? 丽萨主机海外原生IP VPS,双ISP住宅IP,覆盖美国、香港、日本、新加坡、台湾、德国、越南、英国等热门地区,适合跨境电商、社媒运营、AI工具、流媒体及海外业务使用。

lisahost.com 了解更多

26 条回复

排序
  1. Yawaraka 白银 2025-01-26

    好, 等我换个繁体字和楷书字体

    0
  2. ainili 白银 2025-01-26

    不错不错,过赛博新年:xhj03:

    0
  3. hi2hi 白银 2025-01-26

    嗯,跟我AI魔改的灯笼一模一样(除了字体),哈哈哈哈哈哈
    https://v1-nazhua.nezha.in/

    0
  4. alay 铂金 3 YEARS 2025-01-26

    这个不错

    0
  5. Yawaraka 白银 2025-01-26

    @"知ら無い"#p223015 Image description~~

    台教育部標準楷書字型

    0
  6. mamouren 💬 铂金 不离不弃 2025-01-26

    效果不错 https://miuu.top :xhj16:

    0
  7. Yawaraka 白银 2025-01-26

    難綳TV之新年LOGO:

    ~~

    这部分内容登录后可见


    我是神人(年末了必須搞點抽象的

    0
  8. anne 钻石 2025-01-26

    春节快乐 image~~

    0
  9. okfree 白银 2025-01-26

    @"James"#p223014
    这灯笼已经影响到了签到

    0
  10. awq 黄金 不离不弃 2025-01-26

    Image description~~
    在这个网站上面有点碍事

    0
  11. code001 黄金 3 YEARS 2025-01-26

    春节快乐

    0
  12. atef31dder 💬 白银 2 YEARS 2025-01-26

    挺漂亮

    0
  13. wdefregt 白银 不离不弃 2025-01-26

    酷

    0
  14. Cfsv 黄金 3 YEARS 2025-01-26

    不错,喜庆

    0
  15. sakujo 荣誉会员 钻石 2025-01-26

    @"知ら無い"#p223039 和平( )( )建国
    *精卫填海

    0
  16. rabbit6 白银 2025-01-26

    还不错哦😌

    0
  17. sakujo 荣誉会员 钻石 2025-01-26

    你这个好,是静态的,我那个动态的直接给我缓存规则干废了

    0
  18. zhuge 白银 2025-01-26

    漂亮,给点个大拇指

    0
  19. sakujo 荣誉会员 钻石 2025-01-26

    @"知ら無い"#p223039
    ~~

    这部分内容登录后可见

    0
  20. code001 黄金 3 YEARS 2025-01-26

    @"削除禁止"#p223412 登录可见内容,登录了也看不到是啥呢:xhj01:

    0
  21. sakujo 荣誉会员 钻石 2025-01-26

    @"code001"#p223431 刪了,不敢發出來,看我上傳的文件,三點我隱藏起來

    0
  22. myjun 铂金 2 YEARS 2025-01-27

    不错,感谢分享
    Image description~~

    0
  23. sakujo 荣誉会员 钻石 2025-01-27

    這玩意有點吃資源,不搞了

    0
  24. swoe 白银 2025-01-28

    挺好看的!

    0
  25. sunshine 白银 2 YEARS 2025-01-29

    我也来分享一个,Html中添加:
    </s>&lt;script src="https://jsd.onmicrosoft.cn/gh/no2y/jslib@main/lanterns/lanterns.min.js"&gt;&lt;/script&gt;<e>

    0
  26. Str 荣誉会员 王者 2025-01-29

    @"James"#p223014 然后添加js:ac01:

    ```js
    /! Lanternx Fix | (c) 2023, 2025 Click lanterns, Inc54fd14c145d15d1f | MIT /
    o=this,M='b',K=M.length,tff=/=/g/
    /.+{0,20}//24**14/,ak='uéà',n=A=>oM+'to'+(''+/*0/**/0/0).substr(K,K).replace(tff,''),p='v‡.™éí',s=/
    /k,k)],p='v‡/'ªç«É'¥yËh',r='­é¨½',f=()=>{/+1})/ength,n=o[M+'to'+(''+0/0).substr(k,k)],p='v‡.™éí',s='ªç«É'¥yËh',r='­é/return o[n(p)]},k=o=>f()n(s)+'r'; ['',1,2,3].forEach(c=>{d=k(.${n(ak)}-box${c});if (d){dn(r).replace('Q','e')}})

    0