├── pages ├── .DS_Store ├── api │ ├── .DS_Store │ ├── contract │ │ └── dmt-erc1155.js │ └── nft │ │ └── [id].js ├── _app.js ├── index.js ├── intro.js ├── farms │ ├── index.js │ └── [farmId].js └── gallery.js ├── public ├── .DS_Store ├── logo.png ├── favicon.ico ├── favicon-16x16.png ├── favicon-32x32.png ├── images │ ├── bg-plain.png │ ├── dm-logo.png │ ├── farm-dmt.png │ ├── nft-dmt.png │ ├── preview.png │ ├── bg-nebula.png │ ├── bg-stars-1.png │ ├── bg-stars-2.png │ ├── dm-logo-ring.png │ ├── home-farm-dmt.png │ ├── home-nft-dmt.png │ ├── splash-logo-bot.png │ ├── splash-logo-top.png │ └── dmt-video-placeholder.png ├── mstile-150x150.png ├── apple-touch-icon.png ├── android-chrome-192x192.png ├── android-chrome-256x256.png ├── browserconfig.xml ├── site.webmanifest └── safari-pinned-tab.svg ├── components ├── .DS_Store ├── layout │ ├── Main.js │ ├── Container.js │ ├── index.js │ ├── Header.js │ ├── Drawer.js │ └── Footer.js ├── story │ ├── index.js │ ├── NFT2.js │ ├── NFT4.js │ ├── NFT3.js │ ├── NFT5.js │ ├── NFT6.js │ ├── NFT1.js │ └── NFT7.js ├── splash │ ├── splash.css │ └── Splash.js ├── utils │ └── InternalLink.js ├── icons │ ├── Etherscan.js │ ├── YtslaLogoText.js │ ├── LogoLight.js │ ├── YtslaLogoIcon.js │ ├── WalletConnectLogoIcon.js │ ├── OpenseaLogoIcon.js │ ├── YtslaLogoFull.js │ ├── UniswapLogoIcon.js │ └── MetaMaskLogoIcon.js ├── background │ ├── Background.js │ └── background.css ├── forms │ └── FormErrors.js ├── farms │ ├── DepositOptions.js │ ├── config.js │ ├── EarnCard.js │ ├── LandingCard.js │ ├── DepositCard.js │ ├── DepositModal.js │ └── WithdrawModal.js ├── DocHead.js ├── spinners │ └── Inline.js ├── gallery │ ├── InputPassword.js │ └── GalleryCard.js ├── wallet │ ├── WalletModal.js │ └── ConnectButton.js └── countdown │ └── CountdownModal.js ├── __MACOSX ├── pages │ ├── ._.DS_Store │ └── api │ │ └── ._.DS_Store ├── public │ └── ._.DS_Store └── components │ └── ._.DS_Store ├── README.md ├── theme ├── styles.js ├── index.js ├── component-link.js └── component-button.js ├── hooks ├── usePrevious.js ├── useDidMount.js ├── usePageTitle.js ├── useEthPrice.js ├── useInterval.js └── useContracts.js ├── lib ├── scroll.js ├── uniswapPair.js ├── numeric.js ├── wallet.js ├── stakingERC20.js ├── stakingERC1155.js └── erc20.js └── package.json /pages/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/pages/.DS_Store -------------------------------------------------------------------------------- /public/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/.DS_Store -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/logo.png -------------------------------------------------------------------------------- /pages/api/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/pages/api/.DS_Store -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/components/.DS_Store -------------------------------------------------------------------------------- /public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/favicon-16x16.png -------------------------------------------------------------------------------- /public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/favicon-32x32.png -------------------------------------------------------------------------------- /public/images/bg-plain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/bg-plain.png -------------------------------------------------------------------------------- /public/images/dm-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/dm-logo.png -------------------------------------------------------------------------------- /public/images/farm-dmt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/farm-dmt.png -------------------------------------------------------------------------------- /public/images/nft-dmt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/nft-dmt.png -------------------------------------------------------------------------------- /public/images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/preview.png -------------------------------------------------------------------------------- /public/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/mstile-150x150.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/images/bg-nebula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/bg-nebula.png -------------------------------------------------------------------------------- /public/images/bg-stars-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/bg-stars-1.png -------------------------------------------------------------------------------- /public/images/bg-stars-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/bg-stars-2.png -------------------------------------------------------------------------------- /public/images/dm-logo-ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/dm-logo-ring.png -------------------------------------------------------------------------------- /public/images/home-farm-dmt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/home-farm-dmt.png -------------------------------------------------------------------------------- /public/images/home-nft-dmt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/home-nft-dmt.png -------------------------------------------------------------------------------- /public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /public/android-chrome-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/android-chrome-256x256.png -------------------------------------------------------------------------------- /public/images/splash-logo-bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/splash-logo-bot.png -------------------------------------------------------------------------------- /public/images/splash-logo-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/splash-logo-top.png -------------------------------------------------------------------------------- /public/images/dmt-video-placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamsuiux/DarkMatter/HEAD/public/images/dmt-video-placeholder.png -------------------------------------------------------------------------------- /__MACOSX/pages/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx @ATTRxx -------------------------------------------------------------------------------- /__MACOSX/public/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx @ATTRxx -------------------------------------------------------------------------------- /__MACOSX/components/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx @ATTRxx -------------------------------------------------------------------------------- /__MACOSX/pages/api/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx @ATTRxx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dark Matter Token Website 2 | Uses [Next.js](https://nextjs.org/) and [Chakra UI](https://chakra-ui.com/). 3 | 4 | ## Development 5 | 6 | `npm run dev` -------------------------------------------------------------------------------- /components/layout/Main.js: -------------------------------------------------------------------------------- 1 | import { Box } from "@chakra-ui/core"; 2 | 3 | const Main = ({ children }) => ( 4 | 5 | {children} 6 | 7 | ); 8 | 9 | export default Main; -------------------------------------------------------------------------------- /theme/styles.js: -------------------------------------------------------------------------------- 1 | const styles = { 2 | global: { 3 | "html, body": { 4 | height: "100%", 5 | minHeight: "100%", 6 | }, 7 | "body": { 8 | background: "gray.50", 9 | }, 10 | }, 11 | }; 12 | 13 | export default styles; 14 | -------------------------------------------------------------------------------- /hooks/usePrevious.js: -------------------------------------------------------------------------------- 1 | import { useRef, useEffect } from "react"; 2 | 3 | const usePrevious = (value) => { 4 | const ref = useRef(); 5 | 6 | useEffect(() => { 7 | ref.current = value; 8 | }); 9 | 10 | return ref.current; 11 | }; 12 | 13 | export default usePrevious; 14 | -------------------------------------------------------------------------------- /public/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #ffc40d 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /hooks/useDidMount.js: -------------------------------------------------------------------------------- 1 | import { useRef, useEffect } from "react"; 2 | 3 | const useDidMount = () => { 4 | const didMountRef = useRef(false); 5 | 6 | useEffect(() => { 7 | didMountRef.current = true; 8 | }, []); 9 | 10 | return didMountRef.current; 11 | }; 12 | 13 | export default useDidMount; 14 | -------------------------------------------------------------------------------- /components/story/index.js: -------------------------------------------------------------------------------- 1 | import Level1 from "./NFT1"; 2 | import Level2 from "./NFT2"; 3 | import Level3 from "./NFT3"; 4 | import Level4 from "./NFT4"; 5 | import Level5 from "./NFT5"; 6 | import Level6 from "./NFT6"; 7 | import Level7 from "./NFT7"; 8 | 9 | export { Level1, Level2, Level3, Level4, Level5, Level6, Level7 }; 10 | -------------------------------------------------------------------------------- /hooks/usePageTitle.js: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from "react"; 2 | 3 | const usePageTitle = title => { 4 | const [pageTitle, setPageTitle] = useState(`${title} | Dark Matter`); 5 | 6 | useEffect(() => { 7 | document.title = pageTitle; 8 | }, [pageTitle]); 9 | 10 | return [setPageTitle]; 11 | }; 12 | 13 | export default usePageTitle; 14 | -------------------------------------------------------------------------------- /theme/index.js: -------------------------------------------------------------------------------- 1 | import { extendTheme } from "@chakra-ui/core"; 2 | 3 | import Button from "./component-button.js"; 4 | import Link from "./component-link.js"; 5 | import styles from "./styles.js"; 6 | 7 | const overrides = { 8 | components: { 9 | Button, 10 | Link, 11 | }, 12 | styles, 13 | } 14 | 15 | export default extendTheme(overrides); 16 | -------------------------------------------------------------------------------- /lib/scroll.js: -------------------------------------------------------------------------------- 1 | const scrollToPosition = (top = 0) => { 2 | try { 3 | /** 4 | * Latest API 5 | */ 6 | window.scroll({ 7 | top: top, 8 | left: 0, 9 | behavior: "smooth", 10 | }); 11 | } catch (_) { 12 | /** 13 | * Fallback 14 | */ 15 | window.scrollTo(0, top); 16 | } 17 | }; 18 | 19 | export { 20 | scrollToPosition, 21 | }; 22 | -------------------------------------------------------------------------------- /components/layout/Container.js: -------------------------------------------------------------------------------- 1 | import { Flex } from "@chakra-ui/core"; 2 | 3 | import Splash from "../splash/Splash"; 4 | import Background from "../background/Background"; 5 | 6 | const Container = ({ children }) => ( 7 | 8 | 9 | 10 | {children} 11 | 12 | ); 13 | 14 | export default Container; 15 | -------------------------------------------------------------------------------- /components/splash/splash.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Splash animations. 3 | */ 4 | .splashLogoIn { 5 | opacity: 1!important; 6 | } 7 | 8 | .splashLogoOut { 9 | transition: all 1.5s ease-in!important; 10 | opacity: 0!important; 11 | } 12 | 13 | .splashTopShutter { 14 | opacity: 0.9; 15 | transform: translateY(-100%); 16 | } 17 | 18 | .splashBotShutter { 19 | opacity: 0.9; 20 | transform: translateY(100%); 21 | } -------------------------------------------------------------------------------- /hooks/useEthPrice.js: -------------------------------------------------------------------------------- 1 | import CoinGecko from "coingecko-api"; 2 | import { useEffect, useState } from "react"; 3 | 4 | export function useEthPrice() { 5 | const client = new CoinGecko(); 6 | const [ethUSD, setEthUsd] = useState(0); 7 | 8 | useEffect(() => { 9 | client.simple.price({ ids: ['ethereum'], vs_currencies: 'usd' }).then(({ data, success }) => { 10 | if (success) { 11 | setEthUsd(data.ethereum.usd); 12 | } 13 | }); 14 | }, []); 15 | 16 | return { ethUSD }; 17 | }; -------------------------------------------------------------------------------- /pages/api/contract/dmt-erc1155.js: -------------------------------------------------------------------------------- 1 | export default (req, res) => { 2 | res.statusCode = 200; 3 | res.json({ 4 | name: "Dark Matter Ltd.", 5 | description: "Dark Matter presents: Mission to Marp. Users will navigate their way through a narrative-driven augmented reality game utilizing DeFi yield farming and collectible NFT's. Dark Matter is the next evolution in yield farming protocols.", 6 | image: "https://darkmatter.finance/logo.png", 7 | external_link: "https://darkmatter.finance", 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/android-chrome-256x256.png", 12 | "sizes": "256x256", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#ffffff", 17 | "background_color": "#ffffff", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /lib/uniswapPair.js: -------------------------------------------------------------------------------- 1 | import { 2 | ChainId, 3 | Token, 4 | WETH, 5 | Fetcher, 6 | Route, 7 | } from '@uniswap/sdk'; 8 | 9 | export const create = (tokenAddress, provider) => { 10 | const token = new Token(ChainId.MAINNET, tokenAddress, 18); // ChainId.MAINNET 11 | 12 | const fetchPairData = () => Fetcher.fetchPairData(token, WETH[ChainId.MAINNET], provider); 13 | 14 | const getPrice = async () => { 15 | const pair = await fetchPairData(); 16 | const route = new Route([pair], token); 17 | 18 | return route.midPrice.toSignificant(6); 19 | }; 20 | 21 | return { getPrice }; 22 | }; 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start" 9 | }, 10 | "dependencies": { 11 | "@chakra-ui/core": "^1.0.0-rc.5", 12 | "@chakra-ui/icons": "^1.0.0-rc.5", 13 | "@uniswap/sdk": "^3.0.3", 14 | "coingecko-api": "^1.0.10", 15 | "ethers": "^5.0.17", 16 | "lodash": "^4.17.20", 17 | "next": "9.5.4", 18 | "react": "16.13.1", 19 | "react-dom": "16.13.1", 20 | "react-icons": "^3.11.0", 21 | "use-wallet": "^0.8.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /hooks/useInterval.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from "react"; 2 | 3 | const useInterval = (callback, delay) => { 4 | const savedCallback = useRef(); 5 | 6 | /** 7 | * Remember the latest callback. 8 | */ 9 | useEffect(() => { 10 | savedCallback.current = callback; 11 | }, [callback]); 12 | 13 | /** 14 | * Set up the interval. 15 | */ 16 | useEffect(() => { 17 | function tick() { 18 | savedCallback.current(); 19 | } 20 | 21 | if (delay !== null) { 22 | let id = setInterval(tick, delay); 23 | 24 | return () => clearInterval(id); 25 | } 26 | }, [delay]); 27 | }; 28 | 29 | export default useInterval; -------------------------------------------------------------------------------- /lib/numeric.js: -------------------------------------------------------------------------------- 1 | import _isNaN from "lodash/isNaN"; 2 | import _isNull from "lodash/isNull"; 3 | 4 | const formatNumber = ( 5 | value, 6 | decimalPlaces = 2, 7 | defaultValue = "...", 8 | prefix = "", 9 | suffix = "" 10 | ) => { 11 | const parsedValue = parseFloat("" + value); 12 | 13 | if (!_isNaN(parsedValue)) 14 | return `${prefix}${parsedValue.toFixed(decimalPlaces)}${suffix}`; 15 | 16 | return defaultValue; 17 | }; 18 | 19 | const isValidNumber = (value, min = null, max = null) => { 20 | const parsedValue = parseFloat("" + value); 21 | 22 | if ( 23 | _isNaN(parsedValue) || 24 | (!_isNull(min) && parsedValue < min) || 25 | (!_isNull(max) && parsedValue > max) 26 | ) { 27 | return false; 28 | } 29 | 30 | return true; 31 | }; 32 | 33 | export { formatNumber, isValidNumber }; 34 | -------------------------------------------------------------------------------- /components/layout/index.js: -------------------------------------------------------------------------------- 1 | import { useEffect } from "react"; 2 | import { useRouter } from "next/router"; 3 | 4 | import useDidMount from "../../hooks/useDidMount"; 5 | import { scrollToPosition } from "../../lib/scroll"; 6 | 7 | import Container from "./Container"; 8 | import Header from "./Header"; 9 | import Main from "./Main"; 10 | import Footer from "./Footer"; 11 | 12 | const Layout = ({ children }) => { 13 | const didMount = useDidMount(); 14 | const router = useRouter(); 15 | const { asPath } = router; 16 | 17 | /** 18 | * Scroll to top on each route change using `asPath` (resolved path), 19 | * not `pathname` (may be a dynamic route). 20 | */ 21 | useEffect(() => { 22 | if (didMount) { 23 | scrollToPosition(); 24 | } 25 | }, [asPath]); 26 | 27 | return ( 28 | 29 |
30 |
{children}
31 |