Skip to content

Commit

Permalink
View all the memes together
Browse files Browse the repository at this point in the history
  • Loading branch information
rberenguel committed Nov 25, 2024
1 parent cfad024 commit 70fb9bf
Show file tree
Hide file tree
Showing 64 changed files with 137 additions and 61 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

An extension to take and annotate screenshots.

It can also be used in a standalone way by visiting https://www.mostlymaths.net/goita/ To annotate an image you have in your clipboard, press `q`, otherwise you can paste pieces of images using `v`. Depending on the browser you may need to click "paste", or accept some clipboard access permissions. Use `m` to have fun with memes.
It can also be used in a standalone way by visiting https://www.mostlymaths.net/goita/ To annotate an image you have in your clipboard, press `q`, otherwise you can paste pieces of images using `v`. Depending on the browser you may need to click "paste", or accept some clipboard access permissions. Use `m` to have fun with memes. You can see all memes available [here](https://www.mostlymaths.net/goita/memes/) (it's also available from within the extension or the standalone help).

All images and text are processed locally, no data is sent anywhere.

Expand Down
48 changes: 0 additions & 48 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,6 @@
<link href="src/style.css" rel="stylesheet" />
</head>
<body>
<div id="help" class="hide">
<p style="text-align: center"><code>Goita!</code> Ruben Berenguel 2024</p>
<hr />
<ul>
<li>Everything you can create can be dragged around and deleted.</li>
<li>Click to select things.</li>
<li>Drag to move them.</li>
<li>
If you prefer other shortcuts, change them in
<code>shortcuts.js</code> (only those
<span class="u">underlined</span> are configurable).
</li>
</ul>
<p><code>h</code> show and hide this help</p>
<p><code class="u">{arrow}</code> draw an arrow</p>
<p><code class="u">{rect}</code>: draw a rectangle</p>
<p><code class="u">{ellipse}</code> draw an ellipse</p>
<p><code class="u">{highlight}</code> highlight an area</p>
<p><code class="u">{text}</code> write text</p>
<p><code> ctrl .</code> Make text larger (for this text block)</p>
<p><code> ctrl ,</code> Make text smaller (for this text block)</p>
<p>
<code> ctrl /</code> Cycle through fonts (Monoid, Reforma, Inter,
Roboto)
</p>
<p><code> ctrl + scrollwheel</code> Resize the text bounding box</p>
<p><code> ctrl + c</code> Center the text</p>
<p>
<code class="u">{paste}</code> paste images or text from the clipboard
</p>
<p><code> ctrl + scrollwheel</code> Resize the pasted image</p>
<p><code class="u">{clip}</code> clip the screenshot</p>
<p><code> drag</code> dragging moves the clipped image</p>
<p><code> shift+drag</code> dragging moves the clipping rectangle</p>
<p>
<code class="u">{clipboard}</code> swap the screenshot for whatever
image there is on the clipboard (or go back to the screenshot)
</p>
<p><code class="u">{color}</code> choose color for the next operations</p>
<p><code> r</code> red (default)</p>
<p><code> y</code> yellow</p>
<p><code> b</code> blue</p>
<p><code> g</code> green</p>
<p><code> o</code> orange</p>
<p><code> w</code> white</p>
<p><code> x</code> black (and highlight then redacts)</p>
<p><code>backspace</code>: delete anything selected</p>
</div>
<div id="screenshotContainer">
<div id="sourceLink"></div>
<svg id="svgOverlay"></svg>
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Goita",
"description": "Take a screenshot, add arrows and sh*t as you wish. With blackjack, and memes",
"version": "2.1.0",
"version": "2.2.0",
"permissions": [
"tabs",
"activeTab",
Expand Down
Binary file modified memes/always-been.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/american-chopper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/ancient-aliens.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/batman-slapping.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/batman-thinking.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/be-normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/boardroom-suggestion.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/cadaver.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/carbon-rod.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/change-my-mind.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/confused-travolta.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/distracted-boyfriend.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/do-today.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/facepalm.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/flex-tape.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/go-banana.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/hammocks.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/harold.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/homer-bush.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/homer-terminator.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/i-hate-this-more.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions memes/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<!doctype html>
<html>
<head>
<title>Goita: all the memes</title>
<link href="../fonts/fonts.css" rel="stylesheet" />
<link href="../src/style.css" rel="stylesheet" />
<style>
#meme-container {
top: 1rem;
display: grid;
width: calc(100% - 2rem);
margin-left: 1rem;
position: absolute;
z-index: 1000;
grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
gap: 0em;
padding: 0;
background-color: white;
border-radius: 5px;
border: none;
backdrop-filter: blur(5px);
}

.blur {
filter: blur(1em);
}

.meme-img {
margin-bottom: 0.8rem;
padding: 0em;
width: 16rem;
height: 16rem;
border: none;
border-radius: 0.3rem;
border: 1px solid black;
}

.meme-img > img {
border: none;
}

#enlarged {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 1000;
opacity: 1;
transition: opacity 0.5s ease-in-out;
padding: 0.5rem;
background: white;
border: 2px solid black;
border-radius: 0.5rem;
}

#enlarged > img {
max-height: 50vh;
border-radius: 0.3rem 0.3rem 0 0;
}

#enlarged.hidden {
opacity: 0;
}

.meme-title {
border-top: 2px solid #630;
font-size: 190%;
}

.close {
position: absolute;
right: 1.5em;
top: 1.5em;
cursor: pointer;
transition: transform 0.1s ease-in-out;
transform: translateX(0em);
}
</style>
</head>
<body>
<div id="filtered-memes"></div>
<div id="enlarged" class="hidden"></div>
<script type="module" src="show.js"></script>
</body>
</html>
Binary file modified memes/is-this-a-pigeon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/khaaan.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/kick-barney.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/kill-it-with-fire.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified memes/left-exit-12.jpg
Binary file modified memes/make-it-so.jpg
14 changes: 7 additions & 7 deletions memes/memes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { filterMemes, displayMemes };
export { memes, filterMemes, displayMemes };

