给我做一个YouTube网页
- User
给我做一个YouTube网页
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
给我做一个YouTube网页
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
以下是一个更加详细和完整的 YouTube 网页示例:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>YouTube 克隆</title>
<style>
/* 重置和基础样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
background-color: #f9f9f9;
line-height: 1.6;
}
/* 顶部导航栏 */
.top-nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
background-color: white;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1000;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.nav-left {
display: flex;
align-items: center;
}
.menu-icon {
cursor: pointer;
margin-right: 20px;
}
.logo {
display: flex;
align-items: center;
color: #FF0000;
font-weight: bold;
}
.nav-center {
display: flex;
flex-grow: 1;
max-width: 600px;
margin: 0 30px;
}
.search-input {
flex-grow: 1;
padding: 8px;
border: 1px solid #d3d3d3;
border-right: none;
border-radius: 2px 0 0 2px;
}
.search-button {
padding: 8px 20px;
background-color: #f8f8f8;
border: 1px solid #d3d3d3;
border-radius: 0 2px 2px 0;
cursor: pointer;
}
.nav-right {
display: flex;
align-items: center;
}
.nav-icons {
display: flex;
margin-right: 20px;
}
.nav-icons div {
margin: 0 10px;
cursor: pointer;
}
.user-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background-color: #888;
}
/* 侧边栏 */
.sidebar {
width: 240px;
height: 100vh;
background-color: white;
position: fixed;
top: 60px;
left: 0;
padding: 20px 0;
overflow-y: auto;
border-right: 1px solid #e0e0e0;
}
.sidebar-section {
margin-bottom: 15px;
border-bottom: 1px solid #e0e0e0;
padding-bottom: 15px;
}
.sidebar-item {
display: flex;
align-items: center;
padding: 10px 20px;
cursor: pointer;
}
.sidebar-item:hover {
background-color: #f0f0f0;
}
.sidebar-item img {
margin-right: 15px;
}
/* 主内容区 */
.main-content {
margin-top: 60px;
margin-left: 240px;
padding: 20px;
}
.video-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
}
.video-card {
background-color: white;
border-radius: 4px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
overflow: hidden;
transition: transform 0.2s;
}
.video-card:hover {
transform: scale(1.02);
}
.video-thumbnail {
width: 100%;
height: 200px;
object-fit: cover;
}
.video-info {
padding: 10px;
}
.video-title {
font-weight: bold;
margin-bottom: 5px;
}
.video-meta {
color: #606060;
font-size: 0.9em;
}
</style>
</head>
<body>
<!-- 顶部导航栏 -->
<nav class="top-nav">
<div class="nav-left">
<div class="menu-icon">☰</div>
<div class="logo">YouTube</div>
</div>
<div class="nav-center">
<input type="text" class="search-input" placeholder="搜索">
<button class="search-button">🔍</button>
</div>
<div class="nav-right">
<div class="nav-icons">
<div>➕</div>
<div>📱</div>
<div>🔔</div>
</div>
<div class="user-avatar"></div>
</div>
</nav>
<!-- 侧边栏 -->
<div class="sidebar">
<div class="sidebar-section">
<div class="sidebar-item">🏠 首页</div>
<div class="sidebar-item">🔥 热门</div>
<div class="sidebar-item">📺 订阅</div>
</div>
<div class="sidebar-section">
<div class="sidebar-item">📁 资料库</div>
<div class="sidebar-item">📜 历史记录</div>
<div class="sidebar-item">📺 我的视频</div>
</div>
</div>
<!-- 主内容区 -->
<main class="main-content">
<div class="video-grid">
<!-- 视频卡片 -->
<div class="video-card">
<img src="https://via.placeholder.com/250x200" class="video-thumbnail">
<div class="video-info">
<div class="video-title">视频标题1</div>
<div class="video-meta">频道名称 • 100万观看次数 • 1天前</div>
</div>
</div>
<!-- 重复多个视频卡片 -->
<div class="video-card">
<img src="https://via.placeholder.com/250x200" class="video-thumbnail">
<div class="video-info">
<div class="video-title">视频标题2</div>
<div class="video-meta">频道名称 • 50万观看次数 • 3天前</div>
</div>
</div>
<!-- 可以继续添加更多视频卡片 -->
</div>
</main>
</body>
</html>
这个版本的 YouTube 克隆页面包含:
特点:
你可以根据需要进一步完善和定制这个页面。