37
37
📌 Key Features:
38
38
39
39
🎥 Multiple Media Support: Images, videos (including YouTube), audio files, PDFs, Markdown files
40
+ 💕 compareMode: Compare Before and After Images
40
41
🔍 Zoom & Pan: Explore media closely with built-in zoom and pan functionality.
41
42
🎬 Transition Effects: Fade, slide, zoom, flip, rotate, blur, squeeze, and more.
42
43
🖼️ Thumbnail Carousel: Quickly navigate slides with customizable thumbnail positioning.
53
54
54
55
Happy sliding! 🚀
55
56
```
56
- ## Installation
57
+ # Installation
57
58
58
59
The plugin is available through Obsidian as a community plugin.
59
60
@@ -64,121 +65,196 @@ The plugin is available through Obsidian as a community plugin.
64
65
3 . Copy the files from step 1 into the new folder.
65
66
4 . Enable the plugin in the Obsidian settings under the "Community plugins" section. You might have to restart Obsidian to see the plugin.
66
67
68
+ # Usuage
67
69
68
- ## Creating a Media Slider
69
-
70
- To create a slider in your note, wrap your media list in a code block tagged with media-slider. For example:
71
- ```
70
+ ## 📸 Basic Image Slider
72
71
``` media-slider
73
- ---
74
- # A unique ID (string) to keep this slider’s state separate from others.
75
- sliderId: my-slider
72
+ ![[image1.png]]
73
+ ![[image2.png]]
74
+ ![[image3.png]]
75
+ ```
76
76
77
- # Show a thumbnail “filmstrip” alongside the main slider?
78
- # true → thumbnails visible
79
- # false → thumbnails hidden
80
- carouselShowThumbnails: true
77
+ ## 🎥 Mixed Media Support
81
78
82
- # Where to place the thumbnail strip:
83
- # top, bottom, left, or right
84
- thumbnailPosition: bottom
79
+ ``` markdown
80
+ ```media-slider
81
+ ![[image1.png]]
82
+ ![[video1.mp4]]
83
+ ![[audio1.mp3]]
84
+ 
85
+ ```
85
86
86
- # How to render captions (if you append “|Your caption” to a file link):
87
- # none → no captions
88
- # overlay → text over the image
89
- # below → text beneath the image
90
- captionMode: overlay
87
+ Supports images, videos, audio, and external URLs.
91
88
92
- # Automatically cycle slides?
93
- autoplay: false
89
+ ## 🏷️ Captions
94
90
95
- # Time between slides (milliseconds) when autoplay=true
96
- slideshowSpeed: 0
91
+ ``` markdown
92
+ ```media-slider
93
+ ![[image1.png|A beautiful sunrise]]
94
+ ![[image2.png|A calm lake]]
95
+ ```
97
96
98
- # E.g. "100%", "800px", "50vw" — controls the slider’s container width
99
- width: 100%
97
+ Add captions to your images using the ` |caption ` syntax.
100
98
101
- # E.g. "300px", "50vh" — fixes the container’s height
102
- height: 300px
99
+ ## 🆚 Compare Mode (Simple)
103
100
104
- # Transition between slides:
105
- # fade, slide, zoom, none
106
- transitionEffect: fade
101
+ ``` markdown
102
+ ```media-slider
103
+ ---
104
+ compareMode: true
105
+ ---
106
+ ![[before.png||1-1]]
107
+ ![[after.png||1-2]]
108
+ ```
109
+ Compare two images side by side.
107
110
108
- # How long the transition takes (ms)
109
- transitionDuration: 500
111
+ ---
110
112
111
- # true → enable right-click & drag to pan/zoom on images
112
- # false → standard <img> behavior
113
- enhancedView: true
113
+ ## 🆚 Compare Mode (Custom Options)
114
114
115
- # true → show your “interactive notes” overlay on each slide
116
- interactiveNotes: true
115
+ ``` markdown
116
+ ```media-slider
117
+ ---
118
+ compareMode: true
119
+ orientation: "horizontal"
120
+ initialPosition: 50
121
+ showLabels: true
122
+ label1: "Before"
123
+ label2: "After"
124
+ ---
125
+ ![[before.png||1-1]]
126
+ ![[after.png||1-2]]
127
+ ![[before2.png||2-1]]
128
+ ![[after2.png||2-2]]
129
+ ```
130
+ Customize compare mode orientation, labels, and divider position.
117
131
118
- # JPEG/WebP compression (0–1) when inserting/pasting images
119
- # 0 = max compression, 1 = original quality
120
- compression: 0.8
121
132
122
- # Array of file extensions to include in your vault folder scan
133
+ ## 📂 Folder Support
134
+
135
+ ``` markdown
136
+ ```media-slider
137
+ ---
123
138
fileTypes:
124
139
- "jpg"
125
140
- "png"
126
141
- "mp4"
127
142
128
- # true → recurse into subfolders when you give a folder path
129
- # false → only scan that exact folder
130
- recursive: true
143
+ recursive: true
144
+ # false → scan exact folder
145
+ # true → scans subfolders as well
146
+ ---
147
+ [[folder/subfolder/]]
148
+ ```
149
+ Automatically include all supported media from a folder.
131
150
132
151
133
- compareMode:
134
- # master toggle
135
- enabled: true
152
+ ## 🖼️ Thumbnail Carousel
136
153
137
- # orientation of the divider:
138
- # vertical → left/right panes
139
- # horizontal → top/bottom panes
140
- orientation: "vertical"
154
+ ``` markdown
155
+ ```media-slider
156
+ ---
157
+ carouselShowThumbnails: true
158
+ thumbnailPosition: bottom #right,left, top
159
+ ---
160
+ ![[image1.png]]
161
+ ![[image2.png]]
162
+ ![[image3.png]]
163
+ ```
164
+ Enable and position the thumbnail carousel.
141
165
142
- # initial divider position (percentage 0–100)
143
- initialPosition: 50
144
166
145
- # show “Before” / “After” labels?
146
- showLabels: true
167
+ ## ✨ Transition Effects
147
168
148
- # label text for the first pane
149
- label1: "Before"
169
+ ``` markdown
170
+ ```media-slider
171
+ ---
172
+ transitionEffect: slide
173
+ transitionDuration: 500
174
+ ---
175
+ ![[image1.png]]
176
+ ![[image2.png]]
177
+ ```
178
+ Choose from fade, slide, zoom, flip, etc.
150
179
151
- # label text for the second pane
152
- label2: "After"
180
+
181
+ ## 🔍 Zoom & Pan
182
+
183
+ ``` markdown
184
+ ```media-slider
185
+ ---
186
+ enhancedView: true
187
+ ---
188
+ ![[image1.png]]
189
+ ```
190
+ Enable zoom and pan controls for images.
153
191
154
192
---
155
193
194
+ ## 📝 Interactive Notes
195
+
196
+ ``` markdown
197
+ ```media-slider
198
+ ---
199
+ interactiveNotes: true
200
+ ---
156
201
![[image1.png]]
157
- ![[video1.mp4]] # mp4 slides supported
158
- ![[audio1.mp3]] # audio will appear as a media control
159
-  # external URLs work too
202
+ ![[image2.png]]
203
+ ```
204
+ Add and save notes for each slide.
160
205
161
- ![[some.pdf]] # PDF pages will be rendered as images
162
206
163
- [[folder/subfolder/]] # scan an entire folder of supported fileTypes
207
+ ## ✏️ Drawing Annotations
164
208
165
- # Compare-mode grouping: use the same group ID (e.g. “1”) on two lines:
166
- ![[compare1.png||1-1]]
167
- ![[compare2.png||1-2]]
168
- ![[image3.png]]
169
- ![[compare4.png||2-1]]
170
- ![[compare5.png||2-2]]
209
+ Enable in plugin settings. When enabled, a drawing button appears on images for annotation.
171
210
172
- ````
211
+ ---
173
212
174
- - **YAML Metadata:**
175
- The section between the `---` lines is used to configure slider behavior (see next section).
213
+ ## 🛠️ Full YAML Example
176
214
177
- - **Media Files:**
178
- Each media file is listed on a new line using Obsidian’s link syntax. You can include images, videos, audio files, PDFs, or Markdown files.
215
+ For advanced users, you can combine multiple options:
216
+
217
+ ``` markdown
218
+ ```media-slider
219
+ ---
220
+ sliderId: my-slider
221
+ carouselShowThumbnails: true
222
+ thumbnailPosition: bottom
223
+ captionMode: overlay
224
+ autoplay: false
225
+ slideshowSpeed: 0
226
+ width: 100%
227
+ height: 300px
228
+ transitionEffect: fade
229
+ transitionDuration: 500
230
+ enhancedView: true
231
+ interactiveNotes: true
232
+ compression: 0.8
233
+ fileTypes:
234
+ - "jpg"
235
+ - "png"
236
+ - "mp4"
237
+ recursive: true
238
+ compareMode: true
239
+ orientation: "vertical"
240
+ initialPosition: 50
241
+ showLabels: true
242
+ label1: "Before"
243
+ label2: "After"
244
+ ---
245
+ ![[image1.png]]
246
+ ![[video1.mp4]]
247
+ ![[audio1.mp3]]
248
+ ![[compare1.png||1-1]]
249
+ ![[compare2.png||1-2]]
250
+ ```
179
251
180
252
---
181
253
254
+ ** Tip:**
255
+ For each feature, you can combine options as needed. See the full YAML example for how to mix and match.
256
+
257
+
182
258
## YAML Metadata Options
183
259
184
260
Inside the YAML block at the top of your media-slider code block, you can customize various options:
0 commit comments