-
Notifications
You must be signed in to change notification settings - Fork 0
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
Packet speed #108
Open
V-SANT
wants to merge
10
commits into
main
Choose a base branch
from
packet-speed
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
Packet speed #108
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0c3e993
feat: packet speed dropdown
V-SANT 39749ee
Merge branch 'main' into packet-speed
V-SANT acdfc0d
feat: wheel speed container
V-SANT 4e3a724
refactor: normalized speed taking edge size into consideration
V-SANT cb8626e
lint: format
V-SANT 74740e1
refactor: packet speed multiplier on a separate class, added in conte…
V-SANT a23b72d
lint: format
V-SANT 70e7ee9
fix: optional SpeedMultiplier on setNetwork
V-SANT 6ac616a
Merge branch 'main' into packet-speed
V-SANT c32247e
Merge branch 'main' into packet-speed
MegaRedHand 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
.wheel-container { | ||
position: absolute; | ||
top: 10px; | ||
right: 180px; | ||
height: 20px; | ||
display: flex; | ||
flex-direction: row; /* Changed to row */ | ||
align-items: center; /* Center items vertically */ | ||
justify-content: space-between; /* Space between elements */ | ||
background-color: #333333; | ||
padding: 5px 10px; /* Added more horizontal padding */ | ||
border-radius: 5px; | ||
z-index: 1000; | ||
width: auto; /* Let content determine width */ | ||
gap: 10px; /* Space between elements */ | ||
} | ||
|
||
.wheel-label { | ||
font-size: 15px; | ||
color: white; | ||
white-space: nowrap; /* Prevent text wrapping */ | ||
margin: 0; /* Remove margin */ | ||
} | ||
|
||
.circular-slider { | ||
position: relative; | ||
width: 120px; | ||
height: 30px; | ||
margin: 0; /* Remove margin */ | ||
} | ||
|
||
.circular-slider input[type="range"] { | ||
position: absolute; | ||
width: 120px; | ||
height: 30px; | ||
background: none; | ||
-webkit-appearance: none; | ||
transform: none; | ||
cursor: pointer; | ||
} | ||
|
||
.circular-slider input[type="range"]::-webkit-slider-thumb { | ||
-webkit-appearance: none; | ||
width: 15px; | ||
height: 15px; | ||
border-radius: 50%; | ||
background: #007bff; | ||
border: 2px solid #fff; | ||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); | ||
cursor: pointer; | ||
margin-top: -5px; | ||
} | ||
|
||
.circular-slider input[type="range"]::-webkit-slider-runnable-track { | ||
width: 100%; | ||
height: 5px; | ||
background: #555; | ||
border: none; | ||
border-radius: 2.5px; | ||
} | ||
|
||
.circular-slider input[type="range"]::-moz-range-thumb { | ||
width: 15px; | ||
height: 15px; | ||
border-radius: 50%; | ||
background: #007bff; | ||
border: 2px solid #fff; | ||
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); | ||
cursor: pointer; | ||
} | ||
|
||
.circular-slider input[type="range"]::-moz-range-track { | ||
width: 100%; | ||
height: 5px; | ||
background: #444; | ||
border: none; | ||
border-radius: 2.5px; | ||
} | ||
|
||
.value-display { | ||
font-size: 15px; | ||
color: white; | ||
margin: 0; /* Remove margin */ | ||
white-space: nowrap; /* Prevent text wrapping */ | ||
min-width: 35px; /* Ensure space for the value */ | ||
text-align: right; | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
export class SpeedMultiplier { | ||
private _value: number; | ||
|
||
constructor(initialValue = 1) { | ||
this._value = initialValue; | ||
} | ||
|
||
// Get the current speed value | ||
get value(): number { | ||
return this._value; | ||
} | ||
|
||
// Set a new speed value | ||
set value(newValue: number) { | ||
if (newValue > 0) { | ||
this._value = newValue; | ||
} else { | ||
throw new Error("Speed value must be greater than 0"); | ||
} | ||
} | ||
|
||
// Get the speed multiplier as a formatted string | ||
get multiplier(): string { | ||
return `${this._value}x`; | ||
} | ||
|
||
// Static method to parse a number to a Speed instance | ||
static parse(value: number): SpeedMultiplier { | ||
if (value > 0) { | ||
return new SpeedMultiplier(value); | ||
} else { | ||
throw new Error("Speed value must be greater than 0"); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
We could have this be a speed of 0 instead