Skip to content
This repository has been archived by the owner on Jan 2, 2022. It is now read-only.

Commit

Permalink
fix: Remove task animation
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmnunes committed Mar 23, 2020
1 parent 64c0b6b commit 50176b9
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 143 deletions.
154 changes: 51 additions & 103 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"dependencies": {
"@binarycapsule/editor": "^1.1.1",
"@binarycapsule/ui-capsules": "^1.10.2",
"@binarycapsule/ui-capsules": "^1.10.3",
"@nivo/pie": "^0.61.1",
"axios": "^0.19.2",
"focus-visible": "^5.0.2",
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/components/day/Board/Task/Task.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ const Task = ({
onChange={() => handleTaskCompletedStateChange(isActive, isCompleted, taskId, sectionId)}
/>
<TaskTitle onDoubleClick={() => handleTaskRename()}>{children}</TaskTitle>
{/*
<StyledCopyButton>
<TaskCopyButton taskTitle={children} />
</StyledCopyButton>
*/}
<ScopeCode scopeCode={scopeCode} style={{ lineHeight: '23px' }} />
{!isCompleted && (
<Controls>
Expand Down
46 changes: 12 additions & 34 deletions frontend/src/components/day/Board/Task/Task.styles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { keyframes } from 'styled-components/macro';
import styled, { css } from 'styled-components/macro';

const getColors = props => {
const colors = {
Expand Down Expand Up @@ -27,39 +27,19 @@ const getColors = props => {
return colors;
};

const pulseAnimationIsActive = props => keyframes`
from {
border-color: ${props.theme.yellow100};
box-shadow: 0 0 0 4px ${props.theme.yellow050};
}
to {
border-color: ${props.theme.yellow700};
box-shadow: 0 0 0 4px ${props.theme.yellow200};
}
export const StyledCopyButton = styled.div`
display: none;
height: 24px;
`;

const pulseAnimationInBreak = props => keyframes`
from {
border-color: ${props.theme.blue050};
box-shadow: 0 0 0 4px ${props.theme.blue050};
}
to {
border-color: ${props.theme.blue400};
box-shadow: 0 0 0 4px ${props.theme.blue100};
}
const isActiveMixin = css`
border-color: ${({ theme }) => theme.yellow700};
box-shadow: 0 0 0 4px ${({ theme }) => theme.yellow200};
`;

const getAnimation = props => {
if (props.isInBreak) return pulseAnimationInBreak(props);
if (props.isActive) return pulseAnimationIsActive(props);
return null;
};

export const StyledCopyButton = styled.div`
display: none;
height: 24px;
const isInBreakMixin = css`
border-color: ${({ theme }) => theme.blue400};
box-shadow: 0 0 0 4px ${({ theme }) => theme.blue100};
`;

export const StyledTask = styled.div`
Expand All @@ -74,10 +54,8 @@ export const StyledTask = styled.div`
margin: 4px 0;
color: ${props => (props.isCompleted ? props.theme.neutral300 : props.theme.neutral700)};
cursor: pointer;
animation: ${props => getAnimation(props)};
animation-duration: 1s;
animation-iteration-count: infinite;
animation-direction: alternate;
${({ isActive }) => isActive && isActiveMixin};
${({ isInBreak }) => isInBreak && isInBreakMixin};
&:hover {
background-color: ${props =>
Expand Down

0 comments on commit 50176b9

Please # to comment.