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

              
                <html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" /> 
      <script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/push-to-talk-button.js"></script>
      <script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/big-transcript.js"></script>
      <script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/error-panel.js"></script>
  </head>
  <body>
    <big-transcript placement="top" ></big-transcript>
    <push-to-talk-button appid="ed4fed3e-3d81-4c3d-8f07-2ea14092a74d" placement="bottom" ></push-to-talk-button>
    <error-panel placement="bottom" ></error-panel>
    <main>
      <section>
        <div class="group">
          <h2>Patient information</h2>
        </div>

        <div class="group">
          <label>Date of Birth</label>
          <div class="inputContainer">
            <input id="date_of_birth" type="text" placeholder='May 4th 1977'/>
          </div>
        </div>

        <div class="group">
          <label>Card ID</label>
          <div class="inputContainer">
            <input id="card_id" type="text" placeholder=""/>
          </div>
        </div>

        <div class="group">
          <label>Phone</label>
          <div class="inputContainer">
            <input id="phone_number" type="text" placeholder=""/>
          </div>
        </div>

        <div class="group">
          <label>Zip</label>
          <div class="inputContainer">
            <input id="zip_code" type="text" placeholder=""/>
          </div>
        </div>
        
      </section>
    </main>

  </body>
</html>

              
            
!

CSS

              
                body {
	background:
    radial-gradient(at 30% 40%, #00ffff80 10%, transparent 74%),
    radial-gradient(at 70% 60%, #0080ff80 10%, transparent 74%);
  background-color: #000;
  color: #fff;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	min-height: 100vh;
  --dropdown-handle-size: 0.35rem;  
}

main {
	display: flex;
	flex-direction: row;
  flex-wrap: wrap;
	justify-content: center;
  align-content: center;
	min-height: 100vh;
  margin: 0;
  padding: 0;
}

section {
  margin: 0.5rem 0.5rem 8rem 0.5rem;
}

label {
  padding: 0 0 0.2rem 0;
  display: block;
}

.group {
  margin: 0.75rem 0.75rem;
}

input, select {
  box-sizing: border-box;
  font-size: 1.35rem;
  border: 1px solid #ccc;
  padding: 0.5em;
  border-radius: 0.3em;
  background: linear-gradient(#eee, #ffffff 20%);
  min-width: 20rem;
}

input:focus, select:focus {
  outline: none !important;
  box-shadow: 0 0 10px #fff;
}

select {
  /* reset */
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image:
    linear-gradient(45deg, transparent 50%, gray 50%),
    linear-gradient(135deg, gray 50%, transparent 50%),
    linear-gradient(#eee, #ffffff 20%);
  background-position:
    calc(100% - var(--dropdown-handle-size) - 1rem) calc(50%),
    calc(100% - 1rem) calc(50%),
    center;
  background-size:
    var(--dropdown-handle-size) var(--dropdown-handle-size),
    var(--dropdown-handle-size) var(--dropdown-handle-size),
    100% 100%;
  background-repeat: no-repeat;
}

.inputContainer {
  position: relative;
}

              
            
!

JS

              
                // Implement a listener for speech segment updates
document
  .getElementsByTagName("push-to-talk-button")[0]
  .addEventListener("speechsegment", (e) => {
    const speechSegment = e.detail;
    console.log(speechSegment);

    if (speechSegment.intent.intent === "fill") {
      speechSegment.entities.forEach(entity => {
        document.getElementById(entity.type).value = entity.value;
      })
    }

    if (speechSegment.intent.intent === "clear" && speechSegment.intent.isFinal) {
      ["date_of_birth", "card_id", "phone_number", "zip_code"]
        .forEach(field => {
          document.getElementById(field).value = "";
        })
    }
  });
              
            
!
999px

Console