Spaces:
Runtime error
Runtime error
Update templates/index.html
Browse files- templates/index.html +92 -197
templates/index.html
CHANGED
|
@@ -1,198 +1,93 @@
|
|
| 1 |
-
{% extends "layout.html" %}
|
| 2 |
-
|
| 3 |
-
{% block content %}
|
| 4 |
-
<
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
<
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
<
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
<
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
<
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
<
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
<h2 class="section-title">我的收藏</h2>
|
| 94 |
-
<button id="clearFavoritesBtn" class="clear-btn">清空收藏</button>
|
| 95 |
-
</div>
|
| 96 |
-
<div id="favoritesList" class="video-grid"></div>
|
| 97 |
-
<div class="empty-state" id="emptyFavorites">
|
| 98 |
-
<svg class="empty-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 99 |
-
<path d="M12 17.27L18.18 21L16.54 13.97L22 9.24L14.81 8.63L12 2L9.19 8.63L2 9.24L7.46 13.97L5.82 21L12 17.27Z" fill="currentColor"/>
|
| 100 |
-
</svg>
|
| 101 |
-
<div class="empty-title">暂无收藏内容</div>
|
| 102 |
-
<div class="empty-desc">点击视频右侧的星标图标将视频添加到收藏夹</div>
|
| 103 |
-
</div>
|
| 104 |
-
</div>
|
| 105 |
-
|
| 106 |
-
<!-- Profile Screen -->
|
| 107 |
-
<div class="screen" id="profileScreen">
|
| 108 |
-
<div class="profile-header">
|
| 109 |
-
<div class="profile-avatar">
|
| 110 |
-
<img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Profile">
|
| 111 |
-
</div>
|
| 112 |
-
<div class="profile-name">用户123456</div>
|
| 113 |
-
</div>
|
| 114 |
-
|
| 115 |
-
<div class="profile-stats">
|
| 116 |
-
<div class="stat-item">
|
| 117 |
-
<div class="stat-value" id="favoritesCount">0</div>
|
| 118 |
-
<div class="stat-label">收藏</div>
|
| 119 |
-
</div>
|
| 120 |
-
<div class="stat-item">
|
| 121 |
-
<div class="stat-value" id="likesCount">0</div>
|
| 122 |
-
<div class="stat-label">点赞</div>
|
| 123 |
-
</div>
|
| 124 |
-
<div class="stat-item">
|
| 125 |
-
<div class="stat-value" id="viewsCount">0</div>
|
| 126 |
-
<div class="stat-label">观看</div>
|
| 127 |
-
</div>
|
| 128 |
-
</div>
|
| 129 |
-
|
| 130 |
-
<div class="profile-actions">
|
| 131 |
-
<div class="action-row" data-action="settings">
|
| 132 |
-
<svg class="action-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 133 |
-
<path d="M12 12C14.21 12 16 10.21 16 8C16 5.79 14.21 4 12 4C9.79 4 8 5.79 8 8C8 10.21 9.79 12 12 12ZM12 14C9.33 14 4 15.34 4 18V20H20V18C20 15.34 14.67 14 12 14Z" fill="white"/>
|
| 134 |
-
</svg>
|
| 135 |
-
<div class="action-text">账号设置</div>
|
| 136 |
-
<svg class="action-arrow" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 137 |
-
<path d="M8.59 16.59L13.17 12L8.59 7.41L10 6L16 12L10 18L8.59 16.59Z" fill="white"/>
|
| 138 |
-
</svg>
|
| 139 |
-
</div>
|
| 140 |
-
<div class="action-row" data-action="preferences">
|
| 141 |
-
<svg class="action-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 142 |
-
<path d="M19.14 12.94C19.18 12.64 19.2 12.33 19.2 12C19.2 11.68 19.18 11.36 19.13 11.06L21.16 9.48C21.34 9.34 21.39 9.07 21.28 8.87L19.36 5.55C19.24 5.33 18.99 5.26 18.77 5.33L16.38 6.29C15.88 5.91 15.35 5.59 14.76 5.35L14.4 2.81C14.36 2.57 14.16 2.4 13.92 2.4H10.08C9.84 2.4 9.65 2.57 9.61 2.81L9.25 5.35C8.66 5.59 8.12 5.92 7.63 6.29L5.24 5.33C5.02 5.25 4.77 5.33 4.65 5.55L2.74 8.87C2.62 9.08 2.66 9.34 2.86 9.48L4.89 11.06C4.84 11.36 4.8 11.69 4.8 12C4.8 12.31 4.82 12.64 4.87 12.94L2.84 14.52C2.66 14.66 2.61 14.93 2.72 15.13L4.64 18.45C4.76 18.67 5.01 18.74 5.23 18.67L7.62 17.71C8.12 18.09 8.65 18.41 9.24 18.65L9.6 21.19C9.65 21.43 9.84 21.6 10.08 21.6H13.92C14.16 21.6 14.36 21.43 14.39 21.19L14.75 18.65C15.34 18.41 15.88 18.09 16.37 17.71L18.76 18.67C18.98 18.75 19.23 18.67 19.35 18.45L21.27 15.13C21.39 14.91 21.34 14.66 21.15 14.52L19.14 12.94ZM12 15.6C10.02 15.6 8.4 13.98 8.4 12C8.4 10.02 10.02 8.4 12 8.4C13.98 8.4 15.6 10.02 15.6 12C15.6 13.98 13.98 15.6 12 15.6Z" fill="white"/>
|
| 143 |
-
</svg>
|
| 144 |
-
<div class="action-text">偏好设置</div>
|
| 145 |
-
<svg class="action-arrow" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 146 |
-
<path d="M8.59 16.59L13.17 12L8.59 7.41L10 6L16 12L10 18L8.59 16.59Z" fill="white"/>
|
| 147 |
-
</svg>
|
| 148 |
-
</div>
|
| 149 |
-
<div class="action-row" data-action="about">
|
| 150 |
-
<svg class="action-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 151 |
-
<path d="M11.99 2C6.47 2 2 6.48 2 12C2 17.52 6.47 22 11.99 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 11.99 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z" fill="white"/>
|
| 152 |
-
</svg>
|
| 153 |
-
<div class="action-text">关于我们</div>
|
| 154 |
-
<svg class="action-arrow" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 155 |
-
<path d="M8.59 16.59L13.17 12L8.59 7.41L10 6L16 12L10 18L8.59 16.59Z" fill="white"/>
|
| 156 |
-
</svg>
|
| 157 |
-
</div>
|
| 158 |
-
<div class="action-row" data-action="logout">
|
| 159 |
-
<svg class="action-icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="color: #FF4D4F;">
|
| 160 |
-
<path d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z" fill="currentColor"/>
|
| 161 |
-
</svg>
|
| 162 |
-
<div class="action-text" style="color: #FF4D4F;">退出登录</div>
|
| 163 |
-
<svg class="action-arrow" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
| 164 |
-
<path d="M8.59 16.59L13.17 12L8.59 7.41L10 6L16 12L10 18L8.59 16.59Z" fill="white"/>
|
| 165 |
-
</svg>
|
| 166 |
-
</div>
|
| 167 |
-
</div>
|
| 168 |
-
</div>
|
| 169 |
-
|
| 170 |
-
<!-- Navigation Bar -->
|
| 171 |
-
<div class="nav-bar">
|
| 172 |
-
<div class="nav-item active" data-screen="homeScreen">
|
| 173 |
-
<svg class="nav-icon" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
| 174 |
-
<path d="M10 20V14H14V20H19V12H22L12 3L2 12H5V20H10Z"/>
|
| 175 |
-
</svg>
|
| 176 |
-
<div class="nav-label">首页</div>
|
| 177 |
-
</div>
|
| 178 |
-
<div class="nav-item" data-screen="historyScreen">
|
| 179 |
-
<svg class="nav-icon" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
| 180 |
-
<path d="M13 3C8.03 3 4 7.03 4 12H1L4.89 15.89L4.96 16.03L9 12H6C6 8.13 9.13 5 13 5C16.87 5 20 8.13 20 12C20 15.87 16.87 19 13 19C11.07 19 9.32 18.21 8.06 16.94L6.64 18.36C8.27 19.99 10.51 21 13 21C17.97 21 22 16.97 22 12C22 7.03 17.97 3 13 3ZM12 8V13L16.28 15.54L17 14.33L13.5 12.25V8H12Z"/>
|
| 181 |
-
</svg>
|
| 182 |
-
<div class="nav-label">历史</div>
|
| 183 |
-
</div>
|
| 184 |
-
<div class="nav-item" data-screen="favoritesScreen">
|
| 185 |
-
<svg class="nav-icon" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
| 186 |
-
<path d="M12 17.27L18.18 21L16.54 13.97L22 9.24L14.81 8.63L12 2L9.19 8.63L2 9.24L7.46 13.97L5.82 21L12 17.27Z"/>
|
| 187 |
-
</svg>
|
| 188 |
-
<div class="nav-label">收藏</div>
|
| 189 |
-
</div>
|
| 190 |
-
<div class="nav-item" data-screen="profileScreen">
|
| 191 |
-
<svg class="nav-icon" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
|
| 192 |
-
<path d="M12 12C14.21 12 16 10.21 16 8C16 5.79 14.21 4 12 4C9.79 4 8 5.79 8 8C8 10.21 9.79 12 12 12ZM12 14C9.33 14 4 15.34 4 18V20H20V18C20 15.34 14.67 14 12 14Z"/>
|
| 193 |
-
</svg>
|
| 194 |
-
<div class="nav-label">我的</div>
|
| 195 |
-
</div>
|
| 196 |
-
</div>
|
| 197 |
-
</div>
|
| 198 |
{% endblock %}
|
|
|
|
| 1 |
+
{% extends "layout.html" %}
|
| 2 |
+
|
| 3 |
+
{% block content %}
|
| 4 |
+
<!-- SVG Symbols新增点赞相关图标 -->
|
| 5 |
+
<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1"
|
| 6 |
+
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
| 7 |
+
<defs>
|
| 8 |
+
<!-- 原有图标保持不变,新增以下内容 -->
|
| 9 |
+
<symbol id="likes-icon" viewBox="0 0 24 24">
|
| 10 |
+
<path d="M12 21.35L10.55 20.03C5.4 15.36 2 12.28 2 8.5C2 5.42 4.42 3 7.5 3C9.24 3 10.91 3.81 12 5.09C13.09 3.81 14.76 3 16.5 3C19.58 3 22 5.42 22 8.5C22 12.28 18.6 15.36 13.45 20.04L12 21.35Z"/>
|
| 11 |
+
</symbol>
|
| 12 |
+
<symbol id="likes-empty-icon" viewBox="0 0 24 24">
|
| 13 |
+
<path d="M12 21.35L10.55 20.03C5.4 15.36 2 12.28 2 8.5C2 5.42 4.42 3 7.5 3C9.24 3 10.91 3.81 12 5.09C13.09 3.81 14.76 3 16.5 3C19.58 3 22 5.42 22 8.5C22 12.28 18.6 15.36 13.45 20.04L12 21.35Z"/>
|
| 14 |
+
</symbol>
|
| 15 |
+
</defs>
|
| 16 |
+
</svg>
|
| 17 |
+
|
| 18 |
+
<div class="app-container">
|
| 19 |
+
<!-- 新增点赞视频屏幕 -->
|
| 20 |
+
<section class="screen" id="likesScreen" role="region" aria-label="点赞视频">
|
| 21 |
+
<header class="screen-header">
|
| 22 |
+
<h2 class="section-title">我的点赞</h2>
|
| 23 |
+
<button id="clearLikesBtn"
|
| 24 |
+
class="clear-btn"
|
| 25 |
+
aria-label="清空点赞记录"
|
| 26 |
+
data-confirm="确定要清空所有点赞内容吗?">
|
| 27 |
+
清空点赞
|
| 28 |
+
</button>
|
| 29 |
+
</header>
|
| 30 |
+
<div id="likesList" class="video-grid"></div>
|
| 31 |
+
{{ empty_state('likes', '暂无点赞内容', '您点赞过的视频将会显示在这里') }}
|
| 32 |
+
</section>
|
| 33 |
+
|
| 34 |
+
<!-- 修改导航栏 -->
|
| 35 |
+
<nav class="nav-bar" role="navigation" aria-label="主菜单">
|
| 36 |
+
{% for item in [
|
| 37 |
+
('home', '首页'),
|
| 38 |
+
('history', '历史'),
|
| 39 |
+
('favorites', '收藏'),
|
| 40 |
+
('likes', '点赞'),
|
| 41 |
+
('profile', '我的')
|
| 42 |
+
] %}
|
| 43 |
+
<button class="nav-item {{ 'active' if loop.first }}"
|
| 44 |
+
data-screen="{{ item[0] }}Screen"
|
| 45 |
+
aria-label="{{ item[1] }}"
|
| 46 |
+
aria-current="{{ 'page' if loop.first else 'false' }}">
|
| 47 |
+
<svg class="nav-icon">
|
| 48 |
+
<use xlink:href="#{{ item[0] }}-icon"/>
|
| 49 |
+
</svg>
|
| 50 |
+
<span class="nav-label">{{ item[1] }}</span>
|
| 51 |
+
</button>
|
| 52 |
+
{% endfor %}
|
| 53 |
+
</nav>
|
| 54 |
+
</div>
|
| 55 |
+
|
| 56 |
+
<!-- 更新空状态宏 -->
|
| 57 |
+
{% macro empty_state(type, title, description) %}
|
| 58 |
+
<div class="empty-state">
|
| 59 |
+
<svg class="empty-icon">
|
| 60 |
+
<use xlink:href="#{{ type }}-empty-icon"/>
|
| 61 |
+
</svg>
|
| 62 |
+
<div class="empty-info">
|
| 63 |
+
<h3 class="empty-title">{{ title }}</h3>
|
| 64 |
+
<p class="empty-desc">{{ description }}</p>
|
| 65 |
+
</div>
|
| 66 |
+
</div>
|
| 67 |
+
{% endmacro %}
|
| 68 |
+
|
| 69 |
+
<!-- 新增点赞视���卡片模板 -->
|
| 70 |
+
<script type="text/template" id="videoCardTemplate">
|
| 71 |
+
<div class="video-card" data-video-id="<%= id %>">
|
| 72 |
+
<img class="video-thumb"
|
| 73 |
+
src="<%= thumbnail %>"
|
| 74 |
+
alt="<%= title %>"
|
| 75 |
+
width="320"
|
| 76 |
+
height="180"
|
| 77 |
+
loading="lazy">
|
| 78 |
+
<div class="video-info">
|
| 79 |
+
<h3 class="video-title"><%= title %></h3>
|
| 80 |
+
<div class="video-stats">
|
| 81 |
+
<span class="stat-item">
|
| 82 |
+
<svg class="icon-sm"><use xlink:href="#like-icon"/></svg>
|
| 83 |
+
<%= likesCount %>
|
| 84 |
+
</span>
|
| 85 |
+
<span class="stat-item">
|
| 86 |
+
<svg class="icon-sm"><use xlink:href="#comment-icon"/></svg>
|
| 87 |
+
<%= commentsCount %>
|
| 88 |
+
</span>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
{% endblock %}
|