Skip to content

Commit c92c74a

Browse files
committed
fix(og:image): fixed og-image issue, and refactor code
1 parent 0f1385f commit c92c74a

File tree

5 files changed

+18
-54
lines changed

5 files changed

+18
-54
lines changed

app/globals.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@
103103

104104

105105
/* Custom scrollbar styles */
106+
html {
107+
scroll-behavior: smooth;
108+
}
109+
106110
.custom-scrollbar {
107111
scrollbar-width: thin;
108112
scrollbar-color: hsl(var(--primary)) transparent;

app/layout.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,23 @@ export const metadata: Metadata = {
1919
siteName: "BlockchainX",
2020
type: "website",
2121
locale: "en_US",
22+
images: [{
23+
url: "https://raw.githubusercontent.com/ShahVandit8/repo-storage/refs/heads/main/blockchain-simulator/ogimage/og.png",
24+
width: 1200,
25+
height: 630,
26+
alt: "BlockchainX - Interactive Blockchain Simulator & Visualizer",
27+
}],
2228
},
2329
twitter: {
2430
card: "summary_large_image",
2531
title: "BlockchainX - Interactive Blockchain Simulator & Visualizer",
2632
description: "BlockchainX is an interactive blockchain simulator to visualize mining, create wallets, and send transactions in real-time. Learn blockchain and Bitcoin mining easily.",
27-
images: ["https://i.ibb.co/sJ2WsJvz/og-5.png"],
33+
images: [{
34+
url: "https://raw.githubusercontent.com/ShahVandit8/repo-storage/refs/heads/main/blockchain-simulator/ogimage/og.png",
35+
width: 1200,
36+
height: 630,
37+
alt: "BlockchainX - Interactive Blockchain Simulator & Visualizer",
38+
}],
2839
},
2940
alternates: {
3041
canonical: "https://shahvandit8.github.io/blockchain-simulator/",

app/opengraph-image.png

-761 KB
Binary file not shown.

app/page.tsx

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default function LandingPage() {
5050
>
5151
Features
5252
</a>
53-
<a href="#" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
53+
<a href="https://github.com/ShahVandit8/blockchain-simulator" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
5454
GitHub
5555
</a>
5656
</div>
@@ -66,47 +66,6 @@ export default function LandingPage() {
6666

6767
<main>
6868
{/* Hero Section */}
69-
{/* <section className="py-24 text-center">
70-
<motion.div
71-
initial={{ opacity: 0, y: 20 }}
72-
animate={{ opacity: 1, y: 0 }}
73-
transition={{ duration: 0.5 }}
74-
className="container mx-auto px-4"
75-
>
76-
<h1 className="text-5xl md:text-7xl font-bold mb-6 tracking-tight">
77-
<span className="text-white">Visualize & Learn</span>
78-
<br />
79-
<span className="bg-gradient-to-r from-blue-500 to-purple-500 bg-clip-text text-transparent">
80-
Blockchain
81-
</span>{" "}
82-
<span className="text-white">Technology</span>
83-
</h1>
84-
<p className="text-xl text-gray-400 mb-12 max-w-3xl mx-auto">
85-
Interactive blockchain simulator for developers, students, and
86-
enthusiasts. Create blocks, make transactions, and visualize the
87-
entire process in real-time.
88-
</p>
89-
<div className="flex justify-center space-x-4">
90-
<Link href="/simulator">
91-
<Button
92-
size="lg"
93-
className="bg-white text-black hover:bg-gray-200"
94-
>
95-
Try Simulator
96-
<ArrowRight className="ml-2 h-4 w-4" />
97-
</Button>
98-
</Link>
99-
<Button
100-
size="lg"
101-
variant="outline"
102-
className="border-white/20 hover:bg-white/10"
103-
>
104-
<Github className="mr-2 h-4 w-4" />
105-
GitHub
106-
</Button>
107-
</div>
108-
</motion.div>
109-
</section> */}
11069
<section className="relative overflow-hidden py-24 text-center">
11170
<motion.div
11271
initial={{ opacity: 0, y: 20 }}
@@ -235,7 +194,7 @@ export default function LandingPage() {
235194
BlockchainX
236195
</a>
237196
. The source code is available on{" "}
238-
<a href="https://github.com/ShahVandit8" target="_blank" rel="noopener noreferrer" className="text-foreground hover:text-primary transition-colors">
197+
<a href="https://github.com/ShahVandit8/blockchain-simulator" target="_blank" rel="noopener noreferrer" className="text-foreground hover:text-primary transition-colors">
239198
GitHub
240199
</a>
241200
.

app/simulator/page.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
"use client";
22

33
import { useState, useEffect, useRef } from "react";
4-
import { v4 as uuidv4 } from "uuid";
54
import { motion, AnimatePresence } from "framer-motion";
65
import { Button } from "@/components/ui/button";
76
import { Input } from "@/components/ui/input";
87
import { Card } from "@/components/ui/card";
98
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
10-
import { ScrollArea } from "@/components/ui/scroll-area";
119
import { LogConsole } from "@/components/log-console";
1210
import Link from "next/link";
1311
import {
@@ -31,34 +29,26 @@ import {
3129
Wallet,
3230
ArrowLeftRight,
3331
Plus,
34-
Settings,
3532
ArrowLeft,
3633
} from "lucide-react";
3734
import { ModeToggle } from "@/components/theme-toggle";
3835
import {
3936
Block,
4037
Blockchain,
41-
Transaction,
4238
Wallet as WalletType,
4339
constructMerkleTree,
44-
generateWalletKeyPair,
4540
} from "@/lib/blockchain";
46-
import Image from "next/image";
4741

4842
export default function BlockchainSimulator() {
4943
const [AppBlockchain] = useState(() => new Blockchain());
50-
// const AppBlockchain = new Blockchain();
5144

5245
const [logs, setLogs] = useState<{ message: string; timestamp: Date }[]>([]);
53-
const [isLoading, setIsLoading] = useState(false);
54-
const [selectedBlock, setSelectedBlock] = useState<Block | null>(null);
5546
const [isNewTransactionOpen, setIsNewTransactionOpen] = useState(false);
5647
const [isNewWalletOpen, setIsNewWalletOpen] = useState(false);
5748
const [isMiningOpen, setIsMiningOpen] = useState(false);
5849
const [nonce, setNonce] = useState(0);
5950
const [hash, setHash] = useState("");
6051
const [timeElapsed, setTimeElapsed] = useState(0);
61-
const [nonceDisplay, setNonceDisplay] = useState(0);
6252
const [isMining, setIsMining] = useState(false);
6353
const [mined, setMined] = useState("");
6454
const [isPendingTransactionsEmpty, setIsPendingTransactionsEmpty] = useState(true);

0 commit comments

Comments
 (0)