PHP Helper Functions (v2)

by varundubey March 11, 2026 Public

A simple multi-file web page demonstrating HTML, CSS, and JavaScript working together.

42 views Raw Download Revisions (v3)
index.html markup Raw
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hello World (v3)</title>
</head>
<body>
    <h1>Hello, World!</h1>
    <p>Welcome to SnipShare.</p>
</body>
</html>
style.css css Raw
/* Final styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: sans-serif; background: #fff; color: #333; }
h1 { padding: 2rem; }
p { padding: 0 2rem; }
app.js javascript Raw
// Simple greeting rotator
const greetings = [
    "Hello, SnipShare!",
    "Bonjour, SnipShare!",
    "Hola, SnipShare!",
    "Ciao, SnipShare!",
    "Hallo, SnipShare!",
    "Konnichiwa, SnipShare!",
];

let currentIndex = 0;
const heading = document.getElementById("greeting");
const button = document.getElementById("change-btn");

button.addEventListener("click", () => {
    currentIndex = (currentIndex + 1) % greetings.length;
    heading.textContent = greetings[currentIndex];
    heading.style.color = `hsl(${currentIndex * 60}, 70%, 45%)`;
});
Skip to toolbar