Skip to content

Commit dbdd5ab

Browse files
committed
Changed web tool input style
1 parent eed918f commit dbdd5ab

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed

_includes/demo.html

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,20 @@
2727
<p style="line-height: 100%">This is an prototype implementation of the sparse tensor algebra compiler theory and contains known bugs, which are documented <a href="https://github.com/tensor-compiler/taco/issues">here</a>. If you find additional issues, please consider submitting a bug report.</p>
2828
<h6 style="margin-bottom: 0px; margin-top: 18px">Input a tensor algebra expression in index notation to generate code that computes it:</h6>
2929
<div class="input-bar">
30-
<div class="mdl-textfield mdl-js-textfield expr-input">
31-
<input id="txtExpr" class="mdl-textfield__input" value="y(i) = A(i,j) * x(j)" style="font-family: monospace" spellcheck="false" autocomplete="off" autocorrect="false" autocapitalize="false">
30+
<div class="mdl-textfield expr-input">
31+
<input id="txtExpr" class="input" value="y(i) = A(i,j) * x(j)" style="font-family: monospace" spellcheck="false" autocomplete="off" autocorrect="false" autocapitalize="false">
3232
<span id="lblError" class="mdl-textfield__error" style="font-size: 14px"></span>
3333
<label class="mdl-textfield__label"></label>
3434
</div>
3535
<div class="input-bar-misc">
36-
<div style="float: left; margin-top: 16px">
36+
<div style="float: left">
3737
<button id="btnExamples" class="mdl-button mdl-js-button mdl-button--icon">
3838
<i class="material-icons">more_vert</i>
3939
</button>
4040
<ul id="listExamples" class="mdl-menu mdl-menu--bottom-left mdl-js-menu mdl-js-ripple-effect" style="margin-top: 0em; margin-left: 0em" for="btnExamples"></ul>
4141
</div>
42-
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label prefix-input">
43-
<input id="prefix" class="mdl-textfield__input" style="font-family: monospace" spellcheck="false" autocomplete="off" autocorrect="false" autocapitalize="false">
44-
<label class="mdl-textfield__label">Prefix (Optional)</label>
42+
<div class="mdl-textfield prefix-input">
43+
<input id="prefix" class="input" placeholder="Prefix (Optional)" style="font-family: monospace" spellcheck="false" autocomplete="off" autocorrect="false" autocapitalize="false">
4544
</div>
4645
<button id="btnGetKernel" class="button is-primary demo-btn">Generate Kernel</button>
4746
</div>
@@ -188,4 +187,3 @@ <h6 style="margin-bottom: 0px; margin-top: 18px">Input a tensor algebra expressi
188187

189188
<script>demo()</script>
190189

191-
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/app.css">

assets/css/app.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
$primary: #FFD150;
44

55
html {
6-
-webkit-text-size-adjust: none;
6+
-webkit-text-size-adjust: none;
77
}
88

99
// Import Main CSS file from theme
1010
@import "main";
11+
12+
.button.is-primary[disabled] {
13+
border-color: $primary;
14+
}

javascripts/demo.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,15 @@ function demo() {
276276
clearTimeout(txtExprView.timerEvent);
277277
txtExprView.errorMsg = model.output.error;
278278
$("#txtExpr").parent().addClass('is-invalid');
279+
$("#txtExpr").addClass('is-danger');
279280
} else if (model.input.error.message !== "") {
280281
if (model.input.error.message !== txtExprView.errorMsg ||
281282
txtExprView.lastInput != currInput) {
282283
clearTimeout(txtExprView.timerEvent);
283284
txtExprView.errorMsg = model.input.error.message;
284285
var markError = function() {
285286
$("#txtExpr").parent().addClass('is-invalid');
287+
$("#txtExpr").addClass('is-danger');
286288
txtExprView.errorMsg = "";
287289
};
288290
txtExprView.timerEvent = setTimeout(markError, model.input.error.delay);
@@ -291,6 +293,7 @@ function demo() {
291293
clearTimeout(txtExprView.timerEvent);
292294
txtExprView.errorMsg = "";
293295
$("#txtExpr").parent().removeClass('is-invalid');
296+
$("#txtExpr").removeClass('is-danger');
294297
}
295298
$("#lblError").html(txtExprView.errorMsg);
296299
txtExprView.lastInput = currInput;

stylesheets/style.css

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,23 @@ h1, h2, h3, h4, h5, h6 {
161161
.input-bar-misc {
162162
display: flex;
163163
justify-content: space-between;
164-
min-width: 400px;
164+
min-width: 450px;
165165
}
166166

167167
#btnExamples {
168168
margin-left: 8px;
169169
margin-right: 8px;
170170
margin-bottom: 20px;
171+
margin-top: 25px;
171172
}
172173

173-
@media (max-width: 825px) {
174+
.demo-btn {
175+
margin-top: 20px;
176+
width: 175px;
177+
min-width: 175px;
178+
}
179+
180+
@media (max-width: 900px) {
174181
.input-bar {
175182
flex-wrap: wrap;
176183
}
@@ -191,12 +198,18 @@ h1, h2, h3, h4, h5, h6 {
191198
#btnExamples {
192199
margin-left: 0px;
193200
}
194-
}
195201

196-
.demo-btn {
197-
margin-top: 16px;
198-
width: 175px;
199-
min-width: 175px;
202+
.demo-btn {
203+
margin-top: 15px;
204+
}
205+
206+
.prefix-input {
207+
padding-top: 15px;
208+
}
209+
210+
#btnExamples {
211+
margin-top: 20px;
212+
}
200213
}
201214

202215
.prefix-input {
@@ -222,7 +235,7 @@ h1, h2, h3, h4, h5, h6 {
222235
}
223236
}
224237

225-
@media (max-width: 425px) {
238+
@media (max-width: 500px) {
226239
.prefix-input {
227240
display: none;
228241
}

0 commit comments

Comments
 (0)