Skip to content

Commit

Permalink
Gridlistdetail (#177)
Browse files Browse the repository at this point in the history
* Grid mode
  • Loading branch information
dlaxcess authored May 4, 2022
1 parent 6fd6f59 commit b7dea1c
Show file tree
Hide file tree
Showing 19 changed files with 720 additions and 458 deletions.
2 changes: 1 addition & 1 deletion gulp/scss/_class.scss
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ select {
background: rgba($green, 0.2);
}
}
&-sell {
&-sell, &-buy {
color: $white;
background: $green;
&:hover {
Expand Down
26 changes: 8 additions & 18 deletions gulp/scss/front.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,13 @@
}

.media {
@include border-radius;
overflow: hidden;
display: inline-block;
vertical-align: middle;
max-width: 100%;
height: 130px;
width: 130px;

img {
object-fit: cover;
width: 100%;
height: 100%;
}
}

.media-grid {
@include border-radius;
overflow: hidden;
display: inline-block;
vertical-align: middle;
width: 100%;
img {

img, video {
object-fit: cover;
width: 100%;
height: 100%;
Expand Down Expand Up @@ -294,11 +279,12 @@
padding-top: 100%;
position: relative;

img {
img, video {
transition: all 300ms ease;
position: absolute;
top: 0;
left: 0;
width:100%;
}
}

Expand Down Expand Up @@ -471,6 +457,10 @@
font-weight: bold;
margin-bottom: 30px;
}

video {
width: 100%;
}
}

.modal-close,
Expand Down
File renamed without changes.
41 changes: 41 additions & 0 deletions svelte/components/Global/Content.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script lang="ts">
// import { displayedTokenID } from "main/diplayedNft";
import Nft from "../Nft/Nft.svelte";
import NftList from "../Nft/NftList.svelte";
export let chainId: number;
export let address: string;
export let account: string;
export let platform: string;
export let refreshing: boolean = false;
export let refresh: number;
let tokenID: string = "";
$: account && chainId && address && handleChange();
const handleChange = () => (tokenID = "");
const handleClick = (evt: Event) => {
const evtTarget = evt.target as HTMLInputElement;
if (!evtTarget.classList.contains("btn")) {
if (evtTarget.closest("div [data-tokenid]")) {
evt.preventDefault();
tokenID = evtTarget.closest("div [data-tokenid]").getAttribute("data-tokenid");
} else if (evtTarget.getAttribute("data-back") === "backtocoll") {
evt.preventDefault();
tokenID = "";
}
}
};
</script>

<div on:click={(evt) => handleClick(evt)}>
{#if tokenID}
<Nft {chainId} {address} {tokenID} {account} {platform} />
{:else}
{#key address}
<NftList {chainId} {address} {account} {refresh} bind:refreshing {platform} />
{/key}
{/if}
</div>
13 changes: 5 additions & 8 deletions svelte/components/Global/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
import Create from "../Global/Create.svelte";
import Navigation from "../Global/Navigation.svelte";
import Nft from "../Nft/Nft.svelte";
import NftsList from "../Nft/NftsList.svelte";
import NftsListRefresh from "../Nft/NftsListRefresh.svelte";
import Title from "../Global/Title.svelte";
// import BreadCrumb from "../../tests/BreadCrumb.svelte";
import HomeLayout from "../Global/HomeLayout.svelte";
import Content from "./Content.svelte";
// import { metamaskProvider } from "main/metamask";
export let platform: string = "dapp";
let chainId: number;
let address: string;
let tokenID: string;
let account: string;
let refreshing: boolean;
let refresh: number;
Expand Down Expand Up @@ -62,11 +63,7 @@

<span slot="content">
{#if chainId && account && address}
{#if tokenID}
<Nft {chainId} {address} {tokenID} />
{:else}
<NftsList {chainId} {address} {account} {refresh} bind:refreshing />
{/if}
<Content {chainId} {address} {account} {platform} bind:refreshing {refresh} />
{/if}
</span>
</HomeLayout>
Expand Down
Loading

0 comments on commit b7dea1c

Please sign in to comment.