Skip to content

Commit 60413cd

Browse files
committed
fix: compareMode yaml fixed
1 parent 98e274d commit 60413cd

File tree

4 files changed

+247
-119
lines changed

4 files changed

+247
-119
lines changed

README.md

Lines changed: 152 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
📌 Key Features:
3838
3939
🎥 Multiple Media Support: Images, videos (including YouTube), audio files, PDFs, Markdown files
40+
💕 compareMode: Compare Before and After Images
4041
🔍 Zoom & Pan: Explore media closely with built-in zoom and pan functionality.
4142
🎬 Transition Effects: Fade, slide, zoom, flip, rotate, blur, squeeze, and more.
4243
🖼️ Thumbnail Carousel: Quickly navigate slides with customizable thumbnail positioning.
@@ -53,7 +54,7 @@
5354
5455
Happy sliding! 🚀
5556
```
56-
## Installation
57+
# Installation
5758

5859
The plugin is available through Obsidian as a community plugin.
5960

@@ -64,121 +65,196 @@ The plugin is available through Obsidian as a community plugin.
6465
3. Copy the files from step 1 into the new folder.
6566
4. Enable the plugin in the Obsidian settings under the "Community plugins" section. You might have to restart Obsidian to see the plugin.
6667

68+
# Usuage
6769

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
7271
```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+
```
7676

77-
# Show a thumbnail “filmstrip” alongside the main slider?
78-
# true → thumbnails visible
79-
# false → thumbnails hidden
80-
carouselShowThumbnails: true
77+
## 🎥 Mixed Media Support
8178

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+
![](https://…/zoom-pan.gif)
85+
```
8586

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.
9188

92-
# Automatically cycle slides?
93-
autoplay: false
89+
## 🏷️ Captions
9490

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+
```
9796

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.
10098

101-
# E.g. "300px", "50vh" — fixes the container’s height
102-
height: 300px
99+
## 🆚 Compare Mode (Simple)
103100

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.
107110

108-
# How long the transition takes (ms)
109-
transitionDuration: 500
111+
---
110112

111-
# true → enable right-click & drag to pan/zoom on images
112-
# false → standard <img> behavior
113-
enhancedView: true
113+
## 🆚 Compare Mode (Custom Options)
114114

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.
117131

118-
# JPEG/WebP compression (0–1) when inserting/pasting images
119-
# 0 = max compression, 1 = original quality
120-
compression: 0.8
121132

122-
# Array of file extensions to include in your vault folder scan
133+
## 📂 Folder Support
134+
135+
```markdown
136+
```media-slider
137+
---
123138
fileTypes:
124139
- "jpg"
125140
- "png"
126141
- "mp4"
127142

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.
131150

132151

133-
compareMode:
134-
# master toggle
135-
enabled: true
152+
## 🖼️ Thumbnail Carousel
136153

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.
141165

142-
# initial divider position (percentage 0–100)
143-
initialPosition: 50
144166

145-
# show “Before” / “After” labels?
146-
showLabels: true
167+
## ✨ Transition Effects
147168

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.
150179

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.
153191

154192
---
155193

194+
## 📝 Interactive Notes
195+
196+
```markdown
197+
```media-slider
198+
---
199+
interactiveNotes: true
200+
---
156201
![[image1.png]]
157-
![[video1.mp4]] # mp4 slides supported
158-
![[audio1.mp3]] # audio will appear as a media control
159-
![](https://…/zoom-pan.gif) # external URLs work too
202+
![[image2.png]]
203+
```
204+
Add and save notes for each slide.
160205

161-
![[some.pdf]] # PDF pages will be rendered as images
162206

163-
[[folder/subfolder/]] # scan an entire folder of supported fileTypes
207+
## ✏️ Drawing Annotations
164208

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.
171210

172-
````
211+
---
173212

174-
- **YAML Metadata:**
175-
The section between the `---` lines is used to configure slider behavior (see next section).
213+
## 🛠️ Full YAML Example
176214

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+
```
179251

180252
---
181253

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+
182258
## YAML Metadata Options
183259

184260
Inside the YAML block at the top of your media-slider code block, you can customize various options:

data.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@
1414
"1A-Pasted image 20250215003050.png | 23": "Add",
1515
"1A-Tj Holowaychuk.jpg | Details about the image": "Add1",
1616
"1A-https://dfstudio-d420.kxcdn.com/wordpress/wp-content/uploads/2019/06/digital_camera_photo-1080x675.jpg": "Information. This is camera I might forget that this is camera. that's why I need to write to 1-2 words notes specially about this image. I might later delete it and it is also not so important that I will include it in the note. I might later write a note about it. This is just random though I am writing",
17-
"1A-epicaly-short-113909.mp3": "audio",
18-
"test-Pasted image 20250330020512.png": ""
17+
"1A-epicaly-short-113909.mp3": "audio"
1918
}

0 commit comments

Comments
 (0)