Skip to content

Commit

Permalink
build v.1.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
r002 committed May 4, 2024
1 parent 9e35c5f commit 61ed208
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 9 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ Onward and upward!! Accelerate!! 🌎🚀✨
- [ ] build `wheel` page
- [ ] track every week's pick
- [ ] build histogram of everyone's who's been picked
- [ ] create `links` section
- [x] create `books` section
- [x] add `bad movie club` section
- [x] code a script to automatically push `x.json` and `new pfps` to GitHub
- [x] revamp the `calendar` sidebar -> display all days in the year & always center current week
Expand Down
8 changes: 8 additions & 0 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"dt": "2024-05-03",
"version": "1.4.6",
"notes": [
"added `books` section to XNA page",
"added placeholders to BMC page"
]
},
{
"dt": "2024-04-27",
"version": "1.4.5",
Expand Down
3 changes: 3 additions & 0 deletions data/books.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"@tomorrow3"
]
1 change: 0 additions & 1 deletion data/media.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"@Foundation_",
"@IndianaJones",
"@AvatarNetflix",
"@tomorrow3",
"@Armageddon"
]
14 changes: 14 additions & 0 deletions data/movies.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,19 @@
"ticketCost": 5,
"month": "March",
"year": 2023
},
{
"title": "No movie",
"yearMonth": "2023-02",
"ticketCost": 0,
"month": "February",
"year": 2023
},
{
"title": "No movie",
"yearMonth": "2023-01",
"ticketCost": 0,
"month": "January",
"year": 2023
}
]
Binary file added img/bmc/2023-01.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 added img/bmc/2023-02.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 16 additions & 4 deletions js/xna.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const DBURL = "../x.json";
const ORGSURL = "../data/orgs.json";
const MEDIAURL = "../data/media.json";
const BOOKSURL = "../data/books.json";

let SELECTEDPERSON = "";
let mapTAG, // map of tags => [tids]
Expand All @@ -11,6 +12,7 @@ let mapTAG, // map of tags => [tids]
dbPPL, // map of handle => personObjs
setORGS, // set of orgs
setMEDIA, // set of media
setBOOKS, // set of books
arrDATES, // [dates]
arrTWEET, // [tweetObjs] from oldest to newest
arrTIDS; // [tids] from newest to oldest
Expand All @@ -30,24 +32,29 @@ async function fetchdata() {
const media = await mediapayload.json();
console.log(">> media length:", media.length);

const bookspayload = await fetch(BOOKSURL);
const books = await bookspayload.json();
console.log(">> books length:", books.length);

arrTIDS = tweets.map(t=>t.id);
arrTWEET = tweets.reverse();
arrDATES = Array.from(new Set(tweets.map(t=>t.dt)));

indexDB(arrTWEET, orgs, media);
indexDB(arrTWEET, orgs, media, books);
rendercalendar();
rendermeta("revchrono");
renderDefaultStream();
}

function indexDB(dbArr, orgsArr, mediaArr) {
function indexDB(dbArr, orgsArr, mediaArr, booksArr) {
mapTAG = new Map();
mapPPL = new Map();
dbPPL = new Map();
mapDATE = new Map();
mapTIDS = new Map();
setORGS = new Set(orgsArr.map(o=>o.substr(1).toLowerCase()));
setMEDIA = new Set(mediaArr.map(o=>o.substr(1).toLowerCase()));
setBOOKS = new Set(booksArr.map(o=>o.substr(1).toLowerCase()));

for (let t of dbArr) {
// Index tweets by tid
Expand Down Expand Up @@ -152,8 +159,8 @@ function selectperson(handle){
}

function rendermeta(mode) {
let ppl = orgs = media = "";
let pplcount = orgscount = mediacount = 0;
let ppl = orgs = media = books = "";
let pplcount = orgscount = mediacount = bookscount = 0;
if (mode === "revchrono") {
const revsersechrono = Array.from(mapPPL.keys()).reverse();
for (let handle of revsersechrono) {
Expand All @@ -163,6 +170,9 @@ function rendermeta(mode) {
} else if (setMEDIA.has(handle)) {
media += genavatar(handle);
mediacount++;
} else if (setBOOKS.has(handle)) {
books += genavatar(handle);
bookscount++;
} else {
ppl += genavatar(handle);
pplcount++;
Expand All @@ -188,9 +198,11 @@ function rendermeta(mode) {
document.getElementById("people").innerHTML = ppl;
document.getElementById("orgs").innerHTML = orgs;
document.getElementById("media").innerHTML = media;
document.getElementById("books").innerHTML = books;
document.getElementById("titlepeople").innerHTML = `People (${pplcount})`;
document.getElementById("titleorgs").innerHTML = `Organizations (${orgscount})`;
document.getElementById("titlemedia").innerHTML = `TV + Movies (${mediacount})`;
document.getElementById("titlebooks").innerHTML = `Books (${bookscount})`;
document.getElementById("titleyear").innerHTML = `2024 | "Year of Connection" (${arrDATES.length})`;
}

Expand Down
11 changes: 7 additions & 4 deletions xna/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,14 @@
<div id="media" class="avatargrid"></div>
<br />

<h2>Ballistic Rants</h2>
🚧👨‍🍳 <em>Still cooking!!</em> 👨‍🍳🚧
<br /><br />
<div id="titlebooks" class="paneheader"
title="📚 life-changing books">
Books
</div>
<div id="books" class="avatargrid"></div>
<br />

<h2>Books</h2>
<h2>Ballistic Rants</h2>
🚧👨‍🍳 <em>Still cooking!!</em> 👨‍🍳🚧
<br /><br />

Expand Down

0 comments on commit 61ed208

Please sign in to comment.