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

              
                <!-- Form -->
          <div class="text-lg sm:text-lg mb-16">
            <form name="contact" method="POST" v-on:submit.prevent="handleSubmit" action="/contact-thanks" data-netlify="true" data-netlify-honeypot="bot-field" class="mb-12">
              <!-- Name & Email -->
              <div class="flex flex-wrap mb-6 -mx-4">
                <div class="w-full md:w-1/2 mb-6 md:mb-0 px-4">
                  <input type="hidden" name="form-name" value="contact" />
                  <p hidden>
                    <label>No no no:<input name="bot-field" /></label>
                  </p>
                  <label for="name" class="block mb-2 text-copy-primary">Your name</label>
                  <input
                    type="text"
                    name="name"
                    v-model="formData.name"
                    id="name"
                    placeholder="Jon Snow"
                    class="block w-full bg-background-form border border-border-color-primary shadow rounded outline-none focus:border-ink-400 mb-2 p-4"
                    required
                  />
                </div>
                <div class="w-full px-4 md:w-1/2">
                  <label for="email" class="block text-copy-primary mb-2">Your email</label>
                  <input
                    type="email"
                    name="email"
                    v-model="formData.email"
                    id="email"
                    placeholder="email@example.com"
                    class="block w-full bg-background-form border border-border-color-primary shadow rounded outline-none focus:border-ink-400 mb-2 p-4"
                    required
                  />
                </div>
              </div>

              <!-- Message -->
              <div class="w-full mb-12">
                <label class="block text-copy-primary mb-2" for="message">Message</label>
                <textarea
                  id="message"
                  rows="5"
                  name="message"
                  v-model="formData.message"
                  class="block w-full bg-background-form border border-border-color-primary shadow rounded outline-none appearance-none focus:border-ink-400 mb-2 px-4 py-4"
                  placeholder="Enter your message here."
                  required
                >
                </textarea>
              </div>

              <!-- Send -->
              <div class="flex justify-end w-full">
                <button type="submit" class="block bg-ink-400 hover:bg-peach-400 text-white text-sm font-semibold tracking-wide uppercase shadow rounded cursor-pointer px-6 py-3">
                  Send
                </button>
              </div>
            </form>
          </div>
              
            
!

CSS

              
                
              
            
!

JS

              
                <script>
export default {
  metaInfo: {
    title: "Contact Us",
  },
  data() {
    return {
      formData: {},
    }
  },
  methods: {
    encode(data) {
      return Object.keys(data)
        .map(key => encodeURIComponent(key) + '=' + encodeURIComponent(data[key]))
        .join('&')
    },
    handleSubmit(e) {
      fetch('/contact-thanks', {
        method: 'POST',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        body: this.encode({
          'form-name': e.target.getAttribute('name'),
          ...this.formData,
        }),
      })
      .then(() => this.$router.push('/contact-thanks'))
      .catch(error => alert(error))
    }
  }
};
</script>

              
            
!
999px

Console