### Applying External Stylesheets to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to apply external stylesheets to the Leetcode Stats Card using the `sheets` parameter. It accepts a comma-separated list of URLs, allowing custom CSS to be injected in the specified order, for example, from a Gist. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?sheets=url1,url2) ``` -------------------------------- ### Applying Light and Unicorn Themes to LeetCode Stats Card in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet shows how to specify different themes for light and dark modes, using a comma-separated list. The card will dynamically switch between the 'light' theme in light mode and the 'unicorn' theme in dark mode, providing a responsive visual experience. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?theme=light,unicorn) ``` -------------------------------- ### Applying Unicorn Theme to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet illustrates how to apply the 'unicorn' theme to the Leetcode Stats Card. The `theme` parameter is used to select one of the available visual themes, customizing the card's appearance. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?theme=unicorn) ``` -------------------------------- ### Applying Light Theme to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet illustrates how to apply the 'light' theme to the Leetcode Stats Card. The `theme` parameter is used to select one of the available visual themes, customizing the card's appearance. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?theme=light) ``` -------------------------------- ### Applying WTF Theme to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet illustrates how to apply the 'wtf' theme to the Leetcode Stats Card. The `theme` parameter is used to select one of the available visual themes, customizing the card's appearance. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?theme=wtf) ``` -------------------------------- ### Applying Unicorn Theme to LeetCode Stats Card in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to apply a specific theme, 'unicorn', to the LeetCode stats card. Themes allow for visual customization of the card's appearance, enhancing its integration with different profile designs. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?theme=unicorn) ``` -------------------------------- ### Displaying Heatmap Extension for Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to display the 'heatmap' extension on a Leetcode Stats Card. The `ext` parameter is used to specify the desired extension. Only one extended-card extension can be used at a time. ```Markdown ![](https://leetcard.jacoblin.cool/lapor?ext=heatmap) ``` -------------------------------- ### Applying Nord Theme to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet illustrates how to apply the 'nord' theme to the Leetcode Stats Card. The `theme` parameter is used to select one of the available visual themes, customizing the card's appearance. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?theme=nord) ``` -------------------------------- ### Displaying Activity Extension for Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to display the 'activity' extension on a Leetcode Stats Card. The `ext` parameter is used to specify the desired extension. Only one extended-card extension can be used at a time. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?ext=activity) ``` -------------------------------- ### Configuring LeetCode Stats Card for CN Site in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet illustrates how to fetch LeetCode statistics from the Chinese (CN) site instead of the default US site. By appending '?site=cn' to the URL, users can display their stats from LeetCode CN. ```Markdown ![](https://leetcard.jacoblin.cool/leetcode?site=cn) ``` -------------------------------- ### Constructing LeetCode Stats Card URL - JavaScript Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/packages/cloudflare-worker/src/demo/demo.html This function constructs a URL for the LeetCode stats card, dynamically including parameters like username, theme, font, extension, and site based on user input. It uses `encodeURIComponent` to properly format URL parameters, ensuring valid and safe URL construction. ```JavaScript function url() { return encodeURIComponent(value("username")) + "?theme=" + encodeURIComponent(value("theme")) + "&font=" + encodeURIComponent(value("font")) + (value("extension") ? "&ext=" + encodeURIComponent(value("extension")) : "") + (value("site") === "cn" ? "&site=cn" : ""); } ``` -------------------------------- ### Applying Transparent Theme to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet illustrates how to apply the 'transparent' theme to the Leetcode Stats Card. The `theme` parameter is used to select one of the available visual themes, customizing the card's appearance. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?theme=transparent) ``` -------------------------------- ### Displaying Contest Extension for Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to display the 'contest' extension on a Leetcode Stats Card. The `ext` parameter is used to specify the desired extension. Only one extended-card extension can be used at a time. ```Markdown ![](https://leetcard.jacoblin.cool/lapor?ext=contest) ``` -------------------------------- ### Displaying Submission Heatmap with Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet generates a Markdown image link to display a user's LeetCode submission heatmap for the past 52 weeks using the Leetcode Stats Card service. It requires a username (e.g., 'lapor') and the 'heatmap' extension. The output is an image visualizing submission frequency. ```md ![Leetcode Stats](https://leetcard.jacoblin.cool/lapor?ext=heatmap) ``` -------------------------------- ### Applying Dark Theme to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet illustrates how to apply the 'dark' theme to the Leetcode Stats Card. The `theme` parameter is used to select one of the available visual themes, customizing the card's appearance. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?theme=dark) ``` -------------------------------- ### Displaying Recent Submissions with Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet generates a Markdown image link to display a user's recent LeetCode submissions using the Leetcode Stats Card service. It requires a username (e.g., 'JacobLinCool') and the 'activity' extension. The output is an image showing submission activity. ```md ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?ext=activity) ``` -------------------------------- ### Applying Forest Theme to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet illustrates how to apply the 'forest' theme to the Leetcode Stats Card. The `theme` parameter is used to select one of the available visual themes, customizing the card's appearance. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?theme=forest) ``` -------------------------------- ### Opening LeetCode Stats Card in New Window - JavaScript Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/packages/cloudflare-worker/src/demo/demo.html This function opens the generated LeetCode stats card URL in a new browser window or tab. It relies on the `url()` function to retrieve the dynamically constructed target URL, providing a quick way to view the generated card. ```JavaScript function go() { let win = window.open(); win.location = url(); } ``` -------------------------------- ### Embedding LeetCode Stats Card in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates the basic way to embed your LeetCode stats card into a Markdown file, such as a GitHub README.md. Simply replace 'JacobLinCool' with your actual LeetCode username to display your dynamic statistics. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool) ``` -------------------------------- ### Setting Cache Time to Zero for Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet shows how to set the cache time for the Leetcode Stats Card to 0 seconds using the `cache` parameter. This ensures the card is always fetched fresh, though it's generally not recommended for long periods due to GitHub's caching behavior. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?cache=0) ``` -------------------------------- ### Displaying Contest Rating History with Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet generates a Markdown image link to display a user's LeetCode contest rating history using the Leetcode Stats Card service. It requires a username (e.g., 'lapor') and the 'contest' extension. The output is an image showing contest rating trends. ```md ![Leetcode Stats](https://leetcard.jacoblin.cool/lapor?ext=contest) ``` -------------------------------- ### Embedding LeetCode Stats Card with Hyperlink in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet shows how to embed the LeetCode stats card as an image that also acts as a hyperlink. Clicking the image will redirect the user to your LeetCode profile, providing easy navigation for viewers. ```Markdown [![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool)](https://leetcode.com/JacobLinCool) ``` -------------------------------- ### Styling and Theming for LeetCode Stats Card UI (CSS) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/packages/cloudflare-worker/src/demo/demo.html This CSS defines the visual appearance of the LeetCode Stats Card generator, including color variables for light and dark themes, responsive adjustments for various screen sizes, and styling for UI components like input fields, buttons, and the preview area. It leverages CSS variables for efficient theme switching and ensures a consistent user experience across devices. ```css :root { --bg-color: #f5f5f5; --card-bg: white; --text-color: #2c3e50; --border-color: #e0e0e0; --hover-color: #f0f0f0; --accent-color: #3498db; } .dark-mode { --bg-color: #1a1a1a; --card-bg: #2d2d2d; --text-color: #ecf0f1; --border-color: #404040; --hover-color: #353535; --accent-color: #3498db; } \* { box-sizing: border-box; transition: background-color 0.3s, color 0.3s; } body { background-color: var(--bg-color); color: var(--text-color); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; line-height: 1.6; padding: 1rem; } .container { max-width: 800px; margin: 0 auto; text-align: center; } .card { background: var(--card-bg); border-radius: 12px; padding: 2rem; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); margin: 2rem 0; } .input-group { display: flex; align-items: center; margin: 1rem 0; gap: 1rem; } .input-group label { min-width: 100px; text-align: right; font-weight: 600; } input, select { flex: 1; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--card-bg); color: var(--text-color); font-size: 14px; } input:focus, select:focus { outline: none; border-color: var(--accent-color); } .button-group { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; } button { padding: 8px 16px; border: none; border-radius: 6px; background: var(--accent-color); color: white; cursor: pointer; font-weight: 600; transition: transform 0.2s, opacity 0.2s; } button:hover { transform: translateY(-1px); opacity: 0.9; } .preview-container { position: relative; min-height: 128px; background: var(--card-bg); border-radius: 12px; padding: 1rem; margin: 2rem 0; } .loading-spinner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border: 4px solid var(--border-color); border-top-color: var(--accent-color); border-radius: 50%; animation: spin 1s linear infinite; opacity: 0; } .preview-container:has(img:not(.loaded)) .loading-spinner { opacity: 1; } @keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } } #preview { width: 100%; opacity: 0; transition: opacity 0.3s; } #preview.loaded { opacity: 1; } .theme-toggle { position: fixed; top: 20px; right: 20px; cursor: pointer; padding: 10px; border-radius: 50%; background: var(--card-bg); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; transition: background-color 0.3s, transform 0.2s, box-shadow 0.2s; } .theme-toggle:hover { background: var(--hover-color); transform: scale(1.05); box ``` -------------------------------- ### Applying Ruthie Font to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to apply the 'Ruthie' font to the Leetcode Stats Card. The `font` parameter allows users to select from a wide range of Google Fonts to customize the card's typography. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?font=ruthie) ``` -------------------------------- ### Generating Markdown for LeetCode Stats Card - JavaScript Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/packages/cloudflare-worker/src/demo/demo.html This function generates a Markdown image tag for the LeetCode stats card and displays it in a SweetAlert2 dialog. It provides options to copy the Markdown code to the clipboard, handling success and error notifications to inform the user about the copy operation's outcome. ```JavaScript function md() { const code = "!\\[LeetCode Stats\\](" + url() + ")"; Swal.fire({ title: "Markdown Code", html: "", confirmButtonText: "Copy", showCancelButton: true, cancelButtonText: "Close" }).then((result) => { if (result.isConfirmed) { navigator.clipboard .writeText(code) .then(() => { Swal.fire({ title: "Copied!", text: "The markdown code has been copied to your clipboard", icon: "success", timer: 1500, showConfirmButton: false }); }) .catch(() => { Swal.fire({ title: "Error!", text: "Failed to copy to clipboard", icon: "error", timer: 1500, showConfirmButton: false }); }); } }); } ``` -------------------------------- ### Applying Milonga Font to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to apply the 'Milonga' font to the Leetcode Stats Card. The `font` parameter allows users to select from a wide range of Google Fonts to customize the card's typography. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?font=milonga) ``` -------------------------------- ### Customizing LeetCode Stats Card Border and Radius in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to modify the border thickness and corner radius of the LeetCode stats card. Setting 'border=0' removes the border, and 'radius=20' creates more rounded corners, allowing for aesthetic adjustments. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?border=0&radius=20) ``` -------------------------------- ### Applying Patrick Hand Font to Leetcode Stats Card (Markdown) Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to apply the 'Patrick Hand' font to the Leetcode Stats Card. The `font` parameter allows users to select from a wide range of Google Fonts to customize the card's typography. ```Markdown ![Leetcode Stats](https://leetcard.jacoblin.cool/JacobLinCool?font=patrick_hand) ``` -------------------------------- ### Setting Dancing Script Font for LeetCode Stats Card in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to customize the font used on the LeetCode stats card. By specifying 'font=Dancing_Script' in the query string, the card will render text using the 'Dancing Script' font, which can be any font available on Google Fonts. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?font=Dancing_Script) ``` -------------------------------- ### Hiding Specific Elements on LeetCode Stats Card in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet demonstrates how to hide specific elements on the LeetCode stats card using a comma-separated list of element IDs. This allows for fine-grained control over what information is displayed, enabling users to simplify the card's appearance. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?hide=ranking,total-solved-text,easy-solved-count,medium-solved-count,hard-solved-count) ``` -------------------------------- ### Adjusting LeetCode Stats Card Dimensions in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet shows how to manually set the 'width' and 'height' of the LeetCode stats card. While it doesn't resize the content, it's useful for controlling the SVG container size, especially when applying custom CSS styles. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?width=500&height=500) ``` -------------------------------- ### Retrieving Input Element Value - JavaScript Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/packages/cloudflare-worker/src/demo/demo.html This helper function retrieves the trimmed value of an HTML input element identified by its ID. It returns an empty string if the element is not found or its value is empty, ensuring a consistent and safe return type for input values. ```JavaScript function value(id) { return document.querySelector("#" + id).value.trim() || ""; } ``` -------------------------------- ### Disabling Animation for LeetCode Stats Card in Markdown Source: https://github.com/jacoblincool/leetcode-stats-card/blob/main/README.md This snippet shows how to disable the default animations on the LeetCode stats card. By setting 'animation=false' in the URL query, the card will render statically without any dynamic visual effects. ```Markdown ![](https://leetcard.jacoblin.cool/jacoblincool?animation=false) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.