Back to Learning

Coding

814 prompts available

Add GSAP Animation

Integrate GSAP (GreenSock Animation Platform) animations into the specified React component, utilizing `className` to select and animate elements directly instead of using refs. Follow these guidelines: 1. Ensure GSAP is installed in your project. If it's not installed, run `npm install gsap` or `yarn add gsap` in your project directory. 2. Identify the elements within the React component that you want to animate and give them distinctive `className` attributes. 3. In the component, use the `useEffect` hook to trigger GSAP animations when the component mounts. 4. Within the `useEffect`, select the elements using `document.querySelector` with the defined `className` and apply the desired GSAP animations. For example, you might want to use `gsap.to`, `gsap.from`, or other GSAP methods. 5. Make sure to also manage cleanup to prevent memory leaks—remove animations or cancel any GSAP timelines if necessary upon component unmounting. 6. Write modular, reusable animations where possible to keep the component clean. Make sure to test the component to verify that the animations are functioning as expected.

Add F5 Keybind

Create a keybind for the given script using the F5 key. Use the resource from https://docs.susano.re/api-reference/input-functions/getasynckeystate to implement the keybind correctly. Steps: 1. Review the provided script. 2. Use the GetAsyncKeyState function as described in the resource link to detect if F5 is pressed. 3. When F5 is pressed, trigger the execution or functionality of the script. Output Format: Provide the modified script code including the keybind implementation using F5 key. Note: - Ensure the keybind is non-blocking and works in typical script environments. - Do not change the original script logic other than adding the keybind.

Add GUI to Fabric Mod

You are tasked with providing clear and detailed guidance on how to add a Graphical User Interface (GUI) to a Minecraft Fabric mod project, specifically for version 1.21.1. The mod project setup follows the structure and conventions from the Kaupenjoe tutorial. Begin by explaining the prerequisites and setup needed to integrate GUI elements into the Fabric mod environment for this specific version. Walk through the step-by-step process, including how to create screens, widgets, and handle user interactions using Fabric's API and Minecraft's client-side code. Emphasize best practices for organizing GUI elements, managing screen transitions, and registering your GUI components properly in the context of the Kaupenjoe tutorial setup. When relevant, reference Fabric API utilities that simplify GUI creation and event handling, and mention any version-specific considerations or changes for Minecraft 1.21.1. Encourage breaking down complex processes into manageable parts and include code snippets where helpful to illustrate how to implement each feature clearly. # Steps 1. Verify the Fabric mod project is set up as per Kaupenjoe's tutorial for Minecraft 1.21.1. 2. Introduce the concept of client-side GUI screens and their role in Fabric mods. 3. Show how to create a new Screen class extending `HandledScreen` or `Screen` as needed. 4. Demonstrate adding widgets/buttons and handling their actions. 5. Explain how to open the GUI from in-game events or commands. 6. Detail registration and initialization of the GUI within the mod's client initializer. 7. Handle input and rendering nuances specific to Minecraft 1.21.1 and Fabric. 8. Test and debug the GUI to ensure proper function. # Output Format Provide your response as a structured tutorial guide with clearly labeled sections and supporting example code snippets formatted in markdown. Use concise and clear explanations for each step to make it easy for developers familiar with Fabric and Java to implement the GUI. # Notes - Focus on Fabric's recommended methods for GUI creation. - Respect the structure of Kaupenjoe's tutorial to maintain consistency. - Assume the user has basic Java and Minecraft modding knowledge.

Add Failure & Handle Error

In the infinitepay-dashboard-flutter repository, expand functionality by implementing a new failure and its handling in multiple files and languages. ## Steps 1. **Create User Failure** - Open the file `create_user_failure.dart` in the `shared_onboarding` package. - Create a new failure class named `PepPersonFailure`. 2. **Map the Failure** - Add a case for `PepPersonFailure` in the `create_user_exception_mapper.dart` file. - Ensure it matches a 422 status code with response code 12. 3. **UI Error Handling** - Modify `OnboardingErrorsFactory` in `app/lib/featuresonboarding/presentation/ui_errors`. - Add error messages for the new failure: - **EN:** - Title: "Hey, politically exposed person" - Message: "This CPF belongs to a politically exposed person and we don't allow creating accounts for people like that" - **PT:** - Title: "Ei, pessoa politicamente exposta" - Message: "Esse CPF pertence a uma pessoa politicamente exposta e não permitimos a criação da conta de pessoas assim" 4. **Localize Messages** - Add these messages to the `.arb` files within the app folder. - Execute `flutter pub run intl_utils:generate` to generate localized files. 5. **Unit Testing** - Create or update unit tests for all modified or newly-created classes. ## Output Format Describe the changes made with any relevant file paths and code snippets. Detail the test case setup and results in a structured format. ## Notes - Make sure to adhere to existing coding standards and project guidelines. - Ensure multilingual support is implemented correctly as per `.arb` file settings.

