mirror of
https://github.com/abrendan/smolNews.git
synced 2025-06-16 12:45:04 +02:00
Added a reset filter button and cleaned the design a little bit more
This commit is contained in:
parent
7ba95a157a
commit
8af82a3d22
@ -9,7 +9,7 @@
|
||||
<link rel="icon" href="https://i.ibb.co/jvVTdPM/nobackground-withoutname2.png">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container mt-5 mx-auto">
|
||||
<div class="container mt-3 mx-auto">
|
||||
<div class="text-center mb-4">
|
||||
<img src="/images/smolNews_transparent-grey.png" alt="smolNews" class="title-logo">
|
||||
</div>
|
||||
@ -50,6 +50,7 @@
|
||||
<div class="form-group">
|
||||
<input type="text" id="searchInput" class="form-control" placeholder="Search for articles...">
|
||||
</div>
|
||||
<button id="resetButton" class="btn btn-secondary btn-block mb-2">Reset Filters</button>
|
||||
<button id="searchButton" class="btn btn-primary btn-block">Search</button>
|
||||
<div id="articles" class="mt-4"></div>
|
||||
</div>
|
||||
|
11
script.js
11
script.js
@ -15,6 +15,17 @@ document.getElementById('searchButton').addEventListener('click', function() {
|
||||
fetchNewsArticles();
|
||||
});
|
||||
|
||||
document.getElementById('resetButton').addEventListener('click', function() {
|
||||
document.getElementById('searchInput').value = '';
|
||||
document.getElementById('topicSelect').value = '';
|
||||
document.getElementById('apiSelect').value = 'currents';
|
||||
document.getElementById('sourceSelect').value = '';
|
||||
document.getElementById('languageSelect').value = '';
|
||||
document.getElementById('countrySelect').value = '';
|
||||
configureDropdowns();
|
||||
fetchNewsArticles();
|
||||
});
|
||||
|
||||
function fetchTopics() {
|
||||
const url = `https://api.currentsapi.services/v1/available/categories?apiKey=${apiKeyCurrents}`;
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
:root {
|
||||
--bg-dark: #202020;
|
||||
--card-dark: #2d2d2d;
|
||||
@ -39,6 +38,9 @@ body {
|
||||
border-radius: var(--border-radius);
|
||||
padding: 0.75rem;
|
||||
transition: all 0.2s ease;
|
||||
height: 48px;
|
||||
line-height: 24px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
@ -52,6 +54,11 @@ body {
|
||||
border-radius: var(--border-radius);
|
||||
padding: 0.75rem 1.5rem;
|
||||
transition: transform 0.2s, background-color 0.2s;
|
||||
height: 48px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn:active {
|
||||
|
Loading…
x
Reference in New Issue
Block a user