Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
6b85b3d5
Commit
6b85b3d5
authored
Mar 20, 2024
by
Alejandro Celaya
Committed by
Alejandro Celaya
Mar 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add slide-in animation for pending updates notification
parent
23c83fef
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
NotebookView.tsx
src/sidebar/components/NotebookView.tsx
+10
-2
PendingUpdatesNotification.tsx
src/sidebar/components/PendingUpdatesNotification.tsx
+5
-2
tailwind.config.mjs
tailwind.config.mjs
+11
-0
No files found.
src/sidebar/components/NotebookView.tsx
View file @
6b85b3d5
import
{
Link
,
Panel
}
from
'@hypothesis/frontend-shared'
;
import
{
Link
,
Panel
}
from
'@hypothesis/frontend-shared'
;
import
classnames
from
'classnames'
;
import
{
useEffect
,
useLayoutEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
{
useEffect
,
useLayoutEffect
,
useRef
,
useState
}
from
'preact/hooks'
;
import
scrollIntoView
from
'scroll-into-view'
;
import
scrollIntoView
from
'scroll-into-view'
;
...
@@ -133,8 +134,15 @@ function NotebookView({ loadAnnotationsService, streamer }: NotebookViewProps) {
...
@@ -133,8 +134,15 @@ function NotebookView({ loadAnnotationsService, streamer }: NotebookViewProps) {
{
groupName
}
{
groupName
}
</
h1
>
</
h1
>
</
header
>
</
header
>
<
div
className=
"absolute w-full z-5 left-0 top-7"
>
<
div
className=
"absolute w-full z-5 left-0 lg:top-8 top-5"
>
<
div
className=
"container flex flex-row-reverse"
>
<
div
className=
{
classnames
(
'container flex flex-row-reverse relative'
,
// Compensate for container's right padding, which is defined in
// tailwind.config.mjs
'right-[4rem]'
,
)
}
>
{
pendingUpdatesNotification
&&
<
PendingUpdatesNotification
/>
}
{
pendingUpdatesNotification
&&
<
PendingUpdatesNotification
/>
}
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/sidebar/components/PendingUpdatesNotification.tsx
View file @
6b85b3d5
...
@@ -55,7 +55,10 @@ function PendingUpdatesNotification({
...
@@ -55,7 +55,10 @@ function PendingUpdatesNotification({
}
}
return
(
return
(
<
div
role=
"status"
className=
"animate-fade-in"
>
<
div
role=
"status"
className=
"absolute right-0 animate-updates-notification-slide-in"
>
<
Button
<
Button
onClick=
{
applyPendingUpdates
}
onClick=
{
applyPendingUpdates
}
unstyled
unstyled
...
@@ -70,7 +73,7 @@ function PendingUpdatesNotification({
...
@@ -70,7 +73,7 @@ function PendingUpdatesNotification({
>
>
<
RefreshIcon
/>
<
RefreshIcon
/>
{
!
collapsed
&&
(
{
!
collapsed
&&
(
<
span
data
-
testid=
"full-notification"
>
<
span
data
-
testid=
"full-notification"
className=
"whitespace-nowrap"
>
Load
<
span
className=
"font-bold"
>
{
pendingUpdateCount
}
</
span
>
updates
{
' '
}
Load
<
span
className=
"font-bold"
>
{
pendingUpdateCount
}
</
span
>
updates
{
' '
}
<
span
className=
"sr-only"
>
by pressing l
</
span
>
<
span
className=
"sr-only"
>
by pressing l
</
span
>
</
span
>
</
span
>
...
...
tailwind.config.mjs
View file @
6b85b3d5
...
@@ -23,6 +23,7 @@ export default {
...
@@ -23,6 +23,7 @@ export default {
'fade-out'
:
'fade-out 0.3s forwards'
,
'fade-out'
:
'fade-out 0.3s forwards'
,
'pulse-fade-out'
:
'pulse-fade-out 5s ease-in-out forwards'
,
'pulse-fade-out'
:
'pulse-fade-out 5s ease-in-out forwards'
,
'slide-in-from-right'
:
'slide-in-from-right 0.3s forwards ease-in-out'
,
'slide-in-from-right'
:
'slide-in-from-right 0.3s forwards ease-in-out'
,
'updates-notification-slide-in'
:
'updates-notification-slide-in 0.3s ease-in'
},
},
boxShadow
:
{
boxShadow
:
{
// A more prominent shadow than the one used by tailwind, intended for
// A more prominent shadow than the one used by tailwind, intended for
...
@@ -175,6 +176,16 @@ export default {
...
@@ -175,6 +176,16 @@ export default {
opacity
:
'1'
,
opacity
:
'1'
,
},
},
},
},
'updates-notification-slide-in'
:
{
'0%'
:
{
opacity
:
'0'
,
right
:
'-15px'
,
},
'100%'
:
{
opacity
:
'1'
,
right
:
'0'
,
},
},
},
},
screens
:
{
screens
:
{
touch
:
{
raw
:
'(pointer: coarse)'
},
touch
:
{
raw
:
'(pointer: coarse)'
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment