[text] 자바스크립트 롤 데이터베이스

Viewer

copydownloadembedprintName: 자바스크립트 롤 데이터베이스
  1. document.write('<!DOCTYPE html>');
  2. document.write('<html>');
  3. document.write('');
  4. document.write('<head>');
  5. document.write('    <meta http-equiv="content-type" content="text/html; charset=UTF-8">');
  6. document.write('    <title>리그오브레전드 데이터베이스</title>');
  7. document.write('    <meta http-equiv="content-type" content="text/html; charset=UTF-8">');
  8. document.write('    <meta name="robots" content="noindex, nofollow">');
  9. document.write('    <meta name="googlebot" content="noindex, nofollow">');
  10. document.write('    <meta name="viewport" content="width=device-width, initial-scale=1">');
  11. document.write('');
  12. document.write('');
  13. document.write('    <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/vue/2.2.1/vue.js"></script>');
  14. document.write('');
  15. document.write('    <link rel="stylesheet" type="text/css" href="/css/result-light.css">');
  16. document.write('');
  17. document.write('    <script type="text/javascript" src="https://unpkg.com/axios/dist/axios.min.js"></script>');
  18. document.write('    <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>');
  19. document.write('    <style type="text/css">');
  20. document.write('        td {');
  21. document.write('            text-align: center;');
  22. document.write('            font-family: "돋움";');
  23. document.write('            font-size: 10pt;');
  24. document.write('            border: 1px solid #B09C87;');
  25. document.write('        }');
  26. document.write('');
  27. document.write('        .icon-layer {');
  28. document.write('            border-bottom: 3px ridge #a0a0a0;');
  29. document.write('            display: inline-block;');
  30. document.write('            padding-left: 10px;');
  31. document.write('            padding-right: 10px;');
  32. document.write('            line-height: 150%;');
  33. document.write('            font-weight: bold;');
  34. document.write('        }');
  35. document.write('');
  36. document.write('        .skill-layer {');
  37. document.write('            border: 1px solid #b2b2b2;');
  38. document.write('            display: inline-block;');
  39. document.write('            padding: 5px;');
  40. document.write('            font-weight: bold;');
  41. document.write('        }');
  42. document.write('');
  43. document.write('        .image {');
  44. document.write('            width: 40px;');
  45. document.write('            height: 40px;');
  46. document.write('        }');
  47. document.write('');
  48. document.write('        .image-large {');
  49. document.write('            width: 52px;');
  50. document.write('            height: 52px;');
  51. document.write('        }');
  52. document.write('');
  53. document.write('        #click_layer {');
  54. document.write('            border: 1px solid rgb(222, 223, 223);');
  55. document.write('            background-color: #f7f7f7;');
  56. document.write('            padding: 5px 10px;');
  57. document.write('            cursor: pointer;');
  58. document.write('        }');
  59. document.write('');
  60. document.write('        groupLimit,');
  61. document.write('        stats {');
  62. document.write('            color: #49784d;');
  63. document.write('        }');
  64. document.write('');
  65. document.write('        unique,');
  66. document.write('        passive {');
  67. document.write('            color: #f1d121;');
  68. document.write('        }');
  69. document.write('    </style>');
  70. document.write('    <!-- TODO: Missing CoffeeScript 2 -->');
  71. document.write('');
  72. document.write('    <script type="text/javascript">');
  73. document.write('        window.onload = function() {');
  74. document.write('');
  75. document.write('            const app = new Vue({');
  76. document.write('                el: \'#app\',');
  77. document.write('                data: {');
  78. document.write('                    champions: [],');
  79. document.write('                    items: [],');
  80. document.write('                    summoners: [],');
  81. document.write('                    runes: [],');
  82. document.write('                    show: [true, false, false, false],');
  83. document.write('                },');
  84. document.write('                mounted() {');
  85. document.write('                    this.getLatestVersion().then(version => {');
  86. document.write('                        const url = `https://ddragon.leagueoflegends.com/cdn`');
  87. document.write('                        const url_version = `${url}/${version}`');
  88. document.write('');
  89. document.write('                        this.setChampInfo(url_version)');
  90. document.write('                        this.setItemInfo(url_version)');
  91. document.write('                        this.setSummonerSpell(url_version)');
  92. document.write('                        this.setRune(url, version)');
  93. document.write('                    })');
  94. document.write('                },');
  95. document.write('                computed: {');
  96. document.write('');
  97. document.write('                },');
  98. document.write('                methods: {');
  99. document.write('                    getLatestVersion: async function() {');
  100. document.write('                        return await axios.get(`https://ddragon.leagueoflegends.com/api/versions.json`)');
  101. document.write('                            .then(version_list => version_list.data[0])');
  102. document.write('                    },');
  103. document.write('                    toggleShow(index) {');
  104. document.write('                        Vue.set(this.show, index, !this.show[index]);');
  105. document.write('                    },');
  106. document.write('                    SelectText(element) {');
  107. document.write('                        const doc = document;');
  108. document.write('                        if (doc.body.createTextRange) {');
  109. document.write('                            const range = document.body.createTextRange();');
  110. document.write('                            range.moveToElementText(element);');
  111. document.write('                            range.select();');
  112. document.write('                        } else if (window.getSelection) {');
  113. document.write('                            const selection = window.getSelection();');
  114. document.write('                            const range = document.createRange();');
  115. document.write('                            range.selectNodeContents(element);');
  116. document.write('                            selection.removeAllRanges();');
  117. document.write('                            selection.addRange(range);');
  118. document.write('                        }');
  119. document.write('                    },');
  120. document.write('                    copySrc(e) {');
  121. document.write('                        $(e.currentTarget).attr("contenteditable", true);');
  122. document.write('                        this.SelectText(e.currentTarget);');
  123. document.write('                        document.execCommand("copy");');
  124. document.write('                        window.getSelection().removeAllRanges();');
  125. document.write('                        $(e.currentTarget).removeAttr("contenteditable");');
  126. document.write('                        alert("image copied!");');
  127. document.write('                    },');
  128. document.write('                    setChampInfo(url) {');
  129. document.write('                        axios.get(`${url}/data/ko_KR/champion.json`).then(champlist_kor => {');
  130. document.write('                            for (const idx in champlist_kor.data.data) {');
  131. document.write('                                const champData = champlist_kor.data.data[idx]');
  132. document.write('                                const champId = champData.id');
  133. document.write('');
  134. document.write('                                this.champions.push({');
  135. document.write('                                    id: champId,');
  136. document.write('                                    isLoaded: false');
  137. document.write('                                })');
  138. document.write('');
  139. document.write('                                axios.get(`${url}/data/ko_KR/champion/${champId}.json`).then(champ_res => {');
  140. document.write('                                    axios.get(`${url}/data/en_US/champion/${champId}.json`).then(champ_res_eng => {');
  141. document.write('                                        const spellImg = []');
  142. document.write('                                        const spellName = []');
  143. document.write('                                        const spellName_eng = []');
  144. document.write('');
  145. document.write('                                        for (let i = 0; i < 4; i++) {');
  146. document.write('                                            spellImg[i] = `${url}/img/spell/${champ_res.data.data[champId].spells[i].image.full}`');
  147. document.write('                                            spellName[i] = champ_res.data.data[champId].spells[i].name');
  148. document.write('                                            spellName_eng[i] = champ_res_eng.data.data[champId].spells[i].name');
  149. document.write('                                        }');
  150. document.write('');
  151. document.write('                                        this.champions.find(champ => {');
  152. document.write('                                            if (champ.id === champId) {');
  153. document.write('                                                champ.champImg = `${url}/img/champion/${champData.image.full}`');
  154. document.write('                                                champ.name = champData.name');
  155. document.write('                                                champ.name_eng = champ_res_eng.data.data[champId].name');
  156. document.write('                                                champ.pImg = `${url}/img/passive/${champ_res.data.data[champId].passive.image.full}`');
  157. document.write('                                                champ.pName = champ_res.data.data[champId].passive.name');
  158. document.write('                                                champ.pName_eng = champ_res_eng.data.data[champId].passive.name');
  159. document.write('                                                champ.spellImg = spellImg');
  160. document.write('                                                champ.spellName = spellName');
  161. document.write('                                                champ.spellName_eng = spellName_eng');
  162. document.write('                                                champ.isLoaded = true');
  163. document.write('                                            }');
  164. document.write('                                        })');
  165. document.write('');
  166. document.write('                                    })');
  167. document.write('                                })');
  168. document.write('                            }');
  169. document.write('                        })');
  170. document.write('                    },');
  171. document.write('                    setItemInfo(url) {');
  172. document.write('                        axios.get(`${url}/data/ko_KR/item.json`).then(itemlist_kor => {');
  173. document.write('                            axios.get(`${url}/data/en_US/item.json`).then(itemlist_eng => {');
  174. document.write('                                for (const idx in itemlist_kor.data.data) {');
  175. document.write('                                    const item_data = itemlist_kor.data.data[idx]');
  176. document.write('                                    this.items.push({');
  177. document.write('                                        itemName: item_data.name,');
  178. document.write('                                        itemName_eng: itemlist_eng.data.data[idx].name,');
  179. document.write('                                        itemImg: `${url}/img/item/${item_data.image.full}`,');
  180. document.write('                                        itemDesc: item_data.description,');
  181. document.write('                                        itemCost: item_data.gold.total');
  182. document.write('                                    })');
  183. document.write('                                }');
  184. document.write('                            })');
  185. document.write('                        })');
  186. document.write('                    },');
  187. document.write('                    setSummonerSpell(url) {');
  188. document.write('                        axios.get(`${url}/data/ko_KR/summoner.json`).then(summonerlist => {');
  189. document.write('                            for (const idx in summonerlist.data.data) {');
  190. document.write('                                const item = summonerlist.data.data[idx]');
  191. document.write('                                this.summoners.push({');
  192. document.write('                                    summonerName: item.name,');
  193. document.write('                                    summonerImage: `${url}/img/spell/${item.image.full}`,');
  194. document.write('                                    summonerDesc: item.description,');
  195. document.write('                                    summonerCool: item.cooldown[0]');
  196. document.write('                                })');
  197. document.write('                            }');
  198. document.write('                        })');
  199. document.write('                    },');
  200. document.write('                    setRune(url, version) {');
  201. document.write('                        let temp = [');
  202. document.write('                            [],');
  203. document.write('                            [],');
  204. document.write('                            [],');
  205. document.write('                            [],');
  206. document.write('                            []');
  207. document.write('                        ]');
  208. document.write('                        axios.get(`${url}/${version}/data/ko_KR/runesReforged.json`).then(runelist_kor => {');
  209. document.write('                            axios.get(`${url}/${version}/data/en_US/runesReforged.json`).then(runelist_eng => {');
  210. document.write('                                for (const cate_idx in runelist_kor.data) {');
  211. document.write('                                    for (const slot_idx in runelist_kor.data[cate_idx].slots) {');
  212. document.write('                                        for (const rune_idx in runelist_kor.data[cate_idx].slots[slot_idx].runes) {');
  213. document.write('');
  214. document.write('                                            const data_kor = runelist_kor.data[cate_idx].slots[slot_idx].runes[rune_idx]');
  215. document.write('                                            const data_eng = runelist_eng.data[cate_idx].slots[slot_idx].runes[rune_idx]');
  216. document.write('');
  217. document.write('                                            temp[cate_idx].push({');
  218. document.write('                                                runeName: data_kor.name,');
  219. document.write('                                                runeName_eng: data_eng.name,');
  220. document.write('                                                runeImg: `${url}/img/${data_kor.icon}`');
  221. document.write('                                            })');
  222. document.write('                                        }');
  223. document.write('                                    }');
  224. document.write('                                }');
  225. document.write('                                this.runes = this.transpose(temp)');
  226. document.write('                            })');
  227. document.write('                        })');
  228. document.write('                    },');
  229. document.write('                    transpose(a) {');
  230. document.write('');
  231. document.write('                        // Calculate the width and height of the Array');
  232. document.write('                        var w = a.length || 0;');
  233. document.write('                        var h = a[0] instanceof Array ? a[0].length : 0;');
  234. document.write('');
  235. document.write('                        // In case it is a zero matrix, no transpose routine needed.');
  236. document.write('                        if (h === 0 || w === 0) {');
  237. document.write('                            return [];');
  238. document.write('                        }');
  239. document.write('');
  240. document.write('                        /**');
  241. document.write('                         * @var {Number} i Counter');
  242. document.write('                         * @var {Number} j Counter');
  243. document.write('                         * @var {Array} t Transposed data is stored in this array.');
  244. document.write('                         */');
  245. document.write('                        var i, j, t = [];');
  246. document.write('');
  247. document.write('                        // Loop through every item in the outer array (height)');
  248. document.write('                        for (i = 0; i < h; i++) {');
  249. document.write('');
  250. document.write('                            // Insert a new row (array)');
  251. document.write('                            t[i] = [];');
  252. document.write('');
  253. document.write('                            // Loop through every item per item in outer array (width)');
  254. document.write('                            for (j = 0; j < w; j++) {');
  255. document.write('');
  256. document.write('                                // Save transposed data.');
  257. document.write('                                t[i][j] = a[j][i];');
  258. document.write('                            }');
  259. document.write('                        }');
  260. document.write('');
  261. document.write('                        return t;');
  262. document.write('                    }');
  263. document.write('                },');
  264. document.write('            })');
  265. document.write('');
  266. document.write('');
  267. document.write('        }');
  268. document.write('    </script>');
  269. document.write('');
  270. document.write('</head>');
  271. document.write('');
  272. document.write('<body>');
  273. document.write('    <div id="app">');
  274. document.write('        <blockquote id="click_layer" @click.prevent="toggleShow(0)">');
  275. document.write('            <center>챔피언</center>');
  276. document.write('        </blockquote>');
  277. document.write('        <div v-show="show[0]">');
  278. document.write('            <table class="table">');
  279. document.write('                <thead>');
  280. document.write('                    <tr>');
  281. document.write('                        <th scope="col">Champ</th>');
  282. document.write('                        <th scope="col">P</th>');
  283. document.write('                        <th scope="col">Q</th>');
  284. document.write('                        <th scope="col">W</th>');
  285. document.write('                        <th scope="col">E</th>');
  286. document.write('                        <th scope="col">R</th>');
  287. document.write('                    </tr>');
  288. document.write('                </thead>');
  289. document.write('                <tbody>');
  290. document.write('                    <tr v-for="(champion, i) in champions" :key="i" v-if="champion.isLoaded">');
  291. document.write('                        <td>');
  292. document.write('                            <div @click="copySrc($event)">');
  293. document.write('                                <div class="icon-layer"><img class="image-large" :src="champion.champImg"><br />{{ champion.name }}</div> ');
  294. document.write('                            </div>{{ champion.name_eng }}');
  295. document.write('                        </td>');
  296. document.write('                        <td>');
  297. document.write('                            <div @click="copySrc($event)">');
  298. document.write('                                <div class="skill-layer"><img class="image" :src="champion.pImg"><br />{{ champion.pName }} (패시브)</div> ');
  299. document.write('                            </div>{{ champion.pName_eng }}');
  300. document.write('                        </td>');
  301. document.write('                        <td>');
  302. document.write('                            <div @click="copySrc($event)">');
  303. document.write('                                <div class="skill-layer"><img class="image" :src="champion.spellImg[0]"><br />{{ champion.spellName[0] }} (Q)</div> ');
  304. document.write('                            </div>{{ champion.spellName_eng[0] }}');
  305. document.write('                        </td>');
  306. document.write('                        <td>');
  307. document.write('                            <div @click="copySrc($event)">');
  308. document.write('                                <div class="skill-layer"><img class="image" :src="champion.spellImg[1]"><br />{{ champion.spellName[1] }} (W)</div> ');
  309. document.write('                            </div>{{ champion.spellName_eng[1] }}');
  310. document.write('                        </td>');
  311. document.write('                        <td>');
  312. document.write('                            <div @click="copySrc($event)">');
  313. document.write('                                <div class="skill-layer"><img class="image" :src="champion.spellImg[2]"><br />{{ champion.spellName[2] }} (E)</div> ');
  314. document.write('                            </div>{{ champion.spellName_eng[2] }}');
  315. document.write('                        </td>');
  316. document.write('                        <td>');
  317. document.write('                            <div @click="copySrc($event)">');
  318. document.write('                                <div class="skill-layer"><img class="image" :src="champion.spellImg[3]"><br />{{ champion.spellName[3] }} (R)</div> ');
  319. document.write('                            </div>{{ champion.spellName_eng[3] }}');
  320. document.write('                        </td>');
  321. document.write('                    </tr>');
  322. document.write('                </tbody>');
  323. document.write('            </table>');
  324. document.write('        </div>');
  325. document.write('');
  326. document.write('        <blockquote id="click_layer" @click.prevent="toggleShow(1)">');
  327. document.write('            <center>아이템</center>');
  328. document.write('        </blockquote>');
  329. document.write('        <div v-show="show[1]">');
  330. document.write('            <table class="table">');
  331. document.write('                <thead>');
  332. document.write('                    <th scope="col">아이템</th>');
  333. document.write('                    <th scope="col">설명</th>');
  334. document.write('                    <th scope="col">비용</th>');
  335. document.write('                </thead>');
  336. document.write('');
  337. document.write('                <tbody>');
  338. document.write('                    <tr v-for="(item, j) in items" :key="j">');
  339. document.write('                        <td>');
  340. document.write('                            <div @click="copySrc($event)">');
  341. document.write('                                <div class="icon-layer"><img class="image-large" :src="item.itemImg"><br />{{ item.itemName }}</div> ');
  342. document.write('                            </div>{{ item.itemName_eng }}');
  343. document.write('                        </td>');
  344. document.write('                        <td v-html="item.itemDesc"></td>');
  345. document.write('                        <td> {{ item.itemCost }}</td>');
  346. document.write('                    </tr>');
  347. document.write('                </tbody>');
  348. document.write('            </table>');
  349. document.write('        </div>');
  350. document.write('');
  351. document.write('        <blockquote id="click_layer" @click.prevent="toggleShow(2)">');
  352. document.write('            <center>소환사 주문</center>');
  353. document.write('        </blockquote>');
  354. document.write('        <div v-show="show[2]">');
  355. document.write('            <table class="table">');
  356. document.write('                <thead>');
  357. document.write('                    <th scope="col">소환사 주문</th>');
  358. document.write('                    <th scope="col">설명</th>');
  359. document.write('                    <th scope="col">재사용 대기시간</th>');
  360. document.write('                </thead>');
  361. document.write('');
  362. document.write('                <tbody>');
  363. document.write('                    <tr v-for="(data, i) in summoners" :key="i">');
  364. document.write('                        <td>');
  365. document.write('                            <div @click="copySrc($event)">');
  366. document.write('                                <div class="icon-layer"><img class="image-large" :src="data.summonerImage"><br />{{ data.summonerName }}</div> ');
  367. document.write('                            </div>');
  368. document.write('                        </td>');
  369. document.write('                        <td> {{ data.summonerDesc }}</td>');
  370. document.write('                        <td> {{ data.summonerCool }}</td>');
  371. document.write('                    </tr>');
  372. document.write('                </tbody>');
  373. document.write('            </table>');
  374. document.write('        </div>');
  375. document.write('');
  376. document.write('        <blockquote id="click_layer" @click.prevent="toggleShow(3)">');
  377. document.write('            <center>룬</center>');
  378. document.write('        </blockquote>');
  379. document.write('        <div v-show="show[3]">');
  380. document.write('            <table class="table">');
  381. document.write('                <thead>');
  382. document.write('                    <th scope="col">지배</th>');
  383. document.write('                    <th scope="col">영감</th>');
  384. document.write('                    <th scope="col">정밀</th>');
  385. document.write('                    <th scope="col">결의</th>');
  386. document.write('                    <th scope="col">마법</th>');
  387. document.write('                </thead>');
  388. document.write('');
  389. document.write('                <tbody>');
  390. document.write('                    <tr v-for="(data, i) in runes" :key="i">');
  391. document.write('                        <td v-for="(runeitem, j) in data" :key="j">');
  392. document.write('                            <div v-if="runeitem !== undefined">');
  393. document.write('                                <div @click="copySrc($event)">');
  394. document.write('                                    <div class="icon-layer"><img class="image-large" :src="runeitem.runeImg"><br />{{ runeitem.runeName }}</div> ');
  395. document.write('                                </div>{{ runeitem.runeName_eng }}');
  396. document.write('                            </div>');
  397. document.write('                        </td>');
  398. document.write('                    </tr>');
  399. document.write('                </tbody>');
  400. document.write('            </table>');
  401. document.write('        </div>');
  402. document.write('    </div>');
  403. document.write('');
  404. document.write('');
  405. document.write('    <script>');
  406. document.write('        // tell the embed parent frame the height of the content');
  407. document.write('        if (window.parent && window.parent.parent) {');
  408. document.write('            window.parent.parent.postMessage(["resultsFrame", {');
  409. document.write('                height: document.body.getBoundingClientRect().height,');
  410. document.write('                slug: "g7k9p0tz"');
  411. document.write('            }], "*")');
  412. document.write('        }');
  413. document.write('    </script>');
  414. document.write('</body>');
  415. document.write('');
  416. document.write('</html>');
  417.  

Editor

You can edit this paste and save as new:


File Description
  • 자바스크립트 롤 데이터베이스
  • Paste Code
  • 21 Jan-2022
  • 25.88 Kb
You can Share it: