Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- "*"
paths-ignore:
- 'client/web/**'
- "backend/**"
jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- "*"
paths-ignore:
- 'client/web/**'
- "backend/**"
jobs:
test:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- synchronize
- closed
paths-ignore:
- 'client/web/**'
- "backend/**"
permissions:
id-token: write # This is required for aws oidc connection
Expand Down
32 changes: 29 additions & 3 deletions client/web/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="environment" content="local" />
<meta name="environment" content="production" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pastebin</title>
Expand All @@ -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 Down Expand Up @@ -82,6 +87,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 @@ -92,13 +119,12 @@ <h1>Pastebin</h1>
<textarea
id="pasteContent"
placeholder="Paste your text here..."
onclick="paste(this)"
></textarea>
<br />
<button onclick="submitText()">Submit</button>
<div id="responseContainer"></div>
<h2>latest pastes</h2>
<div id="latestPasteUrls"></div>
<script src="script.js"></script>
<script src="pastebinscript.js"></script>
</body>
</html>
16 changes: 1 addition & 15 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 All @@ -134,15 +128,6 @@ function toggleMode() {
document.getElementById("toggleModeButton").innerHTML = isDark ? "☀️" : "🌙";
}

document
.getElementById("pasteContent")
.addEventListener("keydown", function (event) {
if (event.key === "Enter" && !event.shiftKey) {
event.preventDefault(); // Prevents adding a new line
submitText(); // Triggers submit
}
});

window.onload = function () {
displayPasteUrls();
const darkModeSetting = localStorage.getItem("darkMode");
Expand All @@ -153,4 +138,5 @@ window.onload = function () {
} else {
document.getElementById("toggleModeButton").innerHTML = "🌙";
}
document.getElementById("pasteContent").focus();
};
Loading