feat: adicionando css a header da pagina

This commit is contained in:
PATRICK DE SOUZA SILVA 2022-12-15 20:03:08 -03:00
parent eb0cdf0455
commit aa96543ca6
2 changed files with 81 additions and 5 deletions

View File

@ -18,11 +18,15 @@ export default class Header {
interval: 1000, // vai verificar a cada 1 segundo se o elemento existe interval: 1000, // vai verificar a cada 1 segundo se o elemento existe
}); });
this.document = $(document); this.document = $(document);
this.window = $(window);
} }
events() { events() {
this.document.ready(() => { this.document.ready(() => {
this.createProgressBar(); this.createProgressBar();
}); });
this.window.on("hashchange", () => {
this.isActive();
});
} }
createProgressBar() { createProgressBar() {
@ -40,7 +44,17 @@ export default class Header {
<span class="progress-bar__status payment"></span> <span class="progress-bar__status payment"></span>
</div> </div>
`; `;
console.log(this.progressBar);
this.progressBar.innerHTML = progressBar; this.progressBar.innerHTML = progressBar;
this.isActive();
}
isActive() {
$(`.progress-bar__status.active`).removeClass("active");
const hash = window.location.hash.replace("#/", "");
$(`.progress-bar__status.${hash}`).addClass("active");
console.log(`.progress-bar__status .${hash}`);
if (hash === "email" || hash === "shipping") {
$(`.progress-bar__status.profile`).addClass("active");
}
} }
} }

View File

@ -10,13 +10,20 @@
} }
&__logo { &__logo {
min-width: 382px;
img { img {
height: 52px; height: auto;
width: auto; width: 100%;
}
a {
width: 100%;
display: block;
} }
} }
&__safeBuy { &__safeBuy {
display: flex;
min-width: 235px;
span { span {
align-items: center; align-items: center;
display: flex; display: flex;
@ -29,7 +36,7 @@
color: $color-gray; color: $color-gray;
} }
i { img {
margin-right: 8px; margin-right: 8px;
} }
} }
@ -37,13 +44,64 @@
.progress-bar { .progress-bar {
display: flex; display: flex;
width: 100%;
justify-content: space-between;
margin: 0px 219px 0px 73px;
&__title { &__title {
margin-bottom: 15px; margin-bottom: 15px;
} }
&__wrapper { &__wrapper {
display: flex; display: flex;
width: 100%;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
position: relative;
&:not(:first-child, :last-child) {
&::before {
content: "";
width: 50%;
height: 1px;
background: #000000;
position: absolute;
left: 0;
top: 77%;
z-index: -1;
}
&::after {
content: "";
width: 50%;
height: 1px;
background: #000000;
position: absolute;
right: 0;
top: 77%;
z-index: -1;
}
}
&:last-child {
&::before {
content: "";
width: 50%;
height: 1px;
background: #000000;
position: absolute;
left: 0;
top: 77%;
z-index: -1;
}
}
&:first-child {
&::after {
content: "";
width: 50%;
height: 1px;
background: #000000;
position: absolute;
right: 0;
top: 77%;
z-index: -1;
}
}
} }
&__status { &__status {
@ -51,10 +109,14 @@
height: 24px; height: 24px;
border: 1px solid #000000; border: 1px solid #000000;
border-radius: 50%; border-radius: 50%;
z-index: 1;
background: #ffffff;
&.cart { &.cart {
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
&.active {
background: #000000;
}
} }
} }