Added pulsing effect to badge.

master
Håvar Aambø Fosstveit 2019-10-16 21:41:55 +02:00
parent 513f0efa0b
commit f51d07285d
2 changed files with 34 additions and 7 deletions

View File

@ -90,8 +90,6 @@ class ParticipantList extends React.PureComponent
<li className={classes.listheader}>Me:</li> <li className={classes.listheader}>Me:</li>
<ListMe /> <ListMe />
</ul> </ul>
<br />
{ lobbyPeers.length > 0 ? { lobbyPeers.length > 0 ?
<ul className={classes.list}> <ul className={classes.list}>
<li className={classes.listheader}>Participants in Lobby:</li> <li className={classes.listheader}>Participants in Lobby:</li>
@ -106,8 +104,6 @@ class ParticipantList extends React.PureComponent
</ul> </ul>
:null :null
} }
<br />
<ul className={classes.list}> <ul className={classes.list}>
<li className={classes.listheader}>Participants in Spotlight:</li> <li className={classes.listheader}>Participants in Spotlight:</li>
{ spotlightPeers.map((peer) => ( { spotlightPeers.map((peer) => (
@ -124,7 +120,6 @@ class ParticipantList extends React.PureComponent
</li> </li>
))} ))}
</ul> </ul>
<br />
<ul className={classes.list}> <ul className={classes.list}>
<li className={classes.listheader}>Passive Participants:</li> <li className={classes.listheader}>Passive Participants:</li>
{ passivePeers.map((peerId) => ( { passivePeers.map((peerId) => (

View File

@ -150,6 +150,38 @@ const styles = (theme) =>
} }
}); });
const PulsingBadge = withStyles((theme) =>
({
badge :
{
backgroundColor : theme.palette.secondary.main,
// boxShadow : `0 0 0 2px ${theme.palette.secondary.main}`,
'&::after' :
{
position : 'absolute',
width : '100%',
height : '100%',
borderRadius : '50%',
animation : '$ripple 1.2s infinite ease-in-out',
border : `3px solid ${theme.palette.secondary.main}`,
content : '""'
}
},
'@keyframes ripple' :
{
'0%' :
{
transform : 'scale(.8)',
opacity : 1
},
'100%' :
{
transform : 'scale(2.4)',
opacity : 0
}
}
}))(Badge);
class Room extends React.PureComponent class Room extends React.PureComponent
{ {
constructor(props) constructor(props)
@ -286,7 +318,7 @@ class Room extends React.PureComponent
className={room.toolbarsVisible ? classes.show : classes.hide} className={room.toolbarsVisible ? classes.show : classes.hide}
> >
<Toolbar> <Toolbar>
<Badge <PulsingBadge
color='secondary' color='secondary'
badgeContent={unread} badgeContent={unread}
> >
@ -298,7 +330,7 @@ class Room extends React.PureComponent
> >
<MenuIcon /> <MenuIcon />
</IconButton> </IconButton>
</Badge> </PulsingBadge>
{ window.config.logo ? { window.config.logo ?
<img alt='Logo' className={classes.logo} src={window.config.logo} /> <img alt='Logo' className={classes.logo} src={window.config.logo} />
:null :null