Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <html>

<head>
    <link
        href="https://fonts.googleapis.com/css2?family=Cantarell&family=Fira+Sans:wght@800&display=swap"
        rel="stylesheet"
    >
    <link
        rel="stylesheet"
        href="style.css"
    >
</head>

<body>
    <header>
        <h1>What is 'Stats for Spotify?'</h1>
        <p>I was recently listening to the <a href="https://www.bbc.co.uk/sounds/play/live:bbc_world_service">BBC World
                Service</a>, and heard about <a href="https://www.statsforspotify.com">Stats for Spotify</a>, which
            seemed
            like the perfect subject matter for this week's Scrimba <a
                href="https://twitter.com/search?q=%23WeeklyWebDevChallenge&src=typed_query"
            >#WeeklyWebDevChallenge</a>!
        </p>
        <p class="interested">Interested in finding out yours? Surf on over to <a href="https://www.statsforspotify.com">Stats for
                Spotify</a>!</p>
    </header>
    <div class="container">
        <div class="card">
            <div class="front">
                <h1>My Spotify Faves</h1>
                <p>Wanna check out who Spotify says your favourite artists are?</p>
                <p>Now you can!</p>
                <p>Hover to see mine!</p>
                <img
                    src="https://assets.codepen.io/5058470/spotify-logo%26me.png"
                    alt="me wondering in front of the spotify logo"
                >
            </div>
            <div class="back">
                <ul>
                    <li>The Black Keys</li>
                    <li>The Smashing Pumpkins</li>
                    <li>Imagine Dragons</li>
                    <li>Weezer</li>
                    <li>The Who</li>
                    <li>Aerosmith</li>
                    <li>Stone Temple Pilots</li>
                    <li>Red Hot Chili Peppers</li>
                    <li>Bush</li>
                    <li>The Rolling Stones</li>
                    <li>Foo Fighters</li>
                    <li>Fleetwood Mac</li>
                    <li>The Tragically Hip</li>
                    <li>R.E.M.</li>
                    <li>I Don't Know How But They Found Me</li>
                    <li>Rush</li>
                    <li>Van Halen</li>
                    <li>Rage Against the Machine</li>
                    <li>Guns N' Roses</li>
                    <li>Gin Blossoms</li>
                </ul>
            </div>
        </div>
    </div>
    <script src="index.js"></script>
</body>

</html>
              
            
!

CSS

              
                html,
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: whitesmoke;
  font-size: 1.01rem;
}

.interested {
  font-size: .7rem;
  font-weight: bold;
}

h1 {
  font-family: "Fira Sans", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 1.6;
  color: #50d850;
  text-shadow: 1px 1px 1px green;
  text-decoration: underline;
  text-decoration-color: whitesmoke;
}

p {
  font-family: "Cantarell", sans-serif;
}

a {
  color: #50d850;
  text-shadow: 1px 1px 1px lightgreen;
  font-weight: bold;
  transition: background-color .3s ease-in-out, color .3s ease-in-out, text-shadow .3s ease-in-out;
}
a:hover {
  background-color: #50d850;
  color: whitesmoke;
  text-shadow: 1px 1px 1px black;
}

header {
  width: 500px;
  margin: 30px;
}

header p {
  line-height: 1.8rem;
}

ul {
  list-style-type: none;
}

ul li:before {
  content: "";
  display: inline-block;
  height: 10px;
  width: 10px;
  background-size: 10px;
  background-image: url("https://www.freepnglogos.com/uploads/spotify-logo-png/spotify-download-logo-30.png");
  background-repeat: no-repeat;
  margin-right: 5px;
}

.container {
  margin: auto;
  /* need this to all card to flip nicely, if 100 gets all distorted, like the card is stretching out towards you */
  perspective: 1000;
}

.card {
  width: 500px;
  height: 500px;
  position: relative;
  /* controls how the card flips */
  transition: all 1.2s linear;
  transform-style: preserve-3d;
}

.front,
.back {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  background-color: #191414;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  font-family: "Cantarell", sans-serif;
  color: #fff;
  text-align: center;
  position: absolute;
}

.front {
  z-index: 1;
  /* keeps the reverse side hidden */
  backface-visibility: hidden;
}

.back {
  z-index: 2;
  transform: rotateY(180deg);
  backface-visibility: hidden;
}

.container:hover .card {
  transform: rotateY(180deg);
}

@media (max-width:1000px) {
  body {
    flex-direction: column;
    width: 80%;
    min-width: 500px;
    margin: 0 auto;
    text-align: center;
  }

}

              
            
!

JS

              
                
              
            
!
999px

Console