Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve appearance of click-to-copy confirmation message #579

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,33 @@ th {
font-weight: bold;
font-size: 1.1em;
margin: 0.5em 0;
position: relative;
}
.big-text #mainResult:hover { /* indicates the presence of click-to-copy function */
cursor: pointer;
opacity: 0.7;
}
#tooltipText {
position: absolute;
left: 42%;
top: -170%;
font-size: 0.8em;
visibility: hidden;
border-radius: 5px;
width: 120px;
background-color: black;
background-color: rgba(0, 0, 0, 0.7);
color: white;
text-align: center;
padding: 5px;
margin-left: 10px;
font-weight: normal;
}
#tooltipText::after
{
thejetou marked this conversation as resolved.
Show resolved Hide resolved
position: absolute;
left: 45%;
top: 100%;
content: '';
border: 6px solid transparent;
border-top-color: rgba(0, 0, 0, 0.7);
}
.small-text {
font-size: 0.8em;
Expand Down
6 changes: 3 additions & 3 deletions src/index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@
</div>
</div>
<div aria-label="Calculation results" class="main-result-group" role="region">
<div class="big-text" title="Click to copy.">
<span id="mainResult">Loading...</span>
<span id="tooltipText">Copied</span>
<div class="big-text">
<span id="mainResult" title="Click to copy.">Loading...</span>
<div id="tooltipText">Copied</div>
</div>
<div class="small-text"><span id="damageValues">(If you see this message for more than a few seconds, try enabling JavaScript.)</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/js/index_randoms_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,6 @@ $("#mainResult").click(function () {
document.getElementById('tooltipText').style.visibility = 'visible';
setTimeout(function () {
document.getElementById('tooltipText').style.visibility = 'hidden';
}, 2000);
}, 1500);
});
});
2 changes: 1 addition & 1 deletion src/js/shared_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,6 @@ $("#mainResult").click(function () {
document.getElementById('tooltipText').style.visibility = 'visible';
setTimeout(function () {
document.getElementById('tooltipText').style.visibility = 'hidden';
}, 2000);
}, 1500);
});
});
6 changes: 3 additions & 3 deletions src/randoms.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@
</div>
</div>
<div aria-label="Calculation results" class="main-result-group" role="region">
<div class="big-text" title="Click to copy.">
<span id="mainResult">Loading...</span>
<span id="tooltipText">Copied</span>
<div class="big-text">
<span id="mainResult" title="Click to copy.">Loading...</span>
<div id="tooltipText">Copied</div>
</div>
<div class="small-text"><span id="damageValues">(If you see this message for more than a few seconds, try enabling JavaScript.)</span>
</div>
Expand Down