Friday, August 22, 2025

GitHub Pages: Google Form for Contact Form

How to Add a Google Form to a GitHub Pages Site

Using a Google Form on your GitHub Pages site is a simple and secure way to gather user information without needing a backend server or exposing your personal email address. This guide will walk you through the process, from creating the form to embedding it in your HTML.

Why Use a Google Form?

GitHub Pages is a static hosting service, which means it doesn't support server-side scripts like PHP or Node.js. This can make it tricky to handle form submissions. Google Forms provides a free and secure solution by handling the data collection for you and storing it in a Google Sheet.

Step 1: Create Your Google Form

  1. Go to Google Forms: Open a new form at forms.google.com.
  2. Add Your Questions: Create the fields you need, such as "Name," "Email," and "Message."
  3. Get the Embed Code: Click the purple "Send" button in the top-right corner, then select the `< >` (Embed HTML) tab.
  4. Copy the Code: Copy the `<iframe>` code that Google provides. This code contains a unique URL for your form.

Step 2: Prepare Your HTML File

Open your index.html file on your local machine or directly in your GitHub repository. The goal is to insert the Google Form `<iframe>` into a section where you want it to appear.

Here is a simple, responsive HTML template you can use as a starting point:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Your Landing Page</title>
</head>
<body>
    
    <div>
        
        <!-- Main content here -->
        <div>
            <h1>
                Your Awesome Service
            </h1>
            <p>
                Discover a new way to streamline your workflow and boost productivity.
            </p>
        </div>

        <!-- This is where your form will go -->
        <div>
            <div>
                <h2>
                    Get in Touch
                </h2>
                
                <!-- Paste your Google Form <iframe> code here -->
                <iframe 
                    src="YOUR_GOOGLE_FORM_EMBED_URL_HERE" 
                    width="100%" 
                    height="500" 
                    frameborder="0" 
                    marginheight="0" 
                    marginwidth="0"
                    loading="lazy">Loading…</iframe>

                <div>
                    Your information is submitted securely to a Google Form.
                </div>
            </div>
        </div>
    </div>

</body>
</html>

Step 3: Embed the Form

Now, take the `<iframe>` code you copied from Google Forms and replace the placeholder `src` value in the template above.

For example, if your code looks like this:

<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSe-0h0w7pXbYyqC-D5WJ8T3K4fMvFzYn8JdG-d_x-d_x-d/viewform?embedded=true" width="640" height="850" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe>

You would just need to copy the URL inside the `src` attribute and paste it into the `<iframe>` in your HTML file.

<iframe 
    src="https://docs.google.com/forms/d/e/1FAIpQLSe-0h0w7pXbYyqC-D5WJ8T3K4fMvFzYn8JdG-d_x-d_x-d/viewform?embedded=true" 
    width="100%" 
    height="500" 
    frameborder="0" 
    marginheight="0" 
    marginwidth="0"
    loading="lazy">Loading…</iframe>

Note: The width and height attributes have been adjusted to `100%` and `500` respectively, to make the form more responsive within the page layout.

Step 4: Save and Push to GitHub

Save the changes to your HTML file, commit them, and push them to your GitHub repository. GitHub Pages will automatically rebuild your site, and your new form will be live!

That's it! You've successfully added a secure contact form to your static GitHub Pages site.

Final Thoughts

This approach provides a reliable, secure, and free way to add contact forms to any static website, not just those hosted on GitHub Pages. It's a great example of how you can leverage third-party tools to add dynamic functionality to a static site without needing to write any backend code. If you want to take it a step further, you can explore services like Formspree or Netlify Forms, which offer more customization and direct integration, but for most projects, this simple Google Forms solution is more than enough to get the job done.

Monday, August 18, 2025

Exploring My LAB: Jason Brain’s Digital Workshop

Welcome to My LAB: Digital Workshop, an innovative open-source project by Jason Brain, where I’ve crafted a suite of tools for work, learning, rest, and play. Hosted at lab.jasonbrain.com, this Single Page Application (SPA) is my personal playground for developers, enthusiasts, and curious minds. Built with a passion for accessibility and community contribution, My LAB is open for exploration and enhancement on GitHub



A Tool for Every Pillar

My LAB is organized into four pillars, each reflecting different facets of life. Here’s a rundown of the available tools and a peek at what’s in development:


Work 🔧 (Factory)

  • Image to WebP Converter: Optimize your images with this handy tool.
  • Math Calculator: Solve complex equations with ease.
  • DJ Audio Visualizer (Under Development): Stay tuned for a cutting-edge audio visualization experience.
  • Subwoofer Design (Under Development): Coming soon to assist with audio engineering projects.

Learn 📚 (Classroom)

  • Life Path Calculator: Discover insights based on numerology.
  • Gematria Calculator: Explore the mystical art of letter-number correspondence.
  • Moon Phase (Under Development): Watch for this celestial tool to track lunar cycles.
  • Days Between Dates: Calculate the duration between any two dates.
  • Year Progress Calculator: See how far you’ve come in the year.

Rest 🌿 (Retreat)

  • Binaural Beats: Relax or focus with soothing audio frequencies.

Play 🎮 (Arcade)

  • Magic 8 Ball: Get playful answers to your questions.
  • Radio Stream Player: Enjoy a variety of live radio streams with customizable VU meters.
  • Memory Game: Test your memory with this engaging challenge.

What’s Next?

While DJ Audio Visualizer, Subwoofer Design, and Moon Phase are still in development, the current tools in My LAB offer a diverse set of functionalities. The open-source nature invites contributions—whether you’re a coder, designer, or tester, your input can shape its future. Check the GitHub repository to get involved or explore the code.


Why My LAB Matters

My LAB isn’t just a collection of tools; it’s my testament to creative problem-solving and community-driven development. With a clean, responsive design, it’s accessible on any device. The integration of analytics and ads supports its sustainability while keeping the core experience free.


Visit lab.jasonbrain.com to dive into My LAB. Have feedback or a tool idea? Reach out via GitHub or my website. Happy exploring!



Note: All tools are subject to change as development progresses. Stay updated via the GitHub repository.

Building BlueMountainDJ.com: A Modern Wedding DJ Website with Tailwind CSS and JavaScript

Building BlueMountainDJ.com: A Modern Wedding DJ Website with Tailwind CSS and JavaScript As a web developer, I recently had the opportunit...