Skip to content

Commit

Permalink
Front 001 index page (#5)
Browse files Browse the repository at this point in the history
* create start page
* add Kimberlite contract interaction
  • Loading branch information
poludnev authored Mar 22, 2023
1 parent c6d3e85 commit 1cc018b
Show file tree
Hide file tree
Showing 49 changed files with 1,003 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ artifacts
.idea
package-lock.json
yarn.lock
.DS_Store
3 changes: 3 additions & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
1 change: 1 addition & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
### Frontend
28 changes: 28 additions & 0 deletions frontend/abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"inputs": [],
"name": "extractDiamond",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
]
74 changes: 74 additions & 0 deletions frontend/components/DeployButton/DeployButton.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.container {
background-color: white;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;

.button {
background-color: white;
position: relative;
width: 100%;
height: 100%;
border-radius: 16px;
border: 1px solid var(--lightest-diamond-blue);
font-size: 3rem;
font-weight: 500;
padding: 2rem 1rem;
cursor: pointer;
color: var(--diamond-blue-1);
overflow: hidden;
transition: all 1.3s;

.title {
position: relative;
display: inline-block;
transition: all 1.3s;
}

.background {
position: absolute;
top: 0;
left: 0;
background-image: url(../../public/images/grad-1.webp);
width: 100%;
height: 100%;
opacity: 0;
transition: all 0.3s;
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}

.error {
color: red;
}

.diamond {
transition: 0.3s;
}
&:hover {
&.error {
border: 1px solid red;
.background {
opacity: 0;
transition: all 0.3s;
}
}

.diamond {
color: white;
transition: 0.3s;
}
.background {
opacity: 1;
transition: all 0.3s;
}
}

&:disabled {
cursor: not-allowed;
}
}
}
32 changes: 32 additions & 0 deletions frontend/components/DeployButton/DeployButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import cn from 'classnames';
import { IDeployButtonProps } from './DeployButtonProps';
import styles from './DeployButton.module.scss';
export const DeployButton: React.FC<IDeployButtonProps> = ({ onClick, deploying, error }) => {

return (
<div className={styles.container}>
<button
className={cn(styles.button, error ? styles.error : null)}
onClick={onClick}
disabled={deploying}
>
<div className={styles.background}></div>
<span className={styles.title}>
{error && (
<span className={styles.error}>
Something went wrong, please check your transaction
</span>
)}
{!error &&
(deploying ? (
<span className={styles.diamond}>Deploying...</span>
) : (
<span>
Make your <span className={styles.diamond}>diamond</span>
</span>
))}
</span>
</button>
</div>
);
};
6 changes: 6 additions & 0 deletions frontend/components/DeployButton/DeployButtonProps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface IDeployButtonProps {
children?: React.ReactNode;
onClick: React.MouseEventHandler;
deploying: boolean;
error: boolean;
}
1 change: 1 addition & 0 deletions frontend/components/DeployButton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './DeployButton';
48 changes: 48 additions & 0 deletions frontend/components/Header/Header.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.container {
position: absolute;
width: 100%;
top: 0;
z-index: 5000;
.content {
max-width: 144rem;
margin: auto;
display: flex;
justify-content: space-between;
align-items: center;
padding: 5.6rem 4rem;
@media screen and (max-width: 768px) {
padding: 4rem;
}
@media screen and (max-width: 365px) {
padding: 2rem;
}

.logo {
display: flex;

height: 6.5rem;
padding-right: 1rem;
img {
height: 100%;
}

.title {
padding: 0.5rem 1.5rem;
font-size: 2.2rem;
font-weight: 700;
line-height: 2.2rem;
letter-spacing: 1px;
text-align: left;
color: #186faf;
max-width: 17rem;

@media screen and (max-width: 425px) {
padding: 0.5rem;
}
}
}
.connect {
font-size: 1.7rem;
}
}
}
23 changes: 23 additions & 0 deletions frontend/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* eslint-disable @next/next/no-img-element */
import { ConnectButton } from '@rainbow-me/rainbowkit';
import { IHeaderProps } from './HeaderProps';
import styles from './Header.module.scss';
import Link from 'next/link';
import { Navigation } from '../Navigation';

export const Header: React.FC<IHeaderProps> = () => {
return (
<div className={styles.container}>
<div className={styles.content}>
<div className={styles.logo}>
<Link href='/'>
<img src='/images/logo.png' alt='logo' />
</Link>
</div>
<div className={styles.connect}>
<ConnectButton />
</div>
</div>
</div>
);
};
3 changes: 3 additions & 0 deletions frontend/components/Header/HeaderProps.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface IHeaderProps {
children?: React.ReactNode;
}
1 change: 1 addition & 0 deletions frontend/components/Header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Header';
10 changes: 10 additions & 0 deletions frontend/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Header } from '@/components/Header';

export const Layout = ({ children }: { children: React.ReactNode }) => {
return (
<>
<Header />
{children}
</>
);
};
1 change: 1 addition & 0 deletions frontend/components/Layout/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Layout';
Loading

0 comments on commit 1cc018b

Please sign in to comment.