-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from TheBestTvarynka/dev
- Loading branch information
Showing
27 changed files
with
1,183 additions
and
61 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
dist/ | ||
target/ | ||
test_keys/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,102 @@ | ||
.jwt-page { | ||
display: grid; | ||
grid-template-columns: 40% 60%; | ||
width: calc(100% - 0.5em); | ||
gap: 0.5em; | ||
transition: all 0.3s; | ||
} | ||
|
||
.jwt-header { | ||
color: #a562e3; | ||
word-wrap: break-word; | ||
} | ||
|
||
.jwt-header:hover { | ||
text-decoration: underline; | ||
cursor: pointer; | ||
} | ||
|
||
.jwt-payload { | ||
color: mediumvioletred; | ||
word-wrap: break-word; | ||
} | ||
|
||
.jwt-payload:hover { | ||
text-decoration: underline; | ||
cursor: pointer; | ||
} | ||
|
||
.jwt-signature { | ||
color: #70a66c; | ||
word-wrap: break-word; | ||
} | ||
|
||
.jwt-signature:hover { | ||
text-decoration: underline; | ||
cursor: pointer; | ||
} | ||
|
||
.jwt-dot { | ||
background-color: #403735; | ||
color: #ccc9af; | ||
} | ||
|
||
.jwt-actions-container { | ||
display: inline-flex; | ||
justify-content: flex-start; | ||
gap: 0; | ||
} | ||
|
||
.jwt-action { | ||
font-size: 0.8em; | ||
color: #4c5159; | ||
padding: 0.3em; | ||
border: 2px solid transparent; | ||
transition: all 0.2s; | ||
border-radius: 0; | ||
border-top: 2px solid #403735; | ||
border-bottom: 2px solid #403735; | ||
} | ||
|
||
.jwt-action:first-child { | ||
border-radius: 0.3em 0 0 0.3em; | ||
border-left: 2px solid #403735; | ||
} | ||
|
||
.jwt-action:last-child { | ||
border-radius: 0 0.3em 0.3em 0; | ||
border-right: 2px solid #403735; | ||
} | ||
|
||
.jwt-action:hover { | ||
cursor: pointer; | ||
border: 2px solid #403735; | ||
} | ||
|
||
.selected-jwt-action { | ||
color: #e0e0e0; | ||
background-color: #403735; | ||
border: 2px solid #403735; | ||
} | ||
|
||
.jwt-util-button { | ||
font-size: 0.7em; | ||
color: #e0e0e0; | ||
background-color: #403735; | ||
padding: 0.2em 0.4em 0.2em 0.4em; | ||
border-radius: 0.3em; | ||
font-family: 'JetBrains Mono', monospace; | ||
border: 1px solid transparent; | ||
transition: 0.3s; | ||
} | ||
|
||
.jwt-util-button:hover { | ||
cursor: pointer; | ||
transition: 0.3s; | ||
color: #e0e0e0; | ||
background-color: #403735; | ||
} | ||
|
||
.jwt-util-button:focus { | ||
box-shadow: 0 0 0 2px #736664; | ||
} |
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,35 @@ | ||
use yew::{classes, function_component, html, Html, Properties}; | ||
|
||
#[derive(PartialEq, Eq, Properties)] | ||
pub struct BytesViewerProps { | ||
pub bytes: Vec<u8>, | ||
} | ||
|
||
fn byte_color_class(byte: u8) -> &'static str { | ||
if byte == 0 { | ||
"byte-null" | ||
} else if byte.is_ascii_graphic() { | ||
"byte-printable" | ||
} else if byte.is_ascii_whitespace() { | ||
"byte-whitespace" | ||
} else if byte.is_ascii() { | ||
"byte-ascii" | ||
} else { | ||
"byte-other" | ||
} | ||
} | ||
|
||
fn byte_component(byte: u8) -> Html { | ||
html! { | ||
<span class={classes!(byte_color_class(byte))}>{format!("{:02x?}", byte)}</span> | ||
} | ||
} | ||
|
||
#[function_component(BytesViewer)] | ||
pub fn bytes_viewer(props: &BytesViewerProps) -> Html { | ||
html! { | ||
<div class={classes!("bytes-container")}>{ | ||
props.bytes.iter().map(|byte| byte_component(*byte)).collect::<Vec<_>>() | ||
}</div> | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
mod bytes_viewer; | ||
mod simple_input; | ||
mod simple_output; | ||
mod switch; | ||
|
||
pub use bytes_viewer::{BytesViewer, BytesViewerProps}; | ||
pub use simple_input::{build_simple_input, SimpleInput, SimpleInputProps}; | ||
pub use simple_output::{build_simple_output, BytesFormat}; | ||
pub use switch::{Switch, SwitchProps}; |
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.