开启辅助访问      

站内搜索

搜索
热搜: 下载 1.19 1.20

Minecraft(我的世界)苦力怕论坛

[编程求助] 求用HTML做一个登陆页面

发表于 2022-6-11 13:00:18 | 显示全部楼层 |阅读模式 IP:广东省
求用HTML做一个登陆页面qwq
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>login</title>
    </head>
    <body>
        <h1>登录</h1>
        <form>
            账号:<input type="text" name="name">
            密码:<input type="password" name="password">
        </form>
        <button type="button" onclick="find()">登录</button>
        <script>
            function find(){  
            var search_name = document.getElementById("search_name").value;  
            var password = localStorage.getItem(search_password);  
            var find_result = document.getElementById("find_result");  
            find_result.innerHTML = search_site + "test" + siteurl;  
            }
        </script>
        <h1>注册</h1>
        <form>
            账号:<input type="text" name="name">
            密码:<input type="password" name="password">
        </form>
        <button type="button" onclick="save()">注册</button>
        <script>
            function save(){  
                var password = document.getElementById("password").value;  
                var name = document.getElementById("name").value;  
                localStorage.setItem(name, password);
                alert("注册成功");
            }
            function loadAll(){  
                var list = document.getElementById("list");  
                if(localStorage.length>0){  
                    var result = "<table border='1'>";  
                    result += "<tr><td>key</td><td>value</td></tr>";  
                    for(var i=0;i<localStorage.length;i++){  
                    var name = localStorage.key(i);  
                    var password = localStorage.getItem(password);  
                    result += "<tr><td>"+name+"</td><td>"+password+"</td></tr>";  
                }  
                result += "<table></table>";  
                list.innerHTML = result;  
                }else{  
                    list.innerHTML = "数据为空……";  
                }  
            }      
        </script>
    </body>
</html>

这是我做的,失败了qaq
苦力怕论坛,感谢有您~
回复

使用道具 举报

发表于 2022-6-11 20:04:32 | 显示全部楼层 IP:河北省
看看这个
2# 2022-6-11 20:04:32 回复 收起回复
苦力怕论坛,感谢有您~
回复 支持

使用道具 举报

发表于 2022-6-11 20:04:42 | 显示全部楼层 IP:河北省
本帖最后由 MingHaoGame 于 2022-6-11 20:06 编辑

看看这个index.html
  1. <!DOCTYPE html>
  2. <html lang="zh-CN"><!--BY:MingHaoGame-->
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <title>登陆 作者:MingHaoGame</title>
  8.     <link rel="stylesheet" href="style.css">
  9. </head>
  10. <body>
  11.     <div class="box">
  12.         <h2>登陆</h2>
  13.         <div class="input-box">
  14.             <label>账号</label>
  15.             <input type="text"/>
  16.         </div>
  17.         <div class="input-box">
  18.             <label>密码</label>
  19.             <input type="password"/>
  20.         </div>
  21.         <div class="btn-box">
  22.             <a href="#">忘记密码?</a>
  23.             <div>
  24.                 <button>登录</button>
  25.                 <button>注册</button><!--BY:MingHaoGame-->
  26.             </div>
  27.         </div>
  28.     </div>

  29. <script type="text/javascript">

  30. </script>
  31. </body>
  32. </html>
