diff --git a/.vscode/mcp.json b/.vscode/mcp.json new file mode 100644 index 00000000..8a3773c7 --- /dev/null +++ b/.vscode/mcp.json @@ -0,0 +1,9 @@ +{ + "servers": { + "github-mcp-server": { + "url": "https://api.githubcopilot.com/mcp", + "type": "http" + } + }, + "inputs": [] +} \ No newline at end of file diff --git a/app.py b/app.py new file mode 100644 index 00000000..1e0627e6 --- /dev/null +++ b/app.py @@ -0,0 +1,10 @@ +from flask import Flask, render_template + +app = Flask(__name__) + +@app.route("/") +def index(): + return render_template("index.html") + +if __name__ == "__main__": + app.run(debug=True) diff --git a/main.py b/main.py index e69de29b..5cdb22d6 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,13 @@ +# Fibonacci数列を計算する関数 +def fibonacci(n): + if n <= 0: + return "Input should be a positive integer." + elif n == 1: + return 0 + elif n == 2: + return 1 + else: + a, b = 0, 1 + for _ in range(2, n): + a, b = b, a + b + return b \ No newline at end of file diff --git a/point.py b/point.py index e69de29b..fb37a0bc 100644 --- a/point.py +++ b/point.py @@ -0,0 +1,16 @@ +import math + +class Point3D: + def __init__(self, x, y, z): + self.x = x + self.y = y + self.z = z + + def distance_to(self, other): + dx = self.x - other.x + dy = self.y - other.y + dz = self.z - other.z + return math.sqrt(dx * dx + dy * dy + dz * dz) + + def __str__(self): + return f"Point3D({self.x}, {self.y}, {self.z})" \ No newline at end of file diff --git a/static/style.css b/static/style.css new file mode 100644 index 00000000..50e35175 --- /dev/null +++ b/static/style.css @@ -0,0 +1,81 @@ +body { + background: #7b6ef6; + font-family: 'Segoe UI', sans-serif; +} +.container { + background: #fff; + border-radius: 24px; + width: 340px; + margin: 40px auto; + padding: 32px 24px 24px 24px; + box-shadow: 0 8px 32px rgba(0,0,0,0.12); +} +h2 { + margin: 0 0 16px 0; + font-size: 1.3em; + color: #333; +} +.timer-circle { + position: relative; + width: 180px; + height: 180px; + margin: 0 auto 16px auto; +} +.timer-label { + position: absolute; + top: 48px; + left: 0; + width: 100%; + text-align: center; + color: #888; + font-size: 1.1em; +} +.timer-time { + position: absolute; + top: 70px; + left: 0; + width: 100%; + text-align: center; + font-size: 2.5em; + font-weight: bold; + color: #222; +} +.buttons { + display: flex; + justify-content: center; + gap: 16px; + margin-bottom: 24px; +} +#start-btn { + background: linear-gradient(90deg, #7b6ef6, #5f5be6); + color: #fff; + border: none; + border-radius: 24px; + padding: 10px 32px; + font-size: 1em; + cursor: pointer; +} +#reset-btn { + background: #fff; + color: #7b6ef6; + border: 2px solid #7b6ef6; + border-radius: 24px; + padding: 10px 32px; + font-size: 1em; + cursor: pointer; +} +.progress { + background: #f5f6fa; + border-radius: 12px; + padding: 16px; + margin-top: 16px; + text-align: center; +} +.progress-row { + display: flex; + justify-content: space-around; + margin-top: 8px; +} +.progress-row div { + font-size: 1.1em; +} diff --git a/static/timer.js b/static/timer.js new file mode 100644 index 00000000..4a0f9457 --- /dev/null +++ b/static/timer.js @@ -0,0 +1,50 @@ +let duration = 25 * 60; +let timeLeft = duration; +let timerInterval = null; +let running = false; +let pomodoroCount = 4; +let focusSeconds = 100 * 60; // 1時間40分 + +function updateTimerDisplay() { + const min = String(Math.floor(timeLeft / 60)).padStart(2, '0'); + const sec = String(timeLeft % 60).padStart(2, '0'); + document.getElementById('timer').textContent = `${min}:${sec}`; + // 円グラフ進捗 + const progress = document.getElementById('progress'); + const percent = (duration - timeLeft) / duration; + progress.setAttribute('stroke-dashoffset', 502 * (1 - percent)); +} + +function startTimer() { + if (running) return; + running = true; + document.getElementById('start-btn').disabled = true; + timerInterval = setInterval(() => { + if (timeLeft > 0) { + timeLeft--; + updateTimerDisplay(); + } else { + clearInterval(timerInterval); + running = false; + document.getElementById('start-btn').disabled = false; + pomodoroCount++; + focusSeconds += duration; + document.getElementById('pomodoro-count').textContent = pomodoroCount; + document.getElementById('focus-time').textContent = + `${Math.floor(focusSeconds/60/60)}時間${Math.floor((focusSeconds/60)%60)}分`; + } + }, 1000); +} + +function resetTimer() { + clearInterval(timerInterval); + timeLeft = duration; + running = false; + updateTimerDisplay(); + document.getElementById('start-btn').disabled = false; +} + +document.getElementById('start-btn').onclick = startTimer; +document.getElementById('reset-btn').onclick = resetTimer; + +updateTimerDisplay(); diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 00000000..42953290 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,38 @@ + + +
+ +