File size: 7,085 Bytes
e2ce00f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="fa">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>جستجوی معنایی خاطرات</title>
    <link rel="stylesheet" href="fonts/vazirmatn.css">
    <style>

        body {

            font-family: 'Vazirmatn', sans-serif;

            direction: rtl;

            text-align: right;

            margin: 20px;

            line-height: 1.6;

            background-color: #f4f4f4;

            color: #333;

        }

        .container {

            max-width: 800px;

            margin: auto;

            background: #fff;

            padding: 20px;

            border-radius: 8px;

            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);

        }

        h1, h2, h3 {

            text-align: center;

            color: #555;

            font-family: 'Vazirmatn', sans-serif;

        }

        .search-section, .results-section, .book-selection-section, .results-control-section {

            margin-bottom: 20px;

            padding: 15px;

            border: 1px solid #ddd;

            border-radius: 5px;

            background-color: #f9f9f9;

        }

        .book-selection-section h3, .results-control-section h3 {

            margin-top: 0;

            border-bottom: 1px solid #eee;

            padding-bottom: 10px;

            margin-bottom: 10px;

            font-family: 'Vazirmatn', sans-serif;

        }

        .book-list label {

            display: block;

            margin-bottom: 8px;

            cursor: pointer;

            font-family: 'Vazirmatn', sans-serif;

        }

        .book-list input[type="checkbox"] {

            margin-left: 5px;

        }

        #select_all_books_label {

            font-weight: bold;

        }

        #loadingStatus, #selectionError {

            margin-top: 10px;

            font-style: italic;

            font-weight: bold;

            color: #666;

            font-family: 'Vazirmatn', sans-serif;

        }

        #selectionError {

            color: red;

        }

        label {

            display: block;

            margin-bottom: 8px;

            font-weight: bold;

            font-family: 'Vazirmatn', sans-serif;

        }

        input[type="text"], button, select {

            padding: 10px;

            border: 1px solid #ccc;

            border-radius: 4px;

            font-size: 1rem;

            box-sizing: border-box;

            font-family: 'Vazirmatn', sans-serif !important;

            vertical-align: middle;

        }

        input[type="text"] {

            min-height: 40px;

        }

        button {

            background-color: #5cb85c;

            color: white;

            border: none;

            cursor: pointer;

        }

        button:hover {

            background-color: #4cae4c;

        }

        button:disabled {

            background-color: #d3d3d3;

            cursor: not-allowed;

        }

        select {

            padding: 8px;

            font-size: 0.9rem;

        }

        .search-input-container {

            display: flex;

            align-items: center;

            gap: 10px;

            width: 100%;

            box-sizing: border-box;

            max-width: 700px;

        }

        .search-input-container input[type="text"] {

            flex: 1 1 auto;

            min-width: 200px;

            max-width: 600px;

            margin: 0;

            box-sizing: border-box;

        }

        .search-input-container button {

            flex: 0 0 auto;

            width: 90px;

            margin: 0;

            box-sizing: border-box;

            height: 40px;

        }

        .results-control-section label {

            display: inline-block;

            margin-left: 10px;

            font-weight: normal;

            font-family: 'Vazirmatn', sans-serif;

        }

        .result-item {

            border-bottom: 1px solid #eee;

            padding: 10px 0;

            margin-bottom: 10px;

        }

        .result-item:last-child {

            border-bottom: none;

            margin-bottom: 0;

        }

        .result-reference {

            font-size: 0.9em;

            color: #555;

            margin-bottom: 5px;

            font-family: 'Vazirmatn', sans-serif;

        }

        .result-book-title {

            font-size: 0.8em;

            color: #777;

            margin-bottom: 5px;

            font-style: italic;

            font-family: 'Vazirmatn', sans-serif;

        }

        .result-passage {

            margin-bottom: 5px;

            font-family: 'Vazirmatn', sans-serif;

        }

        .result-similarity {

            font-size: 0.8em;

            color: #007bff;

            text-align: left;

            font-family: 'Vazirmatn', sans-serif;

        }

    </style>
</head>
<body>
    <div class="container">
        <h1>جستجوی معنایی خاطرات دوران پهلوی</h1>

        <div class="book-selection-section">
            <h3>انتخاب کتاب‌ها برای جستجو:</h3>
            <div class="book-list">
                <label id="select_all_books_label">
                    <input type="checkbox" id="select_all_books">
                    انتخاب همه موارد
                </label>
                <label>
                    <input type="checkbox" class="book-checkbox" id="jabe_siah_checkbox" value="jabe_siah.json" checked>
                    جعبه سیاه (منتخب خاطرات اسدالله علم)
                </label>
            </div>
            <p id="loadingStatus"></p>
            <p id="selectionError"></p>
        </div>

        <div class="search-section">
            <label for="userQuestion">سوال شما:</label>
            <div class="search-input-container">
                <input type="text" id="userQuestion" placeholder="عبارت مورد نظر برای جستجو را وارد کنید...">
                <button id="searchButton" disabled>جستجو</button>
            </div>
        </div>

        <div class="results-control-section">
            <h3>کنترل نمایش نتایج:</h3>
            <label for="resultsPerPage">تعداد نتایج برتر برای نمایش:</label>
            <select id="resultsPerPage">
                <option value="10">10</option>
                <option value="20">20</option>
                <option value="30">30</option>
                <option value="50">50</option>
                <option value="100">100</option>
            </select>
        </div>

        <div class="results-section">
            <h2>نتایج جستجو:</h2>
            <div id="searchResults">
                <p>پس از انتخاب کتاب‌ها و وارد کردن سوال، نتایج اینجا نمایش داده می‌شوند.</p>
            </div>
        </div>
    </div>

    <script src="script.js"></script>
</body>
</html>