Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions docs/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ async function fetchAndPrepareUsers() {
isDataLoaded = true;
const total = allUsers.length;
document.getElementById('totalCount').textContent = total.toLocaleString();
document.getElementById('totalCountDesktop').textContent =
total.toLocaleString();
} catch (err) {
console.error(err);
const loadingStates = document.querySelectorAll('.loading-state');
Expand Down Expand Up @@ -995,10 +993,6 @@ function updateCounts(sortedUsers) {
document.getElementById('totalCount').textContent =
totalCount.toLocaleString();

document.getElementById('visibleCountDesktop').textContent =
visibleCount.toLocaleString();
document.getElementById('totalCountDesktop').textContent =
totalCount.toLocaleString();
}

/**
Expand All @@ -1012,21 +1006,15 @@ function updateResultsMessage(sortedUsers) {
const resultsFound = document.getElementById('resultsFound');
const noResults = document.getElementById('noResults');

const resultsFoundDesktop = document.getElementById('resultsFoundDesktop');
const noResultsDesktop = document.getElementById('noResultsDesktop');

// TODO
// if (totalCount === 0) {}
if (visibleCount === 0) {
if (resultsFound) resultsFound.style.display = 'none';
if (noResults) noResults.style.display = 'block';
if (resultsFoundDesktop) resultsFoundDesktop.style.display = 'none';
if (noResultsDesktop) noResultsDesktop.style.display = 'block';
} else {
if (resultsFound) resultsFound.style.display = 'block';
if (noResults) noResults.style.display = 'none';
if (resultsFoundDesktop) resultsFoundDesktop.style.display = 'block';
if (noResultsDesktop) noResultsDesktop.style.display = 'none';
}
}

Expand Down Expand Up @@ -1072,28 +1060,21 @@ function resetFilters() {
*/
function showLoadingState() {
const loadingState = document.getElementById('loadingState');
const loadingStateDesktop = document.getElementById('loadingStateDesktop');
const resultsInfo = document.getElementById('resultsInfo');
const resultsInfoDesktop = document.getElementById('resultsInfoDesktop');

[loadingState, loadingStateDesktop].forEach(
[loadingState].forEach(
(el) => el && (el.style.display = 'flex'),
);
if (resultsInfo) resultsInfo.style.display = 'none';
if (resultsInfoDesktop) resultsInfoDesktop.style.display = 'none';
}

/**
* Hide loading spinner
*/
function hideLoadingState() {
const loadingState = document.getElementById('loadingState');
const loadingStateDesktop = document.getElementById('loadingStateDesktop');
const resultsInfo = document.getElementById('resultsInfo');
const resultsInfoDesktop = document.getElementById('resultsInfoDesktop');

if (loadingState) loadingState.style.display = 'none';
if (loadingStateDesktop) loadingStateDesktop.style.display = 'none';
if (resultsInfo) resultsInfo.style.display = 'block';
if (resultsInfoDesktop) resultsInfoDesktop.style.display = 'block';
}
21 changes: 1 addition & 20 deletions docs/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -316,20 +316,6 @@ h1 {
display: none;
}

.results-info-desktop {
text-align: center;
color: #666;
font-size: 13px;
}

.results-info-desktop strong {
font-weight: 600;
}

#resultsFoundDesktop {
display: none;
}

/* ============================================================================ */
/* LOADING STATE */
/* ============================================================================ */
Expand All @@ -351,8 +337,7 @@ h1 {
}
}

#loadingState,
#loadingStateDesktop {
#loadingState{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and to adhere to common CSS coding conventions, please add a space between the selector #loadingState and the opening brace {.

Suggested change
#loadingState{
#loadingState {

position: fixed;
top: 0;
left: 0;
Expand Down Expand Up @@ -864,10 +849,6 @@ footer {
font-size: 1.8rem;
margin: 20px 0;
}

.results-info-desktop {
display: none;
}
}

/* Fine-tune mobile card widths for small breakpoints */
Expand Down
20 changes: 0 additions & 20 deletions layouts/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,26 +438,6 @@ <h2 id="featuredUserName" class="featured-name"></h2>
</div>
</section>

<div
class="results-info-desktop loading-state"
id="loadingStateDesktop"
style="display: none"
>
<div class="loading-spinner"></div>
<p>Loading developers...</p>
<p class="error-message" style="display: none"></p>
</div>

<div class="results-info-desktop" id="resultsInfoDesktop">
<div id="resultsFoundDesktop">
Showing <strong id="visibleCountDesktop">0</strong> of
<strong id="totalCountDesktop">0</strong> developers
</div>
<div id="noResultsDesktop" style="display: none">
<strong>No developers found</strong> matching your filters.
</div>
</div>

<div class="grid" id="grid"></div>
</main>
</div>
Expand Down