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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <div id="app">
  <h1 class="gradient-3">{{ text }}</h1>
  <div class="toolbar">
    <input v-model="text" placeholder="Enter text" />
    <div class="toolbar__gradients">
      <button v-on:click="changeColor" class="gradient gradient-1" id="gradient-1"></button>
      <button v-on:click="changeColor" class="gradient gradient-2" id="gradient-2"></button>
      <button v-on:click="changeColor" class="gradient gradient-3" id="gradient-3"></button>
      <button v-on:click="changeColor" class="gradient gradient-4" id="gradient-4"></button>
      <button v-on:click="changeColor" class="gradient gradient-5" id="gradient-5"></button>
      <button v-on:click="changeColor" class="gradient gradient-6" id="gradient-6"></button>
      <button v-on:click="changeColor" class="gradient gradient-7" id="gradient-7"></button>
      <button v-on:click="changeColor" class="gradient gradient-8" id="gradient-8"></button>
    </div>
<!--     <div class="toolbar__customize">
      <button v-on:click="togglePopUp">Custom gradient</button>
      <div class="custom-pop-up">
        <div class="css">
          <p>Paste CSS</p>
          <div>
            <span>background: </span>
            <input type="text" placeholder="linear-gradient(43deg, #4158D0 0%, #C850C0 53%, #FFCC70 100%);
" />
          </div>
        </div>
        <div class="separator">OR</div>
        <div class="color-picker">
          <p>Pick 2 colors</p>
          <div class="colors">
            <div class="color-1">
              <span></span>
              <input type="text" placeholder="#ffffff" />
            </div>
            <div class="color-2">
              <span></span>
              <input type="text" placeholder="#ffffff" />
            </div>
          </div>
        </div>
      </div>
    </div> -->
  </div>
</div>
              
            
!

CSS

              
                * {
  font-family: system-ui;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  width: 100%;
}

#app {
  width: 100vw;
  height: 100%;
  background: #fff;
  padding: 0 3%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  

}

#app h1 {
  font-size: 80px;
  color: black;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  filter: drop-shadow(0px 3px 2px rgba(0, 0,0, .1));
  font-family: 'Lobster';
  margin-top: -7rem;
}

.toolbar {
  display: flex;
  align-items: center;
  position: absolute;
  left: 0;
  bottom: 0;
  height: 100px;
  width: 100%;
  background: #F5EFED;
  padding: 1rem;
  justify-content: flex-start;
  
  input {
    padding: 1rem;
    border: none;
    border-radius: 5px;
    font-size: 24px;
    font-weight: bold;
    border: 1px solid transparent;
    transition: .3s ease;
    cursor: text;
    color: lighten(#333, 15%);
    
    &:hover {
      border: 1px solid darken(#efefef, 8%);
    }
    
    &:focus {
      outline: none;
      border: 1px solid darken(#efefef, 10%);
      color: #333;
    }
  }
}

.toolbar__gradients {
  display: flex;
  align-items: center;
  margin-left: 1rem;
  height: 100%;
  padding: .25rem;
}

.gradient {
  width: 4rem;
  height: 100%;
  border-radius: 5px;
  margin-right: .5rem;
  border: none;
  border: 4px solid #F4ECEA;
  cursor: pointer;
  transition: .3s ease;
  
  &:hover {
    border: 4px solid darken(#F5EFED, 20%);
  }
  
  &:focus {
    outline: none;
  }
}

.gradient-1 {
  background: linear-gradient(pink, orange);
}

.gradient-2 {
  background: linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
}

.gradient-3 {
  background: linear-gradient(45deg, #FA8BFF 0%, #2BD2FF 52%, #2BFF88 90%);
}

.gradient-4 {
  background-image: linear-gradient(90deg, #FF9A8B 0%, #FF6A88 55%, #FF99AC 100%);
}

.gradient-5 {
  background-image: linear-gradient(0deg, #FFDEE9 0%, #B5FFFC 100%);
}

.gradient-6 {
  background-image: linear-gradient(19deg, #3EECAC 0%, #EE74E1 100%);
}

.gradient-7 {
  background-image: linear-gradient(225deg, #FF3CAC 0%, #784BA0 50%, #2B86C5 100%);
}

.gradient-8 {
  background-image: linear-gradient(0deg, #08AEEA 0%, #2AF598 100%);
}

.toolbar__customize {
  width: 100%;
  text-align: right;
  position: relative;
  
  button {
    position: relative;
    height: 60px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    background: darken(#F5EFED, 10%);
    padding: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: .3s ease;
    
    &:hover {
      background: darken(#F5EFED, 20%);
    }
    
    &:focus {
      outline: none;
    }
  }
}

.custom-pop-up {
  position: absolute;
  width: 500px;
  height: 250px;
  bottom: 90px;
  right: 0;
  background: #F5EFED;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem;
  
  &:after {
    content: '';
    width: 20px;
    height: 20px;
    position: absolute;
    bottom: -24px;
    right: 0;
    border-radius: 100%;
    background: darken(#F5EFED, 10%);
  }
  
  opacity: 1;
  transition: .3s ease;
  
  &.show {
    opacity: 1;
  }
}

.css {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  
  p {
    font-weight: 700;
    color: darken(#F5EFED, 60%);
  }
  
  span {
    font-size: 14px;
    font-family: monospace;
    color: darken(#F5EFED, 60%);
  }

  input {
    padding: .5rem;
    font-size: 14px;
    font-family: monospace;
    width: 22.5rem;
    opacity: 1;
    font-weight: 400;
    font-family: monospace;
    
    &::placeholder {
      opacity: .3;
    }
  }
}

.separator {
  font-size: 12px;
  font-weight: 700;
  width: 100%;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  text-align: center;
  color: darken(#F5EFED, 60%);
  
  &:before {
    content: '';
    width: 200px;
    height: 1px;
    background: darken(#F5EFED, 30%);
    margin-right: 2rem;
  }
  
  &:after {
    content: '';
    width: 200px;
    height: 1px;
    background: darken(#F5EFED, 30%);
    margin-left: 2rem;
  }
}

.color-picker {
  p {
    font-weight: 700;
    color: darken(#F5EFED, 60%);
    text-align: left;
  }
}

.colors {
  display: flex;
  align-items: center;
  margin-top: 1rem;
  width: 100%;
}

.color-1,
.color-2 {
  width: 100%;
}

.color-1,
.color-2 {
  input {
    padding: .5rem;
    font-size: 14px;
    width: 5rem;
    opacity: 1;
    font-weight: 400;
    font-family: monospace;
    
    &::placeholder {
      opacity: .3;
    }
  }
}

.color-1 {
  margin-right: 1rem;
}

.color-1 span,
.color-2 span {
  width: 4rem;
  height: 4rem;
  border-radius: 100%;
  border: 2px solid black;
  display: flex;
}
              
            
!

JS

              
                const app = new Vue({
  el: '#app',
  data: {
    text: 'Pickle Rick'
  },
  methods: {
    changeColor: function (e) {
      const heading = document.querySelector('h1');
      const gradient = e.target.id;
      heading.classList = [];
      heading.classList.add(gradient);
    },
    togglePopUp: function (e) {
      const popup = document.querySelector('.custom-pop-up');
      popup.classList.toggle('show');
    }
  }
})
              
            
!
999px

Console