mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-03 14:22:41 +02:00
Add sponsor
This commit is contained in:
@@ -22,7 +22,7 @@ const {
|
|||||||
id='sponsor-ad'
|
id='sponsor-ad'
|
||||||
target='_blank'
|
target='_blank'
|
||||||
rel='noopener sponsored'
|
rel='noopener sponsored'
|
||||||
class='fixed bottom-[15px] right-[20px] outline-[2px] outline-transparent z-50 bg-white max-w-[330px] shadow-lg hidden'
|
class='fixed bottom-[15px] right-[20px] outline-transparent z-50 bg-white max-w-[330px] shadow-lg outline-0 hidden'
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={ imageUrl }
|
src={ imageUrl }
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
const ad = document.querySelector('.sponsor-ad');
|
const ad = document.querySelector('#sponsor-ad');
|
||||||
if (!ad) {
|
if (!ad) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ad.classList.remove('hidden');
|
ad.classList.remove('hidden');
|
||||||
|
ad.classList.add('flex');
|
||||||
}, 500);
|
}, 500);
|
@@ -1,24 +1,40 @@
|
|||||||
class Topics {
|
class Topics {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
this.topicSearchId = 'search-topic-input';
|
||||||
|
|
||||||
this.onDOMLoaded = this.onDOMLoaded.bind(this);
|
this.onDOMLoaded = this.onDOMLoaded.bind(this);
|
||||||
this.init = this.init.bind(this);
|
this.init = this.init.bind(this);
|
||||||
this.filterTopicNodes = this.filterTopicNodes.bind(this);
|
this.filterTopicNodes = this.filterTopicNodes.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get topicSearchEl() {
|
||||||
|
return document.getElementById(this.topicSearchId);
|
||||||
|
}
|
||||||
|
|
||||||
filterTopicNodes(e) {
|
filterTopicNodes(e) {
|
||||||
const value = e.target.value.trim().toLowerCase();
|
const value = e.target.value.trim().toLowerCase();
|
||||||
if (!value) {
|
if (!value) {
|
||||||
document.querySelectorAll(`[data-topic]`).forEach((item) => item.classList.remove('hidden'));
|
document
|
||||||
|
.querySelectorAll(`[data-topic]`)
|
||||||
|
.forEach((item) => item.classList.remove('hidden'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.querySelectorAll(`[data-topic]`).forEach((item) => item.classList.add('hidden'));
|
document
|
||||||
|
.querySelectorAll(`[data-topic]`)
|
||||||
|
.forEach((item) => item.classList.add('hidden'));
|
||||||
|
|
||||||
document.querySelectorAll(`[data-topic*="${value}"]`).forEach((item) => item.classList.remove('hidden'));
|
document
|
||||||
|
.querySelectorAll(`[data-topic*="${value}"]`)
|
||||||
|
.forEach((item) => item.classList.remove('hidden'));
|
||||||
}
|
}
|
||||||
|
|
||||||
onDOMLoaded() {
|
onDOMLoaded() {
|
||||||
document.getElementById('search-topic-input').addEventListener('keyup', this.filterTopicNodes);
|
if (!this.topicSearchEl) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.topicSearchEl.addEventListener('keyup', this.filterTopicNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
@@ -28,4 +44,3 @@ class Topics {
|
|||||||
|
|
||||||
const topicRef = new Topics();
|
const topicRef = new Topics();
|
||||||
topicRef.init();
|
topicRef.init();
|
||||||
|
|
@@ -42,7 +42,11 @@ const roadmapData = roadmapFile.frontmatter as RoadmapFrontmatter;
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
!roadmapData.jsonUrl && (
|
||||||
<MarkdownRoadmap>
|
<MarkdownRoadmap>
|
||||||
<roadmapFile.Content />
|
<roadmapFile.Content />
|
||||||
</MarkdownRoadmap>
|
</MarkdownRoadmap>
|
||||||
|
)
|
||||||
|
}
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
Reference in New Issue
Block a user