master
km0 3 years ago
parent 5969005015
commit e65e4875e7

@ -10,6 +10,7 @@
</head> </head>
<body> <body>
<div class="ui"> <div class="ui">
<h1>Speech2Design</h1>
<button id="save">Save</button> <button id="save">Save</button>
<button id="reset">Reset</button> <button id="reset">Reset</button>
</div> </div>

@ -116,11 +116,13 @@ function startConverting() {
"> ${interimTranscripts} </span> `; "> ${interimTranscripts} </span> `;
} }
} }
process.innerHTML = allTheInterim; process.innerHTML = allTheInterim;
let final = let final =
finalTranscripts + '<span class="interim">' + interimTranscripts + "</span>"; finalTranscripts + '<span class="interim">' + interimTranscripts + "</span>";
speech.innerHTML = final; speech.innerHTML = final;
window.scrollTo(0, document.body.scrollHeight);
textStorage = final; textStorage = final;
cleanup = localStorage.setItem( cleanup = localStorage.setItem(

@ -1,6 +1,7 @@
html, html,
body { body {
margin: 0; margin: 0;
scroll-behavior: smooth;
} }
.interim { .interim {
@ -9,31 +10,50 @@ body {
#result { #result {
font-size: 2rem; font-size: 2rem;
padding-right: 1em;
align-self: flex-end;
} }
.speech { .speech {
display: flex;
margin: 0 auto; margin: 0 auto;
padding: 16px; margin-top: 64px;
padding: 32px;
display: flex;
transition: height 0.3s ease-out;
} }
.speech > * { .speech > * {
flex: 1 0 50%; flex: 1 0 45%;
} }
.ui { .ui {
padding: 16px; position: fixed;
text-align: right; background-color: white;
top: 0;
z-index: 100;
width: calc(100% - 64px);
display: flex;
padding: 8px 0;
margin: 0 32px;
}
.ui h1 {
margin: 0;
font-size: 2rem;
font-weight: normal;
margin-right: auto;
} }
#save { #save {
border: 1px solid currentColor; border: 1px solid currentColor;
border-radius: 1rem; border-radius: 2rem;
font-size: 1rem; font-size: 1rem;
padding: 0.25em 0.5em; padding: 0.5em;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
background-color: transparent; background-color: transparent;
cursor: pointer; cursor: pointer;
margin-right: 1rem;
} }
#save:hover { #save:hover {

Loading…
Cancel
Save