当前位置: 首页 > news >正文

用html5写一个手机ui

我将为您展示一个完整的HTML5移动端UI设计,包含多种UI元素和交互效果:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>移动端UI展示</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
            overflow-x: hidden;
            color: #e0e0e0;
            line-height: 1.6;
        }

        /* 状态栏 */
        .status-bar {
            height: 24px;
            background: rgba(15, 32, 39, 0.8);
            color: rgba(255, 255, 255, 0.85);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 15px;
            font-size: 12px;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        /* 导航栏 */
        .nav-bar {
            height: 56px;
            background: rgba(15, 32, 39, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        .nav-title {
            font-size: 18px;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.9);
        }

        .nav-back {
            position: absolute;
            left: 15px;
            width: 24px;
            height: 24px;
            background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>') no-repeat center;
            background-size: contain;
        }

        /* 主容器 */
        .container {
            padding: 20px 15px;
            padding-bottom: 80px;
        }

        /* 卡片样式 */
        .card {
            background: rgba(255, 255, 255, 0.08);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            animation: slideUp 0.3s ease-out;
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }

        @keyframes slideUp {
            from {
                transform: translateY(20px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        /* 按钮样式 */
        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-block;
            text-align: center;
            position: relative;
            overflow: hidden;
            color: white;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .btn:active {
            transform: scale(0.98);
            background: rgba(255, 255, 255, 0.25);
        }

        .btn-primary {
            background: rgba(41, 128, 185, 0.25);
        }

        .btn-primary:active {
            background: rgba(41, 128, 185, 0.35);
        }

        .btn-success {
            background: rgba(39, 174, 96, 0.25);
        }

        .btn-success:active {
            background: rgba(39, 174, 96, 0.35);
        }

        .btn-warning {
            background: rgba(230, 126, 34, 0.25);
        }

        .btn-warning:active {
            background: rgba(230, 126, 34, 0.35);
        }

        .btn-danger {
            background: rgba(231, 76, 60, 0.25);
        }

        .btn-danger:active {
            background: rgba(231, 76, 60, 0.35);
        }

        /* 输入框 */
        .input-group {
            margin-bottom: 15px;
        }

        .input-label {
            display: block;
            margin-bottom: 8px;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.7);
        }

        .input-field {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            font-size: 16px;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.9);
        }

        .input-field:focus {
            outline: none;
            border-color: rgba(52, 152, 219, 0.5);
            background: rgba(255, 255, 255, 0.12);
            box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
        }

        /* 列表项 */
        .list-item {
            padding: 15px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.05);
        }

        .list-item:active {
            background: rgba(255, 255, 255, 0.15);
            transform: scale(0.98);
        }

        .list-item-icon {
            width: 40px;
            height: 40px;
            background: rgba(41, 128, 185, 0.3);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 18px;
            margin-right: 15px;
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }

        .list-item-content {
            flex: 1;
        }

        .list-item-title {
            font-size: 16px;
            color: rgba(255, 255, 255, 0.9);
            margin-bottom: 4px;
        }

        .list-item-subtitle {
            font-size: 13px;
            color: rgba(255, 255, 255, 0.6);
        }

        /* 开关 */
        .switch {
            position: relative;
            width: 51px;
            height: 31px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(255, 255, 255, 0.2);
            transition: .4s;
            border-radius: 31px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 27px;
            width: 27px;
            left: 2px;
            bottom: 2px;
            background: white;
            transition: .4s;
            border-radius: 50%;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }

        input:checked + .slider {
            background: rgba(52, 152, 219, 0.5);
        }

        input:checked + .slider:before {
            transform: translateX(20px);
            background: white;
        }

        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 80px;
            background: rgba(15, 32, 39, 0.7);
            display: flex;
            justify-content: space-around;
            align-items: center;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .bottom-nav-item {
            flex: 1;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            color: rgba(255, 255, 255, 0.6);
        }

        .bottom-nav-item:active {
            color: rgba(255, 255, 255, 0.9);
        }

        .bottom-nav-item.active {
            color: #3498db;
        }

        .bottom-nav-icon {
            font-size: 24px;
            margin-bottom: 4px;
        }

        .bottom-nav-label {
            font-size: 12px;
        }

        /* 模态框 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            animation: fadeIn 0.3s ease-out;
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        .modal-content {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(15, 32, 39, 0.9);
            border-radius: 20px 20px 0 0;
            padding: 20px;
            animation: slideUpModal 0.3s ease-out;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            border-left: 1px solid rgba(255, 255, 255, 0.1);
            border-right: 1px solid rgba(255, 255, 255, 0.1);
        }

        @keyframes slideUpModal {
            from {
                transform: translateY(100%);
            }
            to {
                transform: translateY(0);
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .modal-title {
            font-size: 18px;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.9);
        }

        .modal-close {
            width: 24px;
            height: 24px;
            background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>') no-repeat center;
            background-size: contain;
            cursor: pointer;
        }

        /* 加载动画 */
        .loader {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255, 255, 255, 0.1);
            border-top: 3px solid #3498db;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 标签页 */
        .tabs {
            display: flex;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 8px;
            padding: 4px;
            margin-bottom: 20px;
            border: 1px solid rgba(255, 255, 255, 0.05);
        }

        .tab {
            flex: 1;
            padding: 10px;
            text-align: center;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.7);
        }

        .tab.active {
            background: rgba(52, 152, 219, 0.3);
            color: white;
        }

        /* 进度条 */
        .progress-bar {
            width: 100%;
            height: 8px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 4px;
            overflow: hidden;
            margin: 10px 0;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, r

http://www.dtcms.com/a/390360.html

相关文章:

  • 2.canvas学习
  • 【系统架构设计(34)】计算机网络架构与技术基础
  • 计网1.2 计算机网络体系结构与参考模型
  • ML-Watermelonbook
  • E/E架构新课题的解决方案
  • 【CVPR 2025】用于密集图像预测的频率动态卷积
  • 整体设计 语言拼凑/逻辑拆解/词典缝合 之 1 表达词项的散列/序列/行列 (豆包助手)
  • FPGA学习篇——Verilog学习之半加器的实现
  • Python快速入门专业版(三十五):函数实战2:文件内容统计工具(统计行数/单词数/字符数)
  • CSS的文本样式二【文本布局】
  • redis配置与优化
  • STM32 单片机 - 中断
  • 【网络工程师】ACL基础实验
  • 小实验--LCD1602显示字符和字符串
  • Java 的双亲委派模型(Parent Delegation Model)
  • ​​[硬件电路-249]:LDO(低压差线性稳压器)专用于线性电源,其核心设计逻辑与线性电源高度契合,而与开关电源的工作原理存在本质冲突。
  • conda命令行指令大全
  • TCP三次握手与四次挥手
  • Python读取Excel中指定列的所有单元格内容
  • 【DMA】DMA入门:理解DMA与CPU的并行
  • Redis数据库(一)—— 初步理解Redis:从基础配置到持久化机制
  • Salesforce中的事件驱动架构:构建灵活可扩展的企业应用
  • OpenCV实现消除功能
  • Qt QValueAxis详解
  • deepseek大模型部署
  • 消息队列与定时器:如何优雅地处理耗时任务?
  • Maya绑定基础知识总结合集:父子关系和父子约束对比、目标约束示例
  • STM32开发(中断模式:外部中断)
  • (圆方树)洛谷 P4630 APIO2018 铁人两项 题解
  • windows10 使用moon-pilot并配置模型