Skip to content

Commit 0d7ad14

Browse files
Merge pull request #380 from efshaperveen/main
Added tooltips in the contact form
2 parents 2d3ec4b + c11c4fc commit 0d7ad14

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,19 @@
248248
<form name="Dataverse Reviews" method="POST" data-netlify="true" id="feedback-form"
249249
onsubmit="return validateForm()">
250250
<p style="color:white">Let Me Know Your Thoughts!</p>
251+
<div class="tooltip">
251252
<input type="text" name="Name" placeholder="Your Name" required>
253+
<span class="tooltiptext">Please enter your full name here.</span>
254+
</div>
255+
<div class="tooltip">
252256
<input type="email" name="Email" placeholder="Your Email ID" required>
257+
<span class="tooltiptext">Please enter a valid email like [email protected].</span>
258+
</div>
259+
<div class="tooltip">
253260
<textarea name="Message" placeholder="Your thoughts on Dataverse" rows="4" required
254261
oninput="checkFeedbackLength(this)"></textarea>
262+
<span class="tooltiptext">Feel free to describe your thoughts in detail.</span>
263+
</div>
255264
<p id="feedbackError"
256265
style="color:#fd4346; opacity: 0%; font-size: 15px; white-space: normal; transition: opacity 0.4s ease ">
257266
Feedback must be at least 10 characters long.</p>

website/styles/style.css

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ form {
10191019
input {
10201020
background-color: #76767639;
10211021
width: 85%;
1022-
height: 30px;
1022+
height: 35px;
10231023
margin-top: 20px;
10241024
border-radius: 5px;
10251025
padding: 5px 10px;
@@ -1047,6 +1047,38 @@ input {
10471047
box-shadow: 0px 0px 10px cyan;
10481048
}
10491049

1050+
.tooltip {
1051+
display: flex;
1052+
align-items: center;
1053+
position: relative;
1054+
}
1055+
1056+
/* Tooltip text */
1057+
.tooltip .tooltiptext {
1058+
visibility: hidden;
1059+
width: 150px;
1060+
background-color: rgba(255, 255, 255, 0.873);
1061+
color: black;
1062+
text-align: center;
1063+
border-radius: 5px;
1064+
padding: 5px;
1065+
position: absolute;
1066+
left: 70%;
1067+
margin-left: -100px;
1068+
top: 48%;
1069+
transform: translateY(-50%);
1070+
opacity: 0;
1071+
transition: opacity 0.3s;
1072+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
1073+
font-size: 11px;
1074+
}
1075+
1076+
/* Show the tooltip on hover */
1077+
.tooltip:hover .tooltiptext {
1078+
visibility: visible;
1079+
opacity: 1;
1080+
}
1081+
10501082
.contact {
10511083
width: 40vw;
10521084
}

0 commit comments

Comments
 (0)