Skip to content

Commit

Permalink
Change name to section-links and added pointer effect
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCuff committed Sep 3, 2024
1 parent a600298 commit e2acc29
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/_layouts/guidance-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<!--Scripts-->
<script src="assets/scripts/expandable-sections.js"></script>
<script src="assets/scripts/permalinks.js" defer></script>
<script src="assets/scripts/section-links.js" defer></script>

</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Function to copy link to clipboard
function copylink(text) {
navigator.clipboard.writeText(text).then(() => {
alert(`Link copied to clipboard: ${text}`);
alert(`Link copied to clipboard:\n${text}`);
}).catch(err => {
console.error('Failed to copy link', err);
});
Expand All @@ -16,8 +16,8 @@ document.querySelectorAll('h1, h2, h3, h4, h5').forEach(heading => {

// Create the icon element
const iconWrapper = document.createElement('span');
iconWrapper.className = 'permalink';
iconWrapper.title = 'Permalink';
iconWrapper.className = 'section-link';
iconWrapper.title = 'Section link';
iconWrapper.innerHTML = ' ';

// Append the icon to the heading
Expand Down
9 changes: 6 additions & 3 deletions docs/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ ul, ol{
}


/*Permalinks*/
.permalink{
/*Section links*/
.section-link{
background-image: url('img/permalink.png');
width: 18px;
height: 18px;
Expand All @@ -154,6 +154,10 @@ ul, ol{
background-size: cover;
}

.section-link:hover{
cursor: pointer;
}

h1 span, h2 span, h3 span, h4 span, h5 span {
transition: opacity 0.3s ease-in-out;
}
Expand All @@ -163,7 +167,6 @@ h1:hover span, h2:hover span, h3:hover span, h4:hover span, h5:hover span{
}



/*Fancy elements*/
blockquote{
margin: 1em 0 2em 0;
Expand Down

0 comments on commit e2acc29

Please sign in to comment.