Skip to content

Commit 74a67d4

Browse files
committed
Add sticky media support
1 parent 1b58499 commit 74a67d4

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

.env.development

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
EMAILJS_SERVER_ID=service_sedddrb
22
EMAILJS_TEMPLATE_ID=template_2w42djr
3-
EMAILJS_PUBLIC_KEY=6_tNcp-iBTQ09T2Ql
3+
EMAILJS_PUBLIC_KEY=6_tNcp-iBTQ09T2Ql
4+
APPLICATION_ID=QREGAGU3YC
5+
API_KEY=95b0c6179810e72eefdf5f0e8915ac85
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: Sticky Media
3+
sidebar_label: Sticky Media
4+
---
5+
6+
# Sticky media
7+
8+
You may add a sticky video by giving `sticky-popup` class to an `a` tag.
9+
10+
```html
11+
<!-- md content above -->
12+
13+
<a className="sticky-popup" target="_blank" href="https://www.youtube.com/watch?v=uRgQ_TpTj4g">Sticky video</a>
14+
15+
<!-- md content below -->
16+
```
17+
18+
## Try it!
19+
20+
<a
21+
className="sticky-popup"
22+
target="_blank"
23+
href="https://www.youtube.com/watch?v=uRgQ_TpTj4g"
24+
data-video-id="uRgQ_TpTj4g"
25+
>Sticky video</a>

docusaurus.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const lightCodeTheme = require("prism-react-renderer/themes/github");
66
// const darkCodeTheme = require("prism-react-renderer/themes/dracula");
77
// const Embed = require("./plugins/remark/embed");
88
const darkCodeTheme = require("prism-react-renderer/themes/shadesOfPurple");
9+
require('dotenv').config()
910
const customFields = {
1011
meta: {
1112
title: "An atom based state manager for JavaScript apps.",
@@ -52,6 +53,16 @@ const config = {
5253
defaultLocale: "en",
5354
locales: ["en"],
5455
},
56+
57+
scripts: [
58+
{
59+
src: '//cdn.jsdelivr.net/gh/app-generator/[email protected]/dist/index.min.js',
60+
id: 'stickyVideoScript',
61+
defer: true,
62+
class: 'sticky-popup',
63+
},
64+
],
65+
5566
// themes: ["@docusaurus/theme-live-codeblock"],
5667
plugins: [
5768
// "docusaurus-plugin-sass",

src/css/custom.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,3 +265,11 @@ ul.menu__list > li > a.menu__link--active {
265265
}
266266

267267
/* Home Page Header */
268+
269+
/* Sticky media */
270+
.sticky-video-modal {
271+
width: 100%;
272+
height: 100%;
273+
right: 0;
274+
bottom: 0;
275+
}

0 commit comments

Comments
 (0)