Skip to content

Commit

Permalink
Renew frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
syjn99 committed Dec 26, 2024
1 parent 000ab18 commit 5e0d9d2
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 283 deletions.
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Svelte</title>
</head>
Expand Down
1 change: 0 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
},
"dependencies": {
"@ethersproject/address": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"animate.css": "^4.1.1",
"bulma": "^0.9.4",
"bulma-toast": "^2.4.4"
Expand Down
Binary file removed web/public/background.jpg
Binary file not shown.
Binary file removed web/public/favicon.png
Binary file not shown.
11 changes: 11 additions & 0 deletions web/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 105 additions & 51 deletions web/src/Faucet.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script>
import { onMount } from 'svelte';
import { getAddress } from '@ethersproject/address';
import { CloudflareProvider } from '@ethersproject/providers';
import { setDefaults as setToast, toast } from 'bulma-toast';
let input = null;
Expand Down Expand Up @@ -52,20 +51,6 @@
return;
}
if (address.endsWith('.eth')) {
try {
const provider = new CloudflareProvider();
address = await provider.resolveName(address);
if (!address) {
toast({ message: 'invalid ENS name', type: 'is-warning' });
return;
}
} catch (error) {
toast({ message: error.reason, type: 'is-warning' });
return;
}
}
try {
address = getAddress(address);
} catch (error) {
Expand Down Expand Up @@ -135,34 +120,61 @@
</div>

<div class="hero-body">
<div class="container has-text-centered">
<div class="column is-6 is-offset-3">
<h1 class="title">
Receive {faucetInfo.payout}
{faucetInfo.symbol} per request
</h1>
<h2 class="subtitle">
Serving from {faucetInfo.account}
</h2>
<div id="hcaptcha" data-size="invisible"></div>
<div class="box">
<div class="field is-grouped">
<p class="control is-expanded">
<input
bind:value={input}
class="input is-rounded"
type="text"
placeholder="Enter your address or ENS name"
/>
</p>
<p class="control">
<button
on:click={handleRequest}
class="button is-primary is-rounded"
>
Request
</button>
</p>
<div class="container">
<div class="columns is-vcentered">
<!-- Left Column - Protocol Info -->
<div class="column is-5 left-column">
<img src="/logo.png" alt="Over Protocol Logo" class="protocol-logo" />
<div class="protocol-info">
<h2 class="title is-4">Faucet for Dolphin</h2>
<div class="links-section">
<a href="https://docs.over.network" class="protocol-link" target="_blank" rel="noopener noreferrer">
<span class="icon"><i class="fa fa-book"></i></span>
<span>Documentation</span>
</a>
<a href="https://discord.com/invite/overprotocol" class="protocol-link" target="_blank" rel="noopener noreferrer">
<span class="icon"><i class="fa fa-comments"></i></span>
<span>Discord Community</span>
</a>
<a href="https://github.com/overprotocol" class="protocol-link" target="_blank" rel="noopener noreferrer">
<span class="icon"><i class="fa fa-github"></i></span>
<span>GitHub</span>
</a>
</div>
</div>
</div>

<!-- Right Column - Faucet Interface -->
<div class="column is-7">
<div class="faucet-container">
<h1 class="title">
Receive {faucetInfo.payout}
{faucetInfo.symbol} per request
</h1>
<h2 class="subtitle">
Serving from {faucetInfo.account}
</h2>
<div id="hcaptcha" data-size="invisible"></div>
<div class="box">
<div class="field is-grouped">
<p class="control is-expanded">
<input
bind:value={input}
class="input is-rounded"
type="text"
placeholder="Enter your address"
/>
</p>
<p class="control">
<button
on:click={handleRequest}
class="button is-primary is-rounded"
>
Request
</button>
</p>
</div>
</div>
</div>
</div>
</div>
Expand All @@ -173,19 +185,61 @@

<style>
.hero.is-info {
background:
linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
url('/background.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background: linear-gradient(135deg, #1a1a1a 0%, #363636 100%);
}
.hero .subtitle {
padding: 3rem 0;
padding: 1.5rem 0;
line-height: 1.5;
}
.box {
border-radius: 19px;
background: rgba(255, 255, 255, 0.9);
}
.left-column {
padding: 2rem;
background: rgba(255, 255, 255, 0.9);
border-radius: 15px;
}
.protocol-logo {
max-width: 200px;
margin-bottom: 2rem;
}
.protocol-info {
color: #1a1a1a;
}
.protocol-info h2 {
color: #1a1a1a !important;
}
.links-section {
display: flex;
flex-direction: column;
gap: 1rem;
margin-top: 2rem;
}
.protocol-link {
display: flex;
align-items: center;
gap: 0.5rem;
color: #1a1a1a;
padding: 0.5rem;
border-radius: 8px;
transition: background-color 0.3s ease;
}
.protocol-link:hover {
background-color: rgba(0, 0, 0, 0.1);
color: #1a1a1a;
}
.faucet-container {
padding: 2rem;
}
</style>
Loading

0 comments on commit 5e0d9d2

Please sign in to comment.