Skip to content

Commit

Permalink
レイアウト修正
Browse files Browse the repository at this point in the history
  • Loading branch information
TsukemonoGit committed Jun 2, 2024
1 parent 95c11ba commit 910f247
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion entrypoints/components/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function CopyButton({ text, style }: CopyButtonProps) {
</span>
<Button
onClick={copy}
class="copyButton"
class="nakeCopyButton"
style={{
"margin-left": "4px",
padding: "0 2px ",
Expand Down
2 changes: 1 addition & 1 deletion entrypoints/components/MenuComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export default function MenuComponent(props: {
NAKE
</div>
<button
id="batuButton"
id="nakeBatuButton"
style={{
padding: "0",
"align-self": "end",
Expand Down
24 changes: 18 additions & 6 deletions entrypoints/components/RelayHints.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { className, relayRegex } from "@/util";
import { Accessor, For, Setter, Show, createSignal } from "solid-js";
import {
Accessor,
For,
Setter,
Show,
createMemo,
createSignal,
} from "solid-js";

export default function RelayHints({
setRelayHints,
Expand Down Expand Up @@ -37,7 +44,11 @@ export default function RelayHints({
handleClickAdd();
}
};

const inputStyle = createMemo(() => {
return invalid()
? { border: "1px solid #ff8080" }
: { border: "1px solid #8caeff" };
});
return (
<>
<span
Expand All @@ -54,7 +65,7 @@ export default function RelayHints({
>
<For each={relayHints()}>
{(item, index) => (
<div class={`${className} relay`}>
<div class={`${className} nakeRelay`}>
{item}
<button
class={`${className}`}
Expand All @@ -77,15 +88,16 @@ export default function RelayHints({
}}
>
<input
id="input"
class={`${className} ${invalid() ? "invalidInput" : "relayInput"} `}
id="nakeInput"
class={`${className}`}
style={inputStyle()}
placeholder="wss://"
type="text"
value={inputRelayHint()}
onInput={(e) => setInputRelayHint(e.currentTarget.value)}
onKeyDown={handleKeyDown}
></input>
<button class={`${className} hint`} onClick={handleClickAdd}>
<button class={`${className} nakeHint`} onClick={handleClickAdd}>
Add
</button>
</div>
Expand Down
32 changes: 13 additions & 19 deletions entrypoints/content/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.nake button {
border: none;
}
.relay {
.nakeRelay {
border-radius: 8px;
border: 1px solid transparent;
margin: 2px;
Expand All @@ -22,7 +22,7 @@
font-size: smaller;
height: fit-content;
}
.hint {
.nakeHint {
border-radius: 8px;
border: 1px solid transparent;
font-size: medium;
Expand All @@ -39,45 +39,39 @@
width: "fit-content";
transition: 0.2s;
}
.hint:hover {
.nakeHint:hover {
background-color: #5789ff;
box-shadow: 1px 1px 5px 0px rgba(0, 0, 0, 0.35);
}
.hint:active {
.nakeHint:active {
transform: scale(0.98);
}
.hint:focus,
.hint:focus-visible {
.nakeHint:focus,
.nakeHint:focus-visible {
}

#input {
#nakeInput {
padding: 0 2px !important;
border-radius: 4px !important;
border: 1px solid #8caeff !important;

background-color: #fff !important;
color: #000 !important;
height: 2em !important;
font-size: medium;
}
#input::placeholder {
#nakeInput::placeholder {
opacity: 0.5;
}
.relayInput {
border-color: #8caeff;
}
.invalidInput {
border-color: #ff8080 !important;
}

.copyButton {
.nakeCopyButton {
background-color: rgba(0, 0, 0, 0);
}
.copyButton:hover {
.nakeCopyButton:hover {
opacity: 0.75;
}
#batuButton {
#nakeBatuButton {
background-color: rgba(0, 0, 0, 0);
}
#batuButton:hover {
#nakeBatuButton:hover {
opacity: 0.75;
}
1 change: 1 addition & 0 deletions entrypoints/popup/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function App() {
NAKE
</h2>
<input
class={"nakeInput"}
style={{ margin: "1em 0", "min-width": "350px", "max-width": "90vw" }}
type="text"
placeholder="hex or note1,npub1,..."
Expand Down
9 changes: 3 additions & 6 deletions entrypoints/popup/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,9 @@ button:active {
background-color: #f9f9f9;
}
}
input {
height: 1.5em;
}

.invalidInput {
input {
padding: 0.5em;
border-radius: 4px;
border: 1px solid #ff8080;
padding: 2px;
border: 1px solid #aaa;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nake",
"description": "Nostr Army Knife webExtension",
"private": true,
"version": "0.1.2",
"version": "0.1.3",
"type": "module",
"scripts": {
"dev": "wxt",
Expand Down

0 comments on commit 910f247

Please sign in to comment.