From 277af3aebbd5c66bb34294cd667aafb289d4688e Mon Sep 17 00:00:00 2001 From: jc <419690370@qq.com> Date: Mon, 24 Mar 2025 11:04:56 +0800 Subject: [PATCH] frist commit --- app.py | 10 ++++++++++ static/css/style.css | 44 ++++++++++++++++++++++++++++++++++++++++++++ static/js/script.js | 4 ++++ templates/index.html | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 app.py create mode 100644 static/css/style.css create mode 100644 static/js/script.js create mode 100644 templates/index.html diff --git a/app.py b/app.py new file mode 100644 index 0000000..5ee303f --- /dev/null +++ b/app.py @@ -0,0 +1,10 @@ +from flask import Flask, render_template + +app = Flask(__name__) + +@app.route("/") +def serve_index(): + return render_template("index.html") + +if __name__ == "__main__": + app.run(debug=True, port=80) \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..1f1d03c --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,44 @@ +body { + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #f4f4f4; +} + +header { + background-color: #333; + color: #fff; + padding: 1rem 0; + text-align: center; +} + +main { + padding: 2rem; +} + +h1, h2 { + color: #333; +} + +ul { + list-style-type: none; + padding: 0; +} + +ul li { + background: #fff; + margin: 0.5rem 0; + padding: 0.5rem; + border: 1px solid #ddd; + border-radius: 5px; +} + +footer { + text-align: center; + padding: 1rem 0; + background-color: #333; + color: #fff; + position: fixed; + width: 100%; + bottom: 0; +} \ No newline at end of file diff --git a/static/js/script.js b/static/js/script.js new file mode 100644 index 0000000..0deda3e --- /dev/null +++ b/static/js/script.js @@ -0,0 +1,4 @@ +// 简单的交互示例:显示欢迎信息 +window.onload = function() { + alert("欢迎来到北京游玩攻略网站!"); +}; \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..5d46bac --- /dev/null +++ b/templates/index.html @@ -0,0 +1,42 @@ + + + + + + 北京游玩攻略 + + + +
+

北京游玩攻略

+
+
+
+

简介

+

北京是中国的首都,拥有丰富的历史文化遗产和现代化的城市风貌。无论是古老的故宫、长城,还是现代的鸟巢、水立方,都能让您感受到这座城市的独特魅力。

+
+
+

热门景点

+ +
+
+

游玩小贴士

+ +
+
+ + + + \ No newline at end of file