Merge branch 'master' of https://git.etud.insa-toulouse.fr/bamarty/Site-Proximo
This commit is contained in:
commit
fed8548f05
3 changed files with 34 additions and 5 deletions
|
@ -25,18 +25,26 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sortOrder:hover {
|
/* #sortOrder:hover {
|
||||||
animation: rotate180 2s forwards022314015174
|
animation: rotate180 2s forwards
|
||||||
}
|
}
|
||||||
|
|
||||||
.letter {
|
.letter {
|
||||||
animation: rotate180 2s forwards;
|
animation: rotate180 2s forwards;
|
||||||
|
} */
|
||||||
|
|
||||||
|
#sortOrder>span {
|
||||||
|
animation : rotate180 2s forwards
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes rotate180 {
|
@keyframes rotate180 {
|
||||||
0% {}
|
0% {}
|
||||||
100% { transform: rotate3d(0,1,0, 180deg)}
|
100% { transform: rotate3d(0,1,0, 180deg)}
|
||||||
}
|
}
|
||||||
|
@keyframes reverse180 {
|
||||||
|
0% {transform: rotate3d(0,1,0, 180deg)}
|
||||||
|
100% { transform: rotate3d(0,1,0, 0)}
|
||||||
|
}
|
||||||
|
|
||||||
#selectBlock{
|
#selectBlock{
|
||||||
background:#057B26;
|
background:#057B26;
|
||||||
|
|
|
@ -7,9 +7,11 @@ class Sort extends Component {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
unwound:false,
|
unwound:false,
|
||||||
orderText: "a-z"
|
orderText: "a-z",
|
||||||
|
flipped: false
|
||||||
}
|
}
|
||||||
this.handleChangeSortType = this.handleChangeSortType.bind(this)
|
this.handleChangeSortType = this.handleChangeSortType.bind(this)
|
||||||
|
this.handleChangeSortOrder = this.handleChangeSortOrder.bind(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
changeArrowDirection = () => {
|
changeArrowDirection = () => {
|
||||||
|
@ -60,6 +62,25 @@ class Sort extends Component {
|
||||||
this.props.handleChangeSortType(type)
|
this.props.handleChangeSortType(type)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleChangeSortOrder() {
|
||||||
|
let letters = document.getElementsByClassName("letter")
|
||||||
|
let sortText = document.getElementById("sortOrder")
|
||||||
|
//animation du texte entier
|
||||||
|
if (this.state.flipped) {
|
||||||
|
sortText.style.cssText = "animation: reverse180 1s forwards"
|
||||||
|
} else {
|
||||||
|
sortText.style.cssText = "animation: rotate180 1s forwards"
|
||||||
|
}
|
||||||
|
//animation de chaque lettre
|
||||||
|
for (let i = 0 ; i<letters.length ; i++) {
|
||||||
|
letters[i].style.animation = "rotate180 1s forwards"
|
||||||
|
}
|
||||||
|
this.setState({flipped : !this.state.flipped})
|
||||||
|
setTimeout(() => {
|
||||||
|
this.props.handleChangeSortOrder();
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
// console.log(this.state.orderText)
|
// console.log(this.state.orderText)
|
||||||
// console.log(this.state.orderText.split(""))
|
// console.log(this.state.orderText.split(""))
|
||||||
|
@ -80,7 +101,7 @@ class Sort extends Component {
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p id="sortOrder" onClick={this.props.handleChangeSortOrder} hidden={this.props.orderIsHidden}>
|
<p id="sortOrder" onClick={this.handleChangeSortOrder} hidden={this.props.orderIsHidden}>
|
||||||
{this.state.orderText.split("").map((l) =>
|
{this.state.orderText.split("").map((l) =>
|
||||||
<span className="letter">{l}</span>
|
<span className="letter">{l}</span>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -380,7 +380,7 @@ updateArticle = (index,id) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Gère le choix de tri par ordre croissant ou décroissant quand c'est possible avec le tri actuel
|
//Gère le choix de tri par ordre croissant ou décroissant quand c'est possible avec le tri actuel
|
||||||
handleChangeSortOrder = e => {
|
handleChangeSortOrder = () => {
|
||||||
this.setState({lowToHigh: !this.state.lowToHigh},() => {
|
this.setState({lowToHigh: !this.state.lowToHigh},() => {
|
||||||
this.sortArticles(this.state.sortType);
|
this.sortArticles(this.state.sortType);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue