Skip to content

Commit

Permalink
🚧 feat: criou painel que mostra informações de cryptos
Browse files Browse the repository at this point in the history
  • Loading branch information
CibeleMartins committed Feb 21, 2023
1 parent aafd81e commit 2cfa7c2
Show file tree
Hide file tree
Showing 502 changed files with 582 additions and 17 deletions.
11 changes: 9 additions & 2 deletions src/app/components/crypto-infos/crypto-infos.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<header id="crypto-infos-container">
<p id="info">INFOS CRYPTOS</p>
<header id="slide-wrapper">
<div class="slide-track">
<div class="slide" *ngFor="let crypto of cryptoInfos">
<img class="crypto-icon" src="{{ crypto.symbol }}" />
<p id="info">{{ crypto.name }}</p>
<p id="info">{{ crypto.buyValue }}</p>
<p id="info">{{ crypto.priceVariationPercentage }}</p>
</div>
</div>
</header>
61 changes: 55 additions & 6 deletions src/app/components/crypto-infos/crypto-infos.component.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,59 @@
#crypto-infos-container {
#slide-wrapper {
width: 100%;
height: 6vh;
height: 10vh;
background-color: black;
display: flex;
flex-direction: row;
overflow-x: scroll;
&::-webkit-scrollbar {
display: none;
}

}

#info {
height: 10vh;
margin: 0px;
}
.crypto-icon {
width: 20px;
}

.slide-track {
display: flex;
width: calc(250*6);
animation: slidescroll 80s linear infinite;

}

.slide-track:hover {
animation-play-state: paused;
}

@keyframes slidescroll {
0% {
transform: translateX(0);
}

100% {
transform: translateX(calc(-100%*1));
}
}

.slide {
width: 400px;
height: 50px;
display: flex;
justify-content: space-evenly;
align-items: center;
padding: 10px;
color: white;
overflow: hidden;
perspective: 100px;
cursor: pointer;
}

.slide-wrapper::after {

right: -2px;
top: 0;
transform: rotateZ(180deg);
}


38 changes: 35 additions & 3 deletions src/app/components/crypto-infos/crypto-infos.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,47 @@ import { CryptoCoinService } from 'src/app/services/CryptoCoin.service';
})
export class CryptoInfosComponent {

cryptoInfos!: any;

coinsNotSymbol = [
'bnbbrl',
'ltcbrl',
'bttbrl',
'shibbrl',
'busdbrl',
'galabrl',
'lunabrl',
'galbrl',
'aptbrl',
'linkbrl'
]

constructor(private cryptoService: CryptoCoinService) {

}

ngOnInit() {
this.cryptoService.getCryptoInfos().subscribe((data)=> {
this.cryptoService.getCryptoInfos().subscribe((data) => {
let cryptoName = ''
data.map((i) => {
cryptoName = i.name.replace('B', '').replace('R', '').replace('L', '')
if( cryptoName.toLowerCase() === 'win' || cryptoName.toLowerCase() === 'axs' || cryptoName.toLowerCase() === 'fis' || cryptoName.toLowerCase() === 'c98' || cryptoName.toLowerCase() === 'ftm' || cryptoName.toLowerCase() === 'santos') {
i.symbol = '../../../assets/' + `${cryptoName.toLowerCase()}.png`;
} else if (cryptoName.toLowerCase() === 'cake' ) {
i.symbol = '../../../assets/' + `${cryptoName.toLowerCase()}.webp`
} else {
i.symbol = '../../../assets/' + `${cryptoName.toLowerCase()}.svg`;
}

})

this.cryptoInfos = data

this.cryptoInfos = this.cryptoInfos.filter((i: any)=> !this.coinsNotSymbol.includes((i.name.toLowerCase())))
console.log(data)
console.log(this.cryptoInfos)
})

console.log(this.cryptoService.cryptosInfos)
}


}
1 change: 1 addition & 0 deletions src/assets/$pac.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/0xbtc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/1inch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/2give.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/aave.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/abt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2cfa7c2

Please sign in to comment.