复制代码
style.css


  1. * {
  2.     margin: 0;
  3.     padding: 0;
  4. }

  5. body {
  6.     height: 100vh;
  7.     background: url(image/bg.png) no-repeat;
  8.     background-size: cover;
  9.     display: flex;
  10.     justify-content: center;
  11.     align-items: center;
  12. }

  13. .box {
  14.     width: 350px;
  15.     height: 350px;
  16.     border-top: 1px solid rgba(255,255,255,0.5);
  17.     border-left: 1px solid rgba(255,255,255,0.5);
  18.     border-bottom: 1px solid rgba(255,255,255,0.3);
  19.     border-right: 1px solid rgba(255,255,255,0.3);
  20.     backdrop-filter: blur(10px);
  21.     background: rgba(50,50,50,0.2);
  22.     display: flex;
  23.     flex-direction: column;
  24.     justify-content: center;
  25.     align-items: center;
  26.     border-radius: 10px;
  27. }

  28. .box > h2 {
  29.     color: rgba(255,255,255,0.9);
  30.     margin-bottom: 30px;
  31. }

  32. .box .input-box {
  33.     display: flex;
  34.     flex-direction: column;
  35.     box-sizing: border-box;
  36.     margin-bottom: 10px;
  37. }

  38. .box .input-box label {
  39.     font-size: 13px;
  40.     color: rgba(255,255,255,0.9);
  41.     margin-bottom: 5px;
  42. }

  43. .box .input-box input {
  44.     letter-spacing: 1px;
  45.     font-size: 14px;
  46.     box-sizing: border-box;
  47.     width: 250px;
  48.     height: 35px;
  49.     border-radius: 5px;
  50.     border: 1px solid rgba(255,255,255,0.5);
  51.     background: rgba(255,255,255,0.2);
  52.     outline: none;
  53.     padding: 0 12px;
  54.     color: rgba(255,255,255,0.9);
  55.     transition: 0.2s;
  56. }

  57. .box .input-box input:focus {
  58.     border: 1px solid rgba(255,255,255,0.8);
  59. }

  60. .box .btn-box {
  61.     width: 250px;
  62.     display: flex;
  63.     flex-direction: column;
  64.     align-items: start;
  65. }

  66. .box .btn-box > a {
  67.     outline: none;
  68.     display: block;
  69.     width: 250px;
  70.     text-align: end;
  71.     text-decoration: none;
  72.     font-size: 13px;
  73.     color: rgba(255,255,255,0.9);
  74. }

  75. .box .btn-box > a:hover {
  76.     color: rgba(255,255,255,1);
  77. }

  78. .box .btn-box > div {
  79.     margin-top: 10px;
  80.     display: flex;
  81.     justify-content: center;
  82.     align-items: center;
  83. }

  84. .box .btn-box > div > button {
  85.     outline: none;
  86.     margin-top: 10px;
  87.     display: block;
  88.     font-size: 14px;
  89.     border-radius: 5px;
  90.     transition: 0.2s;
  91. }

  92. .box .btn-box > div > button:nth-of-type(1) {
  93.     width: 120px;
  94.     height: 35px;
  95.     color: rgba(255,255,255,0.9);
  96.     border: 1px solid rgba(192, 119, 91, 0.7);
  97.     background: rgba(192, 119, 91, 0.5);
  98. }

  99. .box .btn-box > div > button:nth-of-type(2) {
  100.     width: 120px;
  101.     height: 35px;
  102.     margin-left: 10px;
  103.     color: rgba(255,255,255,0.9);
  104.     border: 1px solid rgba(192, 119, 91, 0.7);
  105.     background: rgba(192, 119, 91, 0.5);
  106. }

  107. .box .btn-box > div > button:hover {
  108.     border: 1px solid rgba(251, 128, 71, 0.7);
  109.     background: rgba(251, 128, 71, 0.5);
  110. }
复制代码


html.rar

2.7 MB, 下载次数:

评分

参与人数 1铁粒 +2 收起 理由
正在寻找东西屑 + 2 要JS

查看全部评分

3# 2022-6-11 20:04:42 回复 收起回复
苦力怕论坛,感谢有您~
回复 支持

使用道具 举报

 楼主| 发表于 2022-6-12 10:17:25 | 显示全部楼层 IP:广东省
已成功
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <meta charset="utf-8">
  5.         <title>login</title>
  6.     </head>
  7.     <body>
  8.         <h1>登录</h1>
  9.         <form>
  10.             <table>账号:<input type="text" id="search_name" name="name"></table>
  11.             <table>密码:<input type="password" id="search_password" name="password"></table>
  12.         </form>
  13.         <button type="button" onclick="find()">登录</button>
  14.         <button type="button" onclick="save()">注册</button>
  15.         <script  type="text/javascript">
  16.             function find(){  
  17.                 var search_name = document.getElementById("search_name").value;  
  18.                 var password = document.getElementById("search_password").value;
  19.                 var localstorageget = localStorage.getItem(search_name) ;
  20.                 if (password===localstorageget){
  21.                     alert("登录成功");
  22.                 } else {
  23.                     alert("登录失败");
  24.                 }
  25.             }
  26.             function save(){  
  27.                 var password = document.getElementById("search_password").value;  
  28.                 var name = document.getElementById("search_name").value;  
  29.                 localStorage.setItem(name, password);
  30.                 alert("注册成功");
  31.             }
  32.         </script>
  33.     </body>
  34. </html>
复制代码


4# 2022-6-12 10:17:25 回复 收起回复
苦力怕论坛,感谢有您~
回复 支持

使用道具 举报

发表于 2023-9-20 16:31:03 来自手机 | 显示全部楼层 IP:广西
本帖最后由 小永高呐 于 2023-9-21 10:22 编辑

给你个我这的,不过只是空按钮,需要自己对接下后端才可以用

