vtubers.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. const data = [
  2. {
  3. "id": "0",
  4. "name": "凡笙弦語",
  5. "intro": "台灣新人Vtuber鹹魚翻身後依然是條鹹魚以歌唱與歌曲創作為主!",
  6. "img": "https://i.imgur.com/1Oahh38.jpg",
  7. "images": ["https://i.imgur.com/1Oahh38.jpg"],
  8. "style": ["可愛"],
  9. "tags": ["#FS鹹魚", "#魚塭", "#TWVtuber", "#台灣", "#台湾", "#VirtualYouTuber", "#虛擬YouTuber", "#Vtuber"],
  10. "contact": "",
  11. "demand": ["角色曝光", "聲優配音", "承接業配"],
  12. "follow": [
  13. {
  14. "channel": "facebook",
  15. "link": 'https://www.facebook.com/F.S.XianYu/',
  16. "img": "https://i.imgur.com/HtfL33q.png"
  17. },
  18. {
  19. "channel": "Youtube",
  20. "link": "https://www.youtube.com/watch?v=AcE1edvJ9g0",
  21. "img": "https://i.imgur.com/c4VdjRJ.png"
  22. },
  23. {
  24. "channel": "twitter",
  25. "link": 'https://twitter.com/FS_xianyu',
  26. "img": "https://i.imgur.com/4VKBo9w.png"
  27. },
  28. {
  29. "channel": "website",
  30. "link": "https://marshmallow-qa.com/fs_xianyu",
  31. "img": "https://i.imgur.com/8nmvSdj.png"
  32. },
  33. {
  34. "channel": "twitch",
  35. "link": 'https://www.facebook.com/groups/590614894737063/?hoisted_section_header_type=recently_seen&multi_permalinks=1253077595157453',
  36. "img": "https://i.imgur.com/FjIaiz9.png"
  37. },
  38. ],
  39. "mp4": null
  40. },
  41. {
  42. "id": "1",
  43. "name": "小烏龜-Yui",
  44. "intro": "日常♡搞怪♡美食小烏龜 姓名:Yu i 生日:2020/08/07 個性:愛玩、愛吃、愛搞怪 擅長:搗亂、畫圖 品種:烤饅頭 龜稀有值:100%",
  45. "img": "https://i.imgur.com/iHtiCpP.jpg",
  46. "images": ["https://i.imgur.com/iHtiCpP.jpg"],
  47. "style": ["可愛"],
  48. "tags": ["#小烏龜yui"],
  49. "contact": "",
  50. "demand": ["角色曝光", "聲優配音", "承接業配"],
  51. "follow": [
  52. {
  53. "channel": "facebook",
  54. "link": 'https://www.facebook.com/littleturtleyui/',
  55. "img": "https://i.imgur.com/HtfL33q.png"
  56. },
  57. ],
  58. "mp4": null
  59. },
  60. {
  61. "id": "2",
  62. "name": "柚餓幽窮",
  63. "intro": "哈囉大家好!我們是魔法少女⭐幽可⭐&狗狗🎀柚子🎀影片以遊戲、聊天、直播精華、連動…等為主每週二 四晚上六點出片❤假日直播 偶爾有突發⚠️_歡迎私訊合作邀約(˶‾᷄ ⁻̫ ‾᷅˵)希望能和大家一起玩💕_",
  64. "img": "https://i.imgur.com/g00i7Ji.jpg",
  65. "images": ["https://i.imgur.com/NKxoaoi.png", "https://i.imgur.com/pR2IjVn.png"],
  66. "style": ["奶兇"],
  67. "tags": [],
  68. "contact": "",
  69. "demand": ["角色曝光", "聲優配音", "承接業配"],
  70. "follow": [
  71. {
  72. "channel": "facebook",
  73. "link": 'https://www.facebook.com/profile.php?id=100070148449631',
  74. "img": "https://i.imgur.com/HtfL33q.png"
  75. },
  76. {
  77. "channel": "youtube",
  78. "link": 'https://www.youtube.com/channel/UC9ymconZOuIj-cuWpEUyjUg',
  79. "img": "https://i.imgur.com/c4VdjRJ.png"
  80. },
  81. {
  82. "channel": "website",
  83. "link": 'https://discord.gg/4RRQHYfXww',
  84. "img": "https://i.imgur.com/Vbjnelb.png"
  85. },
  86. ],
  87. "mp4": null
  88. },
  89. {
  90. "id": "3",
  91. "name": "花御いしき",
  92. "intro": "吾是住在台灣的花神,如果名子不好記可以叫我花花就好! 願望是看見你們如花朵般燦爛的微笑,私は台湾に住む花の神様です。名前がわかりにくい場合は、華華と呼んでください!,願いが花のように明るくて、あなたの笑顔を作ることです!",
  93. "img": "https://i.imgur.com/e0Nl0FW.png",
  94. "images": ["https://i.imgur.com/e0Nl0FW.png"],
  95. "style": ["溫柔可愛", "人格分裂", "配音系"],
  96. "tags": ["#擴散希望", "#男vtuber", " #虛擬youtuber", "#新人VTuber"],
  97. "contact": "",
  98. "demand": ["角色曝光", "聲優配音", "承接業配"],
  99. "follow": [
  100. {
  101. "channel": "facebook",
  102. "link": 'https://www.facebook.com/groups/590614894737063/?hoisted_section_header_type=recently_seen&multi_permalinks=1253077595157453',
  103. "img": "https://i.imgur.com/HtfL33q.png"
  104. },
  105. {
  106. "channel": "Youtube",
  107. "link": 'https://www.youtube.com/channel/UCtjosoymWqb5YtyL5BIqRlg',
  108. "img": "https://i.imgur.com/c4VdjRJ.png"
  109. },
  110. {
  111. "channel": "twitter",
  112. "link": 'https://twitter.com/hanaoishiki',
  113. "img": "https://i.imgur.com/4VKBo9w.png"
  114. },
  115. {
  116. "channel": "website",
  117. "link": 'https://marshmallow-qa.com/hanaoishiki',
  118. "img": "https://i.imgur.com/8nmvSdj.png"
  119. },
  120. {
  121. "channel": "discord",
  122. "link": 'https://discord.gg/Ey3rNJ75UZ',
  123. "img": "https://i.imgur.com/Vbjnelb.png"
  124. }
  125. ],
  126. "mp4": "https://www.mboxdrive.com/%E8%81%B2%E9%9F%B3%E7%9B%92%E5%AD%901%20-%20ishiki%20hanao.mp4"
  127. },
  128. {
  129. "id": "4",
  130. "name": "Ikusen(小千)",
  131. "intro": "我是來自台灣的Vtuber(台V),Ikusen(小千)!💕 最喜歡跟【MOMOMO團】的夥伴一起直播了!🐑",
  132. "img": "https://i.imgur.com/GXHDTcd.png",
  133. "images": ["https://i.imgur.com/GXHDTcd.png"],
  134. "style": ["御姊"],
  135. "tags": ["#台灣Vtuber", "#いくせん", "#VTuber ", "#TWvtuber", "#Ikusen", "#小千", "#虛擬Youtuber"],
  136. "contact": "",
  137. "demand": ["角色曝光", "聲優配音", "承接業配"],
  138. "follow": [
  139. {
  140. "channel": "facebook",
  141. "link": 'https://www.facebook.com/ikusen.vtube…',
  142. "img": "https://i.imgur.com/HtfL33q.png"
  143. },
  144. {
  145. "channel": "Youtube",
  146. "link": 'https://www.youtube.com/channel/UCKazkVudNQs8ZhwfXj_RNPw',
  147. "img": "https://i.imgur.com/c4VdjRJ.png"
  148. },
  149. {
  150. "channel": "twitter",
  151. "link": 'https://twitter.com/Ikusen_',
  152. "img": "https://i.imgur.com/4VKBo9w.png"
  153. },
  154. ],
  155. "mp4": null
  156. },
  157. {
  158. "id": "5",
  159. "name": "迷途小喵",
  160. "intro": "原本在月球上生活得好好的,結果因為‘假面騎士孝子砸月’行為被甩飛到了地球(台灣),之後發現地球上的高等生物是人類不是兔子,並且學習融入人類的社會中,途中喜歡上了繪師們,所以決定成立漢化組,來無償協助繪師們,夢想是成為繪師們的小天使,但也許是因為漢化過於疲勞,不幸追撞了黑色的高級車。對為了保護組員而擔下全部責任的組長,車主——暴力團員谷岡所提出的和解條件是…成為VTB",
  161. "img": "https://i.imgur.com/YnSPyv7.jpg",
  162. "images": ["https://i.imgur.com/YnSPyv7.jpg"],
  163. "style": ["御姊", "多聲線"],
  164. "tags": ["#台V", "#いくせん", "#VTuber ", "#TWvtuber"],
  165. "contact": "",
  166. "demand": ["角色曝光", "聲優配音", "承接業配"],
  167. "follow": [
  168. {
  169. "channel": "Youtube",
  170. "link": 'https://www.youtube.com/channel/UCWtYRC3kmgSUQcWqWFqXvJA/featured',
  171. "img": "https://i.imgur.com/c4VdjRJ.png"
  172. },
  173. {
  174. "channel": "twitch",
  175. "link": 'https://www.twitch.tv/straynyan',
  176. "img": "https://i.imgur.com/FjIaiz9.png"
  177. },
  178. ],
  179. "mp4": null
  180. },
  181. {
  182. "id": "6",
  183. "name": "天晴Haruru🐧",
  184. "intro": "我是養著可愛小企鵝的天晴Haruru🐧 喜歡電競、吉他、雜談、動漫、運動、程式設計、區塊鏈還有許多不同的領域 希望可以跟大家一起開心的遊戲和談天",
  185. "img": "https://i.imgur.com/9autFIy.jpg",
  186. "images": ["https://i.imgur.com/9autFIy.jpg"],
  187. "style": ["奶兇"],
  188. "tags": ["#天晴Haruru", "#VTuber", "#新人VTuber", "#TWvtuber", "#企鵝"],
  189. "contact": "",
  190. "demand": ["角色曝光", "聲優配音", "承接業配"],
  191. "follow": [
  192. {
  193. "channel": "facebook",
  194. "link": 'https://www.facebook.com/TCHaruru',
  195. "img": "https://i.imgur.com/HtfL33q.png"
  196. },
  197. {
  198. "channel": "Youtube",
  199. "link": 'https://youtu.be/MYcs6bbxwWI',
  200. "img": "https://i.imgur.com/c4VdjRJ.png"
  201. },
  202. {
  203. "channel": "twitter",
  204. "link": 'https://twitter.com/TCHaruru72',
  205. "img": "https://i.imgur.com/4VKBo9w.png"
  206. },
  207. {
  208. "channel": "website",
  209. "link": ' https://marshmallow-qa.com/tcharuru72',
  210. "img": "https://i.imgur.com/8nmvSdj.png"
  211. },
  212. {
  213. "channel": "discord",
  214. "link": 'https://discord.gg/8eRWytUXtf',
  215. "img": "https://i.imgur.com/Vbjnelb.png"
  216. },
  217. ],
  218. "mp4": null
  219. },
  220. {
  221. "id": "7",
  222. "name": "拉美拉 ramellae",
  223. "intro": "我是打工巫女拉美拉 Ramellae ヾ(*´∀ ˋ*)ノ一邊打掃著神社,一邊嚮往著劍與魔法的魔幻世界✨✨✨",
  224. "img": "https://i.imgur.com/0p2VzTh.jpg",
  225. "images": ["https://i.imgur.com/0p2VzTh.jpg"],
  226. "style": ["御姊", "多聲線"],
  227. "tags": ["#台V", "#いくせん", "#VTuber ", "#TWvtuber"],
  228. "contact": "",
  229. "demand": ["角色曝光", "聲優配音", "承接業配"],
  230. "follow": [
  231. {
  232. "channel": "facebook",
  233. "link": 'https://pse.is/3kp3y3',
  234. "img": "https://i.imgur.com/HtfL33q.png"
  235. },
  236. {
  237. "channel": "Youtube",
  238. "link": 'https://www.youtube.com/channel/UCEwfcA9-y1hcQpVMt9Xge_w',
  239. "img": "https://i.imgur.com/c4VdjRJ.png"
  240. },
  241. {
  242. "channel": "twitter",
  243. "link": 'https://pse.is/3layv4',
  244. "img": "https://i.imgur.com/FjIaiz9.png"
  245. },
  246. ],
  247. "mp4": null
  248. },
  249. {
  250. "id": "8",
  251. "name": "蕉バナ Bana🍌",
  252. "intro": "我是打工巫女拉美拉 Ramellae ヾ(*´∀ ˋ*)ノ一邊打掃著神社,一邊嚮往著劍與魔法的魔幻世界✨✨✨",
  253. "img": "https://i.imgur.com/4NyjGaS.jpg",
  254. "images": ["https://i.imgur.com/4NyjGaS.jpg"],
  255. "style": [],
  256. "tags": [],
  257. "contact": "",
  258. "demand": ["角色曝光", "聲優配音", "承接業配"],
  259. "follow": [
  260. {
  261. "channel": "twitch",
  262. "link": 'https://www.twitch.tv/jia0bana',
  263. "img": "https://i.imgur.com/HtfL33q.png"
  264. },
  265. {
  266. "channel": "Youtube",
  267. "link": 'https://www.youtube.com/channel/UCxyTFoXTDyo16R2zBEMPZrw/featured',
  268. "img": "https://i.imgur.com/c4VdjRJ.png"
  269. },
  270. {
  271. "channel": "twitter",
  272. "link": 'https://twitter.com/Jia0bana',
  273. "img": "https://i.imgur.com/FjIaiz9.png"
  274. },
  275. ],
  276. "mp4": null
  277. },
  278. {
  279. "id": "9",
  280. "name": "王顧採",
  281. "intro": "藝輪點燈旗下所屬 Vtuber,平時的職業是六埕順揚宮主任委員,因為整天在休息室看股票泡茶,被太太說怎麼不去做點正事,所以決定中年轉職為偶像實習生的叔叔系藝人。預計會直播的方向包括了股市投資、民俗文化、新聞與訪談,如果有興趣的還請大家多多追蹤訂閱支持!",
  282. "img": "https://i.imgur.com/jqK2SEM.jpg",
  283. "images": ["https://i.imgur.com/jqK2SEM.jpg"],
  284. "style": [],
  285. "tags": [],
  286. "contact": "",
  287. "demand": ["角色曝光", "聲優配音", "承接業配"],
  288. "follow": [
  289. {
  290. "channel": "twitch",
  291. "link": 'https://www.twitch.tv/jia0bana',
  292. "img": "https://i.imgur.com/HtfL33q.png"
  293. },
  294. {
  295. "channel": "Youtube",
  296. "link": 'https://www.youtube.com/channel/UCDK61SWPrZm3PDj8RohAM-w',
  297. "img": "https://i.imgur.com/c4VdjRJ.png"
  298. },
  299. {
  300. "channel": "twitter",
  301. "link": 'https://twitter.com/chiveswang_llt5',
  302. "img": "https://i.imgur.com/FjIaiz9.png"
  303. },
  304. {
  305. "channel": "ig",
  306. "link": 'https://www.instagram.com/chiveswang.llt5/',
  307. "img": "https://i.imgur.com/MAObTJv.png"
  308. },
  309. ],
  310. "mp4": null
  311. },
  312. {
  313. "id": "10",
  314. "name": "【無声透明Vtuber】強化人間【ミラージュコロイド系Vtuber】",
  315. "intro": "こんにちは、個人勢の無声透明系Vtuberの強化人間です!#バ美肉、#バ美声 不使用声優スタッフ交代の予定もありません。",
  316. "img": "https://i.imgur.com/Y3AIW6I.png",
  317. "images": ["https://i.imgur.com/Y3AIW6I.png", "https://i.imgur.com/xKQozOe.png", "https://i.imgur.com/z52eVu2.png", "https://i.imgur.com/zjNCBff.png", "https://i.imgur.com/iTOPEJ3.png"],
  318. "style": [],
  319. "tags": ["#日本", "#Vtuber"],
  320. "contact": "",
  321. "demand": ["角色曝光"],
  322. "follow": [
  323. {
  324. "channel": "Youtube",
  325. "link": 'https://www.youtube.com/c/trombeningen/featured',
  326. "img": "https://i.imgur.com/c4VdjRJ.png"
  327. },
  328. {
  329. "channel": "twitter",
  330. "link": 'https://twitter.com/trombeningen',
  331. "img": "https://i.imgur.com/FjIaiz9.png"
  332. },
  333. {
  334. "channel": "website",
  335. "link": 'https://marshmallow-qa.com/trombeningen',
  336. "img": "https://i.imgur.com/8nmvSdj.png"
  337. },
  338. ],
  339. "mp4": null
  340. },
  341. {
  342. "id": "11",
  343. "name": "鈴音紅葉",
  344. "intro": "【中ENG日粵台MY】馬來西亞Vtuber鈴聲響起,紅葉落下。 目標成為鬼界最牛逼的修羅!目標:在這個世界成為真棒修羅!",
  345. "img": "https://i.imgur.com/x9vPw4G.png",
  346. "images": ["https://i.imgur.com/x9vPw4G.png"],
  347. "style": [],
  348. "tags": [],
  349. "contact": "",
  350. "demand": ["角色曝光"],
  351. "follow": [
  352. {
  353. "channel": "Youtube",
  354. "link": 'https://www.youtube.com/channel/UCiuUID56A217ZapMbpNC4WQ/featured',
  355. "img": "https://i.imgur.com/c4VdjRJ.png"
  356. },
  357. {
  358. "channel": "twitter",
  359. "link": 'https://twitter.com/suzunemomiji_V',
  360. "img": "https://i.imgur.com/FjIaiz9.png"
  361. },
  362. {
  363. "channel": "website",
  364. "link": 'https://ko-fi.com/suzunemomiji',
  365. "img": "https://i.imgur.com/8nmvSdj.png"
  366. },
  367. ],
  368. "mp4": null
  369. },
  370. {
  371. "id": "12",
  372. "name": "渡清夢",
  373. "intro": "幽鬼與靈狐的禁忌之子,在隔離於夢與現世的夾縫小空間中獨自生活,現在來到現世探索中!",
  374. "img": "https://i.imgur.com/gAIFIoI.png",
  375. "images": ["https://i.imgur.com/gAIFIoI.png"],
  376. "style": [],
  377. "tags": ["#VTuber", "#TW_VTuber", "#個人勢"],
  378. "contact": "",
  379. "demand": ["角色曝光"],
  380. "follow": [
  381. {
  382. "channel": "Youtube",
  383. "link": 'https://www.youtube.com/channel/UC_BjgwcygvQatWUh06QQHwg',
  384. "img": "https://i.imgur.com/c4VdjRJ.png"
  385. },
  386. {
  387. "channel": "twitter",
  388. "link": 'https://twitter.com/KiyoyumeWataru',
  389. "img": "https://i.imgur.com/4VKBo9w.png"
  390. },
  391. {
  392. "channel": "twitch",
  393. "link": 'https://www.twitch.tv/wataru_kiyoyum',
  394. "img": "https://i.imgur.com/FjIaiz9.png"
  395. },
  396. ],
  397. "mp4": null
  398. },
  399. ];
  400. function getVtuber() {
  401. if(window.location.pathname.match('vtuber')) {
  402. console.log('vtuber list');
  403. let result = [...data];
  404. console.log(result);
  405. let str = '';
  406. for(let i = 0; i < result.length; i++){
  407. let style = '';
  408. for(let j = 0; j < result[i].style.length; j++){
  409. style += `<span class="vt-style">${result[i].style[j]}</span>`;
  410. console.log(result[i].style.length);
  411. }
  412. str += `<div class="col-6 col-sm-4 col-md-3">
  413. <div class="card" style="width: 100%;">
  414. <div class="vt-ribbon"><p>Vtuber</p></div>
  415. <div class="card-img-fr" style="background-image:url(${result[i].img})"></div>
  416. <div class="card-body">
  417. <h5 class="card-title">${result[i].name}</h5>
  418. ${style}
  419. <button class="card-link" data-toggle="modal" data-target="#more1Modal" data-id="${result[i].id}" >查看更多></button>
  420. </div>
  421. </div>
  422. </div>`;
  423. }
  424. $('.vt-list .vt-content').html(str);
  425. $('.vt-content .card-link').click(function(){
  426. const music = document.querySelector('.modal-body-sample audio');
  427. const progressBar = document.querySelector('#progress-bar');
  428. const progressZone = document.querySelector('.music-progress');
  429. let selected = result.filter(item =>
  430. item.id == $(this).data('id')
  431. )[0];
  432. console.log(selected);
  433. $('#more1Modal .modal-title').text(selected.name);
  434. $('#more1Modal p').text(selected.intro);
  435. let slideStr = '';
  436. for(let i = 0; i < selected.images.length; i++){
  437. if(i==0) {
  438. slideStr += `<div class="item active modal-imgfr">
  439. <div class="modal-slide-item" alt="..." style="background-image:url(${selected.images[i]})"></div>
  440. </div>`;
  441. } else {
  442. slideStr += `<div class="item modal-imgfr">
  443. <div class="modal-slide-item" alt="..." style="background-image:url(${selected.images[i]})"></div>
  444. </div>`;
  445. }
  446. }
  447. $('#more1Modal .carousel-inner').html(slideStr);
  448. let str = '';
  449. for(let i = 0; i < selected.follow.length; i++){
  450. str += `<a href="${selected.follow[i].link}"><img src="${selected.follow[i].img}" alt="${selected.follow[i].channel}" width="32px" height="32px"></a>`
  451. }
  452. $('#more1Modal .footer-socials').html(str);
  453. if(selected.mp4 == null) {
  454. $('.modal-body-sample').css('display', 'none');
  455. } else {
  456. $('.modal-body-sample audio').attr('src', selected.mp4);
  457. }
  458. let hashtagStr = "";
  459. for(let i = 0; i < selected.tags.length; i++){
  460. hashtagStr+= `<span class="hashtag-pill">${selected.tags[i]}</span>`;
  461. };
  462. let demandStr = "";
  463. for(let i = 0; i < selected.demand.length; i++){
  464. demandStr+= `<span class="demand-item">${selected.demand[i]}</span>`;
  465. };
  466. $('#more1Modal .modal-hashtag').html(hashtagStr);
  467. $('#more1Modal .modal-body-demandArr').html(demandStr);
  468. let isPlaying = false;
  469. $('.modal-body-toggleplay').click(function(){
  470. //isPlaying? pauseMusic(music) : playMusic(music)
  471. if(isPlaying) {
  472. music.pause();
  473. $('.modal-body-toggleplay').attr("src", "https://i.imgur.com/gYst9TQ.png");
  474. isPlaying = false;
  475. } else {
  476. music.play();
  477. $('.modal-body-toggleplay').attr("src", "https://i.imgur.com/f5PWQUb.png");
  478. isPlaying = true;
  479. }
  480. console.log(isPlaying);
  481. });
  482. $('[data-dismiss="modal"]').click(function() {
  483. music.pause();
  484. $('.modal-body-toggleplay').attr("src", "https://i.imgur.com/gYst9TQ.png");
  485. isPlaying = false;
  486. });
  487. music.addEventListener('timeupdate', updateProgress);
  488. progressZone.addEventListener('click', setProgress);
  489. })
  490. }
  491. }
  492. getVtuber();
  493. const updateProgress = (e) => {
  494. const music = document.querySelector('.modal-body-sample audio');
  495. const progressBar = document.querySelector('#progress-bar');
  496. const progressZone = document.querySelector('.music-progress');
  497. const {
  498. duration,
  499. currentTime
  500. } = e.srcElement;
  501. const progressPercent = (currentTime / duration) * 100
  502. progressBar.style.width = `${progressPercent}%`
  503. if(progressPercent == 100) {
  504. music.pause();
  505. $('.modal-body-toggleplay').attr("src", "https://i.imgur.com/gYst9TQ.png");
  506. isPlaying = false;
  507. console.log('test');
  508. }
  509. }
  510. function setProgress(e) {
  511. const music = document.querySelector('.modal-body-sample audio');
  512. const width = this.clientWidth;
  513. const setPoint = e.offsetX;
  514. const duration = music.duration;
  515. music.currentTime = (setPoint / width) * duration;
  516. }