Skip to content

Commit dc438e5

Browse files
committed
feat(Panel): add animation when clicking "commencer sélection" in forms for tags
1 parent 6689a89 commit dc438e5

File tree

7 files changed

+48
-4
lines changed

7 files changed

+48
-4
lines changed

assets/css/_panel.scss

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
border-radius: 4px;
1212
background-color: white;
1313
@include box-shadow($SHADOW);
14-
overflow: hidden;
14+
15+
&::before{
16+
content: "";
17+
border-radius: 4px;
18+
position: absolute;
19+
top: 0;
20+
left: 0;
21+
width: 100%;
22+
height: 100%;
23+
@include box-shadow($SHADOW_EXPANDED);
24+
opacity: 0;
25+
}
1526

1627
.panel-wrapper {
1728
height: calc(100% - 50px);
@@ -28,3 +39,21 @@
2839
}
2940
}
3041
}
42+
43+
.animatePanel {
44+
&::before {
45+
animation: bounce infinite ease;
46+
animation-duration: 1.5s;
47+
}
48+
}
49+
50+
@keyframes bounce {
51+
from, 50%, to {
52+
opacity: 0;
53+
}
54+
55+
25%, 75% {
56+
opacity: 1;
57+
}
58+
}
59+

assets/css/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ $LINEAR_GRADIENT_ORANGE: linear-gradient(to right, #eea849, #f46b45);
6363
*/
6464

6565
$SHADOW: 0 0 15px 0 rgba(0, 0, 0, 0.15);
66+
$SHADOW_EXPANDED: 0 0 30px 0 rgba(0, 0, 0, 0.24);
6667
$SHADOW_BOTTOM:0 12px 15px -15px rgba(0, 0, 0, 0.15);
6768

6869
/*

components/Panel/Item/DetailsPanel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* The exercise containing details, tags,...
4242
*/
4343
@Prop({type: Object, required: true}) exercise!: Exercise;
44-
44+
4545
/**
4646
* Classify all tags by categories and sorts the categories
4747
*/
@@ -80,7 +80,7 @@
8080
@import "assets/css/font";
8181
8282
#DetailsPanel {
83-
83+
position: relative;
8484
padding: 20px;
8585
8686
h4 {

components/Panel/Item/ExercisesCheckPanel.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
108108
#ExercisesCheckPanel {
109109
padding: 20px 0;
110+
position: relative;
110111
111112
.results {
112113
padding: 0 20px;

components/Panel/Item/FavoritePanel.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@
157157
158158
#FavoritePanel {
159159
padding: 0;
160+
position: relative;
161+
160162
161163
.disclaimer {
162164
padding: 0 20px;

components/Panel/Item/HistoricalPanel.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
115115
#HistoricalPanel {
116116
padding: 0 0 20px;
117+
position: relative;
117118
118119
h3 {
119120
padding-left: 20px;

components/Panel/Panel.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,16 @@
101101
});
102102
103103
BusEvent.$on('changePanel', (id: number) => {
104-
this.changePanel(id)
104+
this.changePanel(id);
105+
106+
const classList: DOMTokenList = this.$el.classList;
107+
108+
if(!classList.contains("animatePanel")) {
109+
this.$el.classList.add("animatePanel");
110+
setTimeout(() => {
111+
this.$el.classList.remove("animatePanel");
112+
}, 1500);
113+
}
105114
})
106115
}
107116
@@ -124,6 +133,7 @@
124133
right: 0;
125134
z-index: 1000;
126135
display: flex;
136+
border-radius: 4px 4px 0 0;
127137
width: 100%;
128138
justify-content: stretch;
129139
overflow: hidden;

0 commit comments

Comments
 (0)