-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
147 lines (139 loc) · 5.06 KB
/
Copy pathindex.html
File metadata and controls
147 lines (139 loc) · 5.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JavaBooks Documentation</title>
<style>
/* ===== CSS ===== */
body, html { margin:0; padding:0; font-family: Arial,sans-serif; scroll-behavior:smooth; }
.container { display:flex; min-height:100vh; }
.sidebar { width:220px; background:#1e90ff; color:white; padding:20px; position:fixed; height:100%; overflow-y:auto; }
.sidebar h2 { text-align:center; margin-bottom:30px; }
.sidebar ul { list-style:none; padding:0; }
.sidebar ul li { margin:15px 0; }
.sidebar ul li a { color:white; text-decoration:none; font-weight:bold; transition:color 0.3s ease; }
.sidebar ul li a:hover, .sidebar ul li a.active { color:#ffeb3b; }
.content { margin-left:240px; padding:30px; flex:1; animation:fadeIn 0.5s ease; }
.screenshot { max-width:300px; margin:10px 0; border:1px solid #ccc; transition:transform 0.3s ease; }
.screenshot:hover { transform:scale(1.05); }
pre { background:#eaeaea; padding:10px; overflow-x:auto; }
h1,h2,h3 { color:#1e90ff; }
section { margin-bottom:50px; }
@keyframes fadeIn { from{opacity:0; transform:translateY(20px);} to{opacity:1; transform:translateY(0);} }
</style>
</head>
<body>
<div class="container">
<!-- Sidebar -->
<aside class="sidebar">
<h2>JavaBooks</h2>
<ul>
<li><a href="#overview" class="active">Overview</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#classes">Classes</a></li>
<li><a href="#docker">Docker</a></li>
<li><a href="#ci">CI/CD</a></li>
<li><a href="#license">License</a></li>
</ul>
</aside>
<!-- Content -->
<main class="content">
<section id="overview">
<h1>Overview</h1>
<p>JavaBooks is a Java library for managing books in console apps, web apps, and games like Minecraft. Provides add/list/search functions and easy integration into projects.</p>
<!-- Example Screenshots (base64 placeholders) -->
<img class="screenshot" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA..." alt="Console Screenshot">
<img class="screenshot" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA..." alt="Web Screenshot">
</section>
<section id="installation">
<h1>Installation</h1>
<p>Clone the repository:</p>
<pre><code>git clone https://github.com/yourusername/JavaBooks.git</code></pre>
<p>Include in Maven or Gradle project:</p>
<pre><code><dependency>
<groupId>com.javabooks</groupId>
<artifactId>javabooks</artifactId>
<version>1.0.0</version>
</dependency></code></pre>
</section>
<section id="usage">
<h1>Usage Examples</h1>
<h2>Console Example</h2>
<pre><code>Library library = new Library();
library.addBook(new Book("Java Programming","John Doe",2022));
library.listBooks();
library.searchByAuthor("Jane Smith");</code></pre>
<h2>Web Example</h2>
<pre><code>@RestController
@RequestMapping("/books")
public class ExampleWeb {
private Library library = new Library();
@GetMapping public List<Book> getAllBooks() { return library.getBooks(); }
}</code></pre>
</section>
<section id="classes">
<h1>Classes</h1>
<h2>Book</h2>
<pre><code>public class Book {
private String title;
private String author;
private int year;
public Book(String title,String author,int year){...}
public String getTitle(){...}
public String getAuthor(){...}
public int getYear(){...}
public String toString(){...}
}</code></pre>
<h2>Library</h2>
<pre><code>public class Library {
public void addBook(Book book){...}
public void listBooks(){...}
public void searchByAuthor(String author){...}
public void searchByTitle(String title){...}
public List<Book> getBooks(){...}
}</code></pre>
</section>
<section id="docker">
<h1>Docker</h1>
<pre><code>docker build -t javabooks .
docker run -it javabooks</code></pre>
</section>
<section id="ci">
<h1>CI/CD</h1>
<pre><code>name: Java CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with: java-version:17
- run: mvn clean compile</code></pre>
</section>
<section id="license">
<h1>License</h1>
<p>MIT License. See LICENSE file for details.</p>
</section>
</main>
</div>
<script>
// ===== JS =====
// Highlight active sidebar link on scroll
const links=document.querySelectorAll('.sidebar ul li a');
const sections=document.querySelectorAll('main section');
function activateLink(){
let scrollPos=window.scrollY+120;
sections.forEach(section=>{
if(scrollPos>=section.offsetTop && scrollPos<section.offsetTop+section.offsetHeight){
links.forEach(link=>link.classList.remove('active'));
document.querySelector('.sidebar ul li a[href="#'+section.id+'"]').classList.add('active');
}
});
}
window.addEventListener('scroll', activateLink);
</script>
</body>
</html>