This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create EmotionsCard component and add styling for it * Modify carousel styles to center values * Modifying html tags and styling feature details * Fix width of emotions bar * Fix if in emotionscard
- Loading branch information
Showing
6 changed files
with
117 additions
and
26 deletions.
There are no files selected for viewing
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
18 changes: 18 additions & 0 deletions
18
frontend/src/views/ImageDetailsPage/components/FeatureTiles/FaceTile/EmotionsCard.js
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,18 @@ | ||
import { EmotionsTemplate, EmotionBar } from './EmotionsCard.styles'; | ||
|
||
const EmotionsCard = ({ emotionsArray }) => { | ||
return ( | ||
<EmotionsTemplate> | ||
{emotionsArray.map((obj, i) => { | ||
return ( | ||
<div key={i}> | ||
<p key={obj}>{obj.emotion}</p> | ||
{obj.emotionValue === 0 ? <p key={i}>Unknown</p> : <EmotionBar emotionValue={obj.emotionValue} key={i} />} | ||
</div> | ||
); | ||
})} | ||
</EmotionsTemplate> | ||
); | ||
}; | ||
|
||
export default EmotionsCard; |
43 changes: 43 additions & 0 deletions
43
frontend/src/views/ImageDetailsPage/components/FeatureTiles/FaceTile/EmotionsCard.styles.js
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,43 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const EmotionsTemplate = styled.div` | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
p { | ||
text-transform: capitalize; | ||
} | ||
div { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
grid-row-gap: 1%; | ||
} | ||
`; | ||
|
||
export const EmotionBar = styled.div` | ||
display: block; | ||
align-self: center; | ||
width: ${({ emotionValue }) => { | ||
switch (emotionValue) { | ||
case 5: | ||
return '100%'; | ||
case 4: | ||
return '80%'; | ||
case 3: | ||
return '60%'; | ||
case 2: | ||
return '40%'; | ||
default: | ||
return '15%'; | ||
} | ||
}}; | ||
max-width: 80%; | ||
height: 80%; | ||
margin-left: 8%; | ||
border-radius: 5px; | ||
background: rgb(32, 104, 223); | ||
background-image: linear-gradient(244deg, rgba(0, 232, 51, 0.5), rgba(60, 144, 228, 0)); | ||
`; |
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
12 changes: 7 additions & 5 deletions
12
frontend/src/views/ImageDetailsPage/components/FeatureTiles/TextEntityTile/TextEntityTile.js
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