200行Html5+CSS3+JS代码实现动态圣诞树
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">1、</span>前言 </p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic1.zhimg.com/80/v2-2f0ba8d106e43f34e445e98b31dd6924_720w.webp" style="width: 50%; margin-bottom: 20px;"></div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">近期</span>CSDN的热榜<span style="color: black;">显现</span>了<span style="color: black;">非常多</span>用Python、C/C++等编程语言实现的圣诞树,<span style="color: black;">发掘</span>很少用前端的,这篇<span style="color: black;">文案</span>用前端三大杀手Html5、CSS、Js来实现动态圣诞树。</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"> <span style="color: black;">2、</span>圣诞树</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">效果展示:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;">
<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://pic3.zhimg.com/v2-ef568a5c963cf1feaadd435dfa25d742_b.jpg" style="width: 50%; margin-bottom: 20px;"></div>
</div>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">备注:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">整体圣诞树分为3个部分,书的主干、粒子特效、树上的卡片</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">树上的卡片(重点):每一张卡片上都有一个名字,<span style="color: black;">表率</span>圣诞树的叶子,后面<span style="color: black;">能够</span><span style="color: black;">按照</span>自己需求更改,<span style="color: black;">例如</span><span style="color: black;">所有</span>改成<span style="color: black;">爱好</span>人的名字,在JS代码的第五行内更改内容</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">树的动态旋转<span style="color: black;">经过</span>js实现、主干是html5、样式CSS</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">3、</span>编码实现</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">CSS代码:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;">
<span style="color: black;">/*********************************************
</span><span style="color: black;"> * RESET
</span><span style="color: black;">*********************************************/</span>
<span style="color: black;">html</span><span style="color: black;">{</span><span style="color: black;">color</span><span style="color: black;">:</span><span style="color: black;">#000</span><span style="color: black;">;</span><span style="color: black;">bac<span style="color: black;">公斤</span>round</span><span style="color: black;">:</span><span style="color: black;">#222222</span><span style="color: black;">;}</span>
<span style="color: black;">a</span><span style="color: black;">{</span><span style="color: black;">cursor</span><span style="color: black;">:</span><span style="color: black;">pointer</span><span style="color: black;">;}</span>
<span style="color: black;">html</span><span style="color: black;">,</span><span style="color: black;">body</span><span style="color: black;">,</span><span style="color: black;">div</span><span style="color: black;">,</span><span style="color: black;">dl</span><span style="color: black;">,</span><span style="color: black;">dt</span><span style="color: black;">,</span><span style="color: black;">dd</span><span style="color: black;">,</span><span style="color: black;">ul</span><span style="color: black;">,</span><span style="color: black;">ol</span><span style="color: black;">,</span><span style="color: black;">li</span><span style="color: black;">,</span><span style="color: black;">h1</span><span style="color: black;">,</span><span style="color: black;">h2</span><span style="color: black;">,</span><span style="color: black;">h3</span><span style="color: black;">,</span><span style="color: black;">h4</span><span style="color: black;">,</span><span style="color: black;">h5</span><span style="color: black;">,</span><span style="color: black;">h6</span><span style="color: black;">,</span><span style="color: black;">pre</span><span style="color: black;">,</span><span style="color: black;">code</span><span style="color: black;">,</span><span style="color: black;">form</span><span style="color: black;">,</span><span style="color: black;">fieldset</span><span style="color: black;">,</span><span style="color: black;">legend</span><span style="color: black;">,</span><span style="color: black;">input</span><span style="color: black;">,</span><span style="color: black;">textarea</span><span style="color: black;">,</span><span style="color: black;">p</span><span style="color: black;">,</span><span style="color: black;">blockquote</span><span style="color: black;">,</span><span style="color: black;">th</span><span style="color: black;">,</span><span style="color: black;">td</span><span style="color: black;">{</span><span style="color: black;">margin</span><span style="color: black;">:</span><span style="color: black;">0</span><span style="color: black;">;</span><span style="color: black;">padding</span><span style="color: black;">:</span><span style="color: black;">0</span><span style="color: black;">;}</span>
<span style="color: black;">table</span><span style="color: black;">{</span><span style="color: black;">border-collapse</span><span style="color: black;">:</span><span style="color: black;">collapse</span><span style="color: black;">;</span><span style="color: black;">border-spacing</span><span style="color: black;">:</span><span style="color: black;">0</span><span style="color: black;">;}</span>
<span style="color: black;">fieldset</span><span style="color: black;">,</span><span style="color: black;">img</span><span style="color: black;">{</span><span style="color: black;">border</span><span style="color: black;">:</span><span style="color: black;">0</span><span style="color: black;">;}</span>
<span style="color: black;">address</span><span style="color: black;">,</span><span style="color: black;">caption</span><span style="color: black;">,</span><span style="color: black;">cite</span><span style="color: black;">,</span><span style="color: black;">code</span><span style="color: black;">,</span><span style="color: black;">dfn</span><span style="color: black;">,</span><span style="color: black;">em</span><span style="color: black;">,</span><span style="color: black;">strong</span><span style="color: black;">,</span><span style="color: black;">th</span><span style="color: black;">,</span><span style="color: black;">var</span><span style="color: black;">{</span><span style="color: black;">font-style</span><span style="color: black;">:</span><span style="color: black;">normal</span><span style="color: black;">;</span><span style="color: black;">font-weight</span><span style="color: black;">:</span><span style="color: black;">normal</span><span style="color: black;">;}</span>
<span style="color: black;">li</span><span style="color: black;">{</span><span style="color: black;">list-style</span><span style="color: black;">:</span><span style="color: black;">none</span><span style="color: black;">;}</span>
<span style="color: black;">caption</span><span style="color: black;">,</span><span style="color: black;">th</span><span style="color: black;">{</span><span style="color: black;">text-align</span><span style="color: black;">:</span><span style="color: black;">left</span><span style="color: black;">;}</span>
<span style="color: black;">/* h1,h2,h3,h4,h5,h6{font-size:100%;} */</span>
<span style="color: black;">q</span><span style="color: black;">:</span><span style="color: black;">before</span><span style="color: black;">,</span><span style="color: black;">q</span><span style="color: black;">:</span><span style="color: black;">after</span><span style="color: black;">{</span><span style="color: black;">content</span><span style="color: black;">:</span><span style="color: black;">;}</span>
<span style="color: black;">abbr</span><span style="color: black;">,</span><span style="color: black;">acronym</span> <span style="color: black;">{</span><span style="color: black;">border</span><span style="color: black;">:</span><span style="color: black;">0</span><span style="color: black;">;</span><span style="color: black;">font-variant</span><span style="color: black;">:</span><span style="color: black;">normal</span><span style="color: black;">;}</span>
<span style="color: black;">sup</span> <span style="color: black;">{</span><span style="color: black;">vertical-align</span><span style="color: black;">:</span><span style="color: black;">text</span><span style="color: black;">-</span><span style="color: black;">top</span><span style="color: black;">;}</span>
<span style="color: black;">sub</span> <span style="color: black;">{</span><span style="color: black;">vertical-align</span><span style="color: black;">:</span><span style="color: black;">text</span><span style="color: black;">-</span><span style="color: black;">bottom</span><span style="color: black;">;}</span>
<span style="color: black;">input</span><span style="color: black;">,</span><span style="color: black;">textarea</span><span style="color: black;">,</span><span style="color: black;">select</span><span style="color: black;">{</span><span style="color: black;">font-family</span><span style="color: black;">:</span><span style="color: black;">inherit</span><span style="color: black;">;</span><span style="color: black;">font-size</span><span style="color: black;">:</span><span style="color: black;">inherit</span><span style="color: black;">;</span><span style="color: black;">font-weight</span><span style="color: black;">:</span><span style="color: black;">inherit</span><span style="color: black;">;</span><span style="color: black;">outline-sty</span>
</div>
外链发布社区 http://www.fok120.com/ “BS”(鄙视的缩写) 我完全赞同你的观点,思考很有深度。 我深受你的启发,你的话语是我前进的动力。 认真阅读了楼主的帖子,非常有益。
页:
[1]