-
Notifications
You must be signed in to change notification settings - Fork 1
.1470493481763451:c59f682263c2a433c3c31a0039a4160d_69d0cd6c5529e86d86c06e3d.69d0ce2f5529e86d86c06e5b.69d0ce2e63e7875adddb66a9:Trae CN.T(2026/4/4 16:39:11) #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rfnjdhj
wants to merge
1
commit into
IRNCyber:main
Choose a base branch
from
rfnjdhj:fix/bugfix-b
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,11 +73,45 @@ function App() { | |
| setOperation(null); | ||
| }; | ||
|
|
||
| const handleTrig = (func: string) => { | ||
| playSound(operationSound); | ||
| setIsAnimating(true); | ||
| setTimeout(() => setIsAnimating(false), 150); | ||
|
|
||
| const value = parseFloat(display); | ||
| // 将角度转换为弧度 | ||
| const radians = value * Math.PI / 180; | ||
| let result = 0; | ||
|
|
||
| switch (func) { | ||
| case 'sin': | ||
| result = Math.sin(radians); | ||
| break; | ||
| case 'cos': | ||
| result = Math.cos(radians); | ||
| break; | ||
| case 'tan': | ||
| result = Math.tan(radians); | ||
| break; | ||
| } | ||
|
|
||
| // 处理精度问题,确保sin90°显示1而不是0.9999999999 | ||
| if (Math.abs(result - 1) < 0.000001) { | ||
| result = 1; | ||
| } else if (Math.abs(result) < 0.000001) { | ||
| result = 0; | ||
| } | ||
|
|
||
| setDisplay(result.toString()); | ||
| setResetDisplay(true); | ||
| }; | ||
|
|
||
| const clear = () => { | ||
| playSound(clearSound); | ||
| setIsAnimating(true); | ||
| setTimeout(() => setIsAnimating(false), 150); | ||
|
|
||
| // 彻底重置所有状态 | ||
| setDisplay('0'); | ||
| setPreviousValue(null); | ||
| setOperation(null); | ||
|
|
@@ -94,7 +128,10 @@ function App() { | |
| className={`p-4 text-xl rounded-xl transition-all duration-200 | ||
| hover:bg-opacity-80 active:scale-95 ${className} | ||
| transform hover:-translate-y-0.5 hover:shadow-lg | ||
| ${isAnimating ? 'animate-pulse' : ''}`} | ||
| ${isAnimating ? 'animate-pulse' : ''} | ||
| /* 移动端响应式调整 */ | ||
| sm:p-3 sm:text-lg | ||
| xs:p-2 xs:text-base`} | ||
| > | ||
|
Comment on lines
128
to
135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Comment becomes class token The Button component includes a CSS-style block comment inside the template-literal for className, which becomes literal class tokens (e.g., "/*", Chinese text, "*/") on the DOM element. This pollutes the class list and can make styling/debugging unreliable because these tokens are not real Tailwind utilities. Agent Prompt
|
||
| {children} | ||
| </button> | ||
|
|
@@ -118,7 +155,7 @@ function App() { | |
| </div> | ||
|
|
||
| {/* Calculator */} | ||
| <div className={`bg-gray-800 p-6 rounded-2xl shadow-2xl w-full max-w-xs relative z-10 | ||
| <div className={`bg-gray-800 p-4 sm:p-6 rounded-2xl shadow-2xl w-full max-w-xs relative z-10 | ||
| backdrop-blur-lg bg-opacity-90 | ||
| transform transition-all duration-300 hover:shadow-[0_0_30px_rgba(99,102,241,0.2)] | ||
| ${isAnimating ? 'scale-[1.02]' : 'scale-100'}`}> | ||
|
|
@@ -137,17 +174,29 @@ function App() { | |
| </div> | ||
| </div> | ||
|
|
||
| <div className="grid grid-cols-4 gap-3"> | ||
| <Button onClick={clear} className="bg-red-500 text-white col-span-3 | ||
| <div className="grid grid-cols-4 gap-2 sm:gap-3"> | ||
| <Button onClick={clear} className="bg-red-500 text-white col-span-2 | ||
| hover:bg-red-600 transition-colors duration-200"> | ||
| <div className="flex items-center justify-center gap-2"> | ||
| <RotateCcw size={20} className="animate-spin-slow" /> Clear | ||
| </div> | ||
| </Button> | ||
| <Button onClick={() => handleTrig('sin')} className="bg-purple-600 text-white | ||
| hover:bg-purple-700 transition-colors duration-200"> | ||
| sin | ||
| </Button> | ||
| <Button onClick={() => handleTrig('cos')} className="bg-purple-600 text-white | ||
| hover:bg-purple-700 transition-colors duration-200"> | ||
| cos | ||
| </Button> | ||
| <Button onClick={() => handleOperation('/')} className="bg-indigo-600 text-white | ||
| hover:bg-indigo-700 transition-colors duration-200"> | ||
| <Divide size={24} /> | ||
| </Button> | ||
| <Button onClick={() => handleTrig('tan')} className="bg-purple-600 text-white | ||
| hover:bg-purple-700 transition-colors duration-200 col-span-3"> | ||
| tan | ||
| </Button> | ||
|
|
||
| {['7', '8', '9'].map((num) => ( | ||
| <Button key={num} onClick={() => handleNumber(num)} className="bg-gray-700 text-white | ||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Tan asymptote unhandled
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools