65 添加快速跳转至exambase#66
Merged
Hidden character warning
The head ref may contain hidden characters: "65-\u6dfb\u52a0\u5feb\u901f\u8df3\u8f6c\u81f3exambase"
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new "Exam Base" navigation feature along with a settings toggle to enable or disable the floating Exam Base button, and a fixed navigation tab on course pages.
- Adds a settings toggle component for enabling/disabling the floating Exam Base button
- Implements a jumpToExamBase function with animated floating and fixed navigation elements
- Provides a reusable Label component for consistent UI elements
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/setting/jsx/Setting.js | Added Exam Base settings toggle with a new ExamBaseButton function |
| scripts/moodle/js/content.js | Implemented jumpToExamBase with animated floating button and fixed navigation tab |
| scripts/lib/elements.js | Added a new reusable Label component |
Comments suppressed due to low confidence (1)
scripts/setting/jsx/Setting.js:195
- [nitpick] Consider using a label text that matches the feature name (e.g., 'Exam Base') to maintain consistency with other UI elements.
innerText: "Skyrocketing Exam Base",
| vh = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); | ||
| }); | ||
|
|
||
| setInterval(() => { |
There was a problem hiding this comment.
Consider using requestAnimationFrame for smoother and more efficient animations instead of setInterval with a fixed 50ms interval.
Suggested change
| setInterval(() => { | |
| function animate() { |
Co-authored-by: Copilot <[email protected]>
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature for integrating an "Exam Base" navigation element into the application, along with enhancements to the user interface and functionality. The changes include adding a floating "Exam Base" button with animations, a fixed navigation tab for quick access, and a corresponding toggle in the settings menu.
New Feature: Exam Base Navigation
Floating "Exam Base" Button with Animations: Added a floating button (
jump-to-exam-base) on course pages that animates and provides quick access to the "Exam Base" page. The button includes hover effects, random floating animations, and a smooth transition to a fixed navigation tab when clicked.Fixed Navigation Tab for "Exam Base": Introduced a fixed navigation tab (
jump-to-exam-base-fixed) under the navigation bar on course pages. Clicking the tab opens the "Exam Base" page in a new tab.Integration with Course Page Routing: Updated the routing logic to invoke the
jumpToExamBasefunction on course pages, ensuring the "Exam Base" button and tab are initialized.User Interface Enhancements
Settings Toggle for "Exam Base" Feature: Added a new toggle in the settings menu to enable or disable the floating "Exam Base" button. The toggle uses a checkbox (
ez-exam-base-checkbox) and stores the user's preference in Chrome's sync storage. [1] [2]Reusable
LabelComponent: Added a newLabelcomponent to thewindow.elementsnamespace for consistent label creation across the application.