commit 56befa23a18148d470c37e031c041a54925bf429
Author: jc <419690370@qq.com>
Date: Sun Mar 9 18:16:49 2025 +0800
first commit
diff --git a/app.py b/app.py
new file mode 100644
index 0000000..d11218f
--- /dev/null
+++ b/app.py
@@ -0,0 +1,26 @@
+from flask import Flask, jsonify
+
+app = Flask(__name__, static_folder="public", static_url_path="/static")
+
+
+# 根路径返回 index.html
+@app.route("/")
+def serve_index():
+ return app.send_static_file("index.html")
+
+
+# API 子路径,提供数据
+@app.route("/api/daily-workout")
+def api_daily_workout():
+ return jsonify({
+ "message": "Your daily workout plan",
+ "data": [
+ {"description": "Running", "duration": "30 minutes"},
+ {"description": "Yoga", "duration": "1 hour"},
+ {"description": "Strength training", "duration": "45 minutes"}
+ ]
+ })
+
+
+if __name__ == "__main__":
+ app.run(debug=True, port=80)
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
new file mode 100644
index 0000000..7103f2f
--- /dev/null
+++ b/public/index.html
@@ -0,0 +1,15 @@
+
+
+
+
+ Daily Workout Plan
+
+
+
+ Daily Workout Plan
+
+
+
+
\ No newline at end of file
diff --git a/public/script.js b/public/script.js
new file mode 100644
index 0000000..04f8c9d
--- /dev/null
+++ b/public/script.js
@@ -0,0 +1,14 @@
+document.addEventListener('DOMContentLoaded', function() {
+ const dailyWorkouts = [
+ { description: "Running", duration: "30 minutes" },
+ { description: "Yoga", duration: "1 hour" },
+ { description: "Strength training", duration: "45 minutes" }
+ ];
+
+ const workoutPlanElement = document.getElementById('workout-plan');
+ dailyWorkouts.forEach(workout => {
+ const li = document.createElement('li');
+ li.textContent = `${workout.description} - ${workout.duration}`;
+ workoutPlanElement.appendChild(li);
+ });
+});
\ No newline at end of file
diff --git a/public/style.css b/public/style.css
new file mode 100644
index 0000000..09789d6
--- /dev/null
+++ b/public/style.css
@@ -0,0 +1,21 @@
+body {
+ font-family: Arial, sans-serif;
+ background-color: #f8f4f9;
+ color: #333;
+ margin: 0;
+ padding: 20px;
+}
+
+h1 {
+ color:black;
+ text-align: center;
+}
+
+ul {
+ list-style-type: none;
+ padding: 0;
+}
+
+li {
+ margin-bottom: 10px;
+}
\ No newline at end of file