-
-
Table of Content
-
-
-
+
+
+
zkLend Documentation
-
- • Introduction
-
- Welcome to [Product Name] Documentation
- [Product Name] is a decentralized platform designed to [describe purpose, e.g., "empower users to securely manage digital assets and access DeFi tools effortlessly"]. This documentation provides a comprehensive guide on using [Product Name] and making the most of its features.
-
-
+
-
- • Overview
-
- What is [Product Name]?
- [Product Name] is a Web3 platform that leverages blockchain technology to [describe primary functionalities, e.g., "facilitate secure transactions, staking, and asset management without intermediaries"].
-
-
- Core features include:
-
-
- - • Decentralized Finance (DeFi): Access a suite of DeFi services, including lending, borrowing, and yield farming.
- - • Security-First Design: Built on smart contracts to ensure safety and transparency.
- - • Cross-Chain Compatibility: [Product Name] supports multiple blockchains for a seamless user experience.
-
-
+
-
- • Getting Started
- Setting Up Your Wallet
-
- - 1. Download a compatible Web3 wallet (e.g., MetaMask).
- - 2. Fund your wallet with the supported cryptocurrency.
-
-
+
-
-
-
+
);
};
diff --git a/frontend/src/pages/spotnet/documentation/Section.jsx b/frontend/src/pages/spotnet/documentation/Section.jsx
new file mode 100644
index 00000000..9f9c342a
--- /dev/null
+++ b/frontend/src/pages/spotnet/documentation/Section.jsx
@@ -0,0 +1,47 @@
+import React from 'react';
+import './documentation.css';
+
+const Section = ({ id, title, content }) => {
+ const renderContent = (item, index) => {
+ switch (item.type) {
+ case 'text':
+ return (
+
+ {item.value.split('\n').map((text, i) => (
+
+ {text}
+ {i < item.value.split('\n').length - 1 &&
}
+
+ ))}
+
+ );
+ case 'list':
+ return (
+
+ {item.items.map((listItem, i) => (
+ - • {listItem}
+ ))}
+
+ );
+ case 'orderedList':
+ return (
+
+ {item.items.map((listItem, i) => (
+ - {i + 1}. {listItem}
+ ))}
+
+ );
+ default:
+ return null;
+ }
+ };
+
+ return (
+
+ • {title}
+ {content.map((item, index) => renderContent(item, index))}
+
+ );
+};
+
+export default Section;
\ No newline at end of file
diff --git a/frontend/src/pages/spotnet/documentation/TableOfContents.jsx b/frontend/src/pages/spotnet/documentation/TableOfContents.jsx
new file mode 100644
index 00000000..c3dc1c9d
--- /dev/null
+++ b/frontend/src/pages/spotnet/documentation/TableOfContents.jsx
@@ -0,0 +1,85 @@
+import React, { useEffect, useState } from 'react';
+import { useLocation } from 'react-router-dom';
+
+const TableOfContents = ({ items }) => {
+ const location = useLocation();
+ const [activeId, setActiveId] = useState('introduction');
+
+ useEffect(() => {
+ if (location.pathname === '/documentation') {
+ setActiveId('introduction');
+ }
+
+ const handleScroll = () => {
+ const sections = document.querySelectorAll('.documentation-section');
+ const scrollPosition = window.scrollY;
+
+ sections.forEach((section) => {
+ const sectionTop = section.offsetTop - 100;
+ const sectionHeight = section.offsetHeight;
+
+ if (scrollPosition >= sectionTop && scrollPosition < sectionTop + sectionHeight) {
+ setActiveId(section.id);
+ }
+ });
+ };
+
+ window.addEventListener('scroll', handleScroll);
+ handleScroll();
+ return () => window.removeEventListener('scroll', handleScroll);
+ }, [location]);
+
+ const handleClick = (e, link) => {
+ e.preventDefault();
+ const targetId = link.replace('#', '');
+ const element = document.getElementById(targetId);
+
+ if (element) {
+ const headerHeight = 80;
+ const elementPosition = element.getBoundingClientRect().top + window.scrollY;
+ const offsetPosition = elementPosition - headerHeight;
+
+ window.scrollTo({
+ top: targetId === 'introduction' ? 0 : offsetPosition,
+ behavior: 'smooth'
+ });
+
+ setActiveId(targetId);
+ }
+ };
+
+ return (
+
+
Table of Content
+
+
+ );
+};
+
+export default TableOfContents;
\ No newline at end of file
diff --git a/frontend/src/pages/spotnet/documentation/documentation.css b/frontend/src/pages/spotnet/documentation/documentation.css
index f5fee5e5..456f865d 100644
--- a/frontend/src/pages/spotnet/documentation/documentation.css
+++ b/frontend/src/pages/spotnet/documentation/documentation.css
@@ -1,146 +1,270 @@
.documentation-container {
- display: flex;
- min-height: 100vh;
- background: linear-gradient(to bottom right, #0B0B14, #1A1A2E);
- color: #fff;
- position: relative;
- padding: 2rem;
- }
-
+ display: flex;
+ min-height: 100vh;
+ background: linear-gradient(135deg, #0B0B14 0%, #1A1A2E 100%);
+ color: var(--primary);
+ position: relative;
+ padding-top: 80px;
+}
+
+.documentation-container::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 100%;
+ height: 100%;
+ background-image:
+ radial-gradient(circle at 85% 15%, rgba(255,255,255,0.25) 1px, transparent 1px),
+ radial-gradient(circle at 15% 85%, rgba(255,255,255,0.25) 1px, transparent 1px),
+ radial-gradient(circle at 75% 75%, rgba(255,255,255,0.25) 1px, transparent 1px);
+ background-size: 100px 100px;
+ pointer-events: none;
+ z-index: 0;
+}
+
+.table-of-contents {
+ width: 280px;
+ padding: 2rem;
+ background: rgba(0, 0, 0, 0.3);
+ height: calc(100vh - 80px);
+ position: fixed;
+ overflow-y: auto;
+ border-right: 1px solid rgba(255, 255, 255, 0.1);
+}
+
+.toc-title {
+ font-size: 1.25rem;
+ font-weight: 600;
+ margin-bottom: 1.5rem;
+ color: var(--primary);
+}
+
+.toc-nav {
+ display: flex;
+ flex-direction: column;
+ gap: 1rem;
+}
+
+.toc-item {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+}
+
+.toc-link {
+ color: var(--primary);
+ text-decoration: none;
+ font-size: 0.875rem;
+ opacity: 0.8;
+ transition: all 0.2s ease;
+ display: flex;
+ align-items: center;
+ padding: 4px 8px;
+ border-radius: 4px;
+ width: 100%;
+ position: relative;
+}
+
+.toc-link:hover {
+ background: transparent;
+ color: #74D6FD;
+}
+
+.toc-link.active {
+ color: #74D6FD;
+ opacity: 1;
+ background: transparent;
+}
+
+.toc-link.active::after {
+ content: '';
+ position: absolute;
+ left: 8px;
+ right: 0;
+ bottom: -2px;
+ height: 1px;
+ background: linear-gradient(to right, #74D6FD 0%, transparent 100%);
+}
+
+.toc-subitems {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ margin-left: 1.5rem;
+}
+
+.toc-sublink {
+ color: var(--primary);
+ text-decoration: none;
+ font-size: 0.875rem;
+ opacity: 0.6;
+ padding: 4px 8px;
+ border-radius: 4px;
+ width: 100%;
+ position: relative;
+ transition: all 0.2s ease;
+}
+
+.toc-sublink:hover {
+ background: transparent;
+ color: #74D6FD;
+}
+
+.toc-sublink.active {
+ color: #74D6FD;
+ opacity: 1;
+ background: transparent;
+}
+
+.toc-sublink.active::after {
+ content: '';
+ position: absolute;
+ left: 8px;
+ right: 0;
+ bottom: -2px;
+ height: 1px;
+ background: linear-gradient(to right, #74D6FD 0%, transparent 100%);
+}
+
+.main-content {
+ margin-left: 280px;
+ flex: 1;
+ padding: 2rem 3rem;
+ position: relative;
+}
+
+.main-title {
+ font-size: 2.5rem;
+ font-weight: 700;
+ margin-bottom: 3rem;
+ color: #74D6FD;
+ background: linear-gradient(73deg, #74D6FD 1.13%, #E01DEE 103.45%);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+}
+
+.documentation-section {
+ margin-bottom: 4rem;
+ position: relative;
+ scroll-margin-top: 80px;
+}
+
+.section-title {
+ font-size: 1.5rem;
+ font-weight: 600;
+ margin-bottom: 1.5rem;
+ color: var(--primary);
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+}
+
+.section-text {
+ font-size: 1rem;
+ line-height: 1.8;
+ margin-bottom: 1.5rem;
+ opacity: 0.9;
+ color: var(--primary);
+}
+
+.feature-list,
+.setup-steps {
+ list-style: none;
+ padding: 0;
+ margin: 0.5rem 0 1.5rem 1.5rem;
+}
+
+.feature-list li,
+.setup-steps li {
+ margin-bottom: 0.75rem;
+ line-height: 1.6;
+ opacity: 0.9;
+ color: var(--primary);
+ display: flex;
+ align-items: flex-start;
+ gap: 0.5rem;
+}
+
+.scroll-button-wrapper {
+ position: fixed;
+ bottom: 2rem;
+ right: 2rem;
+ z-index: 50;
+}
+
+.scroll-button {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ padding: 0.75rem 1.25rem;
+ background: rgba(20, 20, 40, 0.8);
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ border-radius: 9999px;
+ color: var(--primary);
+ font-family: var(--font-family);
+ font-size: 0.875rem;
+ cursor: pointer;
+ transition: all 0.2s ease;
+ backdrop-filter: blur(8px);
+}
+
+.scroll-button:hover {
+ background: rgba(30, 30, 50, 0.9);
+ border-color: rgba(255, 255, 255, 0.2);
+}
+
+.scroll-text {
+ font-weight: 500;
+}
+
+.scroll-chevron {
+ transform: translateY(1px);
+ transition: transform 0.2s ease;
+}
+
+.scroll-button:hover .scroll-chevron {
+ transform: translateY(2px);
+}
+
+html {
+ scroll-behavior: smooth;
+ scroll-padding-top: 80px;
+}
+
+@media (max-width: 768px) {
.table-of-contents {
- width: 280px;
- padding: 2rem;
- background: rgba(0, 0, 0, 0.2);
- border-radius: 8px;
- position: fixed;
- height: calc(100vh - 4rem);
- overflow-y: auto;
- }
-
- .toc-title {
- font-size: 1.25rem;
- font-weight: 600;
- margin-bottom: 1.5rem;
- }
-
- .toc-nav {
- display: flex;
- flex-direction: column;
- gap: 1rem;
- }
-
- .toc-item {
- display: flex;
- flex-direction: column;
- gap: 0.5rem;
- }
-
- .toc-link {
- color: #fff;
- text-decoration: none;
- font-size: 0.875rem;
- opacity: 0.8;
- transition: opacity 0.2s;
- }
-
- .toc-link:hover {
- opacity: 1;
- }
-
- .toc-subitems {
- display: flex;
- flex-direction: column;
- gap: 0.5rem;
- margin-left: 1.5rem;
- }
-
- .toc-sublink {
- color: #fff;
- text-decoration: none;
- font-size: 0.875rem;
- opacity: 0.6;
+ display: none;
}
-
- .toc-sublink:hover {
- opacity: 0.8;
- }
-
+
.main-content {
- margin-left: 300px;
- flex: 1;
- padding: 2rem;
+ margin-left: 0;
+ padding: 1rem;
}
-
+
.main-title {
font-size: 2rem;
- font-weight: 700;
- margin-bottom: 2rem;
- background: linear-gradient(45deg, #6B46C1, #9F7AEA);
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- }
-
- .section-title {
- font-size: 1.5rem;
- font-weight: 600;
- margin-bottom: 1rem;
- color: #9F7AEA;
- }
-
- .section-text {
- font-size: 1rem;
- line-height: 1.6;
- margin-bottom: 1.5rem;
- opacity: 0.9;
- }
-
- .feature-list, .setup-steps {
- list-style: none;
- padding: 0;
- margin: 0 0 1.5rem 1rem;
- }
-
- .feature-list li, .setup-steps li {
- margin-bottom: 0.5rem;
- line-height: 1.6;
- opacity: 0.9;
- }
-
- .scroll-indicator {
- position: fixed;
- bottom: 2rem;
- right: 2rem;
- }
-
- .scroll-down {
- display: flex;
- align-items: center;
- gap: 0.5rem;
- background: rgba(111, 63, 245, 0.1);
- border: 1px solid rgba(111, 63, 245, 0.3);
- color: #fff;
- padding: 0.75rem 1.5rem;
- border-radius: 9999px;
- cursor: pointer;
- transition: all 0.2s;
- }
-
- .scroll-down:hover {
- background: rgba(111, 63, 245, 0.2);
}
-
- .scroll-icon {
- font-size: 1.25rem;
+
+ .scroll-button-wrapper {
+ bottom: 1rem;
+ right: 1rem;
}
-
- .documentation-container::before {
- content: '';
- position: absolute;
- top: 0;
- right: 0;
- width: 100%;
- height: 100%;
- background-image: radial-gradient(circle at center, rgba(255,255,255,0.1) 1px, transparent 1px);
- background-size: 50px 50px;
- pointer-events: none;
- }
\ No newline at end of file
+}
+
+.table-of-contents::-webkit-scrollbar {
+ width: 6px;
+}
+
+.table-of-contents::-webkit-scrollbar-track {
+ background: rgba(0, 0, 0, 0.1);
+}
+
+.table-of-contents::-webkit-scrollbar-thumb {
+ background: rgba(255, 255, 255, 0.1);
+ border-radius: 3px;
+}
+
+.table-of-contents::-webkit-scrollbar-thumb:hover {
+ background: rgba(255, 255, 255, 0.2);
+}
\ No newline at end of file