Highlight messages we jump to.

This commit is contained in:
Paul
2021-07-09 09:58:38 +01:00
parent 362e7452fe
commit 7a5ace2def
5 changed files with 31 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import styled, { css } from "styled-components";
import styled, { css, keyframes } from "styled-components";
import { decodeTime } from "ulid";
import { Text } from "preact-i18n";
@@ -17,8 +17,15 @@ export interface BaseMessageProps {
blocked?: boolean;
sending?: boolean;
contrast?: boolean;
highlight?: boolean;
}
const highlight = keyframes`
0% { background: var(--mention); }
66% { background: var(--mention); }
100% { background: transparent; }
`;
export default styled.div<BaseMessageProps>`
display: flex;
overflow: none;
@@ -70,6 +77,14 @@ export default styled.div<BaseMessageProps>`
color: var(--error);
`}
${(props) =>
props.highlight &&
css`
animation-name: ${highlight};
animation-timing-function: ease;
animation-duration: 3s;
`}
.detail {
gap: 8px;
display: flex;