Skip to content

Commit

Permalink
Neon styling
Browse files Browse the repository at this point in the history
  • Loading branch information
philipjames44 committed Mar 4, 2024
1 parent 6682e47 commit 23b2c61
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 18 deletions.
5 changes: 1 addition & 4 deletions src/components/liquidityPositions/status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,8 @@ const LPStatus = ({ nftId, position }: LPStatusProps) => {

return (
<Box
outline={".15em solid var(--complimentary-background)"}
borderRadius={".5em"}
className="neon-box"
padding={15}
width="fit-content"
backgroundImage={"var(--background-gradient)"}
>
<VStack width={"100%"}>
<Text>{nftId}</Text>
Expand Down
19 changes: 19 additions & 0 deletions src/components/util/loadingSpinner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Center, VStack, Spinner, Text } from "@chakra-ui/react";

export const LoadingSpinner = () => {
return (
<Center height="100vh">
<VStack spacing={4} align="center" justify="center">
<Spinner
className="neon-spinner" // Custom neon effect
thickness="4px"
speed="0.65s"
emptyColor="gray.200"
color="purple.700"
size="xl"
/>
<Text fontSize="l">Loading</Text>{" "}
</VStack>
</Center>
);
}
2 changes: 1 addition & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function MyApp({ Component, pageProps }: AppProps) {
global: {
// Apply some styles globally across all elements
body: {
bg: "var(--charcoal)",
bg: "var(--charcoal-secondary)",
color: "var(--light-grey)",
fontFamily: "sans-serif",
fontWeight: "400",
Expand Down
14 changes: 4 additions & 10 deletions src/pages/lp/[lp_nft_id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
} from "@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/dex/v1/dex_pb";
import Layout from "../../components/layout";
import LPStatus from "../../components/liquidityPositions/status";
import { VStack } from "@chakra-ui/layout";
import { Text } from "@chakra-ui/react";
import { VStack, Text, Spinner, Center } from "@chakra-ui/react";
import { LoadingSpinner } from "../../components/util/loadingSpinner";

export default function LP() {
const router = useRouter();
Expand Down Expand Up @@ -56,7 +56,7 @@ export default function LP() {
<Layout pageTitle={`LP - ${lp_nft_id}`}>
<main className={styles.main}>
{isLoading ? (
<p>Loading...</p>
<LoadingSpinner />
) : liquidityPosition ? (
<>
<VStack width={"100%"} paddingTop={"4em"}>
Expand All @@ -66,19 +66,13 @@ export default function LP() {
width={"100%"}
alignContent={"left"}
fontSize={"1.5em"}
paddingBottom=".5em"
>
Position Status
</Text>
<LPStatus nftId={lp_nft_id} position={liquidityPosition} />
</VStack>
</VStack>
{/*
<br />
<br />
<br />
<h1>NFT ID: {lp_nft_id}</h1>
<p>{JSON.stringify(liquidityPosition)}</p>
*/}
</>
) : (
<p>No liquidity position found.</p>
Expand Down
1 change: 1 addition & 0 deletions src/utils/protos/services/app/shielded-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class ShieldedPoolQuerier implements ShieldedPoolQuerierInterface {

async assetMetadata(assetId: AssetId): Promise<Metadata | undefined> {
const res = await this.client.assetMetadataById({ assetId });
console.info(res)
return res.denomMetadata;
}
}
6 changes: 4 additions & 2 deletions styles/Home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@

.header {
width: 100%;
background-color: var(--purple-accent-700); /* Grey with 50% opacity */
background: linear-gradient(to bottom, var(--purple-accent-700), transparent);
/* position: fixed; /* Optional: makes the header stay at the top on scroll */
top: 0;
z-index: 10;
z-index: 10;
padding: 1em;
}


25 changes: 24 additions & 1 deletion styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@
--light-brown: #363434;
--light-grey: #e3e3e3;
--brown: rgba(29, 29, 29, 0.7);
--background-gradient: linear-gradient(90deg, rgba(139, 228, 217, .42) 0%, rgba(200, 184, 128, .42) 50%, rgba(255, 144, 47, .36) 100%);
--background-gradient: linear-gradient(
90deg,
rgba(139, 228, 217, 0.42) 0%,
rgba(200, 184, 128, 0.42) 50%,
rgba(255, 144, 47, 0.36) 100%
);
--complimentary-background: #6e6eb8;
--teal-accent: #5b6584;
--purple-accent: #6e6eb8;
Expand Down Expand Up @@ -66,3 +71,21 @@ img {
max-width: 100%;
height: auto;
}

.neon-box {
outline: 0.15em solid var(--complimentary-background);
border-radius: 0.5em;
width: fit-content;
background: var(--charcoal);
box-shadow: 0 0 5px var(--complimentary-background),
/* Smaller glow */ 0 0 10px var(--complimentary-background),
/* Smaller glow */ 0 0 15px var(--complimentary-background),
/* Subtle bright glow */ 0 0 20px var(--complimentary-background),
/* Subtle bright glow */ 0 0 25px var(--complimentary-background),
/* Subtle bright glow */ 0 0 30px var(--complimentary-background); /* Subtle bright glow */
}

.neon-spinner {
filter: drop-shadow(0 0 8px white)
drop-shadow(0 0 12px white);
}

0 comments on commit 23b2c61

Please sign in to comment.