File size: 11,370 Bytes
4b4719a
 
 
 
 
 
 
 
 
 
972a39a
 
 
 
16861d2
 
 
972a39a
 
0aabf7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
972a39a
4b4719a
 
 
0aabf7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4b4719a
 
ff8ad3e
4b4719a
 
 
 
 
972a39a
4b4719a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff8ad3e
4b4719a
 
 
 
 
972a39a
4b4719a
 
 
972a39a
4b4719a
 
0aabf7d
0290203
 
 
 
 
 
4b4719a
 
 
 
 
 
 
0aabf7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4b4719a
 
0aabf7d
4b4719a
0aabf7d
 
4b4719a
 
0aabf7d
4b4719a
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<!DOCTYPE html>
<html lang="ja">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Gemini Prompt Generator</title>
    <link href="https://unpkg.com/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"

        crossorigin="anonymous">
    <style>

        #query {

            min-height: 40vh;

        }



        #promptEn,

        #promptMyLanguage {

            min-height: 20vh;

        }



        #sidebar {

            position: fixed;

            top: 0;

            left: -250px;

            width: 250px;

            height: 100%;

            background-color: #343a40;

            transition: 0.3s;

            z-index: 1000;

        }



        #sidebar.active {

            left: 0;

        }



        #content {

            transition: margin-left 0.3s;

        }



        #content.active {

            margin-left: 250px;

        }



        #historyContainer::-webkit-scrollbar {

            width: 5px;

        }



        #historyContainer::-webkit-scrollbar-track {

            background: #f1f1f1;

        }



        #historyContainer::-webkit-scrollbar-thumb {

            background: #888;

        }



        #historyContainer::-webkit-scrollbar-thumb:hover {

            background: #555;

        }



        .comic-animation {

            width: 100%;

            height: auto;

            max-width: 680px;

            max-height: 680px;

            margin: 0 auto;

            background-size: contain;

            background-repeat: no-repeat;

            background-position: center;

            aspect-ratio: 1 / 1;

            animation: comic-frame-switch 6s step-end infinite;

        }



        @media (min-width: 768px) {

            .modal-dialog.modal-large {

                max-width: 700px;

            }

        }



        @media (max-width: 767px) {

            .comic-animation {

                width: 100%;

                height: auto;

            }

        }



        @keyframes comic-frame-switch {



            0%,

            50% {

                background-image: url("https://i.imgur.com/4A7K3TC.png");

            }



            50.01%,

            100% {

                background-image: url("https://i.imgur.com/LqLqwJi.png");

            }

        }

    </style>
</head>

