Skip to content

Commit

Permalink
fix: sliders & players
Browse files Browse the repository at this point in the history
  • Loading branch information
MIU-cz committed Jun 30, 2024
1 parent d3c19d4 commit ce3ee18
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Yandex/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -798,9 +798,9 @@ <h2 class="txt_main_h">Участники турнира</h2>
</footer>

<!-- scripts -->
<script src="src/js/slider-stage.js"></script>
<script src="src/js/players.js"></script>
<script src="src/autor-resourse/autor-footer-script.js"></script>
<script src="src/js/animation.js"></script>
<script src="src/js/slider.js"></script>
<script src="src/js/players.js"></script>
</body>
</html>
3 changes: 1 addition & 2 deletions Yandex/src/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,6 @@
display: grid;
grid-auto-flow: column;
grid-auto-columns: 100%;
-moz-column-gap: 20px;
column-gap: 20px;
}
@media (min-width: 768px) {
.players_cards_wraper {
Expand Down Expand Up @@ -945,6 +943,7 @@

.player_btns {
display: flex;
align-items: center;
margin-top: 40px;
}
@media (min-width: 1240px) {
Expand Down
2 changes: 1 addition & 1 deletion Yandex/src/css/main.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion Yandex/src/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,9 @@
display: grid;
grid-auto-flow: column;
grid-auto-columns: 100%;
column-gap: 20px;
// column-gap: 20px;

// transform: translateX(0%);

@media (min-width: 768px) {
grid-auto-columns: 50%;
Expand All @@ -679,6 +681,10 @@
align-items: center;
text-align: center;

// &:nth-child(1) {
// display: none;
// }

.card_img {
width: 244px;
height: 244px;
Expand Down Expand Up @@ -714,6 +720,7 @@

.player_btns {
display: flex;
align-items: center;
margin-top: 40px;

@media (min-width:1240px) {
Expand Down
3 changes: 2 additions & 1 deletion Yandex/src/js/players.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const addPlayers = () => {
}

playersCards.innerHTML = cardsHTML;

};

window.addEventListener("load", addPlayers);
window.addEventListener("load", addPlayers);
12 changes: 5 additions & 7 deletions Yandex/src/js/slider.js → Yandex/src/js/slider-stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let blockWidth = 0,
stageItems = 0,
pugBtnsItems = "";

function apdateVariables() {
function updateStages() {
blockWidth = sliderBlock.clientWidth + 20;
let lineLength = sliderLine.scrollWidth;
stageItems = Math.round(lineLength / blockWidth);
Expand Down Expand Up @@ -66,12 +66,10 @@ pugContainer.addEventListener("click", function (e) {
stageItem = e.target.dataset.stage - 1;
moveStageLine();

// console.log(e.target);
// console.log(e.currentTarget);
// console.log(e.target);
// console.log(e.currentTarget);
});

window.addEventListener("load", apdateVariables);
window.addEventListener("resize", apdateVariables);
window.addEventListener("load", updateStages);
window.addEventListener("resize", updateStages);

// ################################
// Player slider

0 comments on commit ce3ee18

Please sign in to comment.