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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div id="app" class="p-8" v-cloak>
  <div class="flex-none sm:flex justify-center">
    <div class="w-full lg:w-1/2 xl:w-1/3 overflow-auto py-5 px-4">
      <form-wizard class="w-full sm:float-right relative max-w-md bg-white shadow-lg rounded overflow-hidden" shape="tab" @on-complete="onComplete" back-button-text="Back" next-button-text="Next" finish-button-text="Submit" ref="wizard" :start-index="0">
        <div slot="title"></div>
        <tab-content title="Framework">
          <h2 class="text-xl text-gray-800 text-center mb-2">Choose your Framework</h2>
          <div class="flex flex-wrap -mx-1 overflow-hidden">
            <div v-for="(framework, index) in frameworks" v-bind:id="'framework-'+framework.id" :class="'w-1/2 overflow-hidden my-1 px-1 item-'+index" @click="saveFramework(index)">
              <div class="bg-orange-200 hover:bg-orange-300 text-gray-800 text-center text-base rounded py-4 cursor-pointer">
                <span>{{ framework.name }}</span>
              </div>
            </div>
          </div>
        </tab-content>
        <tab-content title="PHP Version">
          <h2 class="text-xl text-gray-800 text-center mb-2">Choose your PHP Version</h2>
          <div class="flex flex-wrap -mx-1 overflow-hidden">
            <div v-for="(version, index) in versions" v-bind:id="'version-'+version.id" :class="'w-1/2 overflow-hidden my-1 px-1 item-'+index" @click="saveVersion(index)">
              <div class="bg-orange-200 hover:bg-orange-300 text-gray-800 text-center text-base rounded py-4 cursor-pointer">
                <span>{{ version.name }}</span>
              </div>
            </div>
          </div>
        </tab-content>
        <tab-content title="System">
          <h2 class="text-xl text-gray-800 text-center mb-2">Choose your operating system</h2>
          <div class="flex flex-wrap -mx-1 overflow-hidden">
            <div v-for="(system, index) in systems" v-bind:id="'system-'+system.id" :class="'w-1/2 overflow-hidden my-1 px-1 item-'+index" @click="saveSystem(index)">
              <div class="bg-orange-200 hover:bg-orange-300 text-gray-800 text-center text-base rounded py-4 cursor-pointer">
                <span>{{ system.name }}</span>
              </div>
            </div>
          </div>
          <p class="text-gray-600 text-xs italic mt-2">This is not a list of supported platforms, it is only for information purpose.</p>
        </tab-content>
        <tab-content title="Launch">
          <h2 class="text-xl text-gray-800 text-center mb-2">Thank you!</h2>
          <label class="block uppercase tracking-wide text-gray-600 text-xs mb-2" for="grid-password">Email address</label>
          <input class="bg-white focus:outline-0 focus:shadow-outline border border-gray-300 rounded py-3 px-4 block w-full appearance-none leading-normal" v-model="email" type="email" maxlength="200" class="input" placeholder="Your email address" />
          <p class="text-gray-600 text-xs italic mt-2">Your data will not be disclosed to third parties.</p>
        </tab-content>
      </form-wizard>
    </div>

    <div class="w-full lg:w-1/2 xl:w-1/3 overflow-auto mb-5">
      <div class="w-full float-left py-5 px-4">
        <p class="block uppercase tracking-wide text-gray-600 text-xs mb-2">Developer preview</p>
        <div class="w-full float-left relative max-w-sm bg-white shadow-lg rounded overflow-hidden md">
          <pre class="w-full text-blue-800 float-left px-6 py-4"><code>{{ normalized }}</code></pre>
        </div>
      </div>
    </div>
  </div>
</div>
<p class="text-gray-600 text-xs text-center py-2 px-3 fixed bottom-0 right-0">Made by <a href="https://hofmannsven.com" target="_blank" rel="external noopener">Sven Hofmann</a>.</p>
              
            
!

CSS

              
                [v-cloak] {
  display: none;
}

:focus {
  outline: 0;
}

body {
  font-family: "Fira Sans", sans-serif;
  line-height: 1.2;
}

pre {
  font-family: "Fira Mono", monospace;
}

