diff --git a/src/app/ui/copy-to-clipboard.js b/src/app/ui/copy-to-clipboard.js index 8588d2cdd0..869dfd53c5 100644 --- a/src/app/ui/copy-to-clipboard.js +++ b/src/app/ui/copy-to-clipboard.js @@ -29,7 +29,7 @@ module.exports = function copyToClipboard (getContent) { } } catch (e) {} copy(copiableContent) - addTooltip(event) + addTooltip(event, 'Successfully copied!') } } return copyIcon diff --git a/src/app/ui/tooltip.js b/src/app/ui/tooltip.js index 388d53dcc1..0f58d70ae1 100644 --- a/src/app/ui/tooltip.js +++ b/src/app/ui/tooltip.js @@ -6,46 +6,42 @@ var styles = styleGuide.chooser() var css = csjs` .tooltip { - visibility: hidden; - width: 100px; + z-index: 1001; + display: inline-block; + position: fixed; background-color: ${styles.remix.tooltip_CopyToClipboard_BackgroundColor}; color: ${styles.remix.tooltip_CopyToClipboard_Color}; - font-weight: bold; + min-height: 50px; + min-width: 290px; + padding: 16px 24px 12px; + border-radius: 3px; + bottom: -300; + left: 40%; font-size: 12px; - text-transform: initial; text-align: center; - border-radius: 3px; - padding: 5px 0; - position: absolute; - z-index: 1; - bottom: 160%; - left: 100%; - margin-left: -60px; - opacity: 0; - transition: opacity 1s; + -webkit-animation-name: animatebottom; + -webkit-animation-duration: 6s; + animation-name: animatebottom; + animation-duration: 6s + } + @-webkit-keyframes animatebottom { + 0% {bottom: -300px} + 20% {bottom: 0} + 50% {bottom: 0} + 100% {bottom: -300px} } - .tooltip::after { - content: ""; - position: absolute; - top: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; - border-style: solid; - border-color: ${styles.remix.tooltip_CopyToClipboard_BackgroundColor} transparent transparent transparent; + @keyframes animatebottom { + 0% {bottom: -300px} + 20% {bottom: 0} + 50% {bottom: 0} + 100% {bottom: -300px} } ` -module.exports = function addTooltip (event) { - var icon = event.target - icon.style.position = 'relative' - var tooltip = yo`