Skip to content

Commit b78e303

Browse files
authored
update styling
1 parent 632dadb commit b78e303

File tree

2 files changed

+71
-19
lines changed

2 files changed

+71
-19
lines changed

newaccount.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
document.addEventListener("DOMContentLoaded", function () {
2+
const clinicLocationLabel = document.querySelector(
3+
"label[for='ctl01_TemplateBody_WebPartManager1_gwpciCreateNewAccountForm_ciCreateNewAccountForm_FB_DropDown_CsContact_Chapter']"
4+
);
5+
6+
if (clinicLocationLabel) {
7+
// If using jQuery UI for tooltips, set the title attribute
8+
clinicLocationLabel.setAttribute(
9+
"title",
10+
"Select the county of your primary clinic, residency/fellowship, or study."
11+
);
12+
clinicLocationLabel.style.cursor = "help"; // Change cursor to indicate tooltip
13+
14+
if (clinicLocationLabel) {
15+
// Add CSS classes for dotted underline and tooltip styling
16+
clinicLocationLabel.classList.add("tooltip-container");
17+
}
18+
19+
// If jQuery is available, initialize the tooltip
20+
if (window.jQuery) {
21+
$(clinicLocationLabel).tooltip({
22+
position: { my: "left+15 center", at: "right center" },
23+
tooltipClass: "custom-tooltip",
24+
});
25+
} else {
26+
// If jQuery UI is not available, add a custom tooltip element
27+
clinicLocationLabel.classList.add("tooltip-container");
28+
clinicLocationLabel.insertAdjacentHTML(
29+
"beforeend",
30+
"<span class='tooltiptext'>List the county of your primary clinic, residency/fellowship, or study.</span>"
31+
);
32+
}
33+
}
34+
});

newaccountstyles.css

+37-19
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ select {
4545
padding : 12px;
4646
font-size : 1em;
4747
border : 1px solid #ddd;
48-
border-radius : 5px;
48+
border-radius : 12px;
4949
background-color: #f8f8f8;
5050
transition : border-color 0.3s, box-shadow 0.3s;
5151
}
@@ -56,39 +56,57 @@ select:focus {
5656
box-shadow : 0 0 5px rgba(0, 138, 173, 0.4);
5757
}
5858

59-
/* Dotted Underline for Labels with Tooltips */
59+
/* Dotted underline and icon indicator */
6060
.tooltip-container {
6161
position : relative;
6262
display : inline-flex;
6363
align-items : center;
6464
border-bottom : 1px dotted #008aad;
65-
/* Dotted underline */
6665
padding-bottom: 2px;
67-
/* Adjust underline positioning */
6866
cursor : help;
6967
color : #333;
7068
transition : border-color 0.3s;
7169
}
7270

73-
/* Tooltip Icon Styling */
74-
.tooltip-icon {
75-
font-size : 0.9em;
76-
color : #008aad;
77-
/* Icon color to match the dotted underline */
78-
margin-left: 5px;
79-
/* Spacing between text and icon */
80-
cursor : pointer;
81-
transition : color 0.3s;
71+
/* Custom tooltip styling */
72+
.tooltip-container .tooltiptext {
73+
visibility : hidden;
74+
width : 240px;
75+
background-color: rgba(51, 51, 51, 0.95);
76+
color : #fff;
77+
text-align : left;
78+
border-radius : 8px;
79+
padding : 10px;
80+
position : absolute;
81+
z-index : 10;
82+
bottom : 150%;
83+
/* Positions tooltip above the label */
84+
left : 50%;
85+
margin-left : -120px;
86+
opacity : 0;
87+
transform : scale(0.95);
88+
box-shadow : 0px 8px 16px rgba(0, 0, 0, 0.3);
89+
font-size : 0.95em;
90+
transition : opacity 0.3s, transform 0.3s;
8291
}
8392

84-
.tooltip-container:hover {
85-
border-bottom-color: #005f6b;
86-
/* Darker color on hover */
93+
/* Tooltip visibility on hover */
94+
.tooltip-container:hover .tooltiptext {
95+
visibility: visible;
96+
opacity : 1;
97+
transform : scale(1);
8798
}
8899

89-
.tooltip-container:hover .tooltip-icon {
90-
color: #005f6b;
91-
/* Darken icon color on hover */
100+
.tooltiptext::after {
101+
content : "";
102+
position : absolute;
103+
top : 100%;
104+
/* Positions arrow at the bottom of the tooltip */
105+
left : 50%;
106+
margin-left : -5px;
107+
border-width: 5px;
108+
border-style: solid;
109+
border-color: rgba(51, 51, 51, 0.95) transparent transparent transparent;
92110
}
93111

94112
/* Modern Tooltip Styling */

0 commit comments

Comments
 (0)