64 lines
1.6 KiB
HTML
64 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Responsive Page with Bulma</title>
|
|
<!-- Bulma CSS -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.2/css/bulma.min.css">
|
|
<style>
|
|
/* Centering the content */
|
|
body {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 100vh;
|
|
margin: 0;
|
|
}
|
|
|
|
/* Styling the results box */
|
|
#results-box {
|
|
margin-top: 20px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="container">
|
|
<div class="columns is-centered">
|
|
<div class="column is-half">
|
|
<!-- Search Bar -->
|
|
<input type="text" class="input" id="searchInput" placeholder="Type something and press Enter">
|
|
|
|
<!-- Results Box -->
|
|
<div id="results-box" class="mt-3"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Custom JavaScript for handling the search -->
|
|
<script>
|
|
document.getElementById('searchInput').addEventListener('keyup', function (event) {
|
|
if (event.key === 'Enter') {
|
|
handleSearch();
|
|
}
|
|
});
|
|
|
|
function handleSearch() {
|
|
var searchInput = document.getElementById('searchInput');
|
|
var searchTerm = searchInput.value;
|
|
|
|
if (searchTerm.trim() !== '') {
|
|
// Append result to the results box
|
|
var resultsBox = document.getElementById('results-box');
|
|
resultsBox.innerHTML += '<div class="notification is-success">Result: ' + searchTerm + '</div>';
|
|
|
|
// Clear the search input
|
|
searchInput.value = '';
|
|
}
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|