写一个完整的前端登录界面

时间: 2023-04-03 08:04:39 浏览: 51
好的,我可以回答这个问题。前端登录界面通常包括用户名和密码输入框、登录按钮、注册按钮、忘记密码链接等元素。可以使用 HTML、CSS 和 JavaScript 技术来实现。具体实现方式可以根据需求和设计来确定。
相关问题

用vue写一个前端登陆界面

以下是一个简单的前端登录界面,使用Vue框架: ``` <template> <div class="login"> <h1>Login</h1> <form> <input type="text" placeholder="Username" v-model="username"> <input type="password" placeholder="Password" v-model="password"> <button type="submit" @click.prevent="handleLogin">Login</button> </form> <p v-if="error" class="error">{{ error }}</p> </div> </template> <script> export default { data() { return { username: '', password: '', error: '' } }, methods: { handleLogin() { if (this.username === 'admin' && this.password === 'password') { // 登录成功 this.$router.push('/dashboard') } else { // 登录失败 this.error = 'Invalid username or password' } } } } </script> <style> .login { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; } h1 { font-size: 2rem; margin-bottom: 2rem; } form { display: flex; flex-direction: column; gap: 1rem; } input[type="text"], input[type="password"] { padding: 0.5rem; border-radius: 0.25rem; border: 1px solid gray; } button[type="submit"] { padding: 0.5rem; border-radius: 0.25rem; border: none; background-color: blue; color: white; cursor: pointer; } .error { color: red; } </style> ``` 在上面的代码中,我们定义了一个组件,包含一个登录表单。表单中有用户名和密码的输入框,以及一个提交按钮。在点击提交按钮时,我们调用handleLogin方法。如果用户名和密码正确,我们使用Vue Router将用户重定向到仪表板页面。如果用户名或密码不正确,我们设置一个错误消息,告诉用户登陆失败。

写一个光线粒子充满科技感的前端登陆界面

好的,让我来为您展示一个充满科技感的前端登陆界面吧。 首先,我们需要一个背景,可以选择一个科技感十足的图片或者视频作为背景。这里我选择了一个动态的背景视频。可以通过CSS实现: ```css body { background: #000; } .video-bg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; } .video-bg video { min-width: 100%; min-height: 100%; object-fit: cover; } ``` 然后,我们需要一个登陆框。这里我选择了一个简单的表单,并添加了一些动画效果和光线粒子效果。可以通过CSS和JavaScript实现: ```html <div class="login-container"> <form> <h1>Login</h1> <div class="input-box"> <input type="text" placeholder="Username" required> <span></span> </div> <div class="input-box"> <input type="password" placeholder="Password" required> <span></span> </div> <button type="submit">Login</button> </form> <div class="particles-container"></div> </div> ``` ```css .login-container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); padding: 50px; border-radius: 10px; box-shadow: 0 0 20px rgba(255, 255, 255, 0.1); animation: login-form 1s ease-in-out forwards; } @keyframes login-form { from { opacity: 0; transform: translate(-50%, -150%); } to { opacity: 1; transform: translate(-50%, -50%); } } form { display: flex; flex-direction: column; } form h1 { color: #fff; margin-bottom: 30px; text-align: center; } .input-box { position: relative; margin-bottom: 20px; } input { width: 100%; padding: 10px; background: transparent; border: none; border-bottom: 2px solid rgba(255, 255, 255, 0.5); color: #fff; } input:focus, input:valid { border-bottom-color: #fff; } input:focus + span:before, input:valid + span:before { transform: scaleX(1); } input:focus + span:after, input:valid + span:after { transform: scaleX(1); } span { position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(to right, #00c6ff, #0072ff); transform: scaleX(0); transform-origin: bottom right; transition: transform 0.3s ease-in-out; } span:before, span:after { content: ""; position: absolute; bottom: 0; width: 10px; height: 2px; background-color: #fff; transform: scaleX(0); transition: transform 0.3s ease-in-out; } span:before { left: -10px; transform-origin: bottom left; } span:after { right: -10px; transform-origin: bottom right; } button { background: linear-gradient(to right, #00c6ff, #0072ff); border: none; color: #fff; padding: 10px; border-radius: 5px; cursor: pointer; transition: background 0.3s ease-in-out; } button:hover { background: linear-gradient(to right, #0072ff, #00c6ff); } ``` ```javascript const particlesContainer = document.querySelector(".particles-container"); for (let i = 0; i < 50; i++) { const particle = document.createElement("div"); particle.classList.add("particle"); particlesContainer.appendChild(particle); } document.addEventListener("mousemove", function (event) { const particles = document.querySelectorAll(".particle"); for (let i = 0; i < particles.length; i++) { const particle = particles[i]; const dx = event.clientX - particle.offsetLeft - particle.clientWidth / 2; const dy = event.clientY - particle.offsetTop - particle.clientHeight / 2; const angle = Math.atan2(dy, dx); const distance = Math.sqrt(dx * dx + dy * dy); const maxDistance = 200; const strength = (maxDistance - distance) / maxDistance; const x = Math.cos(angle) * strength * 20; const y = Math.sin(angle) * strength * 20; particle.style.transform = `translate(${x}px, ${y}px)`; } }); ``` 最后,将背景视频和登陆框放在一个容器中即可: ```html <div class="container"> <div class="video-bg"> <video src="background.mp4" autoplay loop muted></video> </div> <div class="login-container"> <!-- 登陆框代码 --> </div> </div> ``` 通过这些 CSS 和 JavaScript 效果的组合,我们可以创建一个充满科技感的前端登录界面,让用户有一种置身未来世界的感觉。

