This repository was archived by the owner on Jun 19, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
179 lines (154 loc) · 8.22 KB
/
Copy pathindex.html
File metadata and controls
179 lines (154 loc) · 8.22 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CyberCraft Security</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q10DW7YJPC"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Q10DW7YJPC');
</script>
</head>
<body>
<header>
<img src="images/symbol.png" alt="CyberCraft" class="logo">
<h1>CyberCraft Security</h1>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li>
<a href="#">More</a>
<ul>
<li><a href="projects.html">Projects</a></li>
<li><a href="blog.html">Blog</a></li>
<li><a href="art.html">AI Art</a></li>
</ul>
</li>
</ul>
</nav>
</header>
<main class="container">
<section>
<h2>Welcome to CyberCraft Security</h2>
<p>At CyberCraft Security, we're passionate about cybersecurity and dedicated to making the digital world a safer place. With a background in the trades and a wealth of experience in security engineering, we tackle technical challenges head-on, never giving up until the problem is solved.</p>
<p>We hope you'll take some time to look around the site and learn more about the variety of topics we have been working on.</p>
</section>
<section>
<h2>Cybersecurity in the Digital Age</h2>
<p>In today's interconnected world, cybersecurity has become a crucial aspect of our daily lives. With the rapid advancement of technology, the risk of cyber attacks has also increased significantly. From personal data breaches to large-scale corporate hacks, no one is immune to the dangers of cyber threats.</p>
<p>At CyberCraft Security, we understand the importance of staying ahead of the curve when it comes to cybersecurity. We continuously monitor the latest trends and vulnerabilities in the digital landscape.</p>
</section>
<section>
<h2>Artificial Intelligence and Cybersecurity</h2>
<p>Artificial Intelligence (AI) has been a game-changer in many different industries, and especially with cybersecurity. With its ability to analyze vast amounts of data and identify patterns, AI has become an invaluable tool in detecting and preventing cyber threats.</p>
<p>At CyberCraft Security, we leverage the power of AI to enhance our security endeavors and try to understand the deeper patterns that lead to conclusions given.</p>
</section>
<section>
<div class="search-bar">
<input type="text" placeholder="Search site..." id="searchInput">
<div id="searchResultsDropdown" class="search-results-dropdown"></div> <!-- Dropdown for displaying search results -->
</div>
</section>
</main>
<footer>
<p>© 2024 CyberCraft Security. All rights reserved.</p>
</footer>
<!--
<script>
const searchInput = document.getElementById('searchInput');
const searchResultsDropdown = document.getElementById('searchResultsDropdown');
searchInput.addEventListener('input', function() {
const searchTerm = searchInput.value.toLowerCase();
const pages = ['blog.html', 'projects.html', 'about.html', 'art.html'];
// Clear previous search results
searchResultsDropdown.innerHTML = '';
// Fetch content from each page and search for the term
Promise.all(pages.map(page => fetch(page).then(response => response.text())))
.then(contents => {
contents.forEach((content, index) => {
const parser = new DOMParser();
const doc = parser.parseFromString(content, 'text/html');
const pageTitle = doc.title;
const pageResults = Array.from(doc.querySelectorAll('h1, h2, h3, p')).filter(element => element.textContent.toLowerCase().includes(searchTerm));
displaySearchResults(pageTitle, pageResults, pages[index]);
});
})
.catch(error => {
console.error('Error fetching page:', error);
});
});
// Function to display search results in the dropdown
function displaySearchResults(pageTitle, matches, pageUrl) {
if (matches.length > 0) {
const dropdownItem = document.createElement('div');
dropdownItem.classList.add('dropdown-item');
const pageHeader = document.createElement('h3');
pageHeader.textContent = pageTitle;
dropdownItem.appendChild(pageHeader);
matches.forEach(match => {
const resultItem = document.createElement('div');
resultItem.textContent = match.textContent;
dropdownItem.appendChild(resultItem);
});
const pageLink = document.createElement('a');
pageLink.href = pageUrl;
pageLink.textContent = 'Go to page';
dropdownItem.appendChild(pageLink);
searchResultsDropdown.appendChild(dropdownItem);
}
}
</script>-->
<script>
const searchInput = document.getElementById('searchInput');
const searchResultsDropdown = document.getElementById('searchResultsDropdown');
// Function to handle search input
const handleSearchInput = async () => {
const searchTerm = searchInput.value.trim().toLowerCase();
const pages = ['blog.html', 'projects.html', 'about.html', 'art.html'];
// Clear previous search results
searchResultsDropdown.innerHTML = '';
try {
// Fetch content from each page and search for the term
const responses = await Promise.all(pages.map(page => fetch(page)));
const contents = await Promise.all(responses.map(response => response.text()));
contents.forEach((content, index) => {
const doc = new DOMParser().parseFromString(content, 'text/html');
const pageTitle = doc.title;
const pageResults = Array.from(doc.querySelectorAll('h1, h2, h3, p')).filter(element => element.textContent.toLowerCase().includes(searchTerm));
displaySearchResults(pageTitle, pageResults, pages[index]);
});
} catch (error) {
console.error('Error fetching or parsing page:', error);
}
};
// Function to display search results in the dropdown
const displaySearchResults = (pageTitle, matches, pageUrl) => {
if (matches.length > 0) {
const dropdownItem = document.createElement('div');
dropdownItem.classList.add('dropdown-item');
const pageHeader = document.createElement('h3');
pageHeader.textContent = pageTitle;
dropdownItem.appendChild(pageHeader);
matches.forEach(match => {
const resultItem = document.createElement('div');
resultItem.textContent = match.textContent;
dropdownItem.appendChild(resultItem);
});
const pageLink = document.createElement('a');
pageLink.href = pageUrl;
pageLink.textContent = 'Go to page';
dropdownItem.appendChild(pageLink);
searchResultsDropdown.appendChild(dropdownItem);
}
};
// Event listener for search input
searchInput.addEventListener('input', handleSearchInput);
</script>
</body>
</html>