Skip to content

Commit 3792c48

Browse files
committed
Improve performance of note pane animation
Summary: Widen the pane a little, to 40% of the screen from 33%. Also darken the click capture area, more like the mockups. Test Plan: - Go to a document - Open the note pane - It should be almost buttery smooth - Rest of the page should darken Differential Revision: https://phabricator.opengovfoundation.org/D169
1 parent 618d47d commit 3792c48

File tree

2 files changed

+21
-28
lines changed

2 files changed

+21
-28
lines changed

resources/assets/sass/annotation.scss

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,30 @@
66
}
77

88
.annotation-click-capture {
9-
@extend .col-md-8;
109
position: fixed;
1110
top: 0;
1211
bottom: 0;
1312
left: 0;
13+
right: 0;
14+
background-color: rgba(0,0,0,0.2);
1415
}
1516

1617
.annotation-pane {
17-
@extend .col-md-4;
1818
position: fixed;
1919
top: 0;
2020
bottom: 0;
2121
right: 0;
2222
height: 100%;
23+
width: 100%;
2324
z-index: ($zindex-navbar + 1);
2425
background-color: white;
25-
@extend %simple-shadow;
26-
padding: 0 0 (2 * $line-height-computed);
27-
// Pad the top to allow the header to float above it.
28-
margin-top: 0;
2926

3027
// Slide in/out
31-
margin-right: -34%;
32-
@include transition(all $transition-duration $transition-easing);
28+
@include translate(100%, 0);
29+
@include transition-transform($transition-duration $transition-easing);
3330
&.active {
34-
margin-right: 0;
31+
@extend %simple-shadow;
32+
@include translate(0, 0);
3533
}
3634

3735
.title-header {
@@ -60,11 +58,12 @@
6058
display: inline-block;
6159
}
6260

63-
.close-button {
64-
float: right;
65-
font-style: italic;
61+
.close {
6662
line-height: (2 * $line-height-computed);
67-
cursor: pointer;
63+
}
64+
65+
@media screen and (min-width: $screen-md-min) {
66+
width: 40%;
6867
}
6968
}
7069

@@ -218,14 +217,6 @@
218217
display: none;
219218
}
220219

221-
.annotation-pane {
222-
left: 100%;
223-
224-
&.active {
225-
left: 0;
226-
}
227-
}
228-
229220
// Hide all inline annotations for now.
230221
.annotator-outer,
231222
.annotator-adder {

resources/views/documents/show.blade.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,18 @@
6464
</div>
6565

6666
<aside class="annotation-container col-md-1">
67-
<aside class="annotation-pane" role="dialog">
67+
<aside class="annotation-pane-wrapper" role="dialog">
6868
<div class="annotation-click-capture hidden" onclick="hideNotes()"></div>
6969

70-
<header class="title-header navbar navbar-default navbar-static-top">
71-
<h2>@lang('messages.document.notes')</h2>
72-
<a class="close-button navbar-link" onclick="hideNotes()">@lang('messages.close')</a>
73-
</header>
70+
<div class="annotation-pane">
71+
<header class="title-header navbar navbar-default navbar-static-top">
72+
<h2>@lang('messages.document.notes')</h2>
73+
<a class="close" aria-label="{{ trans('messages.close') }}" onclick="hideNotes()">&times;</a>
74+
</header>
7475

75-
<ul class="annotation-list media-list">
76-
</ul>
76+
<ul class="annotation-list media-list">
77+
</ul>
78+
</div>
7779
</aside>
7880
</aside>
7981
</div>

0 commit comments

Comments
 (0)