Skip to content

Commit 74a370e

Browse files
committed
added tooltop to captcha text, and changed tooltop location from right to bottom
1 parent 720d838 commit 74a370e

File tree

3 files changed

+47
-45
lines changed

3 files changed

+47
-45
lines changed

popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ function initPopup() {
922922
if (blockPatterns.some(pattern => pattern.test(domainSummaries[termType]))) {
923923
let warningDiv = document.createElement('div');
924924
let warning = document.createElement('p');
925-
warning.textContent = "Note: This summary may have failed due to the website's use of CAPTCHAs. We're working on a solution for this.";
925+
warning.innerHTML = `Note: This summary may have failed due to the website's use of CAPTCHAs. <span class="tooltip"><span id="captchaexplainer-${termType.toLowerCase().replace(/[^a-z0-9]/g, '-')}">We're working on a solution for this.</span><span class="tooltiptext">In the meantime, we'll manually summarise this policy. Check back tomorrow to see it.</span></span>`;
926926
warningDiv.className = "mb-4 -mt-2 p-4 bg-yellow-100 border-yellow-500";
927927
warning.className = "m-0";
928928
warningDiv.appendChild(warning);

production.css

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,31 +2640,32 @@ button:hover {
26402640
}
26412641

26422642
.tooltip .tooltiptext {
2643-
visibility: hidden;
2644-
width: 150px;
2645-
background-color: black;
2646-
opacity: 0.85;
2647-
color: white;
2648-
text-align: left;
2649-
border-radius: 6px;
2650-
padding: 5px 7px;
2651-
position: absolute;
2652-
z-index: 1;
2653-
top: -5px;
2654-
left: 120%;
2655-
border: 1px solid black;
2656-
font-family: Arial, Helvetica, sans-serif !important;
2643+
visibility: hidden;
2644+
width: 150px;
2645+
background-color: black;
2646+
opacity: 0.85;
2647+
color: white;
2648+
text-align: left;
2649+
border-radius: 6px;
2650+
padding: 5px 7px;
2651+
position: absolute;
2652+
z-index: 1;
2653+
top: 150%; /* tooltip appears below the text */
2654+
left: 50%; /* center the tooltip */
2655+
transform: translateX(-50%); /* ensure the tooltip is centered */
2656+
border: 1px solid black;
2657+
font-family: Arial, Helvetica, sans-serif !important;
26572658
}
26582659

26592660
.tooltip .tooltiptext::after {
2660-
content: "";
2661-
position: absolute;
2662-
top: 10%;
2663-
right: 100%;
2664-
margin-top: -5px;
2665-
border-width: 5px;
2666-
border-style: solid;
2667-
border-color: transparent black transparent transparent;
2661+
content: "";
2662+
position: absolute;
2663+
bottom: 100%; /* arrow is at the top of the tooltip box */
2664+
left: 50%; /* center the arrow */
2665+
transform: translateX(-50%); /* ensure the arrow is centered */
2666+
border-width: 5px;
2667+
border-style: solid;
2668+
border-color: transparent transparent black transparent;
26682669
}
26692670

26702671
.tooltip:hover .tooltiptext {

styles.css

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -167,31 +167,32 @@ button:hover {
167167
}
168168

169169
.tooltip .tooltiptext {
170-
visibility: hidden;
171-
width: 150px;
172-
background-color: black;
173-
opacity: 0.85;
174-
color: white;
175-
text-align: left;
176-
border-radius: 6px;
177-
padding: 5px 7px;
178-
position: absolute;
179-
z-index: 1;
180-
top: -5px;
181-
left: 120%;
182-
border: 1px solid black;
183-
font-family: Arial, Helvetica, sans-serif !important;
170+
visibility: hidden;
171+
width: 150px;
172+
background-color: black;
173+
opacity: 0.85;
174+
color: white;
175+
text-align: left;
176+
border-radius: 6px;
177+
padding: 5px 7px;
178+
position: absolute;
179+
z-index: 1;
180+
top: 150%; /* tooltip appears below the text */
181+
left: 50%; /* center the tooltip */
182+
transform: translateX(-50%); /* ensure the tooltip is centered */
183+
border: 1px solid black;
184+
font-family: Arial, Helvetica, sans-serif !important;
184185
}
185186

186187
.tooltip .tooltiptext::after {
187-
content: "";
188-
position: absolute;
189-
top: 10%;
190-
right: 100%;
191-
margin-top: -5px;
192-
border-width: 5px;
193-
border-style: solid;
194-
border-color: transparent black transparent transparent;
188+
content: "";
189+
position: absolute;
190+
bottom: 100%; /* arrow is at the top of the tooltip box */
191+
left: 50%; /* center the arrow */
192+
transform: translateX(-50%); /* ensure the arrow is centered */
193+
border-width: 5px;
194+
border-style: solid;
195+
border-color: transparent transparent black transparent;
195196
}
196197

197198
.tooltip:hover .tooltiptext {

0 commit comments

Comments
 (0)