Add Highlight Tabs

Add 5 highlight-style tabs to the second GUI window named "Advance Sort +" in the "EasySongSearchTool - Add 2nd GUI Window Hightlight Tabs.ahk" AutoHotkey script, replicating the tab behavior (hover highlight and tooltips) of the "Facebook", "Google", "Pandora", and "Pinterest" buttons from the provided "Example - Highlight Tab.ahk" sample script, excluding "Reddit" and "Twitter" behaviors. Use the base tab size from the sample script without any icons. Each tab should show a tooltip on hover as illustrated in the sample script. Incorporate the external support scripts "TAB.ahk" and "Fnt.ahk" from the relative path "$Currentpath\_Functions\" as per the example. The 5 tabs and their tooltips to add are: 1. "Books" - Tooltip: "Find Hymns Through Hymn Books Details." 2. "Sinhala" - Tooltip: "Find Sinhala Hymns Through the Database." 3. "English" - Tooltip: "Find English Hymns Through the Database." 4. "Latin" - Tooltip: "Find English Hymns Through the Database." 5. "Set" - Tooltip: "Find My Hymn Collection Through the Database." Ensure the tabs appear correctly in the "Advance Sort +" 2nd GUI window, replicate the hover highlight effect and display tooltips on mouse hover exactly like in the provided sample. Do not use icons on the tabs. # Steps - Study the "Example - Highlight Tab.ahk" to understand the behavior and code for tabs "Facebook", "Google", "Pandora", and "Pinterest". - Identify how tooltips are implemented on hover in the sample. - Replicate the tab creation and styling code for 5 new tabs with the specified captions and tooltips. - Integrate the "TAB.ahk" and "Fnt.ahk" support scripts from the "_Functions" folder, referencing their paths as "$CurrentPath\_Functions\TAB.ahk" and "$CurrentPath\_Functions\Fnt.ahk". - Add the new tabs to the "Advance Sort +" GUI window of the main script. - Remove any references to icon images and confirm tabs show no icons. - Test that hovering on a tab displays the correct tooltip. - Ensure the tab size matches the sample script. # Output Format Provide the modified AutoHotkey script snippet for adding the 5 tabs into the "Advance Sort +" second GUI window of "EasySongSearchTool - Add 2nd GUI Window Hightlight Tabs.ahk", including necessary includes or references for "TAB.ahk" and "Fnt.ahk". The snippet should show tab creation, tooltip setting on hover, and visual styling consistent with the example script tabs (Facebook, Google, Pandora, Pinterest). Include comments to clarify areas added or modified. Do not include unrelated code. # Notes - Do not include the Reddit or Twitter tab behaviors. - Tabs must have no icons. - Tooltips must be visible on hover exactly like in the sample. - The two support scripts must be referenced correctly and assumed available. - Assume the rest of the GUI and script remain unchanged except where tabs are added.

Add Fields to Todo App

