Skip to content

Commit

Permalink
今日、共有した?
Browse files Browse the repository at this point in the history
  • Loading branch information
Ry0taK committed Oct 5, 2024
1 parent 780ec44 commit d83d6ad
Showing 1 changed file with 28 additions and 21 deletions.
49 changes: 28 additions & 21 deletions root/details/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@
h1 > a {
text-decoration-line: inherit;
}

.share_button {
position: relative;
margin-top: 5px;
float: right;
text-decoration: none;
}
</style>
</head>

Expand All @@ -126,26 +133,7 @@ <h1><a href=/>NATIONAL OYAJIGYAGU DATABASE</a></h1>
<main>
<div class=container>
<h2 id=cre_id>Common RyotaK Scoring System Calculator</h2>
<div class=infos>
<div class=info>
<label>CRSSスコア:</label>
<div><label id=severity>読込中...</label></div>
</div>
<div class=info>
<label>発言者:</label>
<div><label id=author>読込中...</label></div>
</div>
<div class=info>
<label>該当テキスト:</label>
<div><label id=text>読込中...</label></div>
</div>
<div class=info>
<label>Vector String:</label>
<div><label id=vector_string>読込中...</label></div>
</div>
</div>

<a id=share target=_blank>
<a id=share_twitter class=share_button target=_blank style="text-decoration: none; float:right; margin-top: 5px; position: relative;">
<svg width="25px" height="25px" viewBox="0 0 67.228993 67.228996" version="1.1" id="svg1"
xml:space="preserve" inkscape:export-filename="SDGstwitter.png" inkscape:export-xdpi="240"
inkscape:export-ydpi="240" inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
Expand Down Expand Up @@ -185,6 +173,24 @@ <h2 id=cre_id>Common RyotaK Scoring System Calculator</h2>
</g>
</svg>
</a>
<div class=infos>
<div class=info>
<label>CRSSスコア:</label>
<div><label id=severity>読込中...</label></div>
</div>
<div class=info>
<label>発言者:</label>
<div><label id=author>読込中...</label></div>
</div>
<div class=info>
<label>該当テキスト:</label>
<div><label id=text>読込中...</label></div>
</div>
<div class=info>
<label>Vector String:</label>
<div><label id=vector_string>読込中...</label></div>
</div>
</div>
</div>
</main>
<footer class=owsc>
Expand Down Expand Up @@ -276,6 +282,7 @@ <h1><a href=/>OWSC</a></h1>
return;
}
document.getElementById('cre_id').textContent = id;
document.getElementById('cre_id').appendChild(document.getElementById('share_twitter'));
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 @@ -308,7 +315,7 @@ <h1><a href=/>OWSC</a></h1>
severityElement.textContent = format(overall_score) + ' ' + severity.label;
severityElement.className = severity.class;

document.getElementById('share').href = `https://x.com/intent/tweet?text=${encodeURIComponent(`${data.author}${data.text}(${format(overall_score)})\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} \nhttps://crss.gnknzm.net/details/?id=${id}`)}`;
})();
</script>
</body>
Expand Down

0 comments on commit d83d6ad

Please sign in to comment.