├── CNAME ├── server.sh ├── .gitignore ├── css ├── kor.css ├── global.css └── common.css ├── BaiduPlay.apkg ├── img ├── button │ ├── de.png │ ├── en.png │ ├── jp.png │ ├── pt.png │ ├── ru.png │ ├── th.png │ ├── ara.png │ ├── cte.png │ ├── fra.png │ ├── kor.png │ ├── spa.png │ └── template.psd ├── transition.gif ├── transition.jpg └── transition.psd ├── docs ├── img │ ├── jp-en.png │ ├── 20170115144808.png │ ├── 20170115144853.png │ ├── 20170115145007.png │ ├── 20170115145049.png │ ├── 20170115145105.png │ ├── 20170115145130.png │ ├── 20170115152035.png │ ├── 20170115153547.png │ ├── 20170115153735.png │ └── 20170115153809.png └── 百度翻译语音接口.txt ├── js ├── playAudio.js ├── onload.js ├── controller.js ├── config.js └── main.js ├── LICENSE ├── README.md └── demo ├── de.html ├── en.html ├── jp.html ├── pt.html ├── ru.html ├── th.html ├── ara.html ├── cte.html ├── fra.html ├── kor.html └── spa.html /CNAME: -------------------------------------------------------------------------------- 1 | anki-theme-baiduplay.nocode.site -------------------------------------------------------------------------------- /server.sh: -------------------------------------------------------------------------------- 1 | python -m SimpleHTTPServer 666 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.tmp 2 | *.code-workspace 3 | .DS_Store -------------------------------------------------------------------------------- /css/kor.css: -------------------------------------------------------------------------------- 1 | .card{ 2 | font-family:Malgun Gothic; 3 | } -------------------------------------------------------------------------------- /BaiduPlay.apkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/BaiduPlay.apkg -------------------------------------------------------------------------------- /img/button/de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/de.png -------------------------------------------------------------------------------- /img/button/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/en.png -------------------------------------------------------------------------------- /img/button/jp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/jp.png -------------------------------------------------------------------------------- /img/button/pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/pt.png -------------------------------------------------------------------------------- /img/button/ru.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/ru.png -------------------------------------------------------------------------------- /img/button/th.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/th.png -------------------------------------------------------------------------------- /docs/img/jp-en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/jp-en.png -------------------------------------------------------------------------------- /img/button/ara.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/ara.png -------------------------------------------------------------------------------- /img/button/cte.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/cte.png -------------------------------------------------------------------------------- /img/button/fra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/fra.png -------------------------------------------------------------------------------- /img/button/kor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/kor.png -------------------------------------------------------------------------------- /img/button/spa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/spa.png -------------------------------------------------------------------------------- /img/transition.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/transition.gif -------------------------------------------------------------------------------- /img/transition.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/transition.jpg -------------------------------------------------------------------------------- /img/transition.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/transition.psd -------------------------------------------------------------------------------- /img/button/template.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/img/button/template.psd -------------------------------------------------------------------------------- /docs/img/20170115144808.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115144808.png -------------------------------------------------------------------------------- /docs/img/20170115144853.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115144853.png -------------------------------------------------------------------------------- /docs/img/20170115145007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115145007.png -------------------------------------------------------------------------------- /docs/img/20170115145049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115145049.png -------------------------------------------------------------------------------- /docs/img/20170115145105.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115145105.png -------------------------------------------------------------------------------- /docs/img/20170115145130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115145130.png -------------------------------------------------------------------------------- /docs/img/20170115152035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115152035.png -------------------------------------------------------------------------------- /docs/img/20170115153547.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115153547.png -------------------------------------------------------------------------------- /docs/img/20170115153735.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115153735.png -------------------------------------------------------------------------------- /docs/img/20170115153809.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ecator/anki-theme-baiduplay/HEAD/docs/img/20170115153809.png -------------------------------------------------------------------------------- /js/playAudio.js: -------------------------------------------------------------------------------- 1 | //播放音频函数,需要传入音频地址 2 | function playAudio(audioSrc) { 3 | // alert(audioSrc) 4 | //尝试获取语速 5 | var spd = document.getElementById('spd') 6 | // console.log(spd) 7 | spd = spd ? spd.value : '3' 8 | audioSrc += "&spd=" + spd 9 | var player = new Audio(audioSrc) 10 | player.play() 11 | } -------------------------------------------------------------------------------- /css/global.css: -------------------------------------------------------------------------------- 1 | h1{ 2 | text-align: center; 3 | } 4 | .container{ 5 | border:0px solid blue; 6 | width: 80%; 7 | height: 500px; 8 | margin: 5px auto; 9 | } 10 | .content{ 11 | border:0px solid red; 12 | width: 90%; 13 | height: 400px; 14 | margin: 5px auto; 15 | overflow: auto; 16 | } 17 | .controller{ 18 | border:0px solid gray; 19 | width: 90%; 20 | height: 30px; 21 | margin: 5px auto; 22 | text-align: center; 23 | } 24 | .controller button{ 25 | cursor: pointer; 26 | } -------------------------------------------------------------------------------- /js/onload.js: -------------------------------------------------------------------------------- 1 | //页面加载完毕后加载本文件 2 | showFront() 3 | //自动填充标题和h1为模板名称 4 | var titleMap={ 5 | "en":"BaiduPlay-en:英语", 6 | "jp":"BaiduPlay-jp:日语", 7 | "fra":"BaiduPlay-fra:法语", 8 | "kor":"BaiduPlay-kor:韩语", 9 | "de":"BaiduPlay-de:德语", 10 | "spa":"BaiduPlay-spa:西班牙语", 11 | "ara":"BaiduPlay-ara:阿拉伯语", 12 | "ru":"BaiduPlay-ru:俄语", 13 | "pt":"BaiduPlay-pt:葡萄牙语", 14 | "th":"BaiduPlay-th:泰语", 15 | "cte":"BaiduPlay-cte:粤语" 16 | } 17 | document.title=titleMap[language] 18 | document.getElementsByTagName("h1")[0].innerText=document.title -------------------------------------------------------------------------------- /js/controller.js: -------------------------------------------------------------------------------- 1 | //显示卡片背面 2 | function showAns() { 3 | var content=document.getElementById("content") 4 | var controller=document.getElementById("controller") 5 | var tmp=config.tpl.back.replace(/{{word}}/g,words[wordIndex]) 6 | tmp=tmp.replace(/{{phonetic}}/g,phonetics[wordIndex]) 7 | content.innerHTML=tmp.replace(/{{trans}}/g,trans[wordIndex]) 8 | controller.innerHTML=" " 9 | requestjs("../js/main.js") 10 | } 11 | //显示卡片正面 12 | function showFront(){ 13 | var content=document.getElementById("content") 14 | var controller=document.getElementById("controller") 15 | content.innerHTML=config.tpl.front.replace(/{{word}}/g,words[wordIndex]) 16 | controller.innerHTML="" 17 | requestjs("../js/main.js") 18 | } 19 | //显示下一个单词,数组循环 20 | function showNext(){ 21 | wordIndex=wordIndex==words.length-1?0:wordIndex+1 22 | showFront() 23 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Martin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/百度翻译语音接口.txt: -------------------------------------------------------------------------------- 1 | 百度翻译语音接口 2 | 3 | 请求参数text=你好 4 | 5 | 阿拉伯语 6 | http://fanyi.baidu.com/gettts?lan=ara&text=%D9%85%D8%B1%D8%AD%D8%A8%D8%A7&spd=3&source=web 7 | 8 | 德语 9 | http://fanyi.baidu.com/gettts?lan=de&text=Hallo&spd=3&source=web 10 | 11 | 俄语 12 | http://fanyi.baidu.com/gettts?lan=ru&text=%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82&spd=3&source=web 13 | 14 | 法语 15 | http://fanyi.baidu.com/gettts?lan=fra&text=Bonjour&spd=3&source=web 16 | 17 | 韩语 18 | http://fanyi.baidu.com/gettts?lan=kor&text=%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%94.&spd=3&source=web 19 | 20 | 葡萄牙语 21 | http://fanyi.baidu.com/gettts?lan=pt&text=Ol%C3%A1&spd=3&source=web 22 | 23 | 日语 24 | http://fanyi.baidu.com/gettts?lan=jp&text=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF&spd=3&source=web 25 | 26 | 泰语 27 | http://fanyi.baidu.com/gettts?lan=th&text=%E0%B8%AA%E0%B8%A7%E0%B8%B1%E0%B8%AA%E0%B8%94%E0%B8%B5&spd=3&source=web 28 | 29 | 西班牙语 30 | http://fanyi.baidu.com/gettts?lan=spa&text=%C2%A1Hola!&spd=3&source=web 31 | 32 | 英语 33 | http://fanyi.baidu.com/gettts?lan=en&text=Hello%2C&spd=3&source=web 34 | 35 | 粤语 36 | http://fanyi.baidu.com/gettts?lan=cte&text=%E4%BD%A0%E5%A5%BD&spd=3&source=web -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BaiduPlay 2 | 3 | Anki百度风格在线发音模板,支持11种语言。 4 | 5 | > 本模板采用引入资源的写法,全程依赖网络,所有资源文件均托管在本仓库。 6 | 7 | [详细说明传送门](https://zhuanlan.zhihu.com/p/24888978) 8 | 9 | # 模板在线预览 10 | 11 | - [BaiduPlay-en:英语](https://ecator.github.io/anki-theme-baiduplay/demo/en.html) 12 | - [BaiduPlay-jp:日语](https://ecator.github.io/anki-theme-baiduplay/demo/jp.html) 13 | - [BaiduPlay-fra:法语](https://ecator.github.io/anki-theme-baiduplay/demo/fra.html) 14 | - [BaiduPlay-kor:韩语](https://ecator.github.io/anki-theme-baiduplay/demo/kor.html) 15 | - [BaiduPlay-de:德语](https://ecator.github.io/anki-theme-baiduplay/demo/de.html) 16 | - [BaiduPlay-spa:西班牙语](https://ecator.github.io/anki-theme-baiduplay/demo/spa.html) 17 | - [BaiduPlay-ara:阿拉伯语](https://ecator.github.io/anki-theme-baiduplay/demo/ara.html) 18 | - [BaiduPlay-ru:俄语](https://ecator.github.io/anki-theme-baiduplay/demo/ru.html) 19 | - [BaiduPlay-pt:葡萄牙语](https://ecator.github.io/anki-theme-baiduplay/demo/pt.html) 20 | - [BaiduPlay-th:泰语](https://ecator.github.io/anki-theme-baiduplay/demo/th.html) 21 | - [BaiduPlay-cte:粤语](https://ecator.github.io/anki-theme-baiduplay/demo/cte.html) 22 | 23 | # 本地调试 24 | 25 | 在本地运行`./server.sh`后可以在当前目录创建一个监听666端口的服务器 26 | 27 | > 需要安装Python 28 | -------------------------------------------------------------------------------- /demo/de.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |