|
25 | 25 | word-break: break-all; |
26 | 26 | word-wrap: break-word; |
27 | 27 | box-shadow: 5px 5px 5px 3px rgba(0,0,0,0.2); |
28 | | - transform: translateX(-50%); |
| 28 | + transform: translate(-50%, -4px); |
29 | 29 | } |
30 | 30 | .bubble-box::after{ |
31 | 31 | content: ''; |
|
112 | 112 |
|
113 | 113 | divInf = document.createElement("div"); |
114 | 114 | divInf.className = 'bubble-box'; |
115 | | - const divInfVerticalOffset = 4; //px |
116 | 115 | const bodyStyle = getComputedStyle(document.body); |
117 | 116 | if (bodyStyle.position === "static") { |
118 | 117 | Object.assign(divInf.style, { |
119 | 118 | left: `${(convertedP1.x + convertedP2.x) / 2}px`, |
120 | | - bottom: `${document.documentElement.clientHeight - convertedP1.y + divInfVerticalOffset}px`, |
| 119 | + bottom: `${document.documentElement.clientHeight - convertedP1.y}px`, |
121 | 120 | }); |
122 | 121 | } else { // if you set body `position` as `relative`, `absolute`, things can get complicated |
123 | 122 | const bodyRect = document.body.getBoundingClientRect(); |
124 | 123 | const bodyBorderLeft = parseFloat(bodyStyle.borderLeftWidth); |
125 | 124 | const bodyBorderBottom = parseFloat(bodyStyle.borderBottomWidth); |
126 | 125 | Object.assign(divInf.style, { |
127 | 126 | left: `${(convertedP1.x + convertedP2.x) / 2 - bodyRect.left - bodyBorderLeft}px`, |
128 | | - bottom: `${bodyRect.bottom - convertedP1.y - bodyBorderBottom + divInfVerticalOffset}px`, |
| 127 | + bottom: `${bodyRect.bottom - convertedP1.y - bodyBorderBottom}px`, |
129 | 128 | }); |
130 | 129 | } |
131 | 130 | divInf.innerText = result.barcodeText; |
|
0 commit comments