Changed around line 1
+ // Sample data for initial rankings
+ const initialRankings = [
+ { name: "Whiskers", score: 95, photo: "https://placekitten.com/200/300" },
+ { name: "Mittens", score: 92, photo: "https://placekitten.com/200/301" },
+ { name: "Snowball", score: 90, photo: "https://placekitten.com/200/302" }
+ ];
+
+ // Function to display rankings
+ function displayRankings() {
+ const rankingsList = document.getElementById('rankings-list');
+ rankingsList.innerHTML = '';
+
+ initialRankings.forEach((cat, index) => {
+ const rankingItem = document.createElement('div');
+ rankingItem.classList.add('ranking-item');
+ rankingItem.innerHTML = `
+ ${index + 1}
+
+ ${cat.name}
+ ${cat.score} points
+ `;
+ rankingsList.appendChild(rankingItem);
+ });
+ }
+
+ // Handle form submission
+ document.getElementById('cat-entry-form').addEventListener('submit', function(e) {
+ e.preventDefault();
+
+ const catName = document.getElementById('cat-name').value;
+ const ownerName = document.getElementById('owner-name').value;
+ const catPhoto = document.getElementById('cat-photo').value;
+
+ // Here you would typically send the data to a server
+ alert(`Thank you, ${ownerName}! ${catName} has been entered into the contest.`);
+
+ // Clear the form
+ this.reset();
+ });
+
+ // Initialize the page
+ document.addEventListener('DOMContentLoaded', function() {
+ displayRankings();
+ });