Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
node_modules/
151 changes: 19 additions & 132 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,137 +1,24 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<title>Script Printer - シナリオテキストを収録用台本に変換</title>
<style>
:root {
--font-size: 12pt;
--font-size-large: 15pt;
--font-serif: "ヒラギノ明朝 Pro", "Hiragino Mincho Pro", serif;
--font-sans: "ヒラギノ角ゴ ProN", "Hiragino Kaku Gothic ProN", sans-serif;
--height: 210mm;
--padding-bottom: 40mm;
--margin: 10mm;
--highlight-color: #666666;
}
body {
writing-mode: vertical-rl;
font-family: var(--font-serif);
margin: var(--margin);
padding: 0;
height: var(--height);
}
.page {
box-sizing: border-box;
padding-bottom: var(--padding-bottom);
font-size: var(--font-size);
}
.character-dialogue {
display: inline-block; /* キャラクター名とセリフを縦に表示 */
margin-block: 3mm; /* キャラクター名とセリフのブロック間の余白 */
height: 100%;
position: relative;
}
.character-name {
font-weight: bold;
font-family: var(--font-sans);
position: absolute;
height: 40mm;
text-align: end;
padding-bottom: 2mm;
}
.dialogue {
margin-top: 50mm; /* キャラクター名とセリフの間の余白 */
display: block;
}
.highlighted {
font-weight: bold;
user-select: none;
cursor: pointer;
}
.highlighted .character-name {
background-color: var(--highlight-color);
color: white;
-webkit-print-color-adjust: exact;
color-adjust: exact;
}
.highlighted .dialogue {
font-size: var(--font-size-large);
}
.dialogue-index {
position: absolute;
right: calc(-0.95 * var(--font-size));
color: var(--highlight-color);
font-family: var(--font-sans);
font-size: calc(0.75 * var(--font-size));
}

/* サマリのスタイル */
#scriptSummary {
margin-left: var(--margin);
input,
textarea {
font: inherit;
background: none;
padding: 0;
border: none;
height: 100%;
width: auto;
resize: none;
}
<head>
<meta charset="UTF-8" />
<title>Script Printer - シナリオテキストを収録用台本に変換</title>
</head>

#characterList,
#dialogueCountResult {
font-family: var(--font-sans);
color: var(--highlight-color);
user-select: none;
}
label {
padding: 2px;
margin: 2px;
display: inline-block;
cursor: pointer;
border: 1px solid transparent;
<body>
<!-- 概要を表示 -->
<div id="scriptSummary">
<h1>
<input type="file" id="fileInput" accept=".txt" onchange="loadScript()" />
<textarea id="fileTitle" style="display: none"></textarea>
</h1>
<p id="characterList"></p>
<p id="dialogueCountResult"></p>
</div>
<!-- 台本が表示されるコンテナ -->
<div id="scriptContainer" class="page"></div>
<script type="module" src="/src/main.ts"></script>
</body>

&:has(input:checked) {
background-color: var(--highlight-color); /* チェックされたキャラクターの背景色 */
color: white;
font-weight: bold;
}

&:hover {
border: 1px solid var(--highlight-color);
}
input {
display: none;
}
}
}

/* 印刷時のスタイル */
@media print {
@page {
size: A4 landscape;
margin: var(--margin);
}
body {
margin: 0;
}
}
</style>
</head>
<body>
<!-- 概要を表示 -->
<div id="scriptSummary">
<h1>
<input type="file" id="fileInput" accept=".txt" onchange="loadScript()" />
<textarea id="fileTitle" style="display: none"></textarea>
</h1>
<p id="characterList"></p>
<p id="dialogueCountResult"></p>
</div>
<!-- 台本が表示されるコンテナ -->
<div id="scriptContainer" class="page"></div>
<script src="script.js"></script>
</body>
</html>
</html>
Loading