Skip to content

Commit 118dac3

Browse files
authored
Update README.md
1 parent c0d4ec0 commit 118dac3

File tree

1 file changed

+73
-49
lines changed

1 file changed

+73
-49
lines changed

README.md

Lines changed: 73 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,50 @@
1-
Got it! Let’s create a **detailed GitHub README** for your library, now named **`lcwTourGuide`**. I’ll include title, description, features, installation, usage, options, styling, and contributing instructions.
1+
# lcwTourGuide
22

3-
````markdown
4-
# 🧭 lcwTourGuide
3+
**lcwTourGuide** is a lightweight JavaScript library for creating guided tours on web pages. Easily highlight elements, add tooltips, and guide users through your UI with callbacks for start, step change, and end events.
54

6-
`lcwTourGuide` is a lightweight, dependency-free JavaScript library for creating guided tours and onboarding experiences on your website.
7-
It highlights elements, shows tooltips, automatically positions them, and provides callback hooks for easy customization.
5+
## Features
86

9-
---
10-
11-
## ✨ Features
12-
- 🚀 Pure JavaScript, no dependencies
13-
- 🎯 Highlights target elements with an overlay
14-
- 📜 Scrolls automatically to show the highlighted element and tooltip
15-
- 🧩 Smart tooltip positioning (auto-adjusts above/below based on space)
16-
- 🔄 Step navigation (`Next`, `Previous`, `Done`)
17-
- ⚡ Callback hooks for `onStart`, `onStep`, `onEnd`
18-
- 🎨 Fully customizable with CSS
7+
- Highlight elements on your page.
8+
- Display tooltips with custom text.
9+
- Navigate steps with "Next" and "Previous".
10+
- Callbacks for `onStart`, `onStep`, and `onEnd`.
11+
- Easy to integrate via CDN or npm.
1912

20-
---
13+
## Installation
2114

22-
## 📦 Installation
23-
24-
Include the script and styles in your project:
15+
### Via CDN
2516

2617
```html
27-
<link rel="stylesheet" href="lcwTourGuide.css">
28-
<script src="lcwTourGuide.js"></script>
29-
````
18+
<link rel="stylesheet" href="https://yourusername.github.io/lcwTourGuide/src/lcwTourGuide.css">
19+
<script src="https://yourusername.github.io/lcwTourGuide/dist/lcwTourGuide.min.js"></script>
3020

31-
Or copy the class code directly into your project.
3221

33-
---
3422

3523
## 🚀 Usage
3624

3725
### 1. Mark elements for the tour
3826

39-
Add `data-tour-step` and `data-tour-text` attributes to elements:
27+
Add `data-lcw-tour-step` and `data-lcw-tour-text` attributes to elements:
4028

41-
```html
42-
<button data-tour-step="1" data-tour-text="Click here to create a new item">
29+
```
30+
<button data-lcw-tour-step="1" data-lcw-tour-text="Click here to create a new item">
4331
New Item
4432
</button>
4533

46-
<input type="text" data-tour-step="2" data-tour-text="Enter the name here">
34+
<input type="text" data-lcw-tour-step="2" data-lcw-tour-text="Enter the name here">
4735

48-
<div data-tour-step="3" data-tour-text="Finally, click Save">
36+
<div data-lcw-tour-step="3" data-lcw-tour-text="Finally, click Save">
4937
Save
5038
</div>
5139
```
5240
53-
* `data-tour-step="1"` → defines the order
54-
* `data-tour-text="..."` → tooltip text
41+
* `data-lcw-tour-step="1"` → defines the order
42+
* `data-lcw-tour-text="..."` → tooltip text
5543
56-
---
5744
5845
### 2. Initialize the tour
5946
60-
```js
47+
```
6148
document.addEventListener('DOMContentLoaded', () => {
6249
const tour = new lcwTourGuide({
6350
onStart: () => console.log("✅ Tour started"),
@@ -85,29 +72,66 @@ document.addEventListener('DOMContentLoaded', () => {
8572
8673
Default styles can be customized:
8774
88-
```css
89-
.tour-tooltip {
90-
background: #222;
91-
color: #fff;
92-
border-radius: 8px;
93-
padding: 15px;
94-
max-width: 250px;
75+
```
76+
.lcw-tour-tooltip {
77+
position: absolute;
78+
background: #ffffff;
79+
color: #444;
80+
padding: 16px;
81+
border-radius: 6px;
82+
max-width: 280px;
83+
z-index: 10001;
84+
font-size: 14px;
85+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
9586
}
96-
.tour-highlight {
97-
box-shadow: 0 0 0 3px #00bcd4;
87+
88+
.lcw-tour-tooltip button {
89+
margin-top: 10px;
90+
margin-right: 5px;
91+
padding: 5px 10px;
92+
border: none;
93+
background: #007bff;
94+
color: white;
95+
border-radius: 4px;
96+
cursor: pointer;
9897
}
99-
.tour-overlay {
100-
background: rgba(0, 0, 0, 0.5);
98+
99+
.lcw-tour-tooltip button:hover {
100+
background: #0056b3;
101101
}
102-
```
103102

104-
---
103+
.lcw-tour-overlay {
104+
position: fixed;
105+
top: 0;
106+
left: 0;
107+
width: 100vw;
108+
height: 100vh;
109+
background: rgba(0, 0, 0, 0.6);
110+
z-index: 10000;
111+
}
105112

106-
## 🛠 Example
113+
.lcw-tour-highlight {
114+
position: relative;
115+
z-index: 10002;
116+
box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.7);
117+
border-radius: 4px;
118+
background-color: white;
119+
}
107120

108-
![demo gif placeholder](https://via.placeholder.com/600x300?text=lcwTourGuide+Demo)
121+
.lcw-tour-close {
122+
position: absolute;
123+
top: 8px;
124+
right: 10px;
125+
color: white;
126+
font-size: 18px;
127+
cursor: pointer;
128+
font-weight: bold;
129+
}
109130

110-
---
131+
.lcw-tour-close:hover {
132+
color: #ff6b6b;
133+
}
134+
```
111135
112136
## 📜 License
113137

0 commit comments

Comments
 (0)