diff options
author | Darshan Baral <darshanbaral@gmail.com> | 2019-06-10 05:34:48 +0300 |
---|---|---|
committer | Darshan Baral <darshanbaral@gmail.com> | 2019-06-10 05:34:48 +0300 |
commit | c351004c3a3f5a0f9a113a4d806d3e2f00dc0d09 (patch) | |
tree | d52f2c04dbd4b14d6c0ea16b8a159687c7efb341 | |
parent | 1ffa696b4a19841727178914acc29afe485abd13 (diff) |
Centered copiedMessage
-rw-r--r-- | static/css/kitab.css | 9 | ||||
-rw-r--r-- | static/js/myFunctions.js | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/static/css/kitab.css b/static/css/kitab.css index e6e764d..7abc9b1 100644 --- a/static/css/kitab.css +++ b/static/css/kitab.css @@ -65,7 +65,12 @@ a:hover { }
#copiedMessage {
position: fixed;
- top: 50%;
- left: 50%;
+ display: table-cell;
+ line-height: 100px;
+ width: 224px;
+ height: 100px;
+ text-align: center;
+ top: calc(50% - 50px);
+ left: calc(50% - 112px);
transition: all 1s;
}
diff --git a/static/js/myFunctions.js b/static/js/myFunctions.js index d3bbf13..196301e 100644 --- a/static/js/myFunctions.js +++ b/static/js/myFunctions.js @@ -18,10 +18,13 @@ function copyUrl(text) { let copiedMessage = document.createElement("div");
copiedMessage.id = "copiedMessage";
copiedMessage.textContent = "Link copied to clipboard";
- copiedMessage.classList.add("bg-warning", "shadow", "p-4", "d-block");
+ copiedMessage.classList.add("bg-warning", "shadow", "d-block", "text-center");
document.body.appendChild(copiedMessage);
setTimeout(function() {
copiedMessage.style.opacity = 0;
}, 500);
+ setTimeout(function() {
+ document.body.removeChild(copiedMessage);
+ }, 1500);
}
|