Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
D
Distributed-Search-Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tammam.alsoleman
Distributed-Search-Engine
Commits
fdec0831
Commit
fdec0831
authored
Jan 21, 2026
by
tammam.alsoleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create the index.html for web
parent
a8f0b211
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
238 additions
and
0 deletions
+238
-0
index.html
src/main/resources/index.html
+238
-0
No files found.
src/main/resources/index.html
0 → 100644
View file @
fdec0831
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Distributed Engine | Navy Edition
</title>
<link
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
>
<link
href=
"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap"
rel=
"stylesheet"
>
<style>
:root
{
/* Navy Color Palette */
--primary-dark
:
#0f172a
;
--primary-navy
:
#1e3a8a
;
--accent-blue
:
#3b82f6
;
--bg
:
#f8fafc
;
--text-main
:
#1e293b
;
--text-muted
:
#64748b
;
--card-border
:
#e2e8f0
;
}
body
{
font-family
:
'Inter'
,
sans-serif
;
background-color
:
var
(
--bg
);
color
:
var
(
--text-main
);
margin
:
0
;
padding
:
0
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
min-height
:
100vh
;
}
/* Modern Navy Header */
header
{
width
:
100%
;
background
:
linear-gradient
(
135deg
,
var
(
--primary-dark
)
0%
,
var
(
--primary-navy
)
100%
);
padding
:
50px
0
;
color
:
white
;
text-align
:
center
;
margin-bottom
:
-40px
;
box-shadow
:
0
4px
15px
rgba
(
0
,
0
,
0
,
0.2
);
}
header
h1
{
margin
:
0
;
font-size
:
2.6rem
;
font-weight
:
700
;
letter-spacing
:
-0.5px
;
}
header
p
{
opacity
:
0.8
;
font-weight
:
300
;
margin-top
:
8px
;
font-size
:
1.1rem
;
}
/* Main Search Area */
.main-container
{
width
:
90%
;
max-width
:
850px
;
background
:
white
;
border-radius
:
12px
;
padding
:
40px
;
box-shadow
:
0
20px
25px
-5px
rgba
(
0
,
0
,
0
,
0.05
);
margin-bottom
:
50px
;
z-index
:
10
;
border
:
1px
solid
var
(
--card-border
);
}
.search-wrapper
{
display
:
flex
;
gap
:
12px
;
margin-bottom
:
25px
;
}
input
[
type
=
"text"
]
{
flex
:
1
;
padding
:
16px
20px
;
border
:
2px
solid
var
(
--card-border
);
border-radius
:
8px
;
font-size
:
1rem
;
transition
:
all
0.3s
;
outline
:
none
;
background-color
:
#ffffff
;
}
input
[
type
=
"text"
]
:focus
{
border-color
:
var
(
--accent-blue
);
box-shadow
:
0
0
0
4px
rgba
(
59
,
130
,
246
,
0.1
);
}
button
#searchBtn
{
padding
:
0
35px
;
background
:
var
(
--primary-navy
);
color
:
white
;
border
:
none
;
border-radius
:
8px
;
font-weight
:
600
;
cursor
:
pointer
;
transition
:
all
0.3s
;
display
:
flex
;
align-items
:
center
;
gap
:
8px
;
}
button
#searchBtn
:hover
{
background
:
var
(
--primary-dark
);
transform
:
translateY
(
-1px
);
}
/* Stats Bar */
.stats-bar
{
display
:
flex
;
justify-content
:
space-between
;
padding
:
14px
20px
;
background
:
#f1f5f9
;
border-radius
:
6px
;
margin-bottom
:
25px
;
font-size
:
0.9rem
;
color
:
var
(
--text-muted
);
display
:
none
;
border-left
:
4px
solid
var
(
--primary-navy
);
}
/* Results Display */
.results-list
{
display
:
flex
;
flex-direction
:
column
;
gap
:
12px
;
}
.result-card
{
padding
:
18px
;
border
:
1px
solid
var
(
--card-border
);
border-radius
:
10px
;
transition
:
all
0.3s
;
display
:
flex
;
align-items
:
center
;
gap
:
18px
;
animation
:
slideUp
0.4s
ease
forwards
;
}
.result-card
:hover
{
border-color
:
var
(
--accent-blue
);
background-color
:
#fcfdfe
;
transform
:
translateX
(
5px
);
}
.icon-box
{
background
:
#eff6ff
;
color
:
var
(
--primary-navy
);
padding
:
12px
;
border-radius
:
8px
;
font-size
:
1.3rem
;
border
:
1px
solid
#dbeafe
;
}
.res-content
{
flex
:
1
;
}
.res-title
{
font-weight
:
700
;
color
:
var
(
--primary-dark
);
font-size
:
1.05rem
;
margin-bottom
:
4px
;
}
.res-meta
{
font-size
:
0.85rem
;
color
:
var
(
--text-muted
);
display
:
flex
;
gap
:
15px
;
}
.res-score
{
color
:
#059669
;
font-weight
:
700
;
}
/* أخضر غامق للنسبة */
/* Pagination Styles */
.pagination
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
gap
:
12px
;
margin-top
:
30px
;
display
:
none
;
}
.nav-btn
{
background
:
white
;
border
:
1px
solid
var
(
--card-border
);
padding
:
10px
22px
;
border-radius
:
6px
;
cursor
:
pointer
;
font-weight
:
600
;
color
:
var
(
--primary-navy
);
transition
:
all
0.2s
;
}
.nav-btn
:hover:not
(
:disabled
)
{
background
:
var
(
--primary-navy
);
color
:
white
;
border-color
:
var
(
--primary-navy
);
}
.nav-btn
:disabled
{
opacity
:
0.4
;
cursor
:
not-allowed
;
}
/* Animations */
@keyframes
slideUp
{
from
{
opacity
:
0
;
transform
:
translateY
(
15px
);
}
to
{
opacity
:
1
;
transform
:
translateY
(
0
);
}
}
.loader
{
display
:
none
;
border
:
3px
solid
#f3f3f3
;
border-top
:
3px
solid
var
(
--primary-navy
);
border-radius
:
50%
;
width
:
25px
;
height
:
25px
;
animation
:
spin
1s
linear
infinite
;
margin
:
20px
auto
;
}
@keyframes
spin
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
360deg
);
}
}
</style>
</head>
<body>
<header>
<h1><i
class=
"fas fa-server"
></i>
Distributed Search System
</h1>
<p>
Scaling TF-IDF Algorithm across an Intelligent Cluster
</p>
</header>
<div
class=
"main-container"
>
<div
class=
"search-wrapper"
>
<input
type=
"text"
id=
"query"
placeholder=
"Search thousands of documents instantly..."
>
<button
id=
"searchBtn"
onclick=
"newSearch()"
>
<i
class=
"fas fa-bolt"
></i>
Search
</button>
</div>
<div
class=
"stats-bar"
id=
"statsBar"
>
<span><i
class=
"fas fa-check-circle"
></i>
Results Found:
<strong
id=
"totalRes"
style=
"color:var(--primary-dark)"
>
0
</strong></span>
<span><i
class=
"fas fa-tachometer-alt"
></i>
Speed:
<strong
id=
"timeTaken"
style=
"color:var(--primary-dark)"
>
0
</strong>
ms
</span>
</div>
<div
class=
"loader"
id=
"loader"
></div>
<div
class=
"results-list"
id=
"results"
></div>
<div
class=
"pagination"
id=
"pagination"
>
<button
class=
"nav-btn"
id=
"prevBtn"
onclick=
"changePage(-1)"
>
Previous
</button>
<span
id=
"pageInfo"
style=
"font-weight: 600; font-size: 0.9rem; color: var(--text-muted);"
>
Page 1
</span>
<button
class=
"nav-btn"
id=
"nextBtn"
onclick=
"changePage(1)"
>
Next
</button>
</div>
</div>
<script>
let
allResults
=
[];
let
currentPage
=
1
;
const
pageSize
=
10
;
async
function
newSearch
()
{
currentPage
=
1
;
await
performSearch
();
}
async
function
performSearch
()
{
const
query
=
document
.
getElementById
(
'query'
).
value
.
trim
();
if
(
!
query
)
return
;
const
resultsDiv
=
document
.
getElementById
(
'results'
);
const
loader
=
document
.
getElementById
(
'loader'
);
const
statsBar
=
document
.
getElementById
(
'statsBar'
);
const
pagination
=
document
.
getElementById
(
'pagination'
);
resultsDiv
.
innerHTML
=
""
;
loader
.
style
.
display
=
"block"
;
statsBar
.
style
.
display
=
"none"
;
pagination
.
style
.
display
=
"none"
;
const
startTime
=
performance
.
now
();
try
{
const
response
=
await
fetch
(
`/api/search?query=
${
encodeURIComponent
(
query
)}
`
);
if
(
!
response
.
ok
)
throw
new
Error
(
"Leader node unresponsive"
);
allResults
=
await
response
.
json
();
const
endTime
=
performance
.
now
();
document
.
getElementById
(
'totalRes'
).
innerText
=
allResults
.
length
;
document
.
getElementById
(
'timeTaken'
).
innerText
=
(
endTime
-
startTime
).
toFixed
(
0
);
loader
.
style
.
display
=
"none"
;
statsBar
.
style
.
display
=
"flex"
;
render
();
}
catch
(
e
)
{
loader
.
style
.
display
=
"none"
;
resultsDiv
.
innerHTML
=
`<div style="text-align:center; color:#dc2626; padding:20px;">
<i class="fas fa-wifi-slash"></i> Error:
${
e
.
message
}
</div>`
;
}
}
function
render
()
{
const
resultsDiv
=
document
.
getElementById
(
'results'
);
const
start
=
(
currentPage
-
1
)
*
pageSize
;
const
pageData
=
allResults
.
slice
(
start
,
start
+
pageSize
);
resultsDiv
.
innerHTML
=
""
;
if
(
allResults
.
length
===
0
)
{
resultsDiv
.
innerHTML
=
"<p style='text-align:center; color:gray;'>No relevant documents found.</p>"
;
return
;
}
pageData
.
forEach
((
item
,
idx
)
=>
{
const
name
=
item
.
documentName_
||
item
.
documentName
||
"Unknown"
;
const
score
=
item
.
score_
||
item
.
score
||
0
;
resultsDiv
.
innerHTML
+=
`
<div class="result-card">
<div class="icon-box"><i class="fas fa-file-invoice"></i></div>
<div class="res-content">
<div class="res-title">Document #
${
name
}
</div>
<div class="res-meta">
<span>Rank: <strong>
${
start
+
idx
+
1
}
</strong></span>
<span>Relativity: <span class="res-score">
${(
score
*
100
).
toFixed
(
4
)}
%</span></span>
</div>
</div>
</div>`
;
});
document
.
getElementById
(
'pagination'
).
style
.
display
=
"flex"
;
document
.
getElementById
(
'pageInfo'
).
innerText
=
`Page
${
currentPage
}
of
${
Math
.
ceil
(
allResults
.
length
/
pageSize
)}
`
;
document
.
getElementById
(
'prevBtn'
).
disabled
=
(
currentPage
===
1
);
document
.
getElementById
(
'nextBtn'
).
disabled
=
(
start
+
pageSize
>=
allResults
.
length
);
}
function
changePage
(
step
)
{
currentPage
+=
step
;
render
();
window
.
scrollTo
({
top
:
0
,
behavior
:
'smooth'
});
}
</script>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment