Spaces:
Running
Running
ชื่อโปรเจกต์: Strava Activity Feed & Stats Mockupเป้าหมาย: สร้างไฟล์ HTML5 เดี่ยว (.html) ที่ประกอบด้วย HTML, CSS, และ JavaScript ทั้งหมด เพื่อจำลองหน้า Activity Feed (ฟีดกิจกรรม) และส่วนแสดง Weekly/Monthly Totals (สถิติรวมรายสัปดาห์/รายเดือน) ของแอป Strava ซึ่งเน้นการแสดงผลเชิงสังคม (Social) และข้อมูลการฝึกซ้อม (Performance Data)📝 รายละเอียด Prompt1. โครงสร้างไฟล์ (File Structure)ต้องเป็น ไฟล์ HTML5 เดี่ยว (index.html หรือชื่ออื่นตามสะดวก)HTML, CSS, และ JavaScript ทั้งหมดต้องอยู่ในไฟล์เดียวCSS ต้องอยู่ในแท็ก <style> (ใช้ Dark Mode และโทนสีส้ม/เทาของ Strava)JavaScript ต้องอยู่ในแท็ก <script> (ใช้ Vanilla JS ในการจัดการ DOM เพื่อสร้างฟีดกิจกรรม)ห้ามใช้ Library/Framework ภายนอก (เช่น React, Vue, jQuery, หรือ Library แผนที่/ชาร์ต)2. ข้อมูลจำลอง (Mock Data)สร้างโครงสร้างข้อมูล JavaScript เพื่อจำลอง Activity Feed (อย่างน้อย 5 กิจกรรม) และ Weekly/Monthly Totals ดังนี้:A. Activity Feed Data (อาร์เรย์ของกิจกรรม)FieldDescriptionTypeExampleidรหัสกิจกรรมNumber101athleteNameชื่อนักกีฬาString"Chris Froome"avatarUrlURL รูปโปรไฟล์Stringhttps://via.placeholder.com/40/FF5500activityTypeประเภทกิจกรรมString"Run" หรือ "Ride"activityTitleชื่อกิจกรรมString"Morning Interval Training"distanceระยะทาง (กม.)Number15.2timeเวลา (ชั่วโมง:นาที:วินาที)String"0:58:30"elevationความสูงที่สะสม (เมตร)Number250kudosจำนวน Kudos (Likes)Number58commentsจำนวน CommentsNumber5mapImageUrlURL รูปแผนที่จำลองStringhttps://via.placeholder.com/600x200/444444/FFFFFF?text=Route+Map+MockupB. Totals Data (สถิติรวม)FieldDescriptionTypeExampleweeklyDistanceระยะรวมสัปดาห์นี้Number85.5weeklyTimeเวลารวมสัปดาห์นี้String"5h 45m"monthlyDistanceระยะรวมเดือนนี้Number320.1monthlyActivitiesจำนวนกิจกรรมรวมเดือนนี้Number153. องค์ประกอบของ Dashboard (Dashboard Components)Dashboard ต้องเน้นองค์ประกอบหลัก 3 ส่วนของ Strava:A. Sidebar/Weekly Totals (สถิติรวมรายสัปดาห์)แสดง Weekly Totals (weeklyDistance, weeklyTime)Goals Mockup: แสดง Progress Bar จำลองความคืบหน้าของเป้าหมายรายสัปดาห์ (เช่น 85.5/100 km).B. Activity Feed (ส่วนกลาง)ต้องใช้ JavaScript ในการวนซ้ำ (Loop) ข้อมูล Activity Feed Data เพื่อสร้าง Card กิจกรรมแต่ละรายการActivity Card Layout: แต่ละ Card ต้องแสดง:รูป Avatar และชื่อนักกีฬาประเภทกิจกรรม (พร้อม Icon ที่เหมาะสม เช่น 🏃♂️ หรือ 🚴♀️)ชื่อกิจกรรมที่โดดเด่นสถิติหลัก 3 ตัว: ระยะทาง (distance), เวลา (time), ความสูง (elevation)Map Mockup: แสดงรูป mapImageUrl (ให้ดูเหมือนเส้นทาง GPS)Social Bar: แสดงจำนวน Kudos, Comments, และปุ่มจำลอง "Give Kudos" (ต้องมีฟังก์ชัน JS ง่ายๆ ในการเพิ่ม Kudos เมื่อคลิก)C. Challenges/Clubs Mockup (การแข่งขันและคลับ)แสดง Card เล็กๆ จำลองการเข้าร่วม Challenge (เช่น "November Running Challenge") และ Club (เช่น "Local Runners Club") พร้อมตัวเลขจำนวนสมาชิก/ความคืบหน้า4. คุณสมบัติการโต้ตอบ (Interactive Features)Kudos Counter: เมื่อผู้ใช้คลิกปุ่ม "Give Kudos" บน Activity Card ใดๆ JavaScript ต้อง เพิ่มจำนวน Kudos ของกิจกรรมนั้นๆ บนหน้าจอทันทีInfinite Scroll Mockup: เพิ่มปุ่ม/ข้อความที่ส่วนท้ายของฟีด เช่น "Load More Activities" (แสดงให้เห็นถึงแนวคิดการโหลดข้อมูลเพิ่ม)Filter Mockup: มีปุ่ม/แถบด้านบนสำหรับ "Following" และ "Yours" (แสดงให้เห็นถึงแนวคิดการเปลี่ยนฟีด)5. ข้อจำกัดด้านการออกแบบ (Design Constraints)โทนสี Strava: ใช้สีเทา/ดำ (Dark Mode) เป็นพื้นหลัง และสีส้ม (#FC4C02 หรือใกล้เคียง) สำหรับ Accent Color, ปุ่ม, และกราฟTypography: ใช้ฟอนต์ที่อ่านง่ายและสะอาด (เช่น System Font หรือ Sans-serif)🚀 สิ่งที่ต้องการจากการตอบกลับโค้ด HTML5 ที่ทำงานได้เต็มรูปแบบ (Full working HTML5 file) พร้อมข้อมูลจำลองและฟังก์ชัน JavaScript ข้างต้น เพื่อเป็น Mockup Dashboard ของ Strava ที่จำลอง Activity Feed และ Social Component ได้อย่างครบถ้วน
Browse files- README.md +8 -5
- index.html +722 -19
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Strava Social Dash
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Strava Social Dash 🏃♂️🔥
|
| 3 |
+
colorFrom: green
|
| 4 |
+
colorTo: yellow
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
index.html
CHANGED
|
@@ -1,19 +1,722 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="th">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Strava Activity Feed Mockup</title>
|
| 7 |
+
<style>
|
| 8 |
+
* {
|
| 9 |
+
margin: 0;
|
| 10 |
+
padding: 0;
|
| 11 |
+
box-sizing: border-box;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
:root {
|
| 15 |
+
--strava-orange: #FC4C02;
|
| 16 |
+
--dark-bg: #0d1117;
|
| 17 |
+
--card-bg: #161b22;
|
| 18 |
+
--text-primary: #c9d1d9;
|
| 19 |
+
--text-secondary: #8b949e;
|
| 20 |
+
--border-color: #30363d;
|
| 21 |
+
--success-green: #3fb950;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
body {
|
| 25 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
| 26 |
+
background-color: var(--dark-bg);
|
| 27 |
+
color: var(--text-primary);
|
| 28 |
+
line-height: 1.6;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.container {
|
| 32 |
+
max-width: 1400px;
|
| 33 |
+
margin: 0 auto;
|
| 34 |
+
padding: 20px;
|
| 35 |
+
display: grid;
|
| 36 |
+
grid-template-columns: 320px 1fr;
|
| 37 |
+
gap: 24px;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
/* Header */
|
| 41 |
+
.header {
|
| 42 |
+
grid-column: 1 / -1;
|
| 43 |
+
background-color: var(--card-bg);
|
| 44 |
+
border-radius: 12px;
|
| 45 |
+
padding: 16px 24px;
|
| 46 |
+
display: flex;
|
| 47 |
+
justify-content: space-between;
|
| 48 |
+
align-items: center;
|
| 49 |
+
border: 1px solid var(--border-color);
|
| 50 |
+
margin-bottom: 10px;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.logo {
|
| 54 |
+
font-size: 24px;
|
| 55 |
+
font-weight: 800;
|
| 56 |
+
color: var(--strava-orange);
|
| 57 |
+
display: flex;
|
| 58 |
+
align-items: center;
|
| 59 |
+
gap: 8px;
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.filter-buttons {
|
| 63 |
+
display: flex;
|
| 64 |
+
gap: 8px;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
.filter-btn {
|
| 68 |
+
padding: 8px 16px;
|
| 69 |
+
border: 1px solid var(--border-color);
|
| 70 |
+
background-color: var(--dark-bg);
|
| 71 |
+
color: var(--text-secondary);
|
| 72 |
+
border-radius: 20px;
|
| 73 |
+
cursor: pointer;
|
| 74 |
+
transition: all 0.3s ease;
|
| 75 |
+
font-size: 14px;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.filter-btn:hover {
|
| 79 |
+
border-color: var(--strava-orange);
|
| 80 |
+
color: var(--strava-orange);
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.filter-btn.active {
|
| 84 |
+
background-color: var(--strava-orange);
|
| 85 |
+
border-color: var(--strava-orange);
|
| 86 |
+
color: white;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
/* Sidebar */
|
| 90 |
+
.sidebar {
|
| 91 |
+
display: flex;
|
| 92 |
+
flex-direction: column;
|
| 93 |
+
gap: 20px;
|
| 94 |
+
height: fit-content;
|
| 95 |
+
position: sticky;
|
| 96 |
+
top: 20px;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.stats-card, .challenge-card, .club-card {
|
| 100 |
+
background-color: var(--card-bg);
|
| 101 |
+
border-radius: 12px;
|
| 102 |
+
padding: 20px;
|
| 103 |
+
border: 1px solid var(--border-color);
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
.card-title {
|
| 107 |
+
font-size: 16px;
|
| 108 |
+
font-weight: 600;
|
| 109 |
+
margin-bottom: 16px;
|
| 110 |
+
color: var(--text-primary);
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.stat-item {
|
| 114 |
+
display: flex;
|
| 115 |
+
justify-content: space-between;
|
| 116 |
+
align-items: center;
|
| 117 |
+
padding: 8px 0;
|
| 118 |
+
border-bottom: 1px solid var(--border-color);
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
.stat-item:last-child {
|
| 122 |
+
border-bottom: none;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
.stat-label {
|
| 126 |
+
color: var(--text-secondary);
|
| 127 |
+
font-size: 14px;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.stat-value {
|
| 131 |
+
font-weight: 700;
|
| 132 |
+
color: var(--text-primary);
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
.progress-bar {
|
| 136 |
+
margin-top: 16px;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
.progress-label {
|
| 140 |
+
display: flex;
|
| 141 |
+
justify-content: space-between;
|
| 142 |
+
font-size: 12px;
|
| 143 |
+
color: var(--text-secondary);
|
| 144 |
+
margin-bottom: 6px;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
.progress-track {
|
| 148 |
+
width: 100%;
|
| 149 |
+
height: 8px;
|
| 150 |
+
background-color: var(--dark-bg);
|
| 151 |
+
border-radius: 4px;
|
| 152 |
+
overflow: hidden;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
.progress-fill {
|
| 156 |
+
height: 100%;
|
| 157 |
+
background-color: var(--strava-orange);
|
| 158 |
+
transition: width 0.5s ease;
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
/* Activity Feed */
|
| 162 |
+
.activity-feed {
|
| 163 |
+
display: flex;
|
| 164 |
+
flex-direction: column;
|
| 165 |
+
gap: 20px;
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
.activity-card {
|
| 169 |
+
background-color: var(--card-bg);
|
| 170 |
+
border-radius: 12px;
|
| 171 |
+
padding: 20px;
|
| 172 |
+
border: 1px solid var(--border-color);
|
| 173 |
+
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
.activity-card:hover {
|
| 177 |
+
transform: translateY(-2px);
|
| 178 |
+
box-shadow: 0 4px 12px rgba(252, 76, 2, 0.1);
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
.athlete-header {
|
| 182 |
+
display: flex;
|
| 183 |
+
align-items: center;
|
| 184 |
+
gap: 12px;
|
| 185 |
+
margin-bottom: 16px;
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
.avatar {
|
| 189 |
+
width: 40px;
|
| 190 |
+
height: 40px;
|
| 191 |
+
border-radius: 50%;
|
| 192 |
+
object-fit: cover;
|
| 193 |
+
border: 2px solid var(--strava-orange);
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
.athlete-info {
|
| 197 |
+
flex: 1;
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
.athlete-name {
|
| 201 |
+
font-weight: 600;
|
| 202 |
+
color: var(--text-primary);
|
| 203 |
+
font-size: 14px;
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
.activity-type {
|
| 207 |
+
display: flex;
|
| 208 |
+
align-items: center;
|
| 209 |
+
gap: 4px;
|
| 210 |
+
font-size: 12px;
|
| 211 |
+
color: var(--text-secondary);
|
| 212 |
+
margin-top: 2px;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
.activity-title {
|
| 216 |
+
font-size: 18px;
|
| 217 |
+
font-weight: 700;
|
| 218 |
+
margin-bottom: 16px;
|
| 219 |
+
color: var(--text-primary);
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
.stats-grid {
|
| 223 |
+
display: grid;
|
| 224 |
+
grid-template-columns: repeat(3, 1fr);
|
| 225 |
+
gap: 16px;
|
| 226 |
+
margin-bottom: 16px;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
.stat-box {
|
| 230 |
+
text-align: center;
|
| 231 |
+
padding: 12px;
|
| 232 |
+
background-color: var(--dark-bg);
|
| 233 |
+
border-radius: 8px;
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
.stat-box-value {
|
| 237 |
+
font-size: 20px;
|
| 238 |
+
font-weight: 800;
|
| 239 |
+
color: var(--strava-orange);
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
.stat-box-label {
|
| 243 |
+
font-size: 12px;
|
| 244 |
+
color: var(--text-secondary);
|
| 245 |
+
margin-top: 4px;
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
.map-mock {
|
| 249 |
+
width: 100%;
|
| 250 |
+
height: 200px;
|
| 251 |
+
background-color: var(--dark-bg);
|
| 252 |
+
border-radius: 8px;
|
| 253 |
+
margin-bottom: 16px;
|
| 254 |
+
overflow: hidden;
|
| 255 |
+
position: relative;
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
.map-mock img {
|
| 259 |
+
width: 100%;
|
| 260 |
+
height: 100%;
|
| 261 |
+
object-fit: cover;
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
.map-placeholder {
|
| 265 |
+
position: absolute;
|
| 266 |
+
top: 50%;
|
| 267 |
+
left: 50%;
|
| 268 |
+
transform: translate(-50%, -50%);
|
| 269 |
+
color: var(--text-secondary);
|
| 270 |
+
font-size: 14px;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
.social-bar {
|
| 274 |
+
display: flex;
|
| 275 |
+
justify-content: space-between;
|
| 276 |
+
align-items: center;
|
| 277 |
+
padding-top: 16px;
|
| 278 |
+
border-top: 1px solid var(--border-color);
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
.social-stats {
|
| 282 |
+
display: flex;
|
| 283 |
+
gap: 20px;
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
.social-stat {
|
| 287 |
+
display: flex;
|
| 288 |
+
align-items: center;
|
| 289 |
+
gap: 6px;
|
| 290 |
+
color: var(--text-secondary);
|
| 291 |
+
font-size: 14px;
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
.kudos-btn {
|
| 295 |
+
display: flex;
|
| 296 |
+
align-items: center;
|
| 297 |
+
gap: 8px;
|
| 298 |
+
padding: 8px 16px;
|
| 299 |
+
background-color: var(--dark-bg);
|
| 300 |
+
border: 1px solid var(--border-color);
|
| 301 |
+
color: var(--text-secondary);
|
| 302 |
+
border-radius: 20px;
|
| 303 |
+
cursor: pointer;
|
| 304 |
+
transition: all 0.3s ease;
|
| 305 |
+
font-size: 14px;
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
.kudos-btn:hover {
|
| 309 |
+
border-color: var(--strava-orange);
|
| 310 |
+
color: var(--strava-orange);
|
| 311 |
+
transform: scale(1.05);
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
.kudos-btn.given {
|
| 315 |
+
background-color: var(--strava-orange);
|
| 316 |
+
color: white;
|
| 317 |
+
border-color: var(--strava-orange);
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
.challenge-card small, .club-card small {
|
| 321 |
+
display: block;
|
| 322 |
+
color: var(--text-secondary);
|
| 323 |
+
font-size: 12px;
|
| 324 |
+
margin-top: 8px;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
.challenge-progress {
|
| 328 |
+
margin-top: 12px;
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
.load-more {
|
| 332 |
+
text-align: center;
|
| 333 |
+
padding: 20px;
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
.load-more-btn {
|
| 337 |
+
padding: 10px 24px;
|
| 338 |
+
background-color: var(--card-bg);
|
| 339 |
+
border: 1px solid var(--border-color);
|
| 340 |
+
color: var(--text-secondary);
|
| 341 |
+
border-radius: 20px;
|
| 342 |
+
cursor: pointer;
|
| 343 |
+
transition: all 0.3s ease;
|
| 344 |
+
font-size: 14px;
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
.load-more-btn:hover {
|
| 348 |
+
border-color: var(--strava-orange);
|
| 349 |
+
color: var(--strava-orange);
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
/* Icons */
|
| 353 |
+
.icon {
|
| 354 |
+
display: inline-block;
|
| 355 |
+
width: 16px;
|
| 356 |
+
height: 16px;
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
@media (max-width: 1024px) {
|
| 360 |
+
.container {
|
| 361 |
+
grid-template-columns: 1fr;
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
.sidebar {
|
| 365 |
+
position: static;
|
| 366 |
+
display: grid;
|
| 367 |
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
| 368 |
+
}
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
@media (max-width: 640px) {
|
| 372 |
+
.stats-grid {
|
| 373 |
+
grid-template-columns: 1fr;
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
.social-bar {
|
| 377 |
+
flex-direction: column;
|
| 378 |
+
gap: 12px;
|
| 379 |
+
}
|
| 380 |
+
|
| 381 |
+
.filter-buttons {
|
| 382 |
+
flex-wrap: wrap;
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
.header {
|
| 386 |
+
flex-direction: column;
|
| 387 |
+
gap: 12px;
|
| 388 |
+
}
|
| 389 |
+
}
|
| 390 |
+
</style>
|
| 391 |
+
</head>
|
| 392 |
+
<body>
|
| 393 |
+
<div class="container">
|
| 394 |
+
<!-- Header -->
|
| 395 |
+
<header class="header">
|
| 396 |
+
<div class="logo">
|
| 397 |
+
🏃♂️ Strava Social Dash
|
| 398 |
+
</div>
|
| 399 |
+
<div class="filter-buttons">
|
| 400 |
+
<button class="filter-btn active" data-filter="following">กำลังติดตาม</button>
|
| 401 |
+
<button class="filter-btn" data-filter="yours">ของคุณ</button>
|
| 402 |
+
</div>
|
| 403 |
+
</header>
|
| 404 |
+
|
| 405 |
+
<!-- Sidebar -->
|
| 406 |
+
<aside class="sidebar">
|
| 407 |
+
<!-- Weekly Stats -->
|
| 408 |
+
<div class="stats-card">
|
| 409 |
+
<h3 class="card-title">📊 สถิติประจำสัปดาห์</h3>
|
| 410 |
+
<div class="stat-item">
|
| 411 |
+
<span class="stat-label">ระยะทาง</span>
|
| 412 |
+
<span class="stat-value" id="weeklyDistance">85.5 กม.</span>
|
| 413 |
+
</div>
|
| 414 |
+
<div class="stat-item">
|
| 415 |
+
<span class="stat-label">เวลา</span>
|
| 416 |
+
<span class="stat-value" id="weeklyTime">5h 45m</span>
|
| 417 |
+
</div>
|
| 418 |
+
<div class="progress-bar">
|
| 419 |
+
<div class="progress-label">
|
| 420 |
+
<span>ความคืบหน้าเป้าหมาย</span>
|
| 421 |
+
<span>85.5 / 100 กม.</span>
|
| 422 |
+
</div>
|
| 423 |
+
<div class="progress-track">
|
| 424 |
+
<div class="progress-fill" style="width: 85.5%"></div>
|
| 425 |
+
</div>
|
| 426 |
+
</div>
|
| 427 |
+
</div>
|
| 428 |
+
|
| 429 |
+
<!-- Monthly Stats -->
|
| 430 |
+
<div class="stats-card">
|
| 431 |
+
<h3 class="card-title">📈 สถิติประจำเดือน</h3>
|
| 432 |
+
<div class="stat-item">
|
| 433 |
+
<span class="stat-label">ระยะทางรวม</span>
|
| 434 |
+
<span class="stat-value" id="monthlyDistance">320.1 กม.</span>
|
| 435 |
+
</div>
|
| 436 |
+
<div class="stat-item">
|
| 437 |
+
<span class="stat-label">กิจกรรมทั้งหมด</span>
|
| 438 |
+
<span class="stat-value" id="monthlyActivities">15 ครั้ง</span>
|
| 439 |
+
</div>
|
| 440 |
+
</div>
|
| 441 |
+
|
| 442 |
+
<!-- Challenge -->
|
| 443 |
+
<div class="challenge-card">
|
| 444 |
+
<h3 class="card-title">🏆 ความท้าทาย</h3>
|
| 445 |
+
<div>
|
| 446 |
+
<strong>November Running Challenge</strong>
|
| 447 |
+
<small>ความคืบหน้า: 85.5 / 100 กม.</small>
|
| 448 |
+
</div>
|
| 449 |
+
<div class="challenge-progress">
|
| 450 |
+
<div class="progress-track">
|
| 451 |
+
<div class="progress-fill" style="width: 85.5%"></div>
|
| 452 |
+
</div>
|
| 453 |
+
</div>
|
| 454 |
+
</div>
|
| 455 |
+
|
| 456 |
+
<!-- Club -->
|
| 457 |
+
<div class="club-card">
|
| 458 |
+
<h3 class="card-title">👥 คลับ</h3>
|
| 459 |
+
<div>
|
| 460 |
+
<strong>Local Runners Club</strong>
|
| 461 |
+
<small>สมาชิก 1,234 คน</small>
|
| 462 |
+
</div>
|
| 463 |
+
</div>
|
| 464 |
+
</aside>
|
| 465 |
+
|
| 466 |
+
<!-- Activity Feed -->
|
| 467 |
+
<main class="activity-feed" id="activityFeed">
|
| 468 |
+
<!-- Activities will be inserted here by JavaScript -->
|
| 469 |
+
</main>
|
| 470 |
+
|
| 471 |
+
<!-- Load More -->
|
| 472 |
+
<div class="load-more" style="grid-column: 1 / -1;">
|
| 473 |
+
<button class="load-more-btn" id="loadMoreBtn">โหลดกิจกรรมเพิ่มเติม</button>
|
| 474 |
+
</div>
|
| 475 |
+
</div>
|
| 476 |
+
|
| 477 |
+
<script>
|
| 478 |
+
// Mock Data
|
| 479 |
+
const mockActivities = [
|
| 480 |
+
{
|
| 481 |
+
id: 101,
|
| 482 |
+
athleteName: "Chris Froome",
|
| 483 |
+
avatarUrl: "https://static.photos/people/200x200/42",
|
| 484 |
+
activityType: "Ride",
|
| 485 |
+
activityTitle: "Morning Interval Training",
|
| 486 |
+
distance: 15.2,
|
| 487 |
+
time: "0:58:30",
|
| 488 |
+
elevation: 250,
|
| 489 |
+
kudos: 58,
|
| 490 |
+
comments: 5,
|
| 491 |
+
mapImageUrl: "https://static.photos/technology/600x200/99"
|
| 492 |
+
},
|
| 493 |
+
{
|
| 494 |
+
id: 102,
|
| 495 |
+
athleteName: "เอมม่า โรเดส",
|
| 496 |
+
avatarUrl: "https://static.photos/people/200x200/88",
|
| 497 |
+
activityType: "Run",
|
| 498 |
+
activityTitle: "พักจบรอบสวนจุฬา",
|
| 499 |
+
distance: 8.5,
|
| 500 |
+
time: "0:45:12",
|
| 501 |
+
elevation: 45,
|
| 502 |
+
kudos: 32,
|
| 503 |
+
comments: 3,
|
| 504 |
+
mapImageUrl: "https://static.photos/nature/600x200/77"
|
| 505 |
+
},
|
| 506 |
+
{
|
| 507 |
+
id: 103,
|
| 508 |
+
athleteName: "Arsène Wenger",
|
| 509 |
+
avatarUrl: "https://static.photos/people/200x200/15",
|
| 510 |
+
activityType: "Ride",
|
| 511 |
+
activityTitle: "ออกปั่นรอบเขาใหญ่",
|
| 512 |
+
distance: 45.8,
|
| 513 |
+
time: "2:15:45",
|
| 514 |
+
elevation: 890,
|
| 515 |
+
kudos: 89,
|
| 516 |
+
comments: 12,
|
| 517 |
+
mapImageUrl: "https://static.photos/outdoor/600x200/55"
|
| 518 |
+
},
|
| 519 |
+
{
|
| 520 |
+
id: 104,
|
| 521 |
+
athleteName: "จารุวรรณ สมใจ",
|
| 522 |
+
avatarUrl: "https://static.photos/people/200x200/33",
|
| 523 |
+
activityType: "Run",
|
| 524 |
+
activityTitle: "วิ่งเช้า 5 โมงเช้า",
|
| 525 |
+
distance: 12.3,
|
| 526 |
+
time: "1:08:15",
|
| 527 |
+
elevation: 120,
|
| 528 |
+
kudos: 45,
|
| 529 |
+
comments: 8,
|
| 530 |
+
mapImageUrl: "https://static.photos/cityscape/600x200/11"
|
| 531 |
+
},
|
| 532 |
+
{
|
| 533 |
+
id: 105,
|
| 534 |
+
athleteName: "Robert Lewandowski",
|
| 535 |
+
avatarUrl: "https://static.photos/people/200x200/99",
|
| 536 |
+
activityType: "Ride",
|
| 537 |
+
activityTitle: "Recovery Ride หลังแข่ง",
|
| 538 |
+
distance: 25.5,
|
| 539 |
+
time: "1:30:00",
|
| 540 |
+
elevation: 180,
|
| 541 |
+
kudos: 67,
|
| 542 |
+
comments: 7,
|
| 543 |
+
mapImageUrl: "https://static.photos/blurred/600x200/22"
|
| 544 |
+
}
|
| 545 |
+
];
|
| 546 |
+
|
| 547 |
+
const activityIcons = {
|
| 548 |
+
'Run': '🏃♂️',
|
| 549 |
+
'Ride': '🚴♀️',
|
| 550 |
+
'Swim': '🏊♂️',
|
| 551 |
+
'Hike': '🥾'
|
| 552 |
+
};
|
| 553 |
+
|
| 554 |
+
// State to track kudos given
|
| 555 |
+
const kudosGiven = new Set();
|
| 556 |
+
|
| 557 |
+
// Render Activities
|
| 558 |
+
function renderActivities(activities) {
|
| 559 |
+
const feedContainer = document.getElementById('activityFeed');
|
| 560 |
+
|
| 561 |
+
activities.forEach(activity => {
|
| 562 |
+
const activityCard = document.createElement('div');
|
| 563 |
+
activityCard.className = 'activity-card';
|
| 564 |
+
activityCard.innerHTML = `
|
| 565 |
+
<div class="athlete-header">
|
| 566 |
+
<img src="${activity.avatarUrl}" alt="${activity.athleteName}" class="avatar">
|
| 567 |
+
<div class="athlete-info">
|
| 568 |
+
<div class="athlete-name">${activity.athleteName}</div>
|
| 569 |
+
<div class="activity-type">
|
| 570 |
+
<span class="icon">${activityIcons[activity.activityType] || '🏃♂️'}</span>
|
| 571 |
+
${activity.activityType}
|
| 572 |
+
</div>
|
| 573 |
+
</div>
|
| 574 |
+
</div>
|
| 575 |
+
|
| 576 |
+
<h2 class="activity-title">${activity.activityTitle}</h2>
|
| 577 |
+
|
| 578 |
+
<div class="stats-grid">
|
| 579 |
+
<div class="stat-box">
|
| 580 |
+
<div class="stat-box-value">${activity.distance}</div>
|
| 581 |
+
<div class="stat-box-label">กิโลเมตร</div>
|
| 582 |
+
</div>
|
| 583 |
+
<div class="stat-box">
|
| 584 |
+
<div class="stat-box-value">${activity.time}</div>
|
| 585 |
+
<div class="stat-box-label">เวลา</div>
|
| 586 |
+
</div>
|
| 587 |
+
<div class="stat-box">
|
| 588 |
+
<div class="stat-box-value">${activity.elevation}</div>
|
| 589 |
+
<div class="stat-box-label">เมตร</div>
|
| 590 |
+
</div>
|
| 591 |
+
</div>
|
| 592 |
+
|
| 593 |
+
<div class="map-mock">
|
| 594 |
+
<img src="${activity.mapImageUrl}" alt="Map">
|
| 595 |
+
<div class="map-placeholder">🗺️ เส้นทาง ${activity.distance} กม.</div>
|
| 596 |
+
</div>
|
| 597 |
+
|
| 598 |
+
<div class="social-bar">
|
| 599 |
+
<div class="social-stats">
|
| 600 |
+
<div class="social-stat">
|
| 601 |
+
<span class="icon">👏</span>
|
| 602 |
+
<span id="kudos-${activity.id}">${activity.kudos}</span>
|
| 603 |
+
</div>
|
| 604 |
+
<div class="social-stat">
|
| 605 |
+
<span class="icon">💬</span>
|
| 606 |
+
<span>${activity.comments}</span>
|
| 607 |
+
</div>
|
| 608 |
+
</div>
|
| 609 |
+
<button class="kudos-btn ${kudosGiven.has(activity.id) ? 'given' : ''}"
|
| 610 |
+
onclick="giveKudos(${activity.id})"
|
| 611 |
+
id="kudos-btn-${activity.id}">
|
| 612 |
+
<span class="icon">👏</span>
|
| 613 |
+
${kudosGiven.has(activity.id) ? 'ให้ Kudos แล้ว' : 'ให้ Kudos'}
|
| 614 |
+
</button>
|
| 615 |
+
</div>
|
| 616 |
+
`;
|
| 617 |
+
feedContainer.appendChild(activityCard);
|
| 618 |
+
});
|
| 619 |
+
}
|
| 620 |
+
|
| 621 |
+
// Give Kudos Function
|
| 622 |
+
function giveKudos(activityId) {
|
| 623 |
+
const kudosElement = document.getElementById(`kudos-${activityId}`);
|
| 624 |
+
const button = document.getElementById(`kudos-btn-${activityId}`);
|
| 625 |
+
|
| 626 |
+
if (!kudosGiven.has(activityId)) {
|
| 627 |
+
// Find activity and increment kudos
|
| 628 |
+
const activity = mockActivities.find(a => a.id === activityId);
|
| 629 |
+
if (activity) {
|
| 630 |
+
activity.kudos++;
|
| 631 |
+
kudosElement.textContent = activity.kudos;
|
| 632 |
+
|
| 633 |
+
button.classList.add('given');
|
| 634 |
+
button.innerHTML = '<span class="icon">👏</span> ให้ Kudos แล้ว';
|
| 635 |
+
|
| 636 |
+
kudosGiven.add(activityId);
|
| 637 |
+
|
| 638 |
+
// Animation effect
|
| 639 |
+
button.style.transform = 'scale(1.1)';
|
| 640 |
+
setTimeout(() => {
|
| 641 |
+
button.style.transform = 'scale(1)';
|
| 642 |
+
}, 200);
|
| 643 |
+
}
|
| 644 |
+
}
|
| 645 |
+
}
|
| 646 |
+
|
| 647 |
+
// Filter Functions
|
| 648 |
+
function setupFilters() {
|
| 649 |
+
const filterButtons = document.querySelectorAll('.filter-btn');
|
| 650 |
+
|
| 651 |
+
filterButtons.forEach(button => {
|
| 652 |
+
button.addEventListener('click', function() {
|
| 653 |
+
// Remove active class from all buttons
|
| 654 |
+
filterButtons.forEach(btn => btn.classList.remove('active'));
|
| 655 |
+
|
| 656 |
+
// Add active class to clicked button
|
| 657 |
+
this.classList.add('active');
|
| 658 |
+
|
| 659 |
+
const filter = this.dataset.filter;
|
| 660 |
+
|
| 661 |
+
// Clear current feed
|
| 662 |
+
const feedContainer = document.getElementById('activityFeed');
|
| 663 |
+
feedContainer.innerHTML = '';
|
| 664 |
+
|
| 665 |
+
// Filter logic (mock)
|
| 666 |
+
if (filter === 'yours') {
|
| 667 |
+
// Show only activities from "คุณ" (mock)
|
| 668 |
+
const yourActivities = mockActivities.filter(a =>
|
| 669 |
+
a.athleteName.includes('จารุวรรณ') || a.athleteName.includes('เอมม่า')
|
| 670 |
+
);
|
| 671 |
+
if (yourActivities.length === 0) {
|
| 672 |
+
feedContainer.innerHTML = '<p style="text-align: center; color: var(--text-secondary); padding: 40px;">คุณยังไม่มีกิจกรรมในสัปดาห์นี้</p>';
|
| 673 |
+
} else {
|
| 674 |
+
renderActivities(yourActivities);
|
| 675 |
+
}
|
| 676 |
+
} else {
|
| 677 |
+
// Show all activities
|
| 678 |
+
renderActivities(mockActivities);
|
| 679 |
+
}
|
| 680 |
+
});
|
| 681 |
+
});
|
| 682 |
+
}
|
| 683 |
+
|
| 684 |
+
// Load More Function
|
| 685 |
+
function setupLoadMore() {
|
| 686 |
+
const loadMoreBtn = document.getElementById('loadMoreBtn');
|
| 687 |
+
let loadCount = 0;
|
| 688 |
+
|
| 689 |
+
loadMoreBtn.addEventListener('click', function() {
|
| 690 |
+
loadCount++;
|
| 691 |
+
// Create duplicate activities with new IDs
|
| 692 |
+
const moreActivities = mockActivities.map(activity => ({
|
| 693 |
+
...activity,
|
| 694 |
+
id: activity.id + (loadCount * 1000),
|
| 695 |
+
kudos: Math.floor(Math.random() * 100) + 20
|
| 696 |
+
}));
|
| 697 |
+
|
| 698 |
+
renderActivities(moreActivities);
|
| 699 |
+
|
| 700 |
+
// Scroll to new content
|
| 701 |
+
const newCards = document.querySelectorAll('.activity-card');
|
| 702 |
+
const lastNewCard = newCards[newCards.length - mockActivities.length];
|
| 703 |
+
lastNewCard.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
| 704 |
+
|
| 705 |
+
// Add loading animation
|
| 706 |
+
this.style.opacity = '0.5';
|
| 707 |
+
setTimeout(() => {
|
| 708 |
+
this.style.opacity = '1';
|
| 709 |
+
}, 300);
|
| 710 |
+
});
|
| 711 |
+
}
|
| 712 |
+
|
| 713 |
+
// Initialize
|
| 714 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 715 |
+
renderActivities(mockActivities);
|
| 716 |
+
setupFilters();
|
| 717 |
+
setupLoadMore();
|
| 718 |
+
});
|
| 719 |
+
</script>
|
| 720 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 721 |
+
</body>
|
| 722 |
+
</html>
|