Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mobile and codacy error #170

Merged
merged 1 commit into from
Feb 15, 2025
Merged
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
19 changes: 19 additions & 0 deletions docs/overrides/assets-2.0/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,12 @@ ul.list-contributors li:nth-last-child(1) a::after {

#users {
margin: 80px 0;

.container {
@media (max-width: 425px) {
max-width: 100%;
}
}
}
#users h2 {
font-weight: 500;
Expand All @@ -575,6 +581,10 @@ ul.list-contributors li:nth-last-child(1) a::after {
width: 100%;
max-width: 400px;
text-align: center;

@media (max-width: 425px) {
padding: 45px 25px;
}
}
.box-testimonial:hover {
border: 1px solid #EE771B
Expand Down Expand Up @@ -1114,5 +1124,14 @@ footer .row {
font-weight: 600;
text-align: right;
}
.swiper-button-next, .swiper-button-prev {
display: none;
}
.swiper {
padding: 1rem;
}
label[for="__drawer"] {
display: none!important;
}
}
@media (max-width: 376px) {}
24 changes: 16 additions & 8 deletions docs/overrides/assets-2.0/js/scripts.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
function openTab(evt, tabName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
const tabcontent = document.getElementsByClassName("tabcontent");
for (let i = 0; i < tabcontent.length; i++) {

Check warning on line 3 in docs/overrides/assets-2.0/js/scripts.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docs/overrides/assets-2.0/js/scripts.js#L3

Expected a `for-of` loop instead of a `for` loop with this simple iteration.
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
const tablinks = document.getElementsByClassName("tablinks");
for (let i = 0; i < tablinks.length; i++) {

Check warning on line 7 in docs/overrides/assets-2.0/js/scripts.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docs/overrides/assets-2.0/js/scripts.js#L7

Expected a `for-of` loop instead of a `for` loop with this simple iteration.
tablinks[i].classList.remove("active");

Check warning on line 8 in docs/overrides/assets-2.0/js/scripts.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docs/overrides/assets-2.0/js/scripts.js#L8

Generic Object Injection Sink
}
const currentTab = document.getElementById(tabName);
if (currentTab) {
currentTab.style.display = "block";
} else {
console.warn(`Error: Not found tab ${tabName}`);
}
if (evt.currentTarget && evt.currentTarget.classList) {
evt.currentTarget.classList.add("active");
} else {
console.warn("Error element.");
}
document.getElementById(tabName).style.display = "block";
evt.currentTarget.className += " active";
}
window.openTab = openTab;

Expand Down
5 changes: 4 additions & 1 deletion docs/overrides/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ <h2><i class="fab fa-github"></i> ${data.owner.login}/${data.name}</h2>
<script src="overrides/assets-2.0/js/chart-example.js"></script>
<script src="overrides/assets-2.0/js/scripts.js"></script>


<script>
document.addEventListener("DOMContentLoaded", function () {
var swiper = new Swiper(".mySwiper", {
Expand All @@ -611,6 +610,10 @@ <h2><i class="fab fa-github"></i> ${data.owner.login}/${data.name}</h2>
clickable: true,
},
breakpoints: {
0: {
slidesPerView: 1,
navigation: false,
},
768: {
slidesPerView: 1,
},
Expand Down