// Vue Form Wizard
.vue-form-wizard {
  .wizard-tab-content {
    width: 100%;
    float: left;
    padding: 2rem 1rem;
  }

  // Tab navigation
  .wizard-nav {
    position: relative;
    text-align: center;
    display: flex;
    flex-wrap: wrap;

    li,
    a {
      flex: 1;
      align-items: center;
      flex-wrap: wrap;
    }

    > li > a {
      color: #718096;

      &.disabled {
        pointer-events: none;
        cursor: default;
      }
    }

    > li.active > a .wizard-icon {
      color: #fff;
    }

    // Step title
    .stepTitle {
      letter-spacing: 0.025em;
      text-transform: uppercase;
      font-size: 0.75rem;
      line-height: 2;
    }

    // Step number
    .wizard-icon-circle {
      width: 100%;
      background-color: #e2e8f0;
      border-radius: 0;

      &.checked:hover {
        background-color: #cbd5e0;
      }

      .wizard-icon-container {
        display: flex;
        justify-content: center;
        flex: 1;
        width: 100%;
        border: none;
        background-color: #e2e8f0;
      }

      .wizard-icon {
        font-size: 1.5rem;
        line-height: 2;
      }
    }
  }

  // Progress bar
  .wizard-progress-with-circle {
    position: absolute;
    bottom: 0;
    height: 0.25rem;
    width: 100%;
    background-color: #e2e8f0;

    .wizard-progress-bar {
      position: relative;
      height: 0.25rem;
    }
  }

  // Footer
  .wizard-card-footer {
    width: 100%;
    float: left;
    padding: 1.5rem 1rem;

    .wizard-footer-left {
      float: left;
    }

    .wizard-footer-right {
      float: right;
    }

    // Buttons
    .wizard-btn {
      padding: 0.5rem 1rem;
      border-radius: 0.25rem;

      &:focus {
        outline: 0;
      }

      &:hover {
        background-color: #c53030 !important;
      }
    }
  }
}

              
            
!

JS

              
                // Docs: https://binarcode.github.io/vue-form-wizard/
Vue.use(VueFormWizard);

function getFrameworks() {
  return [
    { id: 1, name: "Laravel", selected: false },
    { id: 2, name: "CakePHP", selected: false },
    { id: 3, name: "Symfony", selected: false },
    { id: 4, name: "Slim", selected: false }
  ];
}

function getPhpVersions() {
  return [
    { id: 5, name: "PHP 7.1", selected: false },
    { id: 6, name: "PHP 7.2", selected: false },
    { id: 7, name: "PHP 7.3", selected: false },
    { id: 8, name: "PHP 7.4", selected: false }
  ];
}

function getOperatingSystems() {
  return [
    { id: 9, name: "Linux", selected: false },
    { id: 10, name: "macOS", selected: false },
    { id: 11, name: "FreeBSD", selected: false },
    { id: 12, name: "OpenBSD", selected: false },
    { id: 13, name: "NetBSD", selected: false },
    { id: 14, name: "Windows", selected: false }
  ];
}

new Vue({
  el: "#app",
  data() {
    return {
      stepIndex: 0,
      frameworks: getFrameworks(),
      versions: getPhpVersions(),
      systems: getOperatingSystems(),
      data: [],
      email: ""
    };
  },
  methods: {
    saveFramework: function(index) {
      this.$data.frameworks = getFrameworks();
      this.frameworks[index].selected = true;
      this.$refs.wizard.changeTab(0, 1);
    },
    saveVersion: function(index) {
      this.$data.versions = getPhpVersions();
      this.versions[index].selected = true;
      this.$refs.wizard.changeTab(1, 2);
    },
    saveSystem: function(index) {
      this.$data.systems = getOperatingSystems();
      this.systems[index].selected = true;
      this.$refs.wizard.changeTab(2, 3);
    },
    onComplete: function() {
      alert("Thank you for your response! We will contact you soon.");
    }
  },
  computed: {
    normalized: function() {
      let frameworks = this.frameworks.filter(function(item) {
        return item.selected === true;
      });
      let versions = this.versions.filter(function(item) {
        return item.selected === true;
      });
      let systems = this.systems.filter(function(item) {
        return item.selected === true;
      });
      let data = this.data;
      if (this.email.length) {
        data = new Array({
          email: this.email
        });
      }

      return JSON.stringify([frameworks, versions, systems, data], null, 2);
    }
  }
});

              
            
!
999px

Console