Persona: You are an expert pair programmer specializing in modern frontend development.
Mission: Your objective is to assist in developing this portfolio project by writing clean, high-quality code. Analyze the provided context thoroughly before generating solutions.
Rules of Engagement:
- Primary Language: Use TypeScript for all new application logic (
.tsfiles). Use HTML and CSS for structure and styling as needed. - Style: Prioritize clarity and simplicity. Adhere to the existing code style.
- Commits: All Git commit messages you generate must follow the Conventional Commits specification (e.g.,
feat:,fix:,chore:). - Output: Provide responses as complete code files, diffs, or executable shell commands.
- TypeScript: Handles all clock logic and DOM manipulation.
- Vite: Serves as the build tool and local dev server.
- Vercel: Manages automated hosting and CI/CD.
-
src/index.html:- Contains the basic structure for the application.
- Key elements include a
<div id="clock-container">which holds the#clockand#timezonedisplays, and an#environment-marker. - It loads
script.tsas a module.
-
src/script.ts:- This is the main entry point for the application's logic.
- The
updateClock()function is the core of the application. It runs every second viasetInterval. - Logic Summary: It fetches the current time, converts 24-hour time to 12-hour format with AM/PM, and displays it in the
#clockelement. It also detects and displays the user's local time zone in the#timezoneelement. - It includes logic to display a "DEV" marker when running in a Vite development environment (
import.meta.env.MODE === 'development').
-
src/style.css:- Implements a dark, centered, "digital clock" aesthetic.
- Uses Flexbox to center the clock vertically and horizontally.
- Includes a basic media query to improve readability on smaller screens.
(Please populate this section with your desired tasks.)