You are enhancing a simple "to do" app built with HTML, CSS, JavaScript, PHP, and MySQL. The current app stores tasks, but now needs additional fields: "description" (text describing the task) and "priority" (indicating the task's importance). Your goal is to guide the user on how to add these new fields throughout the application, including front-end UI changes, back-end PHP handling, and database updates. Consider the following steps: 1. **Database Schema Update:** - Explain how to modify the MySQL database table to add new columns for "description" and "priority". 2. **Frontend UI Adjustments:** - Describe how to add inputs for "description" and "priority" in the HTML form (e.g., textarea for description, select or radio buttons for priority). - Update JavaScript code to collect these new inputs and include them in the task data being sent to the server. 3. **Backend PHP Changes:** - Update PHP scripts to receive, validate, and process the new fields. - Adjust any SQL queries for inserting or retrieving data to include the new fields. Provide clear, specific instructions or example snippets for each part to ensure the user can implement the changes effectively. Encourage thorough testing after implementing each step. # Output Format Provide a structured explanation divided into three sections: "Database Update", "Frontend Changes", "Backend Changes", each with detailed guidance and example code snippets as needed. # Notes - Assume the user will provide full code files to integrate the changes. - Focus on clarity and completeness to make the additions seamless. - Emphasize validating user inputs for the new fields to maintain app stability.

Add Home Page Buttons

Create a detailed implementation plan to add a new home page into the application. The home page should contain two clearly labeled buttons: one named "Students" and the other named "Teacher". Ensure the layout is user-friendly and accessible, and that the buttons are functional placeholders that can be linked to their respective pages or actions later. # Steps 1. Design the home page layout with two buttons labeled "Students" and "Teacher". 2. Implement the home page in the app's codebase, including UI components for the buttons. 3. Ensure buttons have appropriate accessibility labels and follow UI best practices. 4. Implement placeholder actions or navigation targets for both buttons. 5. Test the home page to verify buttons render correctly and respond to user interactions. # Output Format Provide the implementation details as a step-by-step plan or as code snippets in the relevant programming language or framework used by the app. Include any UI mockups or components if applicable.

Add File Cleaner API

Create a new "cleaner" API module for the provided Node.js project that programmatically clears or deletes files from the decrypted zip archives after decoding FXAP files with FiveM. This module should be integrated cleanly into the existing Express.js server codebase. Requirements: - Implement this in Node.js as a new API route/module within the existing project structure. - The module should expose endpoints to trigger cleaning (deleting) of decrypted zip files securely after processing. - Ensure the deletion only affects files generated by the decryption process (e.g., the zip files stored for download). - Provide an example HTML + CSS + JS front-end page or snippet that interacts with the new cleaner API endpoint to trigger file cleanup. - Use best practices for authentication and error handling, leveraging existing Discord OAuth login middleware. - Add the new module and route to this existing Express.js server code (provided in the project code) without breaking existing functionality. Details and Instructions: - Your Node.js module should export a class or functions responsible for deleting/cleaning decrypted zip files. - Provide a new Express route, e.g., POST `/api/clean/:sessionId`, which when called after authentication deletes the corresponding session's zip file. - Confirm file existence and handle errors gracefully. - The front-end code should show a button or control on a page (e.g., decrypt.html) that calls the cleaner API to remove the file related to the given session. - Keep UI simple but functional, with fetch calls and appropriate success/failure messages. - Use existing session management (session ID passed as param) and read the session zip path from the decryptAPI state if needed. - Your response should include the full Node.js cleaner module code, the Express integration code snippet, and the front-end JS + HTML snippet. Additional Considerations: - Maintain the current code style and conventions. - Security: only allow logged-in Discord users to use the cleaner endpoint. - Avoid removing any user input or configurations unrelated to file cleaning. # Steps 1. Write a Node.js cleaner module that deletes zip files by session ID. 2. Add an Express route `/api/clean/:sessionId` with Discord login middleware for security. 3. Connect the route with the cleaner module to delete the file if it exists. 4. Add front-end UI code that calls the cleaner API for a given session. 5. Handle success and error responses appropriately in UI. # Output Format Provide the following as separate labeled code blocks: 1. Cleaner Module Source Code (Node.js) 2. Express Route Integration Code Snippet (to be added in the main server file) 3. Front-end HTML + JS Snippet (to be included in decrypt.html or linked frontend) # Notes - Use placeholders for any dynamic values like sessionId. - Assume decryptAPI instance is accessible for retrieving session zip paths. - Do not modify existing decrypt logic, only add new cleaning-related code. # Example (simplified): // Node.js cleaner module exports a clean(sessionId) function // Express POST /api/clean/:sessionId calls clean and returns JSON // Front end calls fetch('/api/clean/'+sessionId, {method: 'POST'}) on button click

Add Humanization to Mouse Tracker

Add humanization features to a C++ color tracker that uses dxcam and a private driver for mouse movement. You have a working C++ color tracking program that leverages dxcam for video capture and a private driver to control mouse movement, including features like smoothing, speed control, and good tracking accuracy. Now, you want to enhance it by incorporating human-like behavior in the mouse movements through humanization curves, randomness, and intentional inconsistency. Here is how you can approach this task: # Steps 1. Understand the existing mouse movement logic in your code — identify the functions or sections where raw mouse movement commands are calculated and sent. 2. Integrate humanization curves that modify movement speed and acceleration over time to mimic natural hand movement. These curves could be based on Bezier curves, sigmoid functions, or other easing functions. 3. Introduce randomness in movement parameters such as speed, pause intervals, or slight deviations in trajectory to avoid perfectly linear and mechanical paths. 4. Add inconsistency by varying timing between movements and small jittering motions, simulating human imperfection. 5. Ensure these modifications do not disrupt the core tracking accuracy but enhance naturalistic behavior. 6. Test the system thoroughly to balance tracking performance and humanized movement. # Output Format Provide detailed code snippets, explanations, and suggestions on where and how to insert these components in the existing codebase. Use C++ code examples where applicable and explain any mathematical or algorithmic choices for humanization curves. If possible, include pseudocode outlining how randomness and inconsistency integrate into mouse movement updates. # Notes - Focus on incremental integration so that the core functionality remains intact. - Consider performance implications of added complexity. - Remember to seed random functions properly to ensure varied outputs. - Suggest any libraries or tools that may help implement easing functions or noise generation.

Add Imitation Learning AI

Please modify the provided code to integrate imitation learning AI. The goal is to enhance the existing functionality of the code by implementing effective imitation learning techniques. ### Steps: 1. **Review the Existing Code**: Understand the current structure and functionality. 2. **Research Imitation Learning**: Look for libraries or frameworks that facilitate imitation learning, like TensorFlow, PyTorch, or OpenAI's Spinning Up. 3. **Define the Imitation Learning Model**: Determine the architecture and type of model that suits your needs (e.g., Behavioral Cloning, Generative Adversarial Imitation Learning). 4. **Training Data**: Ensure that you have relevant training data available for the imitation learning process. 5. **Integrate the Imitation Learning Model**: Modify the existing code to include the imitation learning model, adjusting inputs/outputs as necessary. 6. **Test the Code**: Validate the modifications to ensure that the imitation learning implementation works as intended. ### Output Format: The modified code should be clearly commented to explain the changes made regarding imitation learning. It should include imports, any new functions or classes introduced, and usage examples if applicable. ### Example: If your original code contains a function like this: ```python def original_function(): pass ``` The modified output could look something like this: ```python from imitation_learning_library import ImitationModel class NewModel: def __init__(self): self.model = ImitationModel() def train(self, data): self.model.train(data) def imitation_function(): model = NewModel() model.train(training_data) ``` Make sure to adapt this based on the specifics of your existing code.

Add Music Playback

Add a feature to an existing web page that allows users to listen to music directly on the page. Ensure the addition is seamless and integrates naturally with the current design of the page. Consider the following steps: # Steps 1. Choose a method to provide music playback (e.g., embed an audio player, use HTML5 <audio> element). 2. Select or specify the music file(s) or streaming source to be used. 3. Add controls for play, pause, volume adjustment, and track navigation if multiple tracks are present. 4. Ensure the player is responsive and accessible, compatible with multiple browsers and devices. 5. Integrate the audio player into a logical and user-friendly location within the existing webpage layout. # Output Format Provide the HTML and any necessary CSS and JavaScript code snippets that should be added or modified within the existing webpage to enable music listening, including clear comments indicating where to insert or update code.

Add Music to Android Game

Help the user add music to their game made in Android Studio using Java by integrating only the necessary code changes. The user will provide their existing game code and a separate reference code that demonstrates how music is handled. Your task is to carefully compare both codes and apply only the essential modifications to the user's code to implement music functionality similarly to the reference. Avoid adding any new or unnecessary code beyond what is required. After making the changes, provide the complete updated code incorporating these modifications. Steps: 1. Review the user's provided game code. 2. Review the reference code that shows music implementation. 3. Identify minimal necessary changes to add music functionality to the user's code based on the reference. 4. Apply only those changes without adding extra or unrelated code. 5. Present the full updated code after modifications. Output Format: - Provide the complete updated Java code for the game after syncing music functionality as per the instructions. - Do not include explanations or additional commentary; supply only the final code. Notes: - Focus on minimal intervention and only necessary code additions. - Ensure compatibility with the existing code structure.

Page 31 of 68

    Coding Prompts - Learning AI Prompts | Elevato