write html and css file for a page that has info for phd student with three key words for there research and threee keywords for there usecase. and this page should allow people to find who is working on a specific usecase. let it have couple of examples in it. and make it elegent but simple with beautiful business colors
Assistant
Certainly! Below is an example of an HTML and CSS file for a page that lists PhD students with their research keywords and use case keywords. The page also allows users to search for PhD students working on a specific use case keyword. I've included a few examples to illustrate how it works. The design is kept elegant and simple, using professional business colors.
index.html
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>PhD Students Research Directory</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>PhD Students Research Directory</h1>
</header>
<main>
<div class="search-container">
<input type="text" id="searchInput" placeholder="Search use case keywords...">
</div>
<div class="student-list" id="studentList">
<!-- Student Example 1 -->
<div class="student-card">
<h2>Jane Doe</h2>
<p><strong>Research Keywords:</strong> Machine Learning, Data Mining, Artificial Intelligence</p>
<p><strong>Use Case Keywords:</strong> Healthcare, Diagnostics, Patient Monitoring</p>
</div>
<!-- Student Example 2 -->
<div class="student-card">
<h2>John Smith</h2>
<p><strong>Research Keywords:</strong> Cybersecurity, Cryptography, Networks</p>
<p><strong>Use Case Keywords:</strong> Banking, Secure Transactions, Authentication</p>
</div>
<!-- Student Example 3 -->
<div class="student-card">
<h2>Emily Johnson</h2>
<p><strong>Research Keywords:</strong> Robotics, Automation, Control Systems</p>
<p><strong>Use Case Keywords:</strong> Manufacturing, Industry 4.0, Supply Chain</p>
</div>
<!-- Add more student cards as needed -->
</div>
</main>
<script src="script.js"></script>
</body>
</html>
// Search Functionality
document.getElementById('searchInput').addEventListener('keyup', function() {
// Get the search input and convert to uppercase for case-insensitive search
let filter = this.value.toUpperCase();
// Get all student cards
let studentCards = document.getElementsByClassName('student-card');
// Loop through all student cards
for (let i = 0; i < studentCards.length; i++) {
// Get the use case keywords paragraph
let useCaseKeywords = studentCards[i].getElementsByTagName('p')[1];
if (useCaseKeywords) {
let txtValue = useCaseKeywords.textContent || useCaseKeywords.innerText;
// Check if the use case keywords include the search input
if (txtValue.toUpperCase().indexOf(filter) > -1) {
studentCards[i].style.display = "";
} else {
studentCards[i].style.display = "none";
}
}
}
});
Explanation and How to Use
HTML Structure:
The index.html file sets up the structure of the page, including a header, a search input field, and a list of student cards.
Each student card contains the student's name, research keywords, and use case keywords.
You can add more student cards by copying the <div class="student-card"> block and filling in the relevant information.
Styling with CSS:
The styles.css file applies styles to the HTML elements to create an elegant and professional look.
Business colors like deep blue (#004080) are used for headers and highlights.
The font is set to a clean sans-serif for readability.
The layout is responsive, with student cards wrapping as needed.
Search Functionality:
The script.js file adds interactivity to the page, allowing users to search for PhD students by use case keywords.
As the user types into the search input, the script filters the student cards in real-time.
The search is case-insensitive and checks if the use case keywords contain the input text.
How It Works:
Filtering: The JavaScript function listens for keyup events on the search input field.
Matching: It converts both the search input and the use case keywords to uppercase to perform a case-insensitive comparison.
Displaying Results: Student cards that match the search query remain visible, while others are hidden.
Adding More Students:
To add more students, simply duplicate one of the existing student card <div> elements and modify the content.
Ensure that each student card follows the same structure for the search functionality to work correctly.
Business Design Elements:
The overall design uses a minimalistic approach with a focus on content clarity.
The colors are chosen to reflect a professional and corporate aesthetic.
Elements like borders, shadows, and spacing are used subtly to enhance the visual appeal without clutter.
Preview
Here's how the page would look:
[image: PhD Students Research Directory Screenshot] open
(Note: Since this is a text-based medium, the above is a placeholder image representing where a screenshot of the page would be.)
Instructions to Run the Page
Create Files:
Create three files in the same directory: index.html, styles.css, and script.js.
Copy the respective code snippets above into each file.
Open in Browser:
Open the index.html file in a web browser (e.g., Chrome, Firefox, Edge).
The page should display the list of PhD students and the search bar.
Test the Search:
Type a use case keyword into the search bar (e.g., "Healthcare", "Authentication").
The list will filter to show only the students whose use case keywords include the typed text.
Customization Tips
Colors: To change the color scheme, update the color codes in the styles.css file.
Fonts: You can change the font family in the body selector to another professional font.
Responsive Design: The CSS is designed to be responsive, but you can adjust the width property in .student-card for different screen sizes.
Additional Features: For more advanced search functionality, you might integrate a more robust filtering library or backend support.
I hope this meets your requirements! Let me know if you need any further assistance or modifications.