Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ GEM
ffi (1.16.3)
forwardable-extended (2.6.0)
google-protobuf (3.25.1)
google-protobuf (3.25.1-x86_64-darwin)
http_parser.rb (0.8.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -76,6 +77,7 @@ GEM

PLATFORMS
arm64-darwin-23
x86_64-darwin-22
x86_64-darwin-23
x86_64-linux

Expand Down
49 changes: 49 additions & 0 deletions _layouts/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
{% include components/children_nav.html %}
{% endif %}
</main>
<!-- Font Size Control Section -->
<div id="font-size-controls" style="text-align:center; margin-top: 2rem;">
<button id="btn-increase">A+</button>
<button id="btn-decrease">A-</button>
<button id="btn-reset">Reset</button>
</div>
{% include components/footer.html %}
</div>
</div>
Expand All @@ -33,5 +39,48 @@
{% if site.mermaid %}
{% include components/mermaid.html %}
{% endif %}
{% include footer_custom.html %}

<!-- JavaScript for Font Size Control -->
<script>
document.addEventListener("DOMContentLoaded", function () {
const root = document.documentElement; // Targets <html>
let defaultSize = parseFloat(getComputedStyle(root).fontSize); // Get initial font size (16px)
let currentSize = defaultSize;

// Get button elements
const increaseBtn = document.getElementById("btn-increase");
const decreaseBtn = document.getElementById("btn-decrease");
const resetBtn = document.getElementById("btn-reset");

if (increaseBtn && decreaseBtn && resetBtn) {
// Increase font size
increaseBtn.addEventListener("click", () => {
currentSize += 1; // Increase font size by 1px
root.style.setProperty('font-size', `${currentSize}px`, 'important'); // Apply with !important
console.log(`Font size increased: ${currentSize}px`);
});

// Decrease font size
decreaseBtn.addEventListener("click", () => {
if (currentSize > 10) { // Prevent font size from becoming too small
currentSize -= 1; // Decrease font size by 1px
root.style.setProperty('font-size', `${currentSize}px`, 'important'); // Apply with !important
console.log(`Font size decreased: ${currentSize}px`);
}
});

// Reset font size
resetBtn.addEventListener("click", () => {
currentSize = defaultSize; // Reset to the initial font size
root.style.setProperty('font-size', `${defaultSize}px`, 'important'); // Apply with !important
console.log(`Font size reset: ${defaultSize}px`);
});
} else {
console.error("Font size buttons not found in the DOM.");
}
});

</script>
</body>
</html>
40 changes: 40 additions & 0 deletions _sass/custom/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,46 @@ $dot-margin: 0;
--clipboard-checked-color: #43c743;
}

/* font size slider*/
/* Font size slider */
html {
font-size: 16px; /* default font-size */
}

body {
font-size: 1rem; /* will scale with html's font-size */
}

h1 {
font-size: 2rem; /* relative to html font-size */
}

p {
font-size: 1rem; /* relative to html font-size */
}

#font-size-controls {
margin-top: 2rem;
text-align: center;

button {
font-size: 1rem;
margin: 0 0.5rem;
padding: 0.5rem 1rem;
border: none;
border-radius: 5px;
background-color: #eee;
cursor: pointer;
transition: background-color 0.3s ease;

&:hover {
background-color: #ddd;
}
}
}




.highlighter-rouge {
@include light-syntax;
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
detecting vulnerabilities in open source dependencies