Add some animations

This commit is contained in:
Amauri CHAMPEAUX 2020-10-28 17:29:02 +01:00
parent acb449cad9
commit ba79735d36
2 changed files with 23 additions and 1 deletions

View File

@ -19,6 +19,10 @@
text-align: initial;
text-shadow: initial;
}
/* Animation */
#tarteaucitronRoot * {transition: border 300ms, background 300ms, opacity 200ms, box-shadow 400ms}
/* HTML5 display-role reset for older browsers */
#tarteaucitronRoot article, #tarteaucitronRoot aside, #tarteaucitronRoot details, #tarteaucitronRoot figcaption, #tarteaucitronRoot figure, #tarteaucitronRoot footer, #tarteaucitronRoot header, #tarteaucitronRoot hgroup, #tarteaucitronRoot menu, #tarteaucitronRoot nav, #tarteaucitronRoot section {
display: block;

View File

@ -805,7 +805,25 @@ var tarteaucitron = {
"css": function (id, property, value) {
"use strict";
if (document.getElementById(id) !== null) {
document.getElementById(id).style[property] = value;
if (property == "display" && value == "none" && (id == "tarteaucitron" || id == "tarteaucitronBack" || id == "tarteaucitronAlertBig")) {
document.getElementById(id).style["opacity"] = "0";
setTimeout(function() {document.getElementById(id).style[property] = value;}, 200);
} else {
document.getElementById(id).style[property] = value;
if (property == "display" && value == "block" && (id == "tarteaucitron" || id == "tarteaucitronAlertBig")) {
document.getElementById(id).style["opacity"] = "0";
setTimeout(function() {document.getElementById(id).style["opacity"] = "1";}, 1);
}
if (property == "display" && value == "block" && id == "tarteaucitronBack") {
document.getElementById(id).style["opacity"] = "0";
setTimeout(function() {document.getElementById(id).style["opacity"] = "0.7";}, 1);
}
}
}
},
"addClass": function (id, className) {