Skip to content

Commit

Permalink
1.0.1Release
Browse files Browse the repository at this point in the history
  • Loading branch information
htvoffcial authored Sep 8, 2024
1 parent ddc5397 commit 8161c08
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
タグを貼ればbody内を読み上げてくれます!
![image](https://github.com/user-attachments/assets/461331d5-498c-4454-8d91-8664b0de7ffc)
動作イメージ
```
<script src="siteembeddreader.min.js"></script>
```
```
<div class="rb-1"></div>
```
を任意の場所に設置するだけです。
※divはどのブロック要素でも問題ありません。
19 changes: 19 additions & 0 deletions raw/script/siteembeddreader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
document.getElementById("pbtn").innerText = "▼";

function ltts() {
if (document.getElementById("pbtn").className.indexOf("r-now") !== -1) {
document.getElementById("pbtn").classList.remove('r-now');
document.getElementById("pbtn").classList.add('r-pause');
document.getElementById("pbtn").innerText = "▼";
speechSynthesis.cancel();
} else {
document.getElementById("pbtn").classList.remove('r-pause');
document.getElementById("pbtn").classList.add("r-now");
document.getElementById("pbtn").innerText = "=";
var icontent = document.body.innerText;
voices = speechSynthesis.getVoices();
const uttr = new SpeechSynthesisUtterance(icontent);
uttr.voice = voices[182];
speechSynthesis.speak(uttr);
}
}
32 changes: 32 additions & 0 deletions raw/styles/siteembeddreaderstyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.rb-1 {
cursor:pointer;
display: inline-flex;
padding: 0px;
border-radius: 20px;
background: linear-gradient(90deg, rgba(120, 119, 131, 1) 0%, rgba(173, 173, 173, 1) 35%, rgba(131, 194, 195, 1) 73%, rgba(81, 196, 219, 1) 100%);
object-fit: contain;
background-size: contain;
color: #fff;
align-items: center;
}

.l-box-2::before {
content: " ";
height: 100%;
border-left: solid 1px #fefefe;
margin-right: 10px;
}

.l-box-2 {
margin: 10px;
}

.r-box-2 {
margin-left: 15px;
cursor: pointer;
user-select: none;
}

.pbtn-p {
transform: rotate(-90deg);
}
Empty file added sample/index.html
Empty file.
1 change: 1 addition & 0 deletions siteembeddreader/1.0.1/siteembeddreader.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8161c08

Please sign in to comment.