Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0047406

Browse files
authored
Merge pull request #409 from gyyzzz/gyyzzz-branch
Gyyzzz branch
2 parents 6302536 + 83539c0 commit 0047406

File tree

6 files changed

+98
-6
lines changed

6 files changed

+98
-6
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Anniversary Timing
2+
3+
Simple timing page implemented using flask

‎FLASK PROJECTS/Anniversary time/app.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from flask import Flask, render_template
2+
from datetime import datetime
3+
4+
app = Flask(__name__)
5+
6+
# 在此定义纪念日日期
7+
anniversary_date = datetime(2024, 6, 16)
8+
9+
@app.route('/')
10+
def index():
11+
current_date = datetime.now()
12+
delta = current_date - anniversary_date
13+
days_passed = delta.days
14+
return render_template('index.html', days_passed=days_passed, anniversary_date=anniversary_date.strftime("%Y-%m-%d %H:%M:%S"))
15+
16+
if __name__ == '__main__':
17+
app.run(debug=False)
369 KB
Loading[フレーム]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
body {
2+
margin: 0;
3+
padding: 0;
4+
font-family: Arial, sans-serif;
5+
background: url('background.jpg') no-repeat center center fixed;
6+
background-size: cover;
7+
color: white;
8+
display: flex;
9+
justify-content: center;
10+
align-items: center;
11+
height: 100vh;
12+
}
13+
14+
.container {
15+
text-align: center;
16+
background-color: rgba(0, 0, 0, 0.5);
17+
padding: 20px;
18+
border-radius: 10px;
19+
}
20+
21+
h1 {
22+
font-size: 3em;
23+
}
24+
25+
.time {
26+
font-size: 2em;
27+
margin-top: 20px;
28+
}
29+
30+
.time span {
31+
font-weight: bold;
32+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Anniversary</title>
7+
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
8+
<script>
9+
function updateTimer() {
10+
const anniversaryDate = new Date("{{ anniversary_date }}");
11+
const currentDate = new Date();
12+
const timeDiff = currentDate - anniversaryDate;
13+
14+
const days = Math.floor(timeDiff / (1000 * 60 * 60 * 24));
15+
const hours = Math.floor((timeDiff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
16+
const minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
17+
const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
18+
19+
document.getElementById("days").innerText = days;
20+
document.getElementById("hours").innerText = hours;
21+
document.getElementById("minutes").innerText = minutes;
22+
document.getElementById("seconds").innerText = seconds;
23+
}
24+
25+
setInterval(updateTimer, 1000);
26+
</script>
27+
</head>
28+
<body onload="updateTimer()">
29+
<div class="container">
30+
<h1>It has passed the xx anniversary</h1>
31+
<div class="time">
32+
<span id="days">0</span>
33+
<span id="hours">0</span> 小时
34+
<span id="minutes">0</span> 分钟
35+
<span id="seconds">0</span>
36+
</div>
37+
</div>
38+
</body>
39+
</html>

‎README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,16 @@ guide [HERE](https://github.com/larymak/Python-project-Scripts/blob/main/CONTRIB
113113
| 64 | [Umbrella Reminder](https://github.com/larymak/Python-project-Scripts/tree/main/TIME%20SCRIPTS/Umbrella%20Reminder) | [Edula Vinay Kumar Reddy](https://github.com/vinayedula) |
114114
| 65 | [Image to PDF](https://github.com/larymak/Python-project-Scripts/tree/main/IMAGES%20%26%20PHOTO%20SCRIPTS/Image%20to%20PDF) | [Vedant Chainani](https://github.com/Envoy-VC) |
115115
| 66 | [KeyLogger](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/KeyLogger) | [Akhil](https://github.com/akhil-chagarlamudi) |
116-
| 67 | [PDF Text Extractor](https://github.com/SamAddy/Python-project-Scripts/tree/main/PYTHON%20APPS/PDF-Text-Extractor) | [Samuel Addison](https://github.com/SamAddy)
117-
| 68 | [Analyze docx file](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/analyzing%20and%20writing%20.docx%20file) | [Kashaan Mahmood](https://github.com/Kashaan-M)
118-
| 69 | [Bitcoin Price](https://github.com/larymak/Python-project-Scripts/tree/main/WEB%20SCRAPING/Bitcoin%20Price) | [Olu-Olagbuji Delight](https://github.com/Dheelyte)
119-
| 70 | [Password Generator](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Password%20Generator) | [LpCodes](https://github.com/LpCodes)
120-
| 71 | [HTML to Excel](https://github.com/larymak/Python-project-Scripts/tree/main/CONVERSION%20SCRIPTS/HTML%20to%20Excel) | [LpCodes](https://github.com/LpCodes)
116+
| 67 | [PDF Text Extractor](https://github.com/SamAddy/Python-project-Scripts/tree/main/PYTHON%20APPS/PDF-Text-Extractor) | [Samuel Addison](https://github.com/SamAddy)|
117+
| 68 | [Analyze docx file](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/analyzing%20and%20writing%20.docx%20file) | [Kashaan Mahmood](https://github.com/Kashaan-M)|
118+
| 69 | [Bitcoin Price](https://github.com/larymak/Python-project-Scripts/tree/main/WEB%20SCRAPING/Bitcoin%20Price) | [Olu-Olagbuji Delight](https://github.com/Dheelyte) |
119+
| 70 | [Password Generator](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Password%20Generator) | [LpCodes](https://github.com/LpCodes) |
120+
| 71 | [HTML to Excel](https://github.com/larymak/Python-project-Scripts/tree/main/CONVERSION%20SCRIPTS/HTML%20to%20Excel) | [LpCodes](https://github.com/LpCodes) |
121121
| 72 | [Star pattern](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/Star%20pattern) | [LpCodes](https://github.com/LpCodes) |
122122
| 73 | [Logging Helper](https://github.com/larymak/Python-project-Scripts/tree/main/OTHERS/add-multiprocessing-logger) | [Jerry W.](https://github.com/Jerry0420) |
123123
| 74 | [Notepad](https://github.com/larymak/Python-project-Scripts/tree/main/PYTHON%20APPS/Notepad) | [Annarhysa Albert](https://github.com/Annarhysa) |
124124
| 75 | [Quadratic Equation Solver](https://github.com/larymak/Python-project-Scripts/tree/main/GUI/Quadratic-Equation-Solver) | [Akinfenwa Ezekiel](https://github.com/Ezek-iel) |
125125
| 76 | [Internet Connectivity Monitor](https://github.com/larymak/Python-project-Scripts/tree/main/AUTOMATION/InternetConnectivityMonitor) | [Prince Khunt](https://github.com/princekhunt) |
126-
| 76 | [E-commerce](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/E-commerce) | [Eter Nada](https://github.com/tarenjk24) |
126+
| 77 | [E-commerce](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/E-commerce) | [Eter Nada](https://github.com/tarenjk24) |
127+
| 78 | [Anniversary time](https://github.com/larymak/Python-project-Scripts/tree/main/FLASK%20PROJECTS/Anniversary%20time) | [gyyzzz](https://github.com/gyyzzz) |
127128

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /