Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions .dagger/debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (g *Greetings) DebugTests(
// Check if backend is broken
if _, berr := g.Backend.CheckDirectory(ctx, g.Backend.Source()); berr != nil {
ws := dag.Workspace(
g.Backend.Source(),
g.Source,
g.Backend.AsWorkspaceCheckable(),
)
env := dag.Env().
Expand All @@ -39,7 +39,7 @@ func (g *Greetings) DebugTests(
// Check if frontend is broken
if _, ferr := g.Frontend.CheckDirectory(ctx, g.Frontend.Source()); ferr != nil {
ws := dag.Workspace(
g.Frontend.Source(),
g.Source,
g.Frontend.AsWorkspaceCheckable(),
)
env := dag.Env().
Expand Down
6 changes: 3 additions & 3 deletions website/cypress/e2e/greeting_test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
describe("Greetings API", () => {
it("should display a greeting", () => {
cy.visit("/");
cy.get("h1").should("contain", "Greetings Daggernauts");
cy.get("h1").should("contain", "Greetings Halifax!");
});

it("should change the greeting when the button is clicked", () => {
cy.visit("/");
cy.get("#greetingDisplay").should(
"contain",
"Click the button to see a greeting!",
"Click the button to see a Maritime greeting!",
);
cy.get("#randomGreetingButton").click();
cy.get("#greetingDisplay").should(
"not.contain",
"Click the button to see a greeting!",
"Click the button to see a Maritime greeting!",
);
});
});
87 changes: 62 additions & 25 deletions website/index.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,69 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Greetings App</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="bg-purple-900 text-white font-sans flex flex-col items-center justify-center min-h-screen">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Halifax Harbour Greetings</title>
<link
href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css"
rel="stylesheet"
/>
<style>
.maritime-gradient {
background: linear-gradient(
135deg,
#1e3a8a 0%,
#0369a1 50%,
#059669 100%
);
}
.harbor-blue {
background-color: #1e40af;
}
.lighthouse-beacon {
animation: pulse 2s infinite;
}
</style>
</head>
<body
class="maritime-gradient text-white font-sans flex flex-col items-center justify-center min-h-screen"
>
<div class="container mx-auto px-4 py-8 max-w-screen-md">
<h1 class="text-3xl font-bold mb-4">Greetings Daggernauts</h1>
<div id="greetingDisplay" class="greeting bg-purple-700 rounded shadow p-4 min-h-20 flex items-center justify-center">
Click the button to see a greeting!
</div>
<button id="randomGreetingButton" class="bg-purple-500 hover:bg-purple-400 text-white font-bold py-2 px-4 rounded mt-4">👋</button>
<h1 class="text-3xl font-bold mb-2">🌊 Halifax Harbour Greetings ⚓</h1>
<p class="text-blue-200 mb-4 text-center">
Welcome to the Atlantic's finest port city!
</p>
<div
id="greetingDisplay"
class="greeting harbor-blue rounded-lg shadow-lg p-6 min-h-20 flex items-center justify-center border-2 border-blue-300"
>
Click the button to receive a Maritime welcome!
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Click the button to receive a Maritime welcome!
Click the button to see a Maritime greeting!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Click the button to receive a Maritime welcome!
Click the button to see a Maritime greeting!

</div>
<button
id="randomGreetingButton"
class="bg-teal-600 hover:bg-teal-500 text-white font-bold py-3 px-6 rounded-lg mt-4 lighthouse-beacon shadow-lg transition-all duration-200 hover:shadow-xl"
>
🦞 Ahoy!
</button>
</div>

<script>
async function getRandomGreeting() {
try {
const response = await fetch('http://localhost:8080/random');
const data = await response.json();
document.getElementById('greetingDisplay').textContent = data.greeting;
} catch (error) {
console.error('Error fetching greeting:', error);
document.getElementById('greetingDisplay').textContent = 'Error fetching greeting';
} }
async function getRandomGreeting() {
try {
const response = await fetch("http://localhost:8080/random");
const data = await response.json();
document.getElementById("greetingDisplay").textContent =
data.greeting;
} catch (error) {
console.error("Error fetching greeting:", error);
document.getElementById("greetingDisplay").textContent =
"Error fetching greeting";
}
}

document.getElementById('randomGreetingButton').addEventListener('click', getRandomGreeting);
document
.getElementById("randomGreetingButton")
.addEventListener("click", getRandomGreeting);
</script>
</body>
</html>
</body>
</html>
Loading