<body data-bs-theme="dark">
    <div id="sidebar">
        <div class="p-3">
            <h3 id="settingsTitle" class="text-white">設定</h3>
            <div class="form-group mb-3">
                <label for="apiKey" class="form-label" id="apiKeyLabel">

                    <a href="https://aistudio.google.com/app/apikey?hl=ja" target="_blank">APIキー</a>
                </label>
                <input type="text" class="form-control" id="apiKey" placeholder="APIキーを入力してください">
            </div>
            <div class="form-group">
                <label for="characterCount" class="form-label" id="characterCountLabel">文字数</label>
                <input type="number" value="320" class="form-control" id="characterCount"

                    placeholder="生成するプロンプトの文字数を入力してください">
            </div>
            <div class="form-group">
                <label for="languageSelect" class="form-label" id="languageSelectLabel">Language</label>
                <select class="form-select" id="languageSelect">
                    <option value="ja">日本語</option>
                    <option value="en">English</option>
                    <option value="zh">中文</option>
                    <option value="ko">한국어</option>
                    <option value="fr">Français</option>
                    <option value="es">Español</option>
                    <option value="de">Deutsch</option>
                    <option value="it">Italiano</option>
                </select>
            </div>
            <div class="form-group mb-3">
                <label for="endpointSelect" class="form-label" id="endpointSelectLabel">エンドポイント</label>
                <select class="form-select" id="endpointSelect">
                    <option value="gemini-1.5-pro-exp-0827">gemini-1.5-pro-exp-0827</option>
                    <option value="gemini-1.5-flash-exp-0827">gemini-1.5-flash-exp-0827</option>
                    <option value="gemini-1.5-pro-latest">gemini-1.5-pro-latest</option>
                    <option value="gemini-1.5-flash-latest">gemini-1.5-flash-latest</option>

                </select>
            </div>

            <h3 class="text-white mt-4">履歴</h3>
            <div id="historyContainer" style="max-height: 300px; overflow-y: auto;">
                <ul id="historyList" class="list-group">
                    <!-- 履歴項目がここに動的に追加されます -->
                </ul>
                <p id="noHistoryMessage" class="text-white mt-2 d-none">履歴がありません。</p>
            </div>

            <!-- デバッグ用のモーダル表示ボタンを追加 -->
            <div class="mt-4">
                <button id="showLoadingModalButton" class="btn btn-secondary w-100">
                    ローディングモーダルを表示
                </button>
            </div>
        </div>
    </div>

    <div id="content">
        <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
            <div class="container-fluid">
                <button id="sidebarToggle" class="btn btn-outline-light me-2">
                    <i class="fas fa-bars"></i>
                </button>
                <a class="navbar-brand" href="#">Gemini Prompt Generator</a>
            </div>
        </nav>

        <div class="container mt-3">
            <div class="row">
                <div id="inputQuery" class="col-md-6 mb-4">
                    <div class="card">
                        <div class="card-header bg-primary text-white">
                            <h5 class="mb-0" id="inputQueryTitle">入力クエリ</h5>
                        </div>
                        <div class="card-body">
                            <div class="form-group">
                                <textarea class="form-control" id="query" placeholder="ここにクエリを入力してください"></textarea>
                            </div>
                        </div>
                        <div class="card-footer d-flex align-items-center">
                            <button id="generatePromptButton" class="btn btn-primary flex-grow-1 me-2"

                                onclick="generatePrompt()">
                                <i class="fas fa-magic me-2"></i><span id="generateButtonText">プロンプト生成</span>
                                <i class="fas fa-spinner fa-spin me-2 d-none" id="loading"></i>
                            </button>
                            <div class="form-check form-switch" id="splitStringsSwitchWrapper">
                                <input class="form-check-input" type="checkbox" id="splitStringsSwitch">
                                <label class="form-check-label" for="splitStringsSwitch">
                                    <i class="fas fa-shield-alt" id="splitStrings">分割送信</i>
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="outputPrompt" class="col-md-6 mb-4">
                    <div class="card">
                        <div class="card-header bg-success text-white">
                            <h5 class="mb-0" id="outputPromptTitle">生成されたプロンプト</h5>
                        </div>
                        <div class="card-body">
                            <div class="form-group">
                                <textarea class="form-control" id="promptEn"

                                    placeholder="英語のプロンプトがここに表示されます"></textarea>
                            </div>
                            <div class="form-group mt-3">
                                <textarea class="form-control" id="promptMyLanguage" disabled

                                    placeholder="日本訳がここに表示されます"></textarea>
                            </div>
                            <div class="form-group mt-3">
                                <label for="danbooruTags" class="form-label" id="danbooruTagsLabel">
                                    danbooru tags
                                </label>
                                <input type="text" class="form-control" id="danbooruTags" placeholder="danbooru tags"

                                    readonly>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="modal fade" id="loadingModal" tabindex="-1" aria-labelledby="loadingModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-large">
            <div class="modal-content bg-dark text-white">
                <div class="modal-body text-center">
                    <h5 id="loadingModalLabel">プロンプト生成中...</h5>
                    <div class="comic-animation"></div>
                </div>
            </div>
        </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/json5/2.2.3/index.min.js"

        integrity="sha512-44jdhc+R2TFfzBflS3/dGNEABiNUxBkkrqwO7GWTvGsj3HkQNr3GESvI9PUvAxmqxSnTosR0Ij9y3+o+6J1hig=="

        crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/i18next/23.14.0/i18next.min.js"

        integrity="sha512-8ANNUVMWPf6aWGXZqDhS4OXJWBCRxfjlW7lKfupuiG1FZah0ST6LiI2qnEb1L5mp05v/+0hn3s2FO4EwIbIgfA=="

        crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script

        src="https://cdnjs.cloudflare.com/ajax/libs/i18next-browser-languagedetector/8.0.0/i18nextBrowserLanguageDetector.min.js"

        integrity="sha512-8/RTkAM23B3lQzi6fmPs+Yf9qhIHzrzRpeSZsBsQ8OEmo95mbVp+68dB647VDCuyQIBbF+OIbS9b30aTWUkoog=="

        crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"

        integrity="sha384-HwwvtgBNo3bZJJLYd8oVXjrBZt8cqVSpeBNS5n7C8IVInixGAoxmnlMuBnhbgrkm"

        crossorigin="anonymous"></script>
    <script src="translation.js"></script>
    <script src="prompt.js"></script>
    <script src="storage.js"></script>
    <script src="history.js"></script>
    <script src="control.js"></script>

    <script>

        document.getElementById('showLoadingModalButton').addEventListener('click', function () {



            var loadingModal = new bootstrap.Modal(document.getElementById('loadingModal'));

            loadingModal.show();

        });

    </script>

</body>

</html>