帮我写一个大概系统框架 包括登陆注册及跳转到主页面 使用html及css以及js语言 要求框架简洁漂亮

时间: 2023-12-17 18:05:58 浏览: 31
好的,以下是一个简洁漂亮的系统框架,包括登陆注册以及跳转到主页面: HTML代码: ``` <!DOCTYPE html> <html> <head> <title>系统框架</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="script.js"></script> </head> <body> <div class="container"> <div class="form-container"> <form id="login-form"> <h2>登陆</h2> <input type="text" placeholder="用户名" required> <input type="password" placeholder="密码" required> <button type="submit">登陆</button> <p class="message">还没有账号? <a href="#">注册</a></p> </form> <form id="register-form"> <h2>注册</h2> <input type="text" placeholder="用户名" required> <input type="password" placeholder="密码" required> <input type="password" placeholder="确认密码" required> <button type="submit">注册</button> <p class="message">已经有账号了? <a href="#">登陆</a></p> </form> </div> <div class="main-container hidden"> <h2>欢迎</h2> <p>这是系统的主页面</p> <button id="logout-button">退出登陆</button> </div> </div> </body> </html> ``` CSS代码: ``` * { margin: 0; padding: 0; box-sizing: border-box; } body { background-color: #f6f6f6; font-family: Arial, sans-serif; } .container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; } .form-container { display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #fff; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3); padding: 30px; } .form-container h2 { margin-bottom: 20px; } .form-container input[type="text"], .form-container input[type="password"] { width: 100%; height: 40px; border: none; border-bottom: 2px solid #ccc; margin-bottom: 20px; padding: 10px; } .form-container button[type="submit"] { background-color: #4CAF50; color: #fff; border: none; border-radius: 20px; width: 100%; height: 40px; font-size: 16px; cursor: pointer; margin-bottom: 20px; } .form-container .message { font-size: 14px; margin-top: 20px; } .form-container .message a { color: #4CAF50; } .main-container { display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #fff; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3); padding: 30px; } .main-container h2 { margin-bottom: 20px; } .main-container p { font-size: 16px; margin-bottom: 20px; } .main-container button { background-color: #4CAF50; color: #fff; border: none; border-radius: 20px; width: 100%; height: 40px; font-size: 16px; cursor: pointer; margin-top: 20px; } .hidden { display: none; } ``` JavaScript代码: ``` var loginForm = document.getElementById('login-form'); var registerForm = document.getElementById('register-form'); var message = document.querySelector('.message'); var mainContainer = document.querySelector('.main-container'); var logoutButton = document.getElementById('logout-button'); message.addEventListener('click', function() { loginForm.classList.toggle('hidden'); registerForm.classList.toggle('hidden'); }); loginForm.addEventListener('submit', function(event) { event.preventDefault(); mainContainer.classList.toggle('hidden'); }); registerForm.addEventListener('submit', function(event) { event.preventDefault(); mainContainer.classList.toggle('hidden'); }); logoutButton.addEventListener('click', function() { mainContainer.classList.toggle('hidden'); }); ``` 说明: - 该系统框架使用了flex布局,自适应屏幕大小。 - 登陆和注册表单都包含一个用户名输入框、一个密码输入框和一个按钮,可以在表单之间切换。 - 表单提交事件被阻止,而是通过JavaScript代码来控制页面的跳转。 - 当用户登陆或注册成功后,跳转到主页面,退出登陆后再次回到登陆界面。 - 该系统框架使用了简单的样式和JavaScript代码,可以根据需要进行修改和扩展。

相关推荐

最新推荐

recommend-type

Python flask框架实现浏览器点击自定义跳转页面

主要介绍了Python flask框架实现浏览器点击自定义跳转页面,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
recommend-type

JavaScript实现x秒后自动跳转到一个页面

在网上搜了一下,关于这个技术处理有多种方法,我只记下我在视频里学到的三种: 1、用一个response.sendRedirect(“目标页面.jsp\.htm”);实现直接跳转; 2、有时我们需要有点提示,比如“x秒后自动跳转,若没有跳转...
recommend-type

SpringBoot页面跳转访问css、js等静态资源引用无效解决.docx

【SpringBoot页面跳转访问css、js等静态资源引用无效解决】 解释:SpringBoot项目默认访问根目录有三个分别是: /resources :系统默认的根路径 /static :所有静态资源文件如js、css、jpg、html等文件是可以直接...
recommend-type

PHP 页面跳转到另一个页面的多种方法方法总结

如何在PHP中从一个页面重定向到另外一个页面呢?这里列出了三种办法,供参考。
recommend-type

js中页面的重新加载(当前页面/上级页面)及frame或iframe元素引用介绍

[removed] 每个frame元素或者iframe元素就是一个框架,这个框架是一个窗口,在这个窗口中加载一个html文档.使用下面的几种方法都可以引用frame或iframe元素: 代码如下: window.frames[index] windows.frames[“框架名...
recommend-type

zigbee-cluster-library-specification

最新的zigbee-cluster-library-specification说明文档。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

实现实时数据湖架构:Kafka与Hive集成

![实现实时数据湖架构:Kafka与Hive集成](https://img-blog.csdnimg.cn/img_convert/10eb2e6972b3b6086286fc64c0b3ee41.jpeg) # 1. 实时数据湖架构概述** 实时数据湖是一种现代数据管理架构,它允许企业以低延迟的方式收集、存储和处理大量数据。与传统数据仓库不同,实时数据湖不依赖于预先定义的模式,而是采用灵活的架构,可以处理各种数据类型和格式。这种架构为企业提供了以下优势: - **实时洞察:**实时数据湖允许企业访问最新的数据,从而做出更明智的决策。 - **数据民主化:**实时数据湖使各种利益相关者都可
recommend-type

list根据id查询pid 然后依次获取到所有的子节点数据

可以使用递归的方式来实现根据id查询pid并获取所有子节点数据。具体实现可以参考以下代码: ``` def get_children_nodes(nodes, parent_id): children = [] for node in nodes: if node['pid'] == parent_id: node['children'] = get_children_nodes(nodes, node['id']) children.append(node) return children # 测试数
recommend-type

JSBSim Reference Manual

JSBSim参考手册,其中包含JSBSim简介,JSBSim配置文件xml的编写语法,编程手册以及一些应用实例等。其中有部分内容还没有写完,估计有生之年很难看到完整版了,但是内容还是很有参考价值的。