Skip to content

Commit

Permalink
updated UI with pencil icon wobble and positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
russell-rozenbaum committed Jun 25, 2024
1 parent 5edf1c9 commit 294f669
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/haz3lweb/view/ExerciseMode.re
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ let view =
let title_view = {
Cell.simple_cell_view([
div(
~attr=Attr.class_("title-cell"),
~attr=Attr.many([Attr.class_("title-cell")]),
[
settings.instructor_mode
? settings.editing_title
Expand All @@ -86,7 +86,6 @@ let view =
Attr.many([
Attr.class_("title-text"),
Attr.value(eds.title),
Attr.id("title-input"),
Attr.on_keydown(evt =>
if (evt##.keyCode === 13) {
let new_title = Obj.magic(evt##.target)##.value;
Expand All @@ -109,8 +108,13 @@ let view =
~attr=Attr.many([Attr.class_("title-text")]),
[
text(eds.title),
Widgets.button(Icons.pencil, _ =>
inject(Set(EditingTitle))
div(
~attr=Attr.class_("pencil-icon"),
[
Widgets.button(Icons.pencil, _ =>
inject(Set(EditingTitle))
),
],
),
],
)
Expand Down
15 changes: 15 additions & 0 deletions src/haz3lweb/www/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -714,12 +714,27 @@ select {

.title-cell {
padding-left: 1em;
display: flex;
align-items: center;
}

.title-cell .title-text {
font-size: 1.5rem;
font-weight: bold;
color: var(--light-text-color);
flex-grow: 1;
display: flex;
align-items: center;
}

.title-cell .pencil-icon {
margin-left: 0.5em;
cursor: pointer;
color: #7a6219;
}

.title-cell .pencil-icon:hover {
animation: wobble 0.6s ease 0s 1 normal forwards;
}

.cell-prompt {
Expand Down

0 comments on commit 294f669

Please sign in to comment.