CS Logo

Web Coding Camp

Day 5 — Polish, Publish & Gallery Walk

Finish your site · Get it online · Show it off

⬇ Today's slides (PDF)

Schedule

TimeActivity
0:00 – 1:30Finish content, layout, and one interactive feature
1:30 – 2:00Publish: get your site online (pick a host below)
2:00 – 2:30Gallery walk — browse everyone's sites
2:30 – 3:00Share links, save your files, wrap up

Add One More Feature (JavaScript)

You have JavaScript now — add one finishing touch that makes people stop and look at the gallery walk. Every example below is complete: copy it in, change it to fit your site. Each can live in your script.js file (just drop the surrounding <script> tags).

Starter · Auto-updating footer year

The year updates itself, forever — every professional site does this.

<footer>© <span id="year"></span> My Site</footer>

<script>
  document.querySelector("#year").textContent = new Date().getFullYear();
</script>

Starter · Back-to-top button

A button that appears once you scroll down and smooth-scrolls back up.

<button id="topBtn" style="position: fixed; bottom: 1rem; right: 1rem; display: none;">↑ Top</button>

<script>
  const topBtn = document.querySelector("#topBtn");
  window.addEventListener("scroll", () => {
    // show it only after scrolling down a bit
    topBtn.style.display = window.scrollY > 300 ? "block" : "none";
  });
  topBtn.addEventListener("click", () => {
    window.scrollTo({ top: 0, behavior: "smooth" });
  });
</script>

Standard · Countdown timer

Count down to an event — great for a party, tournament, or launch page.

<p id="countdown"></p>

<script>
  const target = new Date("2026-12-31");   // your event date
  const out = document.querySelector("#countdown");

  function update() {
    const days = Math.floor((target - new Date()) / 86400000);  // ms per day
    out.textContent = days + " days to go!";
  }
  update();                    // show it right away
  setInterval(update, 1000);   // then keep it fresh
</script>

Standard · Image slideshow

Next / previous buttons cycle through a list of photos and wrap around.

<img id="slide" src="photo1.jpg" alt="slideshow">
<button id="prev">‹ Prev</button>
<button id="next">Next ›</button>

<script>
  const pics = ["photo1.jpg", "photo2.jpg", "photo3.jpg"];
  let i = 0;
  const img = document.querySelector("#slide");

  document.querySelector("#next").addEventListener("click", () => {
    i = (i + 1) % pics.length;                 // wrap to the first after the last
    img.src = pics[i];
  });
  document.querySelector("#prev").addEventListener("click", () => {
    i = (i - 1 + pics.length) % pics.length;   // wrap to the last before the first
    img.src = pics[i];
  });
</script>

Standard · Live filter / search

Type in a box to filter a list as you go — perfect for a review or recipe site.

<input id="search" placeholder="Filter my list...">
<ul id="list">
  <li>Inception</li>
  <li>Interstellar</li>
  <li>Dune</li>
  <li>Arrival</li>
</ul>

<script>
  const box = document.querySelector("#search");
  box.addEventListener("input", () => {
    const term = box.value.toLowerCase();
    document.querySelectorAll("#list li").forEach(li => {
      const match = li.textContent.toLowerCase().includes(term);
      li.style.display = match ? "" : "none";   // hide the ones that don't match
    });
  });
</script>

Boss Challenge · Live data with fetch()

Ask a free API for real data and show it — here, a random dog photo. No sign-up or key needed. Swap the URL for a joke (official-joke-api.appspot.com/random_joke), a quote (api.quotable.io/random), or weather (Open-Meteo).

<button id="dogBtn">New dog 🐶</button><br>
<img id="dog" alt="a random dog" width="300">

<script>
  document.querySelector("#dogBtn").addEventListener("click", () => {
    fetch("https://dog.ceo/api/breeds/image/random")   // ask the API
      .then(res => res.json())                          // turn the reply into data
      .then(data => {
        document.querySelector("#dog").src = data.message;  // show the photo
      });
  });
</script>

Before You Publish — Final Check

Walk through your site once before it goes live. Fix these first:

Publish — Pick a Host

Time to put your site on the real internet. You'll leave with a link you can text to a friend. Pick one:

Easiest — do this in class

Netlify Drop

Go to app.netlify.com/drop and drag your whole site folder onto the page. That's it — you get an instant public link. No account needed to see it live.

Keep your link: the free link expires unless you make a free account and "claim" the site. Do that if you want it to stick around.
Permanent

Neocities

Make a free account at neocities.org, then drag your files into the file manager. It's built for hand-written HTML/CSS, it's permanent, and there's a fun community of hand-made sites to explore.

Advanced

GitHub Pages

A real portfolio link that teaches you Git and GitHub — tools professional developers use every day.

  1. Make a free account at github.com (you must be 13+)
  2. Create a repository named yourusername.github.io
  3. Upload your files
  4. Your site is live at https://yourusername.github.io

Gallery Walk

No presentations, no pressure. Open your finished site on your screen. For 30 minutes, walk around and browse everyone else's — find the coolest design, the funniest content, the neatest feature. Trade links.

Stretch Goals

  1. Add a favicon (the little icon in the browser tab)
  2. Add a working contact form with Formspree — no backend needed
  3. Add smooth-scroll navigation between sections
  4. Add a CSS animation or transition
  5. Learn how custom domains work — what would you name your site?

Add a Favicon (Stretch)

The favicon is the tiny icon in the browser tab. Adding one makes your site feel finished.

  1. Find or make a small square image and save it as favicon.png in your site folder (an emoji screenshot works fine).
  2. Add this line inside your <head>:
<link rel="icon" href="favicon.png">
No image handy? You can even use an emoji as a favicon with a data URL — search "emoji favicon" for a one-line trick, or just grab a free icon from Icons8.

Keep Going After Camp

The Rest of the Web-Dev World

You built the front end — the part that runs in the browser. That's a real skill, and it's just the start. Here's what else is out there to explore when you're ready:

You don't need all of it — nobody learns it at once. Pick whatever sounds fun and keep building.