Skip to content

Commit 817ed91

Browse files
committed
add: announcement for jetbrains plugin
1 parent 3c405ed commit 817ed91

File tree

1 file changed

+58
-8
lines changed

1 file changed

+58
-8
lines changed

src/pages/index.astro

+58-8
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ const annotationCount = annotationsPage
5252
</Tooltip>
5353
</div>
5454

55+
<div class="announcement">
56+
<a href="#jetbrains-install">
57+
<span class="tag">NEW</span>
58+
<span class="description">JetBrains IntelliJ Plugin</span>
59+
</a>
60+
</div>
61+
5562
<p>
5663
The Lua Language Server uses the <ExternalLink
5764
url="https://microsoft.github.io/language-server-protocol/"
@@ -429,15 +436,20 @@ exec &quot;&lt;path-to-directory&gt;/bin/lua-language-server&quot; &quot;$@&quot
429436
}
430437

431438
// If URL is targeting a specific install method, set it as active and scroll to it.
432-
const target = window.location.hash;
433-
if (target) {
434-
const tabName = target.replace("#", "");
435-
const tab = document.querySelector(`#install .tab-content #${tabName}`);
436-
if (tab) {
437-
setTabActive(tabName);
438-
tabs[tabName].content?.scrollIntoView();
439+
const onHashChange = () => {
440+
const target = window.location.hash;
441+
if (target) {
442+
const tabName = target.replace("#", "");
443+
const tab = document.querySelector(`#install .tab-content #${tabName}`);
444+
if (tab) {
445+
setTabActive(tabName);
446+
tabs[tabName].content?.scrollIntoView();
447+
}
439448
}
440-
}
449+
};
450+
451+
onHashChange();
452+
window.addEventListener("hashchange", onHashChange);
441453
</script>
442454

443455
<style lang="scss">
@@ -509,6 +521,44 @@ exec &quot;&lt;path-to-directory&gt;/bin/lua-language-server&quot; &quot;$@&quot
509521
}
510522
}
511523

524+
.announcement {
525+
width: fit-content;
526+
margin: 1em auto auto auto;
527+
border: 0.1em #2d8ae3 solid;
528+
border-radius: 99em;
529+
background-color: #16436e00;
530+
box-shadow: #16436e 0px 0px 0.5em 0px;
531+
532+
a {
533+
color: white;
534+
}
535+
536+
span {
537+
padding: 0.1em 0.5em;
538+
}
539+
540+
span.tag {
541+
background-color: #2d8ae3;
542+
border-radius: 1em 0px 0px 1em;
543+
position: relative;
544+
padding-left: 0.75em;
545+
546+
&::after {
547+
content: "";
548+
position: absolute;
549+
top: 0px;
550+
right: -0.25em;
551+
width: 0.25em;
552+
height: 100%;
553+
background: linear-gradient(90deg, #2d8ae3, #00000000);
554+
}
555+
}
556+
557+
span.description {
558+
margin: 0px 0.25em;
559+
}
560+
}
561+
512562
.quick-links {
513563
margin-top: 2em;
514564
grid-column: 1/3;

0 commit comments

Comments
 (0)