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 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Knowledge Graph</title>
    <style>

        /* Reset and base styles */

        * {

            margin: 0;

            padding: 0;

            box-sizing: border-box;

        }



        body {

            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;

            height: 100vh;

            overflow: hidden;

            position: relative;

            background: linear-gradient(180deg, #F8F3E7 35%, #708686 90%);

        }



        /* Background Graph Network */

        .background-network {

            position: absolute;

            top: 0;

            left: 0;

            width: 100%;

            height: 100%;

            z-index: 1;

            pointer-events: none;

        }



        .network-lines {

            position: absolute;

            top: 0;

            left: 0;

            width: 100%;

            height: 100%;

            z-index: 1;

        }



        .network-nodes {

            position: absolute;

            top: 0;

            left: 0;

            width: 100%;

            height: 100%;

            z-index: 3;

        }



        .network-node {

            position: absolute;

            border-radius: 50%;

            opacity: 1;

        }



        .network-line {

            position: absolute;

            background-color: #5f6b7a;

            height: 1.5px;

            opacity: 0.4;

            transform-origin: left center;

        }



        /* Node colors and sizes - exact match to your design */

        .node-teal { background-color: #A9C5C5; }

        .node-purple-light { background-color: #DBCAE1; }

        .node-blue-light { background-color: #B0C4DE; }



        .node-small { width: 35px; height: 35px; }

        .node-medium { width: 50px; height: 50px; }

        .node-large { width: 85px; height: 85px; }



        /* Login Button as Network Node */

        .login-node {

            position: absolute;

            background-color: #64748b;

            border-radius: 50%;

            width: 80px;

            height: 80px;

            display: flex;

            flex-direction: column;

            align-items: center;

            justify-content: center;

            font-size: 12px;

            font-weight: 500;

            color: white;

            cursor: pointer;

            transition: all 0.3s ease;

            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

            z-index: 100;

            pointer-events: auto;

            opacity: 1;

        }



        .login-node:hover {

            background-color: #475569;

            transform: translateY(-2px);

            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);

        }



        .login-icon {

            font-size: 20px;

            margin-bottom: 2px;

        }



        /* Main Content */

        .main-content {

            position: relative;

            z-index: 10;

            height: 100vh;

            display: flex;

            flex-direction: column;

            justify-content: center;

            align-items: center;

            text-align: center;

            padding: 0 40px;

        }



        /* Title Section */

        .title-section {

            margin-bottom: 0px;

        }



        .main-title {

            font-family: 'Kumbh Sans', sans-serif;

            font-size: 4.5rem;

            font-weight: 700;

            color: #4D536D;

            letter-spacing: -0.02em;

            margin-top: 120px;

            line-height: 1.1;

        }



        .subtitle {

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

            font-size: 1.125rem;

            color: #4D536D;

            font-weight: 400;

            line-height: 1.6;

            max-width: 500px;

            margin: 0 auto 10px;

        }



        .subtitle-second {

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

            font-size: 1.125rem;

            color: #4D536D;

            font-weight: 400;

        }



        /* Search Section */

        /* Ganti max-width kalo mau ubah lebar */

        .search-container {

            width: 100%;

            max-width: 740px; 

            margin-top: 20px;

        }



        .search-input {

            width: 100%;

            padding: 16px 22px;

            font-size: 1rem;

            border: none;

            border-radius: 25px;

            background-color: rgb(243, 231, 221);

            color: #64748b;

            outline: none;

            transition: all 0.3s ease;

            box-shadow: 0 4px 4px rgba(0, 0, 0, 0.3);

            margin-bottom: 15px;

        }



        .search-input::placeholder {

            color: #797979;

            font-weight: 400;

        }



        .search-input:focus {

            background-color: rgba(255, 255, 255, 1);

            box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);

            transform: translateY(-2px);

        }



        .search-btn {

            background-color: #4D536D;

            color: white;

            border: none;

            border-radius: 20px;

            padding: 12px 32px;

            font-size: 1rem;

            font-weight: 500;

            cursor: pointer;

            transition: all 0.3s ease;

            box-shadow: 0 4px 4px rgba(0, 0, 0, 0.3);

        }



        .search-btn:hover {

            background-color: #475569;

            transform: translateY(-2px);

            box-shadow: 0 6px 20px rgba(100, 116, 139, 0.4);

        }



        .search-btn:active {

            transform: translateY(0);

        }



        /* Divider */

        .divider-container {

            display: flex;

            align-items: center;

            width: 100%;

            max-width: 400px;

            margin: 30px 0;

            margin-top: 15px;

        }



        .divider-line {

            flex: 1;

            height: 1px;

            background-color: rgb(255 255 255);

        }



        .divider-text {

            margin: 0 20px;

            color: #FFFFFF;

            font-size: 1rem;

            font-weight: 500;

        }



        /* Explore Button */

        .explore-btn {

            background-color: #4D536D;

            color: white;

            border: none;

            border-radius: 25px;

            padding: 16px 48px;

            font-size: 1rem;

            font-weight: 500;

            cursor: pointer;

            transition: all 0.3s ease;

            box-shadow: 0 4px 4px rgba(0, 0, 0, 0.3);

            width: 100%;

            max-width: 520px;

        }



        .explore-btn:hover {

            background-color: #475569;

            transform: translateY(-3px);

            box-shadow: 0 8px 30px rgba(100, 116, 139, 0.4);

        }



        .explore-btn:active {

            transform: translateY(-1px);

        }



        /* Responsive Design */

        @media (max-width: 768px) {

            .main-title {

                font-size: 3rem;

            }

            

            .subtitle, .subtitle-second {

                font-size: 1rem;

            }

            

            .main-content {

                padding: 0 20px;

            }

            

            .login-btn {

                width: 60px;

                height: 60px;

                font-size: 10px;

            }

            

            .login-icon {

                font-size: 16px;

            }

        }



        @media (max-width: 480px) {

            .main-title {

                font-size: 2.5rem;

            }

            

            .login-container {

                top: 20px;

                right: 20px;

            }

        }



        /* Animation for network elements */

        @keyframes float {

            0%, 100% { transform: translateY(0px); }

            50% { transform: translateY(-10px); }

        }



        .network-node {

            animation: float 6s ease-in-out infinite;

        }



        .network-node:nth-child(2n) {

            animation-delay: -2s;

        }



        .network-node:nth-child(3n) {

            animation-delay: -4s;

        }

    </style>
</head>
<body>
    <!-- Background Network -->
    <div class="background-network" id="backgroundNetwork">
        <div class="network-lines" id="networkLines"></div>
        <div class="network-nodes" id="networkNodes"></div>
    </div>

    <!-- Main Content -->
    <div class="main-content">
        <div class="title-section">
            <h1 class="main-title">KNOWLEDGE GRAPH</h1>
            <p class="subtitle">Explore health insights powered by national news</p>
            <p class="subtitle-second">ask, discover, and learn.</p>
        </div>

        <div class="search-container">
            <input 

                type="text" 

                class="search-input" 

                id="queryInput"

                placeholder="Type Query"

                onkeypress="handleKeyPress(event)"

            >
            <button class="search-btn" onclick="handleSearch()">Search</button>
        </div>

        <div class="divider-container">
            <div class="divider-line"></div>
            <span class="divider-text">OR</span>
            <div class="divider-line"></div>
        </div>

        <button class="explore-btn" onclick="handleExplore()">Explore Knowledge Graph</button>
    </div>

    <script>

        // Create background network - exact placement matching your image

        function createBackgroundNetwork() {

            const linesContainer = document.getElementById('networkLines');

            const nodesContainer = document.getElementById('networkNodes');

            const nodes = [];

            

            // Exact node positions from your image

            const nodeConfigs = [

                // Top row (left to right, some truncated)

                { x: -1, y: -3, size: 'large', color: 'blue-light' }, 

                { x: 16, y: 3, size: 'medium', color: 'purple-light' },

                { x: 32, y: -5, size: 'large', color: 'teal' },

                { x: 55, y: 2, size: 'medium', color: 'blue-light' },

                { x: 68, y: -4, size: 'small', color: 'purple-light' },

                { x: 86, y: -1, size: 'small', color: 'purple-light' },

                { x: 100, y: -1, size: 'small', color: 'blue-light' },

                

                // Login node (top right as in image)

                { x: 92, y: 2, size: 'login', color: 'login' },

                

                // Second row

                { x: 7, y: 15, size: 'small', color: 'teal' },

                { x: 25, y: 12, size: 'small', color: 'blue-light' },

                { x: 44, y: 12, size: 'medium', color: 'purple-light' },

                { x: 58, y: 15, size: 'small', color: 'teal' },

                { x: 72, y: 6, size: 'large', color: 'purple-light' },

                { x: 82, y: 11, size: 'small', color: 'teal' },

                

                // Third row (more scattered)

                { x: 32, y: 18, size: 'medium', color: 'blue-light' },

                { x: 100, y: 15, size: 'small', color: 'teal' },

            ];



            // Create nodes including login

            nodeConfigs.forEach((config, index) => {

                if (config.color === 'login') {

                    const loginNode = document.createElement('div');

                    loginNode.className = 'login-node';

                    loginNode.style.left = `${config.x}%`;

                    loginNode.style.top = `${config.y}%`;

                    loginNode.style.animation = 'float 6s ease-in-out infinite';

                    loginNode.style.animationDelay = '-2s';

                    loginNode.onclick = handleLogin;

                    loginNode.innerHTML = `

                        <div class="login-icon">👤</div>

                        <div>Login</div>

                    `;

                    nodesContainer.appendChild(loginNode);

                } else {

                    const node = document.createElement('div');

                    node.className = `network-node node-${config.size} node-${config.color}`;

                    node.style.left = `${config.x}%`;

                    node.style.top = `${config.y}%`;

                    nodesContainer.appendChild(node);

                }

                

                nodes.push({

                    x: config.x,

                    y: config.y,

                    index: index,

                    isLogin: config.color === 'login'

                });

            });



            // Connections matching your image exactly

            const connections = [

                // Top row main connections

                [0, 1], [1, 2], [2, 3], [3, 4], [4, 5],

                

                // Login connections (as shown in image)

                [7, 5], [7, 13], [7, 6], [7, 15],

                

                // Vertical connections from top to second row

                [0, 8], [1, 9], [2, 9], [3, 10], [5, 12], [12, 13], [3, 12],

                

                // Second row horizontal connections

                [8, 9], [10, 11], [11, 12],

                

                // Connections to third row

                [9, 14], [10, 14],

                

                // Some cross connections for the web-like structure

                [2, 10], [4, 12]

            ];



            // Create connection lines

            connections.forEach(([startIdx, endIdx]) => {

                const startNode = nodes[startIdx];

                const endNode = nodes[endIdx];

                

                if (startNode && endNode) {

                    const line = document.createElement('div');

                    line.className = 'network-line';

                    

                    const startSize = startNode.isLogin ? 40 : 20;

                    const endSize = endNode.isLogin ? 40 : 20;

                    

                    const startX = (startNode.x * window.innerWidth) / 100 + startSize;

                    const startY = (startNode.y * window.innerHeight) / 100 + startSize;

                    const endX = (endNode.x * window.innerWidth) / 100 + endSize;

                    const endY = (endNode.y * window.innerHeight) / 100 + endSize;

                    

                    const length = Math.sqrt(Math.pow(endX - startX, 2) + Math.pow(endY - startY, 2));

                    const angle = Math.atan2(endY - startY, endX - startX) * 180 / Math.PI;

                    

                    line.style.left = `${startX}px`;

                    line.style.top = `${startY}px`;

                    line.style.width = `${length}px`;

                    line.style.transform = `rotate(${angle}deg)`;

                    

                    linesContainer.appendChild(line);

                }

            });

        }



        // Event handlers

        function handleLogin() {

            alert('Login functionality will be implemented when you provide the login page design.');

            console.log('Login clicked');

        }



        function handleSearch() {

            const query = document.getElementById('queryInput').value.trim();

            if (query) {

                // Navigate to results page with query parameter

                window.location.href = `search.html?q=${encodeURIComponent(query)}`;

            } else {

                alert('Please enter a query to search.');

            }

        }



        function handleExplore() {

            // alert('Explore Knowledge Graph functionality will be implemented when you provide the graph page design.');

            console.log('Explore Knowledge Graph clicked');

            window.location.href = 'explorepage.html'; // Change this line

        }



        function handleKeyPress(event) {

            if (event.key === 'Enter') {

                handleSearch();

            }

        }



        // Initialize the background network when page loads

        window.addEventListener('load', () => {

            createBackgroundNetwork();

        });



        // Recreate network on window resize

        window.addEventListener('resize', () => {

            document.getElementById('networkLines').innerHTML = '';

            document.getElementById('networkNodes').innerHTML = '';

            createBackgroundNetwork();

        });



        // Add some interactivity to the input

        document.addEventListener('DOMContentLoaded', () => {

            const input = document.getElementById('queryInput');

            

            input.addEventListener('focus', () => {

                input.style.transform = 'translateY(-2px)';

            });

            

            input.addEventListener('blur', () => {

                input.style.transform = 'translateY(0)';

            });

        });

    </script>
</body>
</html>