This is where I think out loud.

Wednesday Aug 6, 2025

The Smooth Fade-In: Animating a Random Background on Page Load

I am still working on the Discontinuity Studios website. I came across an interesting problem I worked around and would like to share.

The Problem

I want the background graphic behind everything to change each time the page loads and fade in smoothly.

The First Solution

The first solution I came up with involved setting the body element up with a background.

        body {
background-image: url('/img/backgrounds/1.png');
}

I tend to solve problems by breaking them up into little steps so I built the step that forces a random graphic change each time the page loads first. I set it up beforehand with some indexed graphics in a folder, and I want the JS to load a random background graphic from that folder each time.

My JS chooses a random number and then uses that to build the body's src attribute.


const totalImages = 10;
const randomNumber = Math.floor(Math.random() * totalImages) + 1;
const imagePath = `../img/backgrounds/${randomNumber}.png`;
const imgElement = body.style.backgroundImage = `url('${imagePath}')`;

That worked just fine. It blinks in a new image each time the page is loaded. Great.Now, to move on to build the fade-in. My thought was that using CSS transitions should be easy. I needed to set the transition on the body element's background image. Simple right.


body{transition: background-image 3s ease-in;}

I'll save you the webkit annotation.

That did not work.

I tried giving it a background-image initial setting, so the JS would override the background image using the local attribute.

Nope, no fade in.

The timing of loading the graphic and then animating that graphic using CSS transitions timing is funny. Hmm, an interesting problem to solve, but I don't have time for this. I needed a different solution, but didn't want to throw away all that working JS.

The Final Solution

The solution that worked. Instead of messing with the body, I chose to insert a DIV stretched across the entire viewport in the background of everything.

The HTML


        div id="background-image"

The CSS


#background-image {

    background-size: cover;
    background-position: center;
    position: fixed; /* Or absolute, to stay in the background */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Place it behind all other content */
}

The JS

My JavaScript now looks like this.


const totalImages = 10;
const randomNumber = Math.floor(Math.random() * totalImages) + 1;
const imagePath = `../img/backgrounds/${randomNumber}.png`;
const imgElement = document.getElementById("background-image");
imgElement.style.backgroundImage = `url('${imagePath}')`;
gsap.from("#background-image", { opacity: 0, duration: 7 });

It chooses a random number, like before. Now it inserts that random number into the src attribute of our div element.


imgElement.style.backgroundImage = `url('${imagePath}')`;

I then use GreenSock JS to animate the fade-in on that same element.


gsap.from("#background-image", { opacity: 0, duration: 7 });

So, by inserting this one div into the HTML of my document, it will slowly fade-in a new background image each time the page is loaded.

It works so great every time the page loads that adding it to my snippet library is absolutely a good idea.

 

Tuesday Aug 5, 2025

It Seems, I Am Not a Vibe Coder.

Or am I?

I recently designed a website for the business I am starting with colleagues. I completed the design, and now I need to code the page. I couldn't help but think, "Why don't I try this vibe coding business I keep hearing about?"

I initially wanted to get my feet wet using AI to code the page and finish quickly, but I kept running into snags. It took me a long while to write the prompt that would give me something resembling what I pictured in my head. Of course, it was not perfect. It was still off by a bit, in a thousand tiny ways, but I was frustrated with talking to the machine at that point, and gave up on having more conversation to fix the thing. I was discouraged and still wasn't even close to what I envisioned for the page.

So, I took YouTube's advice and instead of using a prompt to describe what I wanted, I sent it a graphic of the design I had in hand. That produced a closer approximation of what I was looking for, close enough that I could tweak it past the finish line. Getting even a close approximation of what I wanted took much longer than anticipated. However, I was still excited to tweak it and then get it online.

My excitement quickly evaporated because the code itself was pretty insane. The things it did to achieve even the simplest tasks were too complex, which made it very confusing to read. The AI filled the code with hashed numbers, IDs, and Classnames, which made it hard to follow what I needed to fix and how to fix it. Each item was its own perfect little encapsulated issue to resolve, because of how it approached building the page like some Frankenstein monster. I quickly realized I had wasted my time and needed to start over.

Deflated, I started crafting the HTML first, then laying in the typographic scale, then pushing all the boxes into place. Naturally, I did run into snags and continued to use AI to code past those minor issues. I did end up coding the JS parts faster using AI, which is cool, but trying to shove a whole page through AI seems unrealistic when looking at the code it produced.

Everyone has their own vibe coding line in the sand, which is drawn based on how much that person already knows about programming in their particular field. In my case, I use AI to code in small steps. I treat it like a better Stack Overflow. This method still produces code that humans can maintain and easily change at will. Code that lasts into the future. Which is something I can respect and that is important to me.

That way, AI makes me faster without affecting the integrity of my work.

Link to this article on Medium

Tuesday Jun 10, 2025

Back to HTML

Much of this post will be a test.

I will know if this works if I get a two column layout out of this. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Magnam et accusamus nam distinctio dicta beatae quidem hic vel quod. Odit voluptatem vel in reprehenderit similique, ad et consequatur ratione culpa.

Lorem, ipsum dolor sit amet consectetur adipisicing elit. Magnam et accusamus nam distinctio dicta beatae quidem hic vel quod. Odit voluptatem vel in reprehenderit similique, ad et consequatur ratione culpa.

This is an H3

Monday Jun 9, 2025

I have been changing a lot of code in the background

This website is my playground after all, and I wanted to integrate my Protozoa CSS more into the every day running of this website. That means a switch back to HTML posts instead of Markdown, which I think will speed up my workflow. It’s nice being back in the front end web code again.

Saturday May 3, 2025

My Music is BACK!

My music collection has been restored. All 376 Gigs of music I have collected and curated throughout the years in high-quality digital.

It has been almost 4 years since I last had this collection online and accessible. Due to the collection size, I have struggled to keep it on a machine through the years. But now, with this new huge SSD, it isn’t an issue. I had the collection on a local network shared server and used Plex for a long time, but that soon got unwieldy on my network connection.

So I just turned it off. Life went on, and here we are.

I have recently switched to using a PC more, which has opened up many possibilities for listening to music. I don’t want a tool that chews up the precious metadata on my collection. I have been fastidious in keeping up with the proper song and album names, and the original album art in a decent resolution looks good but doesn’t weigh down the files themselves.

So now that I am on Windows, VLC player is giving me all that I need. Even fun visualizations.

Good Times.

Friday May 2, 2025

Relaxing More is Good

I am starting to relax more. I should give myself more grace every once in a while. I have been sleeping better lately, and that has had a positive effect.

Monday Apr 28, 2025

My Latest Drawing

I Love Drawing Cars.

A sketched drawing of a 1950s car

Thursday Apr 24, 2025

Tooling up

This is the first time I have been without the Adobe Suite in a while, and I am researching alternative tools to do instructional work. Also, I love learning new things. I am looking for replacements for Illustrator - I do most of my graphic design work in Illustrator because I love the clean look of smooth curves. Its replacement needs to work with, at minimum, both SVG and EPS file formats. After Effects - I use After Effects to do most of my video editing these days, along with all of the motion graphics I create. Photoshop - I am not a photographer, but I do a lot of photo editing and correction work. Well-designed selection tools are necessary for anything more complicated than basic cropping and color correction tools. Indesign - I use a page layout tool for anything that will end up as a PDF or printed on paper. Premiere - I do much of my video editing straight in After Effects. Still, sometimes you need the fine control of a straight-up video editor.

I have found some good replacements.

Illustrator Replacement Possibilities

Affinity Designer

What led me to this initially is that I have it on my iPad. I first got it because of the killer feature of seamless transitions between working with vectors and raster. The desktop version is the “best of the rest” when dealing with vector art. The tools are easy to understand, and since I had the iPad license, I got a price break on the suite.

Inkscape

A tool that can do many, many things if you know how to do them. My issue is the learning curve at this point. I want something I can use now.

After Effects Replacement Possibilities

Synfig Studio

I am honestly blown away that this is open-source software. It is mainly for motion graphics, so I will have to also find a proper video editor.

Photoshop Replacement Possibilities

Affinity Photo

Think of Photoshop without all the new fancy Ai tools. All the raster graphic tools I need are here and easy to find and understand. Nice.

Gimp

This tool has pulled me out of many binds when I found myself without the financial resources to get any graphics program. Gimp is always a go-to, but I can’t say much about using it. It has come a long way from all the endless menus and right clicks of the past, but it still has a long way to go until I call it easy to use.

Indesign Replacement Possibilities

Affinity Publisher

I learned this faster than I learned inDesign. I may use this as the replacement because it has much the same functionality but not the same bulkiness as inDesign. I may like this better.

Google Docs

Ugh, You know what I mean. You can do some rudimentary page layout in Google docs, but it is nowhere near what I need.

Premier Replacement Possibilities

DaVinci Resolve (free)

They have free and paid tiers, but I have never had to use the paid version. Just wanted to mention that this program was developed by the famous camera builders BlackMagic Studios. So you might want to check it out regardless.

OBS Studio

This is what I used before I found SnagIt. It is entirely open source free software.

My Final Choices

I ended up with the Affinity Suite of tools, along with Synfig Studio for motion graphics and Davinci for Video Editing.

Wednesday Apr 23, 2025

Sitting in This Feeling

I am uncomfortable. I can’t seem to fully relax. I know this feeling is caused by the fact that I got laid off from my job, and in these times of economic uncertainty, this is not the best timing.

In my mind, I know that events such as these can cause irrational anxiety and fear around all the things that I have no control over. Knowing all this doesn’t stop it from happening, nor does it improve my feelings regarding the fact that I no longer have a paycheck.

I am not a fan of totally positive thinking. Thinking positively has its place, but it can mask certain emotional energies that one can and should take advantage of. I am harnessing this uncomfortable energy to land a new job.

Getting Hired Again

I finally have my resume where I want it in terms of words; now I have to improve the layout and insert that improved copy to my LinkedIn profile.

Tuesday Apr 22, 2025

I need some time

Today is a recovery day.

Thursday Apr 17, 2025

Keeping my Mind and Body Going

Working Out is Key

My typical workout routine usually goes six weeks on and then two weeks off to heal. I am currently finishing up my second week off, and I miss my strength workout. I have been doing my cardio workout plus stretching. I didn’t realize how much I get from regular bodyweight strength training. Those endorphins are addictive. I must keep up the activity to boost my positive attitude.

Taking Time to Do Some House Cleaning

I am starting to upgrade the design of this very website. I will begin by switching out the type pairings and updating the vertical spacing.