-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sorts #165
Open
johnbister
wants to merge
7
commits into
main
Choose a base branch
from
add-sorts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add sorts #165
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2ca6f44
add sort ascending
johnbister b4d3367
add sort descending
johnbister eb2e703
add sort remove
johnbister 335b9a6
fix sort remove
johnbister 2454a1f
Merge branch 'main' into add-sorts
johnbister e1cd390
merge main
f9ebd7b
changes to rotation css
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
47 changes: 47 additions & 0 deletions
47
src/components/Operations/SortAscendingMotion/SortAscendingMotion.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,47 @@ | ||
import React, { useRef, useState, useEffect } from 'react' | ||
import styles from './sort-ascending--motion.module.scss' | ||
|
||
const SortAscendingMotion = (props) => { | ||
const iconRef = useRef(null) | ||
const [isAnimating, setIsAnimating] = useState(props.isAnimating) | ||
|
||
let iconStyles = { | ||
width: props.size, | ||
height: props.size | ||
} | ||
|
||
React.useEffect(() => { | ||
setIsAnimating(props.isAnimating) | ||
}, [props.isAnimating]) | ||
|
||
const shouldAnimate = isAnimating ? styles.isAnimating : '' | ||
|
||
return ( | ||
<div ref={iconRef} className={`${shouldAnimate}`}> | ||
<svg | ||
style={iconStyles} | ||
viewBox='0 0 32 32' | ||
className={styles.SortAscendingMotion} | ||
> | ||
<title>Sort Ascending</title> | ||
<g className={styles.SortAscendingArrow}> | ||
<path d="M18,22l1.4-1.4l3.6,3.6V4h2v20.2l3.6-3.6L30,22l-6,6L18,22z" /> | ||
</g> | ||
<g className={styles.SortAscendingShaft}> | ||
<path d="M23,24.2V4h2v20.2H23z M2,18h14v2H2V18z M6,12h10v2H6V12z M10,6h6v2h-6V6z" /> | ||
</g> | ||
<g className={styles.SortAscendingLine1}> | ||
<path d="M10,6h6v2h-6V6z" /> | ||
</g> | ||
<g className={styles.SortAscendingLine2}> | ||
<path d="M6,12h10v2H6V12z" /> | ||
</g> | ||
<g className={styles.SortAscendingLine3}> | ||
<path d="M2,18h14v2H2V18z" /> | ||
</g> | ||
</svg> | ||
</div> | ||
) | ||
} | ||
|
||
export default SortAscendingMotion |
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,2 @@ | ||
import SortAscendingMotion from './SortAscendingMotion' | ||
export default SortAscendingMotion |
97 changes: 97 additions & 0 deletions
97
src/components/Operations/SortAscendingMotion/sort-ascending--motion.module.scss
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,97 @@ | ||
@keyframes sort-ascending-arrow { | ||
0% { | ||
transform: translatey(0px); | ||
} | ||
10% { | ||
transform: translatey(4px); | ||
} | ||
20% { | ||
transform: translatey(0px); | ||
} | ||
100% { | ||
transform: translatey(0px); | ||
} | ||
} | ||
|
||
@keyframes sort-ascending-line1 { | ||
0% { | ||
transform: translateX(0px); | ||
} | ||
6% { | ||
transform: translateX(-2px); | ||
} | ||
12% { | ||
transform: translateX(0px); | ||
} | ||
100% { | ||
transform: translateX(0px); | ||
} | ||
} | ||
|
||
@keyframes sort-ascending-line2 { | ||
4% { | ||
transform: translateX(0px); | ||
} | ||
10% { | ||
transform: translateX(-2px); | ||
} | ||
16% { | ||
transform: translateX(0px); | ||
} | ||
100% { | ||
transform: translateX(0px); | ||
} | ||
} | ||
|
||
@keyframes sort-ascending-line3 { | ||
8% { | ||
transform: translateX(0px); | ||
} | ||
14% { | ||
transform: translateX(-2px); | ||
} | ||
20% { | ||
transform: translateX(0px); | ||
} | ||
100% { | ||
transform: translateX(0px); | ||
} | ||
} | ||
|
||
|
||
.SortAscendingArrow { | ||
will-change: transform; | ||
} | ||
|
||
.isAnimating { | ||
.SortAscendingArrow { | ||
animation: sort-ascending-arrow infinite cubic-bezier(0.4, 0.14, 0.3, 1) 2s; | ||
} | ||
} | ||
|
||
.SortAscendingLine1, | ||
.SortAscendingLine2, | ||
.SortAscendingLine3 { | ||
will-change: transform; | ||
transform-origin: 1rem 0rem; | ||
} | ||
|
||
.isAnimating { | ||
.SortAscendingLine1 { | ||
animation: sort-ascending-line1 infinite cubic-bezier(0.4, 0.14, 0.3, 1) 2s; | ||
} | ||
} | ||
|
||
.isAnimating { | ||
.SortAscendingLine2 { | ||
animation: sort-ascending-line2 infinite cubic-bezier(0.4, 0.14, 0.3, 1) 2s; | ||
} | ||
} | ||
|
||
.isAnimating { | ||
.SortAscendingLine3 { | ||
animation: sort-ascending-line3 infinite cubic-bezier(0.4, 0.14, 0.3, 1) 2s; | ||
} | ||
} | ||
|
||
|
47 changes: 47 additions & 0 deletions
47
src/components/Operations/SortDescendingMotion/SortDescendingMotion.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,47 @@ | ||
import React, { useRef, useState, useEffect } from 'react' | ||
import styles from './sort-descending--motion.module.scss' | ||
|
||
const SortDescendingMotion = (props) => { | ||
const iconRef = useRef(null) | ||
const [isAnimating, setIsAnimating] = useState(props.isAnimating) | ||
|
||
let iconStyles = { | ||
width: props.size, | ||
height: props.size | ||
} | ||
|
||
React.useEffect(() => { | ||
setIsAnimating(props.isAnimating) | ||
}, [props.isAnimating]) | ||
|
||
const shouldAnimate = isAnimating ? styles.isAnimating : '' | ||
|
||
return ( | ||
<div ref={iconRef} className={`${shouldAnimate}`}> | ||
<svg | ||
style={iconStyles} | ||
viewBox='0 0 32 32' | ||
className={styles.SortDescendingMotion} | ||
> | ||
<title>Sort descending</title> | ||
<g className={styles.SortDescendingArrow}> | ||
<path d="M18,22l1.4-1.4l3.6,3.6V4h2v20.2l3.6-3.6L30,22l-6,6L18,22z" /> | ||
</g> | ||
<g className={styles.SortDescendingShaft}> | ||
<path d="M23,24.2V4h2v20.2H23z M10,18h6v2h-6V18z M6,12h10v2H6V12z M2,6h14v2H2V6z" /> | ||
</g> | ||
<g className={styles.SortDescendingLine1}> | ||
<path d="M2,6h14v2H2V6z" /> | ||
</g> | ||
<g className={styles.SortDescendingLine2}> | ||
<path d="M6,12h10v2H6V12z" /> | ||
</g> | ||
<g className={styles.SortDescendingLine3}> | ||
<path d="M10,18h6v2h-6V18z" /> | ||
</g> | ||
</svg> | ||
</div> | ||
) | ||
} | ||
|
||
export default SortDescendingMotion |
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,2 @@ | ||
import SortDescendingMotion from './SortDescendingMotion' | ||
export default SortDescendingMotion |
97 changes: 97 additions & 0 deletions
97
src/components/Operations/SortDescendingMotion/sort-descending--motion.module.scss
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,97 @@ | ||
@keyframes sort-descending-arrow { | ||
0% { | ||
transform: translatey(0px); | ||
} | ||
10% { | ||
transform: translatey(4px); | ||
} | ||
20% { | ||
transform: translatey(0px); | ||
} | ||
100% { | ||
transform: translatey(0px); | ||
} | ||
} | ||
|
||
@keyframes sort-descending-line1 { | ||
0% { | ||
transform: translateX(0px); | ||
} | ||
6% { | ||
transform: translateX(-2px); | ||
} | ||
12% { | ||
transform: translateX(0px); | ||
} | ||
100% { | ||
transform: translateX(0px); | ||
} | ||
} | ||
|
||
@keyframes sort-descending-line2 { | ||
4% { | ||
transform: translateX(0px); | ||
} | ||
10% { | ||
transform: translateX(-2px); | ||
} | ||
16% { | ||
transform: translateX(0px); | ||
} | ||
100% { | ||
transform: translateX(0px); | ||
} | ||
} | ||
|
||
@keyframes sort-descending-line3 { | ||
8% { | ||
transform: translateX(0px); | ||
} | ||
14% { | ||
transform: translateX(-2px); | ||
} | ||
20% { | ||
transform: translateX(0px); | ||
} | ||
100% { | ||
transform: translateX(0px); | ||
} | ||
} | ||
|
||
|
||
.SortDescendingArrow { | ||
will-change: transform; | ||
} | ||
|
||
.isAnimating { | ||
.SortDescendingArrow { | ||
animation: sort-descending-arrow infinite cubic-bezier(0.4, 0.14, 0.3, 1) 2s; | ||
} | ||
} | ||
|
||
.SortDescendingLine1, | ||
.SortDescendingLine2, | ||
.SortDescendingLine3 { | ||
will-change: transform; | ||
transform-origin: 1rem 0rem; | ||
} | ||
|
||
.isAnimating { | ||
.SortDescendingLine1 { | ||
animation: sort-descending-line1 infinite cubic-bezier(0.4, 0.14, 0.3, 1) 2s; | ||
} | ||
} | ||
|
||
.isAnimating { | ||
.SortDescendingLine2 { | ||
animation: sort-descending-line2 infinite cubic-bezier(0.4, 0.14, 0.3, 1) 2s; | ||
} | ||
} | ||
|
||
.isAnimating { | ||
.SortDescendingLine3 { | ||
animation: sort-descending-line3 infinite cubic-bezier(0.4, 0.14, 0.3, 1) 2s; | ||
} | ||
} | ||
|
||
|
50 changes: 50 additions & 0 deletions
50
src/components/Operations/SortRemoveMotion/SortRemoveMotion.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,50 @@ | ||
import React, { useRef, useState, useEffect } from 'react' | ||
import styles from './sort-remove--motion.module.scss' | ||
|
||
const SortRemoveMotion = (props) => { | ||
const iconRef = useRef(null) | ||
const [isAnimating, setIsAnimating] = useState(props.isAnimating) | ||
|
||
let iconStyles = { | ||
width: props.size, | ||
height: props.size | ||
} | ||
|
||
React.useEffect(() => { | ||
setIsAnimating(props.isAnimating) | ||
}, [props.isAnimating]) | ||
|
||
const shouldAnimate = isAnimating ? styles.isAnimating : '' | ||
|
||
return ( | ||
<div ref={iconRef} className={`${shouldAnimate}`}> | ||
<svg | ||
style={iconStyles} | ||
viewBox='0 0 32 32' | ||
className={styles.SortRemoveMotion} | ||
> | ||
<title>Sort remove</title> | ||
<g className={styles.SortRemoveShaft}> | ||
<path d="M10,18h6v2h-6V18z M6,12h10v2H6V12z M9,6h7v2H9V6z" /> | ||
</g> | ||
<g className={styles.SortRemoveVertical}> | ||
<path d="M26,22l0-5.1l-2,0l0,5.1v2v5.1h2V24L26,22z" /> | ||
</g> | ||
<g className={styles.SortRemoveHorizontal}> | ||
<path d="M31.1,24l0-2L26,22l-2,0h-5.1v2H24h2L31.1,24z" /> | ||
</g> | ||
<g className={styles.SortRemoveLine1}> | ||
<path d="M2,6h7.6v2H2V6z" /> | ||
</g> | ||
<g className={styles.SortRemoveLine2}> | ||
<path d="M6,12h10v2H6V12z" /> | ||
</g> | ||
<g className={styles.SortRemoveLine3}> | ||
<path d="M10,18h6v2h-6V18z" /> | ||
</g> | ||
</svg> | ||
</div> | ||
) | ||
} | ||
|
||
export default SortRemoveMotion |
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,2 @@ | ||
import SortRemoveMotion from './SortRemoveMotion' | ||
export default SortRemoveMotion |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel like you should consider creating an
IconTile
component so if you ever need to change the structure, you won’t need to replace all these<h3>
s. Probably feels pretty minor for now, but could come in handy down the road if you only need to make the changes in one place instead of for each instance.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree 110%! It's something I've planned on fixing but haven't gotten to yet. I thought I had an issue open for it but I didn't, so I'll make one now!