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 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://speechly.github.io/browser-ui/v3/push-to-talk-button.js"></script>
    <script type="text/javascript" src="https://speechly.github.io/browser-ui/v3/transcript-drawer.js"></script>
    <link rel="stylesheet" href="https://speechly.github.io/browser-ui/v3/speechly-ui.css">
  </head>
  <body>

    <transcript-drawer hint='Try: "Apples, oranges"'> </transcript-drawer>

    
    <main>
      <div class="group">
        <div class="inputContainer">
          <input id="searchBox" type="text" placeholder="Search with voice..." autofocus>
          <div class="startAdornment"><svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg></div>
          <push-to-talk-button size="4.5rem" class="endAdornment" intro="Hold for voice search" showtime="30000" appid="ead4b9e7-e5c4-48ed-9dae-3c530916ed76"/>

        </div>
      </div>
    </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;
}

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

.group {
  margin: 0 0 3rem 0;
}

input {
  font-size: 1.5rem;
  border: 1px solid #ccc;
  padding: 0.5em;
  border-radius: 30em;
  background: linear-gradient(#eee, #ffffff 20%);
}

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

::placeholder {
  color: #aaa;
  opacity: 1;
}

.inputContainer {
  position: relative;
}

.startAdornment {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
	display: flex;
	flex-direction: row;
	justify-content: center;
  align-items: center;
  color: #aaa;
  padding: 0.5rem;
  font-size: 2rem;
}

.endAdornment {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
	display: flex;
	flex-direction: row;
	justify-content: center;
  align-items: center;
  color: #aaa;
  padding: 0rem;
  font-size: 2rem;
}


svg {
  fill: currentColor;
}

#searchBox {
  box-sizing: border-box;
  width: 60vw;
  min-width: 16rem;
  padding-left: 3rem;
}

              
            
!

JS

              
                // Implement a listener for speech segment updates
document
  .getElementsByTagName("push-to-talk-button")[0]
  .addEventListener("speechsegment", (e) => {
    const segment = e.detail;
    document.getElementById("searchBox").value = segment.words.filter(w => w.value).map(w => w.value.toLowerCase()).join(" ");
  });
              
            
!
999px

Console