Skip to content

Commit

Permalink
"クリッ"クして"クリッ"プボードにコピー!
Browse files Browse the repository at this point in the history
  • Loading branch information
Ry0taK committed Oct 27, 2024
1 parent 0cef801 commit c81c47d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion root/details/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@

.share_button {
position: relative;
margin-top: 5px;
margin: 5px;
float: right;
text-decoration: none;
}
Expand Down Expand Up @@ -173,6 +173,9 @@ <h2 id=cre_id>Common RyotaK Scoring System Calculator</h2>
</g>
</svg>
</a>
<a id="share_clipboard" class=share_button href="#">
<svg width="25px" height="25px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M280 64l40 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l40 0 9.6 0C121 27.5 153.3 0 192 0s71 27.5 78.4 64l9.6 0zM64 112c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16l-16 0 0 24c0 13.3-10.7 24-24 24l-88 0-88 0c-13.3 0-24-10.7-24-24l0-24-16 0zm128-8a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"/></svg>
</a>
<div class=infos>
<div class=info>
<label>CRSSスコア:</label>
Expand Down Expand Up @@ -283,6 +286,7 @@ <h1><a href=/>OWSC</a></h1>
}
document.getElementById('cre_id').textContent = id;
document.getElementById('cre_id').appendChild(document.getElementById('share_twitter'));
document.getElementById('cre_id').appendChild(document.getElementById('share_clipboard'));
document.title = `CRSS Calculator - ${id}`;
const resp = await fetch(`https://raw.githubusercontent.com/gnknzm/crss.gnknzm.net/database/${encodeURIComponent(id)}.json?${Math.random()}`);
if (resp.status !== 200) {
Expand Down Expand Up @@ -315,6 +319,9 @@ <h1><a href=/>OWSC</a></h1>
severityElement.textContent = format(overall_score) + ' ' + severity.label;
severityElement.className = severity.class;

document.getElementById('share_clipboard').addEventListener('click', () => {
navigator.clipboard.writeText(`${data.author}${data.text}${format(overall_score) + ' ' + severity.label} \nhttps://crss.gnknzm.net/details/?id=${id}`);
});
document.getElementById('share_twitter').href = `https://x.com/intent/tweet?text=${encodeURIComponent(`${data.author}${data.text}${format(overall_score) + ' ' + severity.label} \n#CRSS\nhttps://crss.gnknzm.net/details/?id=${id}`)}`;
})();
</script>
Expand Down

0 comments on commit c81c47d

Please sign in to comment.