Skip to content

Commit c0d4ec0

Browse files
authored
Update README.md
1 parent a95cd5e commit c0d4ec0

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed

README.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
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.
2+
3+
````markdown
14
# 🧭 lcwTourGuide
25

36
`lcwTourGuide` is a lightweight, dependency-free JavaScript library for creating guided tours and onboarding experiences on your website.
@@ -23,3 +26,103 @@ Include the script and styles in your project:
2326
```html
2427
<link rel="stylesheet" href="lcwTourGuide.css">
2528
<script src="lcwTourGuide.js"></script>
29+
````
30+
31+
Or copy the class code directly into your project.
32+
33+
---
34+
35+
## 🚀 Usage
36+
37+
### 1. Mark elements for the tour
38+
39+
Add `data-tour-step` and `data-tour-text` attributes to elements:
40+
41+
```html
42+
<button data-tour-step="1" data-tour-text="Click here to create a new item">
43+
New Item
44+
</button>
45+
46+
<input type="text" data-tour-step="2" data-tour-text="Enter the name here">
47+
48+
<div data-tour-step="3" data-tour-text="Finally, click Save">
49+
Save
50+
</div>
51+
```
52+
53+
* `data-tour-step="1"` → defines the order
54+
* `data-tour-text="..."` → tooltip text
55+
56+
---
57+
58+
### 2. Initialize the tour
59+
60+
```js
61+
document.addEventListener('DOMContentLoaded', () => {
62+
const tour = new lcwTourGuide({
63+
onStart: () => console.log("✅ Tour started"),
64+
onStep: (index, el) => console.log(`➡️ Step ${index + 1}:`, el),
65+
onEnd: () => console.log("🏁 Tour finished")
66+
});
67+
68+
tour.start();
69+
});
70+
```
71+
72+
---
73+
74+
## ⚙️ Options
75+
76+
| Option | Type | Default | Description |
77+
| --------- | -------- | ------------------- | ------------------------------- |
78+
| `onStart` | Function | `() => {}` | Called when the tour starts |
79+
| `onStep` | Function | `(index, el) => {}` | Called when a step is displayed |
80+
| `onEnd` | Function | `() => {}` | Called when the tour ends |
81+
82+
---
83+
84+
## 🎨 Styling
85+
86+
Default styles can be customized:
87+
88+
```css
89+
.tour-tooltip {
90+
background: #222;
91+
color: #fff;
92+
border-radius: 8px;
93+
padding: 15px;
94+
max-width: 250px;
95+
}
96+
.tour-highlight {
97+
box-shadow: 0 0 0 3px #00bcd4;
98+
}
99+
.tour-overlay {
100+
background: rgba(0, 0, 0, 0.5);
101+
}
102+
```
103+
104+
---
105+
106+
## 🛠 Example
107+
108+
![demo gif placeholder](https://via.placeholder.com/600x300?text=lcwTourGuide+Demo)
109+
110+
---
111+
112+
## 📜 License
113+
114+
MIT License. Free to use in personal and commercial projects.
115+
116+
---
117+
118+
## 🤝 Contributing
119+
120+
Contributions, issues, and feature requests are welcome!
121+
Feel free to fork, improve, and submit pull requests.
122+
123+
```
124+
125+
If you want, I can also **update your JS code** so it uses the class name `lcwTourGuide` and integrates perfectly with this README, making it fully plugin-ready for GitHub.
126+
127+
Do you want me to do that?
128+
```

0 commit comments

Comments
 (0)