This repository has been archived by the owner on Sep 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Button styling, event handling, loader:
- Refactor the method: move logic for unlocking wallet out of buyEvent - Add constants file - Add loader animation - Add style for button for network mismatch state
- Loading branch information
1 parent
d7dc14d
commit 32c4b05
Showing
8 changed files
with
149 additions
and
55 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
<script src="/node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script> | ||
<script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css"> | ||
<script defer src="/dist/nft-card.js"></script> | ||
<script defer src="/dist/opensea-nft-card.min.js"></script> | ||
|
||
<title>OpenSea Embeddable NFT example</title> | ||
<style media="screen"> | ||
|
@@ -41,11 +41,17 @@ <h3>Show users any crypto collectible and let them buy it straight from your sit | |
</div> | ||
</div> | ||
<div class="card-container"> | ||
<!-- <nft-card--> | ||
<!-- id="nftCard"--> | ||
<!-- contractAddress="0x7dca125b1e805dc88814aed7ccc810f677d3e1db"--> | ||
<!-- network="rinkeby"--> | ||
<!-- tokenId="18"--> | ||
<!-- >--> | ||
<!-- </nft-card>--> | ||
|
||
<nft-card | ||
id="nftCard" | ||
contractAddress="0x7dca125b1e805dc88814aed7ccc810f677d3e1db" | ||
network="rinkeby" | ||
tokenId="18" | ||
contractAddress="0x2fb5d7dda4f1f20f974a0fdd547c38674e8d940c" | ||
tokenId="20014" | ||
> | ||
</nft-card> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const NO_WEB3_ERROR: string = 'You need an Ethereum wallet to interact with this marketplace. Unlock your wallet, get MetaMask.io or Portis on desktop, or get Trust Wallet or Coinbase Wallet on mobile.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import {css, customElement, html, LitElement} from 'lit-element' | ||
|
||
|
||
@customElement('loader-element') | ||
export class Loader extends LitElement { | ||
static get styles() { | ||
return css` | ||
@keyframes pulse-opacity { | ||
0% { | ||
opacity: 1; | ||
} | ||
16.666% { | ||
opacity: 1; | ||
} | ||
100% { | ||
opacity: 0; | ||
} | ||
} | ||
.Loading { | ||
transform: translate(-50%,-50%) rotate(30deg); | ||
height: 81px; | ||
width: 90px; | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
} | ||
.Loading .tri.upwards { | ||
border-top: 0; | ||
border-bottom: 27px solid #fff; | ||
} | ||
.Loading .tri:first-child { | ||
left: 15px; | ||
border-bottom-color: #00c9a4; | ||
} | ||
.Loading .tri:nth-child(2) { | ||
left: 30px; | ||
animation-delay: .1s; | ||
border-top-color: #00ffd0; | ||
} | ||
.Loading .tri:nth-child(3) { | ||
left: 45px; | ||
animation-delay: .2s; | ||
border-bottom-color: #00d7d1; | ||
} | ||
.Loading .tri:nth-child(4) { | ||
left: 45px; | ||
top: 27px; | ||
animation-delay: .3s; | ||
border-top-color: #0095be; | ||
} | ||
.Loading .tri:nth-child(5) { | ||
top: 27px; | ||
left: 30px; | ||
animation-delay: .4s; | ||
border-bottom-color: #007296; | ||
} | ||
.Loading .tri:nth-child(6) { | ||
top: 27px; | ||
left: 15px; | ||
animation-delay: .5s; | ||
border-top-color: #1c1f27; | ||
} | ||
.Loading .tri, .Loading .tri.upwards { | ||
border-left: 15px solid transparent; | ||
border-right: 15px solid transparent; | ||
} | ||
.Loading .tri { | ||
position: absolute; | ||
opacity: 0; | ||
animation: pulse-opacity .6s ease-in infinite; | ||
border-top: 27px solid #fff; | ||
border-bottom: 0; | ||
} | ||
` | ||
} | ||
public render() { | ||
return (html` | ||
<div class="Loading"> | ||
<div class="tri upwards"></div> | ||
<div class="tri"></div> | ||
<div class="tri upwards"></div> | ||
<div class="tri"></div> | ||
<div class="tri upwards"></div> | ||
<div class="tri"></div> | ||
</div>` | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters