feat: user profile pictures
20
main.js
@ -67,13 +67,25 @@ class Post {
|
||||
}
|
||||
|
||||
getHeaderElement() {
|
||||
const headerElem = document.createElement(this.getHeaderTag());
|
||||
headerElem.innerHTML = this.username;
|
||||
|
||||
const elem = document.createElement("a");
|
||||
|
||||
// TODO: fetch current user pfp from thispersondoesnotexist and place in local storage
|
||||
// for now if this person is us, post octopus
|
||||
const currentUser = getCurrentUser();
|
||||
const isCurrentUser = this.username == currentUser.user;
|
||||
const pfpPath = isCurrentUser ? "oct.jpg" : `user/${this.username}.png`;
|
||||
|
||||
const pfpElem = document.createElement("img");
|
||||
pfpElem.setAttribute("src", pfpPath);
|
||||
pfpElem.setAttribute("class", "pfp");
|
||||
elem.appendChild(pfpElem);
|
||||
|
||||
const usernameElem = document.createElement(this.getHeaderTag());
|
||||
usernameElem.innerHTML = this.username;
|
||||
|
||||
elem.setAttribute("href", "#");
|
||||
elem.addEventListener("click", () => updateUserProfile(this.username));
|
||||
elem.appendChild(headerElem);
|
||||
elem.appendChild(usernameElem);
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
@ -35,6 +35,13 @@ body {
|
||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.pfp {
|
||||
max-width: 64px;
|
||||
max-height: 64px;
|
||||
float: left;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.post-actions {
|
||||
margin: 8px;
|
||||
padding: 16px 0;
|
||||
|
BIN
user/AdventureSeeker.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
user/AnimalAdvocate.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
user/AnimalLover.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
user/AnimalWhisperer.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
user/ArtfulDodger.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
user/Artist.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/ArtsyAdvocate.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
user/Bibliophile.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
user/BookLover.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/BookishBaker.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
user/CoffeeCrazedCoder.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
user/CoffeeLover.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
user/Conservationist.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
user/Creative.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
user/CreativeMind.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
user/CreativeSoul.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
user/CulinaryConnoisseur.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
user/DIYDiva.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
user/DesignEnthusiast.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/DigitalArtist.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
user/Epicurean.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
user/Explorer.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
user/FashionBlogger.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
user/FashionForward.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/FashionMaven.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
user/Fashionista.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
user/FitFashionista.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
user/FitnessFanatic.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
user/FitnessGuru.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
user/FitnessJunkie.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/FoodCritic.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
user/Foodie.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
user/FoodieExplorer.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
user/FoodieFilmFan.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
user/GamerGuru.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
user/Gastronome.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
user/Globetrotter.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/Gourmand.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
user/GreenThumbGardener.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
user/HistoryBuff.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
user/HistoryEnthusiast.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
BIN
user/HistoryGuru.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
user/HistoryNerd.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
user/IronManiac.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
user/JazzyJester.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
user/LanguageLover.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
user/LiteraryScholar.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
user/LiteratureEnthusiast.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
user/MarathonRunner.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
user/Melomane.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
user/MusicAddict.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
user/MusicAficionado.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
user/MusicFan.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
user/MusicLover.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
user/MusicNomad.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
user/Musicophile.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
user/NatureEnthusiast.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
user/NatureLover.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
user/NaturePhotographer.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
user/NewsJunkie.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
user/Nomad.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
user/OutdoorEnthusiast.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
user/Outdoorsman.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
user/Outdoorsy.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
user/PetParentPro.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
user/PoliticalJunkie.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
user/Politico.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
user/Reader.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
user/Runner.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
user/SportsFanatic.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
user/StyleIcon.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
user/TechEnthusiast.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
user/TechGeek.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
user/TechGuru.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/TechInnovator.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
user/TechTrendsetter.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
user/TechWizard.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
user/Techie.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
BIN
user/Technophile.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/TechyTrekker.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
user/TravelBlogger.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
user/TravelBug.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
user/Trendsetter.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
user/UltraMarathoner.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
user/VisionaryArtist.png
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
user/Wanderer.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/Wanderlust.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
user/WellnessWarrior.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/WildernessExplorer.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
user/WildlifeEnthusiast.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
user/ancient_history_lover.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
user/animal_rescuer.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
user/art_lover.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
user/artful_activist.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
user/audiophile.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
user/beauty_seeker.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
user/bookish_baker.png
Normal file
After Width: | Height: | Size: 9.0 KiB |