← Back to gallery
Spider Man Into The Spider Verse poster

Project walkthrough

Spider Man Into The Spider Verse

Explore the concept, hints, and starter code for this Nic Cage inspired build.

Title: Multiverse Styling with Spider-Man: Into the Spider-Verse and CSS Properties and Values API

Description:

Inspired by Nicolas Cage’s role as Spider-Man Noir in Spider-Man: Into the Spider-Verse, this project uses the CSS Properties and Values API to create a web application that showcases dynamic and customizable styling. The application captures the vibrant and diverse atmosphere of the Spider-Verse, allowing users to apply custom CSS properties to create unique visual effects. This project demonstrates the practical use of the CSS Properties and Values API to enhance user experience and web design flexibility.

Features:

  • Custom CSS Properties: Use the CSS Properties and Values API to define and apply custom CSS properties.
  • Dynamic Styling: Allow users to change styles dynamically through interactive controls.
  • Thematic Design: Reflect the vibrant and diverse atmosphere of Spider-Man: Into the Spider-Verse through the application’s design and interactions.

Starting Code:

Beginner Hints:

  • Create a single index.html file.
  • Copy the full HTML code block into that file.
  • Open index.html in your browser. If something doesn’t work, try a local server like python -m http.server.
  • Open DevTools Console to spot errors and typos quickly.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Multiverse Styling with Spider-Man: Into the Spider-Verse and CSS Properties and Values API</title>
<style>
    body {
        font-family: Arial, sans-serif;
        background-color: #121212;
        color: #f0f0f0;
        text-align: center;
        padding: 50px;
    }
    .container {
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
        background-color: #1e1e1e;
        border: 1px solid #333;
        border-radius: 10px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    }
    h1 {
        margin-bottom: 20px;
        color: #e84545;
    }
    .spider-verse-element {
        margin: 20px;
        padding: 20px;
        background-color: var(--bg-color, #2e2e2e);
        color: var(--text-color, #f0f0f0);
        border-radius: var(--border-radius, 10px);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
        transition: all 0.3s ease;
    }
    .controls {
        margin-top: 20px;
    }
    .controls label {
        display: block;
        margin: 10px 0 5px;
    }
    .controls input {
        padding: 5px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
    <div class="container">
        <h1>Multiverse Styling</h1>
        <p>Customize the styling inspired by Spider-Man: Into the Spider-Verse.</p>

        <div class="spider-verse-element">
            This is a dynamically styled element. Use the controls below to change my style.
        </div>

        <div class="controls">
            <label for="bg-color">Background Color:</label>
            <input type="color" id="bg-color" name="bg-color">

            <label for="text-color">Text Color:</label>
            <input type="color" id="text-color" name="text-color">

            <label for="border-radius">Border Radius:</label>
            <input type="range" id="border-radius" name="border-radius" min="0" max="50">
        </div>
    </div>
<script>
    if (CSS.registerProperty) {
        CSS.registerProperty({
            name: '--bg-color',
            syntax: '<color>',
            inherits: false,
            initialValue: '#2e2e2e'
        });

        CSS.registerProperty({
            name: '--text-color',
            syntax: '<color>',
            inherits: false,
            initialValue: '#f0f0f0'
        });

        CSS.registerProperty({
            name: '--border-radius',
            syntax: '<length>',
            inherits: false,
            initialValue: '10px'
        });
    }

    const bgColorInput = document.getElementById('bg-color');
    const textColorInput = document.getElementById('text-color');
    const borderRadiusInput = document.getElementById('border-radius');
    const spiderVerseElement = document.querySelector('.spider-verse-element');

    bgColorInput.addEventListener('input', () => {
        spiderVerseElement.style.setProperty('--bg-color', bgColorInput.value);
    });

    textColorInput.addEventListener('input', () => {
        spiderVerseElement.style.setProperty('--text-color', textColorInput.value);
    });

    borderRadiusInput.addEventListener('input', () => {
        spiderVerseElement.style.setProperty('--border-radius', borderRadiusInput.value + 'px');
    });
</script>
</body>
</html>

References:

Project Overview:

This project captures the vibrant and diverse atmosphere of Spider-Man: Into the Spider-Verse using the CSS Properties and Values API to enable dynamic and customizable styling. Users can apply custom CSS properties to create unique visual effects, reflecting the film’s multiverse theme. The application demonstrates the practical use of the CSS Properties and Values API for enhancing web design flexibility, providing an engaging and interactive experience. Embrace the creativity and adaptability of Spider-Man Noir to master the use of the CSS Properties and Values API in web development. Praise Cage!