v1.0.0rfc
Login in to the application
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| PROJECT_ROOT="$SCRIPT_DIR/.." | |
| cd "$PROJECT_ROOT" | |
| echo "Building SvelteKit app..." | |
| pnpm run build |
| <button | |
| class="btn btn-primary" | |
| data-user-id="42" | |
| data-role="admin" | |
| > | |
| View | |
| </button> | |
| <script> | |
| const button = document.querySelector('.btn.btn-primary'); |
| /** | |
| * Creates a debounced version of a function that delays execution until after | |
| * 'delay' milliseconds have elapsed since the last time it was invoked. | |
| * | |
| * @param {Function} fn - The function to execute. | |
| * @param {number} [delay=300] - The delay in milliseconds. | |
| * @returns {Function} - The debounced function with a .cancel() method. | |
| */ | |
| export function debounce(fn, delay = 300) { | |
| let timeoutId = null; |
| // 1. Get the path for our input file from | |
| // the command line arguments | |
| // 2. Check if the input file is readable and contains | |
| // valid JSON | |
| // 3. Format the contents of the file | |
| // 4. Save formatted JSON to another file | |
| // 5. Compile our binary | |
| package main |
| const accordions = document.querySelectorAll(".accordion"); | |
| accordions.forEach((accordion) => { | |
| accordion.addEventListener("click", function () { | |
| // Remove "active" class from all accordions | |
| accordions.forEach((acc) => { | |
| if (acc !== accordion) { | |
| // remove active class | |
| acc.classList.remove("active"); | |