Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>EVH Tribute</title>
  </head>
    <main id="main">
      <div class="guitar-wrapper">
        <div id="guitar">
          <article>
            <header>
              <h1 id="title">A tribute to Edward Van Halen.</h1>
             
              <div id="img-div" style="text-align: center">
                 <figure>
                <img
                  width="100%"
                  height="auto"
                  src="https://res.cloudinary.com/open-late/image/upload/v1614358847/evh-concert-jumping_q4167y.jpg"
                  id="image"
                  alt="Eddie Van Halen performing live on stage" 
                />
                <figcaption id="img-caption">
                  Edwards intense live performance equally matched his musical
                  wizardry
                </figcaption>
                </figure>
              </div>
            </header>
            <div id="tribute-info">
              <p>
                Edward Van Halen's music touched the lives of millions. Since
                the 1970's rock music fans and guitar players worldwide have
                been entertained and inspired by his innovative style and
                technical prowess.
              </p>
              <p>
                Personally speaking, my musical preferences were altered
                immediately after hearing just a few moments of that first album
                (Van Halen). Van Halens relentless assault on my ear drums had
                me choosing 'Edward' as my confirmation name, and buying a
                Kramer guitar with my 8th grade graduation money.
              </p>
              <p>
                Decade after decade Eddie continues to inspire. His ear twisting
                guitar riffs, his renowned 'brown sound', his outrageous style
                and iconic striped pattern continue to permiate the American
                landscape and wave like a Rock & Roll flag.
              </p>
              <p>
                With his untimely passing in October of 2020,
                Eddie Van Halen is truely Unchained.
              </p>
            </div>
            <div class="tribute-links">
              <h2>Further Exploration</h2>

              <p>
                <iframe title="Van Halen (Van Halen Remastered)" src="https://open.spotify.com/embed/track/2tAeN2TKlQLOoSPXtARzBV" width="300" height="380"></iframe>
              </p>

              <iframe
                width="280"
                height="160"
                src="https://www.youtube.com/embed/qy-LfsVysU8?start=1"
                frameborder="0"
                allowfullscreen 
                title="11 Iconic Eddie Van Halen Guitar Moments"
                alt="Link to a Van Halen music video"
              ></iframe>
              <p>
                <a id="tribute-link"
                  href="https://en.wikipedia.org/wiki/Eddie_Van_Halen"
                  target="_blank"
                   title="Wikipedia entry"
                  alt="Link to the Eddie Van Halen Wikipedia entry"
                  >Wikipedia</a>
              </p>
              <p>
                <a
                  href="https://youtu.be/Cn8APTMyKsg"
                  target="_blank"
                   title="'Unchained' live performance video"
                  alt="Link to a live performance video from 1981"
                  >Unchained (Live performance)</a>
              </p>
              <p>
                <a
                  href="https://open.spotify.com/track/2tAeN2TKlQLOoSPXtARzBV?si=9f343fd326924fba"
                  target="_blank"
                  alt="Link to Van Halen's first album. Listen free with sign-up"
                  title="Listen free on Spotify with sign-up"
                  >Van Halen "Eruption"</a
                >
              </p>

            </div>
            <div id="footer">
              <p>
                EVH tribute by Trent Harlem. Background graphic inspired by <a href="https://codepen.io/LukeAtWork/pen/QWEKvMo" target="_blank">@LukeAtWork</a>
              </p>
            </div>
          </article>
        </div>
      </div>
    </main>

    <script src="evh.js"></script>

<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>


              
            
!

CSS

              
                * {
  margin: 0;
  box-sizing: border-box;
  font: 300 1rem 'Helvetica Neue', sans-serif;
  color: whitesmoke;
}

body {
  background: radial-gradient(
    circle,
    rgba(154, 3, 7, 1) 0%,
    rgba(97, 1, 4, 1) 100%
  );
  font: 1.2rem sans-serif;
  line-height: 1.5;
}

main {
  padding: 1rem;
  margin: 0 auto;
}

header {
  grid-column: 1 / 4;
  background-color: #0f0f0fcc;
  z-index: 4;
  position: relative;
  height: auto;
  border-radius: 6%;
  border: 1px solid black;
}
h1 {
  font-size: 24px;
  text-align: center;
}

h2 {
  font-size: 22px;
}
img {
  margin: 0 auto;
  display: block;
  width: 100%;
  max-width: 768px;
  text-align: center;
  height: auto;
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
}
#img-caption {
  font: 400 0.9rem monospace;
  color: whitesmoke;
}
article {
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  /* grid-template-rows: 1fr 1fr 1fr; */
  grid-gap: 10px;
  border-radius: 3%;
}

