Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions static/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,26 @@
retraceOut.append(note);
}

// The headline's second line follows the tab: searching or retracing.
const headline = document.querySelector(".headline-line");
function setHeadline(mode) {
if (!headline) return;
const text = headline.dataset[mode];
if (!text || headline.textContent === text) return;
if (CALM.matches) {
headline.textContent = text;
return;
}
headline.classList.add("swapping");
window.setTimeout(() => {
headline.textContent = text;
headline.classList.remove("swapping");
}, 160);
}

function setMode(mode) {
retracing = mode === "retrace";
setHeadline(mode);
document.querySelectorAll(".mode-tab").forEach((tab) => {
const on = tab.dataset.mode === mode;
tab.classList.toggle("active", on);
Expand Down
2 changes: 2 additions & 0 deletions static/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<div class="campus-panel">
<p class="eyebrow"><span class="live-dot"></span>BIT CAMPUS · LIVE</p>
<h1>Lost something?<br><span>Start where you were.</span></h1>
<h1>Lost something?<br><span class="headline-line" data-search="Someone may have found it." data-retrace="Retrace your steps.">Someone may have found it.</span></h1>

<div class="mode-tabs" role="tablist" aria-label="How to look">
<button type="button" class="mode-tab active" role="tab" aria-selected="true" data-mode="search">Search</button>
Expand Down
2 changes: 2 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,8 @@ def test_home_page_draws_the_campus_map(self):
self.assertIn(b'data-place="main-block"', page)
self.assertIn(b'data-badge="mech-parking"', page)
self.assertIn(b"map.js", page)
self.assertIn(b"Someone may have found it.", page)
self.assertIn(b'data-retrace="Retrace your steps."', page)

def test_the_place_lookup_names_the_candidates(self):
found = self.client.get("/api/place?q=near+the+canteen").get_json()
Expand Down
Loading