相关推荐

最新推荐

recommend-type

pre_o_1csdn63m9a1bs0e1rr51niuu33e.a

pre_o_1csdn63m9a1bs0e1rr51niuu33e.a
recommend-type

matlab建立计算力学课程的笔记和文件.zip

matlab建立计算力学课程的笔记和文件.zip
recommend-type

FT-Prog-v3.12.38.643-FTD USB 工作模式设定及eprom读写

FT_Prog_v3.12.38.643--FTD USB 工作模式设定及eprom读写
recommend-type

matlab基于RRT和人工势场法混合算法的路径规划.zip

matlab基于RRT和人工势场法混合算法的路径规划.zip
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

2. 通过python绘制y=e-xsin(2πx)图像

可以使用matplotlib库来绘制这个函数的图像。以下是一段示例代码: ```python import numpy as np import matplotlib.pyplot as plt def func(x): return np.exp(-x) * np.sin(2 * np.pi * x) x = np.linspace(0, 5, 500) y = func(x) plt.plot(x, y) plt.xlabel('x') plt.ylabel('y') plt.title('y = e^{-x} sin(2πx)') plt.show() ``` 运行这段
recommend-type

JSBSim Reference Manual

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

"互动学习:行动中的多样性与论文攻读经历"

多样性她- 事实上SCI NCES你的时间表ECOLEDO C Tora SC和NCESPOUR l’Ingén学习互动,互动学习以行动为中心的强化学习学会互动,互动学习,以行动为中心的强化学习计算机科学博士论文于2021年9月28日在Villeneuve d'Asq公开支持马修·瑟林评审团主席法布里斯·勒菲弗尔阿维尼翁大学教授论文指导奥利维尔·皮耶昆谷歌研究教授:智囊团论文联合主任菲利普·普雷教授,大学。里尔/CRISTAL/因里亚报告员奥利维耶·西格德索邦大学报告员卢多维奇·德诺耶教授,Facebook /索邦大学审查员越南圣迈IMT Atlantic高级讲师邀请弗洛里安·斯特鲁布博士,Deepmind对于那些及时看到自己错误的人...3谢谢你首先,我要感谢我的两位博士生导师Olivier和Philippe。奥利维尔,"站在巨人的肩膀上"这句话对你来说完全有意义了。从科学上讲,你知道在这篇论文的(许多)错误中,你是我可以依