const memes = [
{
Expand Down Expand Up @@ -440,6 +440,11 @@ const memes = [
file: "xkcd-dependency.jpg",
keywords: ["xkcd dependency", "developer", "xkcd"],
},
{
title: "I have no idea what I'm doing",
file: "no-idea.jpg",
keywords: ["I have no idea what I'm doing", "dog", "confused"],
},
];

const filterTextElement =
Expand Down Expand Up @@ -499,21 +504,16 @@ function displayMemes(memes, settings) {

memes.forEach((meme) => {
const memeDiv = document.createElement("div");
memeDiv.style.border = "1px solid #ccc";
memeDiv.style.overflow = "hidden"; // Hide any content that overflows
memeDiv.style.position = "relative";
const img = document.createElement("img");
img.src = settings.basepath + "memes/" + meme.file;
img.alt = meme.title;
img.style.width = "100%";
img.style.height = "100%";
img.style.objectFit = "cover"; // This is key for square trimming

memeDiv.classList.add("meme-div");
memeDiv.appendChild(img);
memeDiv.dataset["title"] = meme.title;
memeDiv.classList.add("meme-img");
memeDiv.style.width = "12em"; // Set a fixed width
memeDiv.style.height = "12em"; // Set the same height for a square
memeDiv.addEventListener("click", settings.callback("memes/" + meme.file));
newContainer.appendChild(memeDiv);
});
Expand Down
Binary file added memes/no-idea.jpg
Binary file modified memes/not-sure-if-fry.jpg
Binary file modified memes/nothing-to-see-here.jpg
Binary file modified memes/old-man-yells.jpg
Binary file modified memes/one-does-not-simply.jpg
Binary file modified memes/one-of-us.jpg
Binary file modified memes/pepe-silvia.jpg
Binary file modified memes/pingu-dont-want-to.jpg
Binary file modified memes/pingu-toot.jpg
Binary file modified memes/ptsdog.jpg
Binary file modified memes/raccoon-plan.jpg
Binary file modified memes/ralph-danger.jpg
Binary file modified memes/say-it-bart.jpg
34 changes: 34 additions & 0 deletions memes/show.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { memes, displayMemes } from "./memes.js";

const cb = (a) => () => {};

displayMemes(memes, { basepath: "../", callback: cb });

const enlarged = document.getElementById("enlarged");
const container = document.getElementById("meme-container");

document.addEventListener("click", (ev) => {
if (
ev.target.nodeName === "IMG" &&
ev.target.closest(".meme-img") &&
enlarged.classList.contains("hidden")
) {
enlarged.innerHTML = "";
const img = document.createElement("IMG");
const closer = document.createElement("DIV");
closer.classList.add("close");
closer.innerHTML = "&#x274C;";
const title = document.createElement("DIV");
title.classList.add("meme-title");
title.innerHTML = ev.target.closest(".meme-img").dataset["title"];
img.src = ev.target.src;
enlarged.appendChild(img);
enlarged.appendChild(closer);
enlarged.appendChild(title);
enlarged.classList.remove("hidden");
container.classList.add("blur");
} else {
enlarged.classList.add("hidden");
container.classList.remove("blur");
}
});
Binary file modified memes/shut-up-and-take-my-money.jpg
Binary file modified memes/side-eye-monkey.jpg
Binary file modified memes/skinner-idea.jpg
Binary file modified memes/smarts.jpg
Binary file modified memes/so-far.jpg
Binary file modified memes/spice-adams.jpg
Binary file modified memes/spiderman-pointing.jpg
Binary file modified memes/steamed-hams.jpg
Binary file modified memes/thought-police.jpg
Binary file modified memes/to-do-webcomicname-dot-com.jpg
Binary file modified memes/tom-gauld-science-hell.jpg
Binary file modified memes/two-buttons.jpg
Binary file modified memes/wink-wink.jpg
Binary file modified memes/xkcd-compiling.jpg
Binary file modified memes/xkcd-dependency.jpg
4 changes: 2 additions & 2 deletions src/help.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
export { createHelpDiv };

function createHelpDiv() {
function createHelpDiv(settings = {}) {
if (document.getElementById("help")) {
return;
}

const helpDiv = document.createElement("div");
helpDiv.id = "help";
helpDiv.classList.add("hide");
Expand Down Expand Up @@ -57,6 +56,7 @@ function createHelpDiv() {
<p><code> enter</code> to select the topmost meme</p>
<p><code> click</code> on the image or name to select it</p>
<p><code> paste</code> an external meme URL (should be valid) to use that instead</p>
<p><code> </code> see all memes <a href="${settings.basepath}/memes/index.html">here</a></p>
<p><code> esc</code> to dismiss</p>
<p><code>{empty}</code>: switch between the screenshot and a white canvas (better for tweaking memes or diagrams)</p>
<p><code>backspace</code>: delete anything selected</p>
Expand Down
2 changes: 1 addition & 1 deletion src/screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const setupAllTheThings = (testImage, basepath) => () => {

const svg = document.getElementById("svgOverlay");

createHelpDiv();
createHelpDiv({ basepath: basepath });

const help = document.getElementById("help");

Expand Down
7 changes: 6 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,13 @@ svg {
backdrop-filter: blur(5px);
}

#meme-container > div {
.meme-img {
padding: 0em;
width: 12em;
height: 12em;
border: 1px solid #ccc;
overflow: hidden;
position: relative;
}

.meme-img[data-title]:hover::after {
Expand Down

0 comments on commit 70fb9bf

Please sign in to comment.