Skip to content

Commit c09c18a

Browse files
Merge pull request #24 from tomik23:title
feat: Title
2 parents 6649a20 + aaf0ebf commit c09c18a

22 files changed

+1023
-979
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube/)
3939
#### You can download from CDN as well
4040
```html
4141
<!-- CSS -->
42-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tomik23/[email protected].0/dist/css/youtubeLazy.min.css"/>
42+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/tomik23/[email protected].1/dist/css/youtubeLazy.min.css"/>
4343

4444
<!-- JS -->
45-
<script src="https://cdn.jsdelivr.net/gh/tomik23/[email protected].0/dist/js/youtubeLazy.min.js"></script>
45+
<script src="https://cdn.jsdelivr.net/gh/tomik23/[email protected].1/dist/js/youtubeLazy.min.js"></script>
4646
```
4747

4848

@@ -52,6 +52,7 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube/)
5252
- **"local": true** - parameter that tells the library that the movie should play in the same div as the thumbnail, not in the lightbox
5353
- **"maxWidth": 50** - the video opens to the given width, it is a percentage, in this example 50%, if there is no number then the video opens to the whole window - 100%. You can also set a global `maxWidth` for all videos that open in the lightbox. Just add the same `maxWidth: 80` parameter to option, see the example below
5454
- **"openIn"** - this parameter allows you to display a button which, when clicked, directly opens the youtube page with the movie. For full functionality you need the corresponding parameter also added to js, see below `createWatchIn: () => {}`
55+
- **"title"** - the title of the video, it is displayed top of container`
5556

5657
```html
5758
<!-- default -->
@@ -65,6 +66,9 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube/)
6566

6667
<!-- add button "Watch in ..." -->
6768
<div class="ytLazy__item" data-yt='{ "id":"XHeDps0fX6c", "openIn": true }'></div>
69+
70+
<!-- add title -->
71+
<div class="ytLazy__item" data-yt='{ "id":"XHeDps0fX6c", "title": "Movie title ;)" }'></div>
6872
```
6973
> off course you can mix all of them
7074
@@ -73,7 +77,7 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube/)
7377
```html
7478
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
7579
<symbol id="youtube-logo" viewBox="0 0 300 67">
76-
<path ... />
80+
<path ... />
7781
</symbol>
7882
</svg>
7983

@@ -82,12 +86,9 @@ See the demo - [example](https://tomik23.github.io/lazy-youtube/)
8286
<script>
8387
// options are optional
8488
const options = {
85-
// color in hex, default black - #000
86-
background: '#383838',
87-
88-
// lightbox opcity, [10, 20, ...], max is 100
89-
// default: 80
90-
opacity: 90,
89+
// you can add color with opacity, default: 'rgba(0,0,0,0.9)'
90+
// rgba, hsla
91+
background: 'rgba(0,0,0,0.6)',
9192
9293
// global setting for the width of the displayed
9394
// movie as a percentage default 90%

dist/css/youtubeLazy.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/youtubeLazy.esm.js

Lines changed: 7 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)