#tribute-info {
  padding: 1rem 0.5rem;
  background-color: #0f0f0fcc;
  color: whitesmoke;
  font: 1em san serif;
  grid-column: 1 / 4;
}

p {
  background-color: #0f0f0fcc;
  color: white;
  font: 300 1rem sans-serif;
  padding: 0.5rem;
}

.tribute-links {
  padding: 15px;
  background-color: #0f0f0fcc;
  color: whitesmoke;
  font: 1em san serif;
  grid-column: 1 / 4;
  display: block;
  text-align: center;
}
.tribute-links a {
/*   text-decoration: none; */
  color: whitesmoke;
}
.tribute-links a:hover {
  color: white;
  font-weight: 400;
}

#footer {
  grid-column: 1 / 4;
}

#footer p {
  font-size: 1rem;
}

#guitar {
  background-color: rgba(154, 3, 8, 0.1);
  position: static;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0.5rem;
  overflow: visible;
}

#guitar span {
  position: absolute;
  display: block;
  transform-origin: center center;
  width: 400%;
  animation-name: fade-in;
  animation-duration: 2s;
  animation-iteration-count: 1;
  transition: all ease-in-out 1s;
}

.fade {
  animation-name: fade-out;
  animation-duration: 1s;
  animation-iteration-count: 1;
}
@keyframes fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.guitar-wrapper {
  width: 100%;
  position: relative;
  overflow: hidden;
  margin: 0;
}

.fall {
  transform: scale(3);
  transform: translateY(9rem);
  opacity: 0;
}

/* for tablets */
@media only screen and (min-width: 600px) {
  header {
    grid-column: 1 / 4;
    background-color: #0f0f0fcc;
    z-index: 4;
    position: relative;
    height: auto;
    border-radius: 6%;
    border: 1px solid black;
  }
  article {
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-gap: 10px;
    border-radius: 3%;
  }
}

/* ----------------------- for desktop ------------------------------*/
@media only screen and (min-width: 768px) {
  article {
    z-index: 4;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-gap: 10px;
    border-radius: 3%;
  }

  header {
    grid-column: 1 / 4;
    background-color: #0f0f0fcc;
    z-index: 4;
    position: relative;
    height: auto;
    border-radius: 6%;
    border: 1px solid black;
  }

  #tribute-info {
    padding: 0.5rem;
    background-color: #0f0f0fcc;
    color: whitesmoke;
    font: 1em san serif;
    grid-column: 1 / 3;
  }

  .tribute-links {
    padding: 15px;
    background-color: #0f0f0fcc;
    color: whitesmoke;
    font: 1em san serif;
    grid-column: 3 / 4;
    display: block;
    /* flex-wrap: wrap; */
  }
}

              
            
!

JS

              
                const guitar = document.getElementById('guitar');

function addStripe() {
  let qsaSpan = document.querySelectorAll('span');
  let stripe = document.createElement('span');
  let stripeArray = Array.from(qsaSpan);

    let color = 'white';
    let z = Math.floor(Math.random() * 2);
    if (Math.random() > 0.65) {
      color = 'black';
    }
    let angle = Math.floor(Math.random() * 360);
    let x = Math.floor(Math.random() * 30) - 15;
    let y = Math.floor(Math.random() * 30) - 15;
    let width = Math.floor(Math.random() * 6) + 1;
    // console.log('click', color, angle, x, y, width);

    stripe.style.backgroundColor = `${color}`;
    stripe.style.zIndex = `${z}`;
    stripe.style.transform += `translateX(${x}%)`;
    stripe.style.transform += `translateY(${y}%)`;
    stripe.style.transform += `rotate(${angle}deg)`;
    stripe.style.height = `${width}%`;
    guitar.insertAdjacentElement('beforeend', stripe);
  // console.log('length', stripeArray.length);
  

  function parRemove() {
    stripeArray[0].remove()
    stripeArray[0].removeEventListener('transitionend', parRemove)
    stripeArray[0].removeEventListener('webkitTransitionEnd', parRemove)
  }

  if (stripeArray.length > 5) {
    stripeArray[0].classList.add('fall');
    stripeArray[0].classList.add('fade');
//    console.log(' stripeArray[0].classList', stripeArray[0].classList.value);

    stripeArray[0].addEventListener('transitionend', parRemove, false);
    stripeArray[0].addEventListener('webkitTransitionEnd', parRemove, false);
  }
    else if (stripeArray.length < 5) {
  
  }
}
const stripeTimer = setInterval(addStripe, 2000);






// !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 

              
            
!
999px

Console