PHP速学视频免费教程(入门到精通)
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
趁此单身汪伤心之日,作为一名前端程序猿的我也按捺不住了,撸个表白页面送给广大想表白的人儿。
话不多说,先看效果(网页地址):
功能
一个网页输入名称,生成带参数的网址。
浏览器输入该网址,即可打开带有该名字的网页,图片轮播,还带有音乐哟
(简单实现,本文不是技术软文,而是小工具推荐啊啊哈哈)
(ps: 已经做了移动端适配,手机打开效果更加哦)
代码
// name.html nbsp;html> <meta> <meta> <meta> <title>输入名字</title> <style> body { min-height: 100vh; background: linear-gradient(#1d2b64, #f8cdda); color: #fff; font-family: PingFangSC-Regular; padding: 0; margin: 0; } input { display: inline-block; width: 80%; height: 32px; line-height: 1.5; padding: 4px 7px; margin: 20px auto 0 auto; font-size: 16px; border: 1px solid #dcdee2; border-radius: 4px; color: #515a6e; background-color: #fff; background-image: none; position: relative; cursor: text; -webkit-transition: border 0.2s ease-in-out, background 0.2s ease-in-out, -webkit-box-shadow 0.2s ease-in-out; transition: border 0.2s ease-in-out, background 0.2s ease-in-out, -webkit-box-shadow 0.2s ease-in-out; transition: border 0.2s ease-in-out, background 0.2s ease-in-out, box-shadow 0.2s ease-in-out; transition: border 0.2s ease-in-out, background 0.2s ease-in-out, box-shadow 0.2s ease-in-out, -webkit-box-shadow 0.2s ease-in-out; } .button { display: flex; align-items: center; justify-content: center; position: relative; z-index: 10; width: 80%; height: 40px; background: rgba(89, 126, 247, 1); border-radius: 44px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, 1); line-height: 20px; cursor: pointer; } .button-shadow { width: 80%; height: 40px; background: rgba(106, 140, 253, 1); border-radius: 44px; opacity: 0.3081; -webkit-filter: blur(4px); filter: blur(4px); margin-top: -36px; } #card { width: 80%; box-sizing: border-box; padding: 20px 12px; word-wrap: break-word; } @media screen and (min-width: 800px) { .container { width: 350px; margin: 0 auto; } } </style> <div> <div> <h2>Happy Valentine's Day</h2> <input> </div> <script> window.onload = function() { document.getElementById("btn").addEventListener("click", function() { let name = document.getElementById("name").value; if (name === "") { alert("请输入姓名"); return; } let url = "https://zxpsuper.github.io/Demo/valentine_day/index.html?name=" + encodeURIComponent(encodeURIComponent(name)); document.getElementById("card").innerHTML = url; }); }; </script> <div> <div>确定</div> <div></div> <div></div> <p>复制以上网址发给他人吧</p> </div> </div> ------------ //index.html nbsp;html> <meta> <meta> <meta> <title>情人节快乐</title> <style> img { width: 100%; } body { min-height: 100vh; background: linear-gradient(#1d2b64, #f8cdda); color: #fff; font-family: PingFangSC-Regular; padding: 0; margin: 0; } .avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff; } .shadow { position: absolute; left: 0; z-index: -1; filter: blur(50px); } .btn-group { display: flex; margin-top: 40px; justify-content: space-between; align-items: center; } .btn-group div { flex: 1; text-align: center; } .sure { padding: 14px 0; background: linear-gradient( 180deg, rgba(255, 127, 87, 1) 0%, rgba(221, 40, 39, 1) 100% ); border-top-left-radius: 20px; border-bottom-left-radius: 20px; } .cancel { padding: 14px 0; background: #eee; color: #333; border-top-right-radius: 20px; border-bottom-right-radius: 20px; } marquee { background: none; } @media screen and (min-width: 800px) { .container { width: 350px; margin: 0 auto; } } </style> <div> <div> <div> <img> <img> <span>小皮咖</span> </div> <marquee> <img> <img> <img> <img> <img> <img> <img> </marquee> <audio> 您的浏览器不支持 audio 标签。 </audio> <div> <div> 确定 </div> <div>取消</div> </div> </div> </div> <script> function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) { return r[2]; } return null; } window.onload = function() { let name = getQueryString("name"); document.getElementById("name").innerHTML = decodeURIComponent( decodeURIComponent(name) ); }; </script>
最后祝大家情人节快乐!!
相关推荐:
已抢4968个
抢已抢68196个
抢已抢11938个
抢已抢42350个
抢已抢167420个
抢已抢79371个
抢