预览:https://download.kstore.space/download/5005/yanshi/login.html

  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>登录本站</title>
  8. <style>
  9. * {
  10.     margin: 0;
  11.     padding: 0;
  12.     box-sizing: border-box;
  13. }
  14. html {
  15.     font-size: 10px;
  16. }
  17. html::before {
  18.     content: '';
  19.     width: 100%;
  20.     height: 100%;
  21.     position: fixed;
  22.     z-index: -1;
  23. }
  24. ::selection {
  25.     color: #fff;
  26.     background-color: rgb(144,129,241);
  27. }
  28. .box {
  29.     display: flex;
  30.     overflow: hidden;
  31.     width: 90rem;
  32.     height: 55rem;
  33.     background-color: rgba(255,255,255,70%);
  34.     border-radius: 1.5rem;
  35.     margin: 10% auto;
  36.     box-shadow: 0 0 1rem 0.2rem rgb(0 0 0 / 10%);
  37. }
  38. .box .left {
  39.     position: relative;
  40.     width: 35%;
  41.     height: 100%;
  42. }
  43. .box .left::before {
  44.     content: '';
  45.     position: absolute;
  46.     width: 100%;
  47.     height: 100%;
  48.     background-image: url(https://xiaoyonggaoya.pages.dev/login/login-tp.png);
  49.     background-size: cover;
  50. }
  51. .box .right {
  52.     display: flex;
  53.     width: 65%;
  54.     flex-direction: column;
  55.     align-items: center;
  56. }
  57. .box .right h2{
  58.     color: rgb(144,129,241);
  59.     font-size: 3rem;
  60.     margin-top: 5rem;
  61. }
  62. .box .right form {
  63.     display: flex;
  64.     flex-wrap: wrap;
  65.     justify-content: center;
  66. }
  67. .box .right form .acc {
  68.     outline: none;
  69.     width: 80%;
  70.     height: 5rem;
  71.     font-size: 1.6rem;
  72.     margin-top: 5rem;
  73.     padding: 1rem 0 0 1.6rem;
  74.     border: none;
  75.     border-bottom:1px solid rgb(144,129,241) ;
  76.     color: rgb(144,129,241);
  77.     background-color: rgba(0,0,0,0);
  78. }
  79. .right form .acc:focus {
  80.     outline: none;
  81.     color: rgb(144,129,241);
  82.     padding: 1rem 0 0 1.6rem;
  83. }
  84. .right .submit {
  85.     width: 60%;
  86.     height: 5rem;
  87.     color: #f6f6f6;
  88.     background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
  89.     font-size: 1.4rem;
  90.     border: none;
  91.     border-radius: 0.5rem;
  92.     margin: 6rem 0 0 50%;
  93.     transform: translateX(-50%);
  94. }
  95. .right .submit:hover {
  96.     box-shadow: 0 0 2rem -0.5rem rgb(0 0 0 / 15%);
  97. }
  98. .right .fn {
  99.     display: flex;
  100.     justify-content: space-between;
  101.     margin-top: 1rem;
  102.     width: 70%;
  103. }
  104. .right .fn font {
  105.     font-size: 1.3rem;
  106.     margin-top: 5rem;
  107.     padding: 1rem 2rem;
  108.     color: #666;
  109. }
  110. .right .fn font:hover {
  111.     color: rgb(144,129,241);
  112. }
  113. </style>
  114. <script>
  115. function meshinaxidadedog(){
  116. alert("账号登录成功!");}
  117. function kleeworldfirstcute(){
  118. alert("抱歉,注册功能还未开放!");}
  119. function yoimiyadedidudiduzbc(){
  120. alert("抱歉,找回密码功能还未开放");}
  121. </script>
  122. <link rel="icon" href="https://xiaoyonggaoya.pages.dev/live/img/icon.jpg">
  123. </head>
  124. <body background="https://xiaoyonggaoya.pages.dev/login/bg.jpg" style="overflow:hidden;background-repeat:no-repeat;background-size:100%100%;background-attachment:fixed;">
  125. <div class="box">
  126. <div class="left"></div>
  127. <div class="right">
  128. <h2>登 录</h2>
  129. <form action="">
  130. <input class="acc" type="text" placeholder="用户名">
  131. <input class="acc" type="password" placeholder="密码">
  132. <input class="submit" type="submit" value="登录账号" onclick="meshinaxidadedog()">
  133. </form>
  134. <div class="fn">
  135. <font onclick="yoimiyadedidudiduzbc()">找回密码</font>
  136. <font onclick="kleeworldfirstcute()">注册账户</font>
  137. </div></div></div>
  138. </body>
  139. </html>
复制代码
5# 2023-9-20 16:31:03 回复 收起回复
苦力怕论坛,感谢有您~
回复 支持

使用道具 举报

发表于 2023-10-18 12:00:08 来自手机 | 显示全部楼层 IP:贵州省
你的第11行的div标签好像还差一个结束标签
6# 2023-10-18 12:00:08 回复 收起回复
苦力怕论坛,感谢有您~
回复 支持

使用道具 举报

 楼主| 发表于 2023-11-12 18:02:21 | 显示全部楼层 IP:广东省
小永高呐 发表于 2023-9-20 16:31
给你个我这的,不过只是空按钮,需要自己对接下后端才可以用

预览:https://download.kstore.space/downlo ...

谢谢,但是这是早期的问题。
7# 2023-11-12 18:02:21 回复 收起回复
苦力怕论坛,感谢有您~
回复 支持

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

本站
关于我们
联系我们
坛史纲要
官方
哔哩哔哩
技术博客
下载
网易版
安卓版
JAVA
反馈
意见建议
教程中心
更多
捐助本站
QQ群
QQ群

QQ群

访问手机版

访问手机版

手机版|小黑屋|系统状态|klpbbs.com

粤公网安备 44200002445329号 | 由 木韩网络 提供云服务 | GMT+8, 2024-4-30 00:25

声明:本站与Mojang以及微软公司没有从属关系

Powered by Discuz! X3.4 粤ICP备2023071842号