Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 28 additions & 25 deletions client/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@
--text-color: black;
--button-bg: #007bff;
--button-hover: #0056b3;
--submit-bg: #007bff; /* Blue color for Submit (default) */
--submit-hover: #0056b3; /* Darker blue for hover */
--font-size: 16px;
}

body.dark-mode {
--bg-color: #121212;
--text-color: #ffffff;
--button-bg: #ff9800;
--button-hover: #e68900;
--submit-bg: #ff9800; /* Dark mode submit color */
--submit-hover: #e68900;
}

body {
Expand All @@ -41,29 +46,6 @@
transition: background 0.3s, color 0.3s;
}

.paste-button {
position: absolute;
top: 5px;
right: 5px;
padding: 5px 10px;
font-size: 14px;
background-color: var(--button-bg);
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
opacity: 0;
transition: opacity 0.3s ease-in-out, background 0.3s;
}

.container:hover .paste-button {
opacity: 1;
}

.paste-button:hover {
background-color: var(--button-hover);
}

/* Toggle Mode Button (Top-Right) */
#toggleModeButton {
position: absolute;
Expand All @@ -82,6 +64,28 @@
#toggleModeButton:hover {
background-color: var(--button-hover);
}

/* Submit Button Styling */
button {
font-size: 18px;
padding: 12px 20px;
margin-top: 10px;
background-color: var(--submit-bg);
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
background-color: var(--submit-hover);
transform: scale(1.05);
}

button:active {
transform: scale(1);
}
</style>
</head>
<body>
Expand All @@ -91,8 +95,7 @@
<h1>Pastebin</h1>
<textarea
id="pasteContent"
placeholder="Paste your text here..."
onclick="paste(this)"
placeholder="Paste your text here and press ENTER"
></textarea>
<br />
<button onclick="submitText()">Submit</button>
Expand Down
7 changes: 1 addition & 6 deletions client/web/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ async function submitText() {
let content;
if (textData) {
content = textData;
console.log(`content: {content}`);
} else {
alert("Please enter text to be saved");
return;
Expand Down Expand Up @@ -118,11 +117,6 @@ async function displayPasteUrls() {
}
}

async function paste(input) {
const text = await navigator.clipboard.readText();
input.value = text;
}

function toggleMode() {
document.body.classList.toggle("dark-mode");
const isDark = document.body.classList.contains("dark-mode");
Expand Down Expand Up @@ -153,4 +147,5 @@ window.onload = function () {
} else {
document.getElementById("toggleModeButton").innerHTML = "🌙";
}
document.getElementById("pasteContent").focus();
};
Loading