mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-29 03:59:54 +02:00
Add sponsor
This commit is contained in:
@@ -22,7 +22,7 @@ const {
|
||||
id='sponsor-ad'
|
||||
target='_blank'
|
||||
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
|
||||
src={ imageUrl }
|
||||
|
@@ -1,8 +1,9 @@
|
||||
window.setTimeout(() => {
|
||||
const ad = document.querySelector('.sponsor-ad');
|
||||
const ad = document.querySelector('#sponsor-ad');
|
||||
if (!ad) {
|
||||
return;
|
||||
}
|
||||
|
||||
ad.classList.remove('hidden');
|
||||
}, 500);
|
||||
ad.classList.add('flex');
|
||||
}, 500);
|
||||
|
@@ -1,31 +1,46 @@
|
||||
class Topics {
|
||||
constructor() {
|
||||
this.onDOMLoaded = this.onDOMLoaded.bind(this);
|
||||
this.init = this.init.bind(this);
|
||||
this.filterTopicNodes = this.filterTopicNodes.bind(this);
|
||||
}
|
||||
|
||||
filterTopicNodes(e) {
|
||||
const value = e.target.value.trim().toLowerCase();
|
||||
if (!value) {
|
||||
document.querySelectorAll(`[data-topic]`).forEach((item) => item.classList.remove('hidden'));
|
||||
return;
|
||||
}
|
||||
|
||||
document.querySelectorAll(`[data-topic]`).forEach((item) => item.classList.add('hidden'));
|
||||
|
||||
document.querySelectorAll(`[data-topic*="${value}"]`).forEach((item) => item.classList.remove('hidden'));
|
||||
}
|
||||
|
||||
onDOMLoaded() {
|
||||
document.getElementById('search-topic-input').addEventListener('keyup', this.filterTopicNodes);
|
||||
}
|
||||
|
||||
init() {
|
||||
window.addEventListener('DOMContentLoaded', this.onDOMLoaded);
|
||||
}
|
||||
constructor() {
|
||||
this.topicSearchId = 'search-topic-input';
|
||||
|
||||
this.onDOMLoaded = this.onDOMLoaded.bind(this);
|
||||
this.init = this.init.bind(this);
|
||||
this.filterTopicNodes = this.filterTopicNodes.bind(this);
|
||||
}
|
||||
|
||||
const topicRef = new Topics();
|
||||
topicRef.init();
|
||||
|
||||
|
||||
get topicSearchEl() {
|
||||
return document.getElementById(this.topicSearchId);
|
||||
}
|
||||
|
||||
filterTopicNodes(e) {
|
||||
const value = e.target.value.trim().toLowerCase();
|
||||
if (!value) {
|
||||
document
|
||||
.querySelectorAll(`[data-topic]`)
|
||||
.forEach((item) => item.classList.remove('hidden'));
|
||||
return;
|
||||
}
|
||||
|
||||
document
|
||||
.querySelectorAll(`[data-topic]`)
|
||||
.forEach((item) => item.classList.add('hidden'));
|
||||
|
||||
document
|
||||
.querySelectorAll(`[data-topic*="${value}"]`)
|
||||
.forEach((item) => item.classList.remove('hidden'));
|
||||
}
|
||||
|
||||
onDOMLoaded() {
|
||||
if (!this.topicSearchEl) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.topicSearchEl.addEventListener('keyup', this.filterTopicNodes);
|
||||
}
|
||||
|
||||
init() {
|
||||
window.addEventListener('DOMContentLoaded', this.onDOMLoaded);
|
||||
}
|
||||
}
|
||||
|
||||
const topicRef = new Topics();
|
||||
topicRef.init();
|
||||
|
@@ -42,7 +42,11 @@ const roadmapData = roadmapFile.frontmatter as RoadmapFrontmatter;
|
||||
)
|
||||
}
|
||||
|
||||
<MarkdownRoadmap>
|
||||
<roadmapFile.Content />
|
||||
</MarkdownRoadmap>
|
||||
{
|
||||
!roadmapData.jsonUrl && (
|
||||
<MarkdownRoadmap>
|
||||
<roadmapFile.Content />
|
||||
</MarkdownRoadmap>
|
||||
)
|
||||
}
|
||||
</BaseLayout>
|
||||
|
Reference in New Issue
Block a user