HR & Attendance Build

Stage 01 · Interface

Home › Apps › HR & Attendance › Stage 01
👥 Stage 01 · 2 hours

Build the shell.
Two views. One app.

The static shell of an HR & Attendance app. A manager dashboard with KPI cards, an employee list, and today's attendance timeline. An employee clock-in view with a single big button and today's hours. A tab at the top to switch between them. No data, no logic, no timers. Just the layout that Stage 02 will bring to life.

2 hours Beginner HTML · CSS
HR hub Two views Manager layout Employee layout The timeline Shared tokens Full file Next: Stage 02

Short answer: One HTML file, two top-level layouts. Manager view: a grid with KPI cards on top, employee list on the left, today's attendance timeline on the right. Employee view: a single centered card with a giant clock-in button, current time, and today's hours. A tab bar toggles between them. Shared CSS tokens (colors, radii, fonts) make them feel like one app. Sample data is hardcoded — 6 employees, 8 attendance events, 4 KPI values. No JavaScript beyond the tab toggle.

✅ Two views, one app

A manager dashboard. An employee button. Different jobs, same design system.

Most web apps have one audience. HR & Attendance has two, and they don't overlap:

The manager

Needs to see who's working, who's late, who's over hours. Needs to approve timesheets and correct mistakes. Sits at a desktop, glances at the app ten times a day. Values density and scanability.

The employee

Needs to clock in when they arrive and clock out when they leave. Stands at a kiosk or holds a phone. Uses the app twice a day. Values speed and zero friction.

Why one shell can't serve both

A dashboard is the wrong shape for a clock-in button — too many decisions. A giant button is the wrong shape for the manager — too little information. Trying to be both makes both worse.

The shared system

Same color palette, same radii, same font stack, same input styles. A manager tabbing between views feels the same app. An employee seeing the manager view (unlikely) recognizes the visual language. The tokens are the unity; the layouts diverge.

The tab bar sits at the top of both views. It's the only navigation. It flips between #view-manager and #view-employee via a CSS class on the body. In Stage 02, the tab will persist the active view in localStorage so the employee who clocked in last time lands back on the employee view next session.

✅ The manager layout

KPIs on top, list left, timeline right.

KPI row (top)

Four cards: Clocked in now, Hours today, Pending approvals, Active employees. Each shows a big number and a small context line below.

Employee list (left)

Six employees. Each row: avatar, name, role, current status ("Working since 9:02" / "Off" / "On break"). A colored dot on the left encodes status at a glance.

Timeline (right)

Today's events in reverse chronological order. Each row: timestamp, employee name, event type (clock-in / break / clock-out), and a small icon. Scrolls independently.

Two-column grid

Below the KPIs, a 2-column grid: list takes 1fr, timeline takes 1fr. On narrow screens, they stack.

The manager layout is a 3-row grid: header, KPI row, content. The content row is a 2-column grid. Here's the CSS shell — the whole layout fits in 18 lines:

manager-layout.css hr-stage-01.html · lines ~85–102
.hr-manager {
display: grid;
grid-template-rows: var(--header-h) auto 1fr;
grid-template-areas:
"header"
"kpis"
"content";
height: 100vh;
}

.hr-kpis {
grid-area: kpis;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
padding: 1rem 1.5rem;
}

.hr-content {
grid-area: content;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
padding: 0 1.5rem 1.5rem;
min-height: 0;
overflow: hidden;
}

The four cards tell a story: who's here now, how much work happened today, what needs a decision, and who's on the team. The first two are live numbers that update; the third is a queue; the fourth is a constant. Every manager dashboard can be reduced to those four questions, and these four cards are the answers. Stage 02 makes the numbers live; the shape doesn't change.

✅ The employee layout

One button. One number. No decisions.

The employee view is what the employee sees when they tap "Employee view" at the top — or, in a real kiosk deployment, what's shown on the tablet by the door. It has exactly four elements:

Big clock

The current time, in monospace, in a large font. The employee needs to know what time it is — it's the answer to "am I late?"

Status

"Not clocked in" / "Working since 9:02" / "On break since 12:15". One line, plain English, no jargon.

The button

One giant button that says "Clock in" or "Clock out" or "End break" depending on current state. Full width, tall, high contrast.

Today's hours

A small line under the button: "Today: 4h 12m". In Stage 02, this updates live as the clock ticks.

