一、页面结构
1. 页面主体布局
采用左右分栏设计,页面水平分为两个主要部分
2. 左侧视觉区域
整个左侧区域显示一张医疗主题的背景图片,可以是医生问诊、医疗科技或关爱患者的场景图
3. 右侧登录区域
包含以下元素:
-
平台Logo和欢迎标语
-
第三方快捷登录按钮组:微信登录按钮、谷歌登录按钮
-
分割线和'或'标识
-
账号密码登录表单:
-
账号输入框
-
密码输入框
-
登录按钮
-
-
底部辅助链接:
-
'忘记密码'链接(左侧)
-
'立即注册'链接(右侧)
-
4. 响应式设计
在移动端时自动隐藏左侧图片区域,保留登录功能区完整显示。
二、效果演示
三、示例代码
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>医疗平台 - 登录页</title>
<link type="text/css" href="css/family.css" rel="stylesheet" />
<link type="text/css" href="css/all.min.css" rel="stylesheet" />
</head>
<body>
<div class="water-mark water-mark-left">
公众号【<span class="gzh-tips">木番薯科技</span>】,<span class="ym-tips">获取源码</span>
</div>
<div class="water-mark water-mark-right">
公众号【<span class="gzh-tips">木番薯科技</span>】,<span class="ym-tips">获取源码</span>
</div>
<div class="flex min-h-screen">
<div class="hidden lg:block lg:w-1/2">
<img src="./images/login1.jpg" class="w-full h-full object-cover" alt="医疗场景">
</div>
<div class="w-full lg:w-1/2 flex items-center justify-center px-8">
<div class="w-full max-w-md">
<div class="text-center mb-12">
<h1 class="font-['Pacifico'] text-4xl mb-4 text-custom">logo</h1>
<p class="text-gray-600 text-lg">欢迎使用智慧医疗平台</p>
</div>
<div class="space-y-4 mb-8">
<button
class="w-full flex items-center justify-center space-x-2 bg-[#07C160] text-white py-3 !rounded-button">
<i class="fab fa-weixin text-xl"></i>
<span>微信登录</span>
</button>
<button class="w-full flex items-center justify-center space-x-2 border border-gray-300 py-3 !rounded-button">
<i class="fab fa-google text-xl"></i>
<span>谷歌登录</span>
</button>
</div>
<div class="relative my-8">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t border-gray-300"></div>
</div>
<div class="relative flex justify-center text-sm">
<span class="px-4 bg-white text-gray-500">或</span>
</div>
</div>
<form class="space-y-6">
<div>
<div class="relative">
<i class="fas fa-user absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"></i>
<input type="text" placeholder="请输入账号"
class="w-full pl-10 pr-4 py-3 border border-gray-300 !rounded-button focus:border-custom focus:ring-1 focus:ring-custom" />
</div>
</div>
<div>
<div class="relative">
<i class="fas fa-lock absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"></i>
<input type="password" placeholder="请输入密码"
class="w-full pl-10 pr-4 py-3 border border-gray-300 !rounded-button focus:border-custom focus:ring-1 focus:ring-custom" />
</div>
</div>
<button type="submit"
class="w-full bg-custom text-white py-3 !rounded-button hover:bg-opacity-90 transition-colors">
登录
</button>
</form>
<div class="flex justify-between mt-6 text-sm">
<a href="#" class="text-custom hover:underline">忘记密码?</a>
<a href="#" class="text-custom hover:underline">立即注册</a>
</div>
</div>
</div>
</div>
</body>
</html>