Skip to content

Commit

Permalink
feat: ET-1570: Try htmx on lab gen api
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Williams authored and Daniel Williams committed Oct 22, 2024
1 parent aef4f6f commit 941670b
Show file tree
Hide file tree
Showing 3 changed files with 481 additions and 0 deletions.
1 change: 1 addition & 0 deletions lab_gen/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
<body>
<h1>Lab Gen API</h1>
<div><a href="/api/docs">API docs</a></div>
<div><a href="/test/prompts.html">Test Prompts</a></div>
</body>
</html>
235 changes: 235 additions & 0 deletions lab_gen/static/styles/prompts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
.quicksand-header {
font-family: "Quicksand", sans-serif;
font-optical-sizing: auto;
font-weight: 500;
font-style: normal;
}

html{
background-color: #effbf7;
height: 100vh;
}

body{
width: 60%;
background-color: white;
margin: 0 auto;
overflow: auto;
min-height: 100vh;
font-family: "Quicksand", sans-serif;
}

h1, h2, h3 {
font-family: "Quicksand", sans-serif;
font-weight: 500;
margin: 0;
}

h2, h3{
margin-bottom: 2px;
}

p{
font-family: "Quicksand", sans-serif;
font-weight: 400;
margin: 0;
margin-bottom: 15px;
color: #555;
font-size: 0.9em;
}

section{
padding: 20px 20px;
}

section h1{
font-size: 2em;
}

section.header{
background: #2caa7f;
color: white;
}

section.header p{
color: white;
margin-bottom: 0;
}

input[type=password], input[type=text]{
background: #f5f5f5;
padding: 10px;
font-family: "Quicksand";
border: 1px solid #ddd;
border-radius: 5px;
font-size: 0.9em;
color: #555;
}

input[type=password]:focus, input[type=text]:focus{
outline: 2px solid #ddd;
}

input::placeholder{
font-size: 0.8em;
}

button{
font-family: "Quicksand", sans-serif;
padding: 8px 20px;
font-size: 0.9em;
background-color: #555;
border-radius: 5px;
border: 1px solid #333;
color: #fff;
margin-top: 10px;
outline: none;
transition: all 0.5s;
display: flex;
align-items: center;
justify-content: center;
}

button:hover{
background-color: #333;
cursor: pointer;
}

button svg{
margin-right: 5px;
}

.buttons{
display: flex;
align-items: center;
margin-top: 10px;
}

.buttons button{
margin-top: 0;
}

ul{
margin: 0;
padding: 0;
list-style: none;
}

li{
background: white;
padding: 10px;
display: flex;
align-items: baseline;
border-radius: 5px;
border: 1px solid #ddd;
margin-bottom: 1px;
transition: all 0.5s;
justify-content: space-between;
}

li:hover{
background: #f5f5f5;
cursor: pointer;
}

li > p{
margin: 0;
font-weight: 500;
}

.prompt-fields{
display: flex;
}

.tag{
background: aquamarine;
border: 1px solid #6edbb6;
padding: 5px 10px;
border-radius: 5px;
margin: 0 2px;
color: #555;
}

.card{
border: 1px solid #ddd;
border-radius: 5px;
padding: 15px;
margin: 15px 0;
}

.card h3{
margin-bottom: 10px;
}

section.border-top{
border-top: 2px solid #eee;
}

.placeholder{
background-color: #f5f5f5;
font-family: 'Quicksand', sans-serif;
padding: 3em 0;
border-radius: 5px;
font-size: 0.9em;
color: #555;
text-align: center;
}

.placeholder .message{
display: flex;
align-items: center;
justify-content: center;
}

.placeholder svg{
margin-right: 5px;
}

.indicator{
display:none;
margin-left: 10px;
}
.htmx-request .indicator{
display:block;
}
.htmx-request.indicator{
display:block;
}

#single-prompt{
margin-top: 15px;
}

.error-message{
background: #ffd5d5;
padding: 10px 15px;
border-radius: 5px;
margin-top: 10px;
color: #925252;
border: 1px solid #e3baba;
}

label{
font-size: 0.9em;
margin-bottom: 10px;
display: inline-block;
}

@media (min-width: 1500px){
body{
width: 50%;
}
}

@media (max-width: 1200px){
body{
width: 90%;
}

}

@media (max-width: 800px){
body{
width: 100%;
}
}
Loading

0 comments on commit 941670b

Please sign in to comment.