Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Userscript : Gundam Build Divers - Episode Staff Translator
// ==UserScript==
// @name Gundam Build Divers - Episode Staff Translator
// @namespace net.gundam-bd.story
// @version 1.0.1
// @description Translates episode personel information
// @author rmkane
// @match http://www.gundam-bd.net/story/*
// @resource JQUERY_MODAL https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.2/jquery.modal.min.css
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.2/jquery.modal.min.js
// @grant GM_addStyle
// @grant GM_getResourceText
// @grant GM_log
// ==/UserScript==
(function() {
/* global $ */
'use strict';
const modalSelector = '#ep-info-modal';
const closeButtonImgData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAXp3pUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZpndlu5loX/YxQ9BOQwHMS1egZv+P1tXJIOKlfZ1c+yRIoi7wVO2AGA2f/532P+h3/Ze2tiKjW3nC3/YovNd55U+/xr96ez8f68/8J8/c39+Lr5/MHzUtA7n19Lf72/83r69oH3Pdz48XVTX3/x9XUh97nwMwLdWc/X94Pkdf+87uLrQm0/T3Kr5fuhjteF5uuNdyiv7/gZ1vOg380PLxSitBI3Ct7v4IK9P+MzgvB8d74jP13IvM+FxvMUkrkP75EQkB+m93609vsA/RDk9zPzc/Q/z34Kvu+v18NPscyvGPHkL//g0k+vh89t/A/l8BmR//EPLrvyZTqv73NWPWc/s+sxE9H8qqgbbPe+DG8chDzcj2W+Ct+J5+V+Nb6q7XaS8mWnHXxN15wnK8e46Jbr7rh9H6ebDDH67QuP3k8f7ms1FN/8DMpT1Jc7vpCxFSq5nH6bEHjZf8bi7n3bvd90lTsvx1u942KOj/zyy/zdH//ky5yjZnPO1k+sGJdXXTMMZU4/eRcJceeVt3QD/P56pd9+Vz+UKhlMN8yVCXY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sqt8wtob0uE3YarWKPHeWuaHByO3nhgaR585SrVZtQ48DOOZ0cdhWr5+2v/xeCCuVSNBzQ4NUKpXQvixo2PX8w46ZmQds9ToDNBqNyNCdsI1Gw/YaOQCMOOhzY6uaqm9Ggg6DnapvJjF5nXfQB+RkBZ0iLIBIDPgg0CnDAoh+dPmDJKHnDGwLuu0HSBEW4LTD7zoPaUY6A1iAI6kAh0FnANsC/qfkoMuViatzgoqbnPSob6kAh83GcZITW8AbacNO1TcjJyeWtOGgq+6pwsbNyCzITwz4oElFytC+g/ZUZAKbAfS6g66q79jqsRYzgwqDvm8XdgdYcYxbZs1WryfbNu1Rk4pO6JPHj9oEXlNSfG8mHgu2er21/YUgCPDef4iVQU3VN/HefyAIAm5//moTeAH+1UM844NaLnFGudz0erXn0o9LDNxi66wtvaN81YcVJcXF9s1Dux6UMLq1zt1SS0qKV2gPVlmkOl17YfvhaXQxuehqGBa6ApuKuYu2DRRVu2iXXn1fYAO9BNwrMPC9vSyJ+/m0nlE8J89zJcWNbkc83XQTbfYqilbNOxML2DjaxgoC3bQe/ogNbKADYBRt4MztMEabV4L9PhjJL20cbo/Ij2Ft10xQswdt8N8gfoAhvgTIjDMyhXbZLUVt2OsljyvoGni5L3mEgF9GW4OSvMbzREnxptfObF/UGjRpabkvau0Bn8ureL8AHuyr+DsfZFUAAAAASUVORK5CYII=';
GM_addStyle(GM_getResourceText ('JQUERY_MODAL') + [
`${modalSelector} > p {`,
` font-family: "GBDB", sans-serif;`,
` color: #000;`,
`}`,
`${modalSelector} > p > h1 {`,
` font-weight: bold;`,
` text-align: center;`,
` margin: 0.25em 0 0.5em 0;`,
' font-size: 1.67em;',
`}`,
`${modalSelector} > p > table {`,
` border: 2px solid #59D7D9;`,
` border-collapse: collapse;`,
` width: 100%;`,
` height: 100%;`,
`}`,
`${modalSelector} > p > table th,`,
`${modalSelector} > p > table td {`,
` padding: 0.5em;`,
`}`,
`${modalSelector} > p > table tbody td:first-child {`,
` vertical-align: top;`,
`}`,
/* Colors */
`${modalSelector} > p > table thead th {`,
` background: #59D7D9;`,
`}`,
`${modalSelector} > p > table tbody tr:nth-child(even) {`,
` background: #D6FCFC;`,
`}`,
`${modalSelector} a.close-modal {`,
` background-image: url('${closeButtonImgData}')`,
`}`
].join(''));
const keyDict = {
"脚本" : "Script",
"絵コンテ" : "Storyboard",
"演出" : "Director",
"キャラクター作画監督" : "Character Designers",
"メカ作画監督" : "Mechanical Designers"
};
const personelDict = {
"阿部宗孝" : "Munetaka Abe",
"阿久津潤一" : "Junichi Akutsu",
"海老川兼武" : "Kanetake Ebikawa",
"形部一平" : "Ippei Gyōbu",
"羽原信義" : "Nobuyoshi Habara",
"樋口達人" : "Tatsuto Higuchi",
"平岡雅樹" : "Masaki Hiraoka",
"イムガヒ" : "Im Ga-hee",
"石垣純哉" : "Junya Ishigaki",
"石井久美" : "Kumi Ishii",
"イシノアツオ" : "Atsuo Ishino",
"川原智弘" : "Tomohiro Kawahara",
"木村秀彬" : "Hideakira Kimura",
"小林寛" : "Hiroshi Kobayashi",
"小暮昌広" : "Masahiro Kogure",
"小谷杏子" : "Kyoko Kotani",
"児谷直樹" : "Naoki Kotani",
"小谷野竜成" : "Tatsunari Koyano",
"久藤瞬" : "Shun Kudō",
"久壽米木信弥" : "Shinya Kusumegi",
"松田寛" : "Hiroshi Matsuda",
"森木靖泰" : "Yasuhiro Moriki",
"むらせまいこ" : "Shūkō Murase",
"むとうやすゆき" : "Yasuyuki Mutō",
"中原れい" : "Rei Nakahara",
"中本尚子" : "Naoko Nakamoto",
"西澤晋" : "Susumu Nishizawa",
"重田智" : "Susumu Nishizawa",
"野崎真一" : "Shinichi Nozaki",
"大張正己" : "Masami Ōbari",
"大貫健一" : "Kenichi Ohnuki",
"大河原邦男" : "Kunio Okawara",
"大久保朋" : "Tomo Ōkubo",
"大槻敦史" : "Atsushi Ōtsuki",
"大嶋博之" : "Hiroyuki Oshima",
"斉藤香" : "Kaori Saito",
"斉藤哲人": "Tetsuhito Saito",
"斎藤哲人" : "Tetsuhito Saito",
"島田フミカネ" : "Humikane Shimada",
"しんぼくたろう" : "Takuro Shinbo",
"しんぼ たくろう" : "Takuro Shinbo",
"鈴木勘太" : "Kanta Suzuki",
"大籠之仁" : "Norihito Takahashi",
"高見明男" : "Akio Takami",
"高瀬健一" : "Kenichi Takase",
"寺岡巌" : "Iwao Teraoka",
"寺岡賢司" : "Kenji Teraoka",
"寺島慎也" : "Shinya Terashima",
"鳥羽聡" : "Satoshi Toba",
"戸井田珠里" : "Shuri Toida",
"富野由悠季" : "Yoshiyuki Tomino",
"宇田早輝子" : "Sakiko Uda",
"鷲尾直広" : "Naohiro Washio",
"綿田慎也" : "Shinya Watada",
"山田靖智" : "Yasunori Yamada",
"山根理宏" : "Masahiro Yamane",
"山崎克之" : "Katsuyuki Yamazaki",
"柳瀬敬之" : "Takayuki Yanase",
"ヤスカワショウゴ" : "Shogo Yasukawa",
"矢立肇" : "Hajime Yatate"
};
let staffText = $('.c-story-box__staff p').text();
let episodeInfo = staffText.split('/').reduce((obj, pair) => {
let tokens = pair.split(/\s*\s*/);
return Object.assign(obj, {
[ keyDict[tokens[0]] ] : tokens[1].split('、').map(name => personelDict[name] ? personelDict[name] : name)
});
}, {});
// Create, add, and show the modal
$('<div>', { id : 'ep-info-modal', class : 'modal' })
.append($('<p>')
.append($('<h1>', { text : 'Episode Staff' }))
.append(buildTable(episodeInfo)))
.append($('<a>', { href : '#', rel : 'modal:close', text : 'Close' }))
.appendTo('body')
.modal('show');
/**
* Constructs a table element containing staff information.
* @param {object} info - The episode staff information
* @returns {HTMLTableElement} returns a jQuery-wrapped table element.
*/
function buildTable(info) {
let fields = ['Role', 'Personel'];
let entries = Object.entries(info);
return $('<table>')
.append($('<thead>').append($('<tr>').append(fields.map(th => $('<th>').text(th)))))
.append('<tbody>').append(entries.map(pair => $('<tr>')
.append($('<td>', { text : pair[0] }))
.append($('<td>', { html : pair[1].join('<br>') }))));
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment