|

The Visible Light Spectrum

Note: This article was published while I was in my early 20s. I was much younger and dumber. Please don't hold it against me. One of the perils of having a 20+ year old website!
Visible Light

I am taking a Light and Photography course at school where we are learning about the electromagnetic spectrum (EMS) and visible light, color temperature, etc. When giving us a website for the EMS, my professor mentioned he could not find one that was more “interactive”. So, me being the overachiever, I decided to make one. This is how I made it…

I wanted to make a spectrum with clickable areas to display each color. I did not want an image map. Image maps went out with tables. So I created the color background using a multicolor gradient overlay in Photoshop. I then measured out how many pixels each color was. Using some CSS, I created a div that was the height and width of the image I created and made the image the background. I then created a div for each color in the spectrum. With the parent class .color, I was able to float all of color divs left and give them a specific height…

.color{
float: left;
height: 196px;
}

Then, each color got its own color ID that was defined by the different widths.

Now, the hover part. To make each of these colors a link, I simply used blank .gif images set to specific widths. When you would click on the invisible image, the color information comes up. The color boxes were done by code I adapted from the Lightbox JS project, which is linked on the EMS site. Maybe when I get some more time, I will do the entire EMS, not just the visible light sections. Later!

Similar Posts

  • | |

    The Gift of Faith Foundation

    Note: This article was published while I was in my early 20s. I was much younger and dumber. Please don’t hold it against me. One of the perils of having a 20+ year old website! Bill Conroy contacted me over the summer about creating a website for a non-profit organization he started called The Gift…

  • | |

    How I Built It is Officially Hosted by Castos!

    Castos is a fantastic WordPress-centric podcast hosting platform that I’ve been recommending in my courses and coaching calls. But I have a confession to make: since Castos launched after I launched my podcast, I’ve been using Libsyn. For a long time, I’ve considered making the switch, but the migration process always seemed so daunting. On…

  • |

    Setting All Videos To Show Controls In LearnDash

    One of the biggest pieces of feedback I’ve gotten on my course videos in recent weeks was that the controls on my videos were hidden. To be honest, I didn’t realize students couldn’t scrub through videos, or rewind – I assumed everything was working! After looking through the LearnDash settings and not finding a global…

  • | |

    Creating a Responsive Gutenberg Price Table

    Last week I worked on an upcoming tutorial for a popular online publication on how to style the Gutenberg Columns block (I’ll be sure to send that along when it comes out). As as result, I decided to experiment to see what you could reasonable do, and came up with this Gutenberg Price Table: https://codepen.io/jcasabona/pen/RYvEYd. In…

  • | | |

    Learning HTML and CSS (with My New Book, Out Now!)

    I’ve always been a learn-by-doing kind of guy. Maybe it’s because I’m thinking about other things when something is explained to me, or maybe people are bad at explaining things. But either way, a concept doesn’t really sink in until I do it, or until I see an immediate application for it. When I learned…

  • Coding at a new level

    Note: This article was published while I was in my early 20s. I was much younger and dumber. Please don’t hold it against me. One of the perils of having a 20+ year old website!This semester I am taking a class called Machine Organization and Assembly Language. What this amounts to is learning how to…

2 Comments

  1. That’s pretty sweet. If you could make the trasitions more fluid, and make a click-anywhere close button, it would be even better 😛

Comments are closed.