Skip to content

Commit

Permalink
ctive devs
Browse files Browse the repository at this point in the history
  • Loading branch information
IrynaSlavinska committed Oct 21, 2023
1 parent af86e03 commit 0ef3c24
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
22 changes: 14 additions & 8 deletions src/css/modal-team.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,33 @@
}

.team-item {
position: relative;
border: 1px solid #f4f4f4;
border-radius: 30px;
padding: 12px 14px;
text-align: center;
gap: 10px;
}

.more-icon {
position: absolute;
right: 20px;
top: 12px;
fill: #f4f4f4;
}

.team-name {
color: #f4f4f4;
font-size: 16px;
font-weight: 400;
}

.team-soc-list {
margin-top: 15px;
display: none;
}

.active-devel {
margin-top: 8px;
display: flex;
gap: 10px;
justify-content: center;
Expand All @@ -91,10 +103,6 @@
fill: #f4f4f4;
}

.hidden {
display: none;
}

.project-git {
border: 1px solid #f4f4f4;
border-radius: 30px;
Expand All @@ -107,13 +115,11 @@
text-align: center;
gap: 10px;
margin-top: 20px;
color: #242424;
}
.project-icon {
fill: #242424;
}
.active-dev {
display: flex;
}

@media screen and (min-width: 768px) {
.team-modal {
Expand Down
3 changes: 3 additions & 0 deletions src/img/sport-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions src/js/modal-team.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@ const devSocials = [...teamList.children];

function returnHidden() {
devSocials.forEach(dev => {
dev.lastElementChild.classList.add('hidden');
dev.lastElementChild.classList.remove('active-devel');
});
}

function onDevClick(e) {
const currentActiveDevItem = e.target.closest('.team-item');
const currentDevSoc = currentActiveDevItem.querySelector('.team-soc-list');
const devClick = e.target.closest('.team-item');
if (!devClick) {
return;
}
const devSocClick = devClick.querySelector('.team-soc-list');

currentDevSoc.classList.remove('hidden');
const currentActiveDevSoc = document.querySelector('.active-devel');
if (currentActiveDevSoc) {
currentActiveDevSoc.classList.remove('active-devel');
}
//
devSocClick.classList.add('active-devel');
}

function onOpenClick() {
Expand Down
5 changes: 4 additions & 1 deletion src/js/templates/modal-team-markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ export function createDevMarkup(developers) {
.map(developer => {
const { name, linkedin, github } = developer;
return `<li class="team-item">
<svg class="more-icon" width="20" height="20">
<use href="./img/sport-sprite.svg#icon-more"></use>
</svg>
<h3 class="team-name">${name}</h3>
<ul class="team-soc-list hidden">
<ul class="team-soc-list">
<li class="team-soc-item">
<a href="${linkedin}"
class="team-link" target="_blank" rel="noopener noreferrer" >
Expand Down

0 comments on commit 0ef3c24

Please sign in to comment.