The employee layout is centered — the card sits in the middle of the screen with generous whitespace around it. Here's the CSS:

employee-layout.css hr-stage-01.html · lines ~190–215
.hr-employee {
display: grid;
place-items: center;
height: 100vh;
padding: 2rem;
}

.hr-clock-card {
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 16px;
padding: 3rem 2.5rem;
max-width: 420px;
width: 100%;
text-align: center;
display: flex;
flex-direction: column;
gap: 1.5rem;
align-items: center;
}

.hr-clock-btn {
width: 100%;
padding: 1.5rem;
font-size: 1.5rem;
font-weight: 800;
border-radius: 12px;
border: none;
background: var(--accent);
color: var(--bg);
text-transform: uppercase;
letter-spacing: 0.05em;
}

Why data-type instead of a class: the type drives both the icon color (CSS: .hr-event[data-type="in"] { color: var(--success) }) and, in Stage 02, the click handler's branching logic. One attribute, two purposes. A class could do the CSS half, but the JS would need the class too — and class names are easier to change than data attributes when the design updates. Keep data in data-*; keep appearance in classes.

Why data-type values are in / break-start / break-end / out, not clock-in: shorter, and they match the enum in the database schema (which we'll write in Stage 03). One vocabulary across the whole app. If the schema says type = 'in', the HTML says data-type="in". No translation layer, no bugs from mismatched strings.

✅ Shared tokens — what makes it one app

Two layouts, one design system.

The two views share only CSS custom properties. Every color, radius, spacing step, and font size is a token. The layouts diverge; the tokens don't.

tokens.css hr-stage-01.html · lines ~35–55
:root {
--bg: #0f172a;
--bg-elevated: #1e293b;
--bg-hover: #334155;
--border: #334155;
--text: #e2e8f0;
--text-muted: #94a3b8;
--text-dim: #64748b;
--accent: #61dafb;
--accent-dark: #0891b2;
--success: #10b981;
--warning: #f59e0b;
--danger: #ef4444;
--radius: 8px;
--header-h: 56px;
}
:root {
--bg: #0f172a;
--bg-elevated: #1e293b;
--bg-hover: #334155;
--border: #334155;
--text: #e2e8f0;
--text-muted: #94a3b8;
--text-dim: #64748b;
--accent: #61dafb;
--accent-dark: #0891b2;
--success: #10b981;
--warning: #f59e0b;
--danger: #ef4444;
--radius: 8px;
--header-h: 56px;
}

The tokens are identical to Inventory and POS. That's intentional. Every app in the studio shares the same visual identity — same slate palette, same cyan accent, same semantic greens and reds. A manager tabbing between HR, POS, and Inventory feels one product, not three. The tokens are the brand.

--header-h: 56px is new. POS used it as --topbar-height, HR uses it as --header-h. Same value, different name — each app names it for its own context. Both views' grid rows reference this token, so changing the header height is one line, not two.

✅ The full file

The complete shell. Delivered separately so this page stays readable.

The full shell is hr-stage-01.html — one HTML file, ~280 lines, no dependencies, no JavaScript beyond the tab toggle. It's delivered as a separate message (see the "Continue the build" section below for how to request it), so this lesson page stays focused on the concepts and the snippets.

The complete Stage 01 code, ready to run.

Download:
Download hr-stage-01.html →

Right-click, save link as. Or open in a new tab and use File → Save Page.

The file contains:

No data loads, no timers, no storage. Stage 01 is a layout exercise, and the full file is the exercise's answer.

➡️ Next: Stage 02 — Interactions

The clock actually ticks.

Stage 02 makes the shell alive. The KPI numbers recompute from the event list. The employee clock ticks once per second. Clocking in creates a real event, updates the KPI, and starts the "Working since" timer. Clocking out closes the shift, computes the hours worked, and adds them to the daily total. Everything persists in localStorage.

The four big lessons in Stage 02:

Stage 02 ships the full file too — hr-stage-02.html, ~750 lines. Same split: the lesson page here (with snippets), the full file there.

🔗 Continue the build

⚡ Next: Stage 02 — Interactions
Live clock, derived KPIs, idempotent clock-in, localStorage persistence. 3–4 hours.
👥 Back to the HR hub
All four stages, the data model, and the roadmap.
← Back to HR & Attendance hub
HR Stage 01 · Interface