-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Readiness bubble for rest users (#2169)
* Create progressCircle component * Add color variable for progress circle * Delete boardUser, move to userAvatar + boardUsers * Refactor boardUsers scss * Implement progressCircle * Rewrite progressCircle * WIP color changes * Use variables * Add new colors * Use currentColor keyword * Show check icon with animation * Update color, and increase font size * Apply review changes Co-authored-by: Sebastian Schwarzer <[email protected]>
- Loading branch information
1 parent
275c63c
commit b3f3a0b
Showing
7 changed files
with
153 additions
and
147 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/components/BoardHeader/ParticipantsList/ProgressCircle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
type ProgressCircleProps = { | ||
className?: string; | ||
percentage: number; | ||
}; | ||
|
||
export const ProgressCircle = ({percentage, className}: ProgressCircleProps) => { | ||
// clamp between 0 and 1 | ||
percentage = Math.min(Math.max(percentage, 0), 1); | ||
return ( | ||
<svg viewBox="0 0 100 100" className={className}> | ||
<circle | ||
cx="50%" | ||
cy="50%" | ||
r="50%" | ||
stroke="currentColor" | ||
strokeWidth="100%" | ||
strokeDasharray={`${Math.PI * 100}%`} | ||
strokeDashoffset={`${Math.PI * 100 * (1 - percentage)}%`} | ||
transform="rotate (-90 50 50)" | ||
/> | ||
</svg> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,118 @@ | ||
@import "constants/style.scss"; | ||
|
||
.board-users { | ||
list-style-type: none; | ||
align-self: center; | ||
display: flex; | ||
flex-direction: row; | ||
width: max-content; | ||
padding: 0; | ||
margin: 0; | ||
gap: $margin--default; | ||
} | ||
|
||
.board-users li { | ||
display: inline; | ||
} | ||
|
||
.board-users__other-avatars { | ||
box-sizing: border-box; | ||
.board-users__button { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 4px; | ||
background: none; | ||
border: none; | ||
outline: none; | ||
display: flex; | ||
flex-direction: row-reverse; | ||
align-items: center; | ||
|
||
cursor: pointer; | ||
padding-left: $padding--default; | ||
border-radius: 16px; | ||
|
||
& .user-avatar, | ||
& .rest-users { | ||
margin-left: -12px; | ||
transition: all 0.08s ease-out; | ||
} | ||
|
||
&:hover { | ||
& > .rest-users { | ||
transform: scale(1.16); | ||
} | ||
& .user-avatar { | ||
filter: brightness(1.1); | ||
transform: scale(1.08); | ||
} | ||
&--others { | ||
flex-direction: row-reverse; | ||
padding-left: $padding--default; | ||
} | ||
|
||
&:focus-visible { | ||
box-shadow: 0 0 0 2px rgba($color-backlog-blue, 0.48); | ||
} | ||
|
||
&:active { | ||
& > .rest-users, | ||
& > :not(.rest-users) { | ||
transform: scale(1); | ||
&:hover { | ||
.board-users__avatar { | ||
filter: brightness(1.1); | ||
transform: scale(1.08); | ||
} | ||
} | ||
} | ||
|
||
.board-users__my-avatar { | ||
display: contents; | ||
margin-left: $margin--small; | ||
|
||
& > button { | ||
border: none; | ||
outline: none; | ||
background: none; | ||
border-radius: 16px; | ||
cursor: pointer; | ||
.board-users__avatar { | ||
transition: all 0.08s ease-out; | ||
|
||
&:focus-visible { | ||
box-shadow: 0 0 0 2px rgba($color-backlog-blue, 0.48); | ||
} | ||
&--others { | ||
margin-left: -12px; | ||
} | ||
} | ||
|
||
.board-users__my-avatar .user-avatar { | ||
transition: all 0.08s ease-out; | ||
margin: 0; | ||
|
||
&:hover { | ||
filter: brightness(1.1); | ||
transform: scale(1.08); | ||
.rest-users { | ||
position: relative; | ||
font-size: $text-size--medium; | ||
height: $icon--extralarge; | ||
width: $icon--extralarge; | ||
border-radius: $border-radius--round; | ||
background-color: $menu-icon-background-color--dark; | ||
padding: 2px; | ||
color: $color-white; | ||
font-weight: 700; | ||
|
||
&__readiness { | ||
color: $color-progress-circle; | ||
border-radius: $border-radius--round; | ||
|
||
circle { | ||
transition: stroke-dashoffset 0.45s ease-in-out; | ||
fill: transparent; | ||
} | ||
} | ||
|
||
&:active { | ||
transform: scale(1); | ||
&__count, | ||
&__all-ready { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
// line-height: 36px; | ||
// font-size: $text-size--medium; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 768px) { | ||
.board-users { | ||
margin-right: $margin--small; | ||
&__all-ready { | ||
color: $color-white; | ||
width: 100%; | ||
height: 100%; | ||
|
||
.circle { | ||
display: none; | ||
} | ||
|
||
.check { | ||
--dasharray: 20; | ||
stroke-dasharray: var(--dasharray); | ||
stroke-dashoffset: 0; | ||
animation: draw 0.6s ease-in-out, scale 0.3s ease-out; | ||
transform-origin: 37% 40%; | ||
} | ||
} | ||
} | ||
|
||
@media screen and (max-width: 500px) { | ||
.board-users { | ||
margin-right: 0; | ||
@media #{$mini-smartphone} { | ||
.board-users__button--others { | ||
display: none; | ||
} | ||
} | ||
|
||
.board-users__other-avatars { | ||
display: none; | ||
[theme="dark"] { | ||
.rest-users { | ||
background-color: $color-icon-light-blue; | ||
color: $color-dark-two; | ||
} | ||
|
||
.board-users__my-avatar { | ||
margin-right: 0; | ||
.board-users__button { | ||
&:focus-visible { | ||
box-shadow: 0 0 0 2px rgba($color-planning-pink, 0.48); | ||
} | ||
} | ||
} | ||
|
||
[theme="dark"] { | ||
.board-users__other-avatars:focus-visible, | ||
.board-users__my-avatar > button:focus-visible { | ||
box-shadow: 0 0 0 2px rgba($color-planning-pink, 0.48); | ||
@keyframes draw { | ||
0% { | ||
stroke-dashoffset: var(--dasharray); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.