@@ -283,6 +286,7 @@
}
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) {
@@ -315,6 +319,9 @@
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}`)}`;
})();