judeofuturism

[DORMANT] final project for a class on afrofuturism
git clone git://git.figbert.com/judeofuturism.git
Log | Files | Refs

interactive.js (6500B)


      1 let phase = 0;
      2 let typing = false;
      3 const main = document.getElementsByTagName("main");
      4 
      5 const story = [
      6   "MAYDAY!",
      7   "MAYDAY!",
      8   "Hailing all units in sector A721...",
      9   "Error: no units found.",
     10   "Reattempting hail...",
     11   "Error: no units found.",
     12   "Reattempting hail...",
     13   "System failure.",
     14   "System failure.",
     15   "Sysť̀em fāilur3.",
     16   "Syßť̀m fāiii1i1iilur3.",
     17   "...",
     18   "Orange. Ruddy orange. And light. Lots of it.",
     19   "And a throbbing, all across your body. Pounding against you from all sides.",
     20   "You're still in the ship. What's left of it? There's pieces missing, maybe. And a fire. To your left. But the heat from the fire is coming from every direction. You try and stand.",
     21   "...",
     22   "Your eyes crack open again. Crack very literally in this case. Your eyelids are scabbing. Your lips are split all across the surface. You flick your tongue out to wet them, but it just drags across the open cuts.",
     23   "You jostle slightly in the stretcher.",
     24   "...",
     25   "Its darker than it was before. For a second you're not sure you've opened your eyes at all, but the gruff man carefully pouring drops of water down your throat convinces you otherwise.",
     26   "You jolt up. Or try to, anyway. You manage a feeble wiggle. Still, its enough to jostle the tube from the man's waterskin, which falls out from between your dry lips and onto the mat below you. The tube closes before a drop can escape.",
     27   '"Who are you?"',
     28   "The man tilts his head. Two long, twisted strands of hair on either side of his head move with him. A layer over a pair of deep, black eyes sit thick glasses with lenses of what may be large blue gemstones. Draped over his body, a layered white robe with vertical black stripes and stained with the red of the ruddy desert sand sits comfortably over his figure.",
     29   '"Tamir Ben Yosef Ben Ari Ben Tal Ben Ravid Ben El"',
     30   "The man's voice is guttural and deep. His accent is thick, and his words almost unintelligible.",
     31   '"You are from space."',
     32   "It's not a question. You're not sure how to respond.",
     33   '"That makes you one of the deserters."',
     34   'The man grunts and turns away. You pass out again before you can think more about "deserter."',
     35   "...",
     36   "You're unclear how much time is passing between your delirious bursts of conciousness. The black, stiff scab that had formed along the burns down your left arm has almost healed. You woke once to your companion applying a yellow-brown salve over the area.",
     37   "Tamir. That is his name. You've learned very little from your interactions. His forehead is thick with wrinkles, from squinting into the sun. His beard is thick and tangled.",
     38   "He's human. You think.",
     39   "...",
     40   '"The Siloam Channel," the "e" almost an "a" when he says it, "spans from the furthest coast of the Southern Continent to the northernmost shores of the Eastern Continent. It crosses directly through Jerusalem at its center."',
     41   "The channel itself is embedded in the floor of the desert. To the sides, the walls of the channel rise up another ten meters. Cavities carved into the rock on both sides provide crevices to hide from the deadly noon sun.",
     42   "\"Is that where we're going?\" you manage. You've finally got him talking, and you don't want to risk him stopping now. The days of silence, with nothing but the crunch of the desert to keep you company, are too much to bear.",
     43   "Tamir grunts in affirmation, and continues walking.",
     44   "...",
     45   "Silence. All in the name of water. Diamonds, gold, are nothing against water in the desert.",
     46   "...",
     47   "You sleep in the middle of the day, and the middle of the night. Avoiding the extremes. Dawn and dusk are your familiars, and the sun and moon your enemy.",
     48   "Tamir has been very clear what will happen if you find yourself outside at midday or midnight.",
     49   "\"Death. Very painful. In the day, you will dry out. Like a fig. Or the chickpea crisps that are so good at Oori Boori's. At midnight, you will freeze. To freeze on the Siloam is not a good death.",
     50   "...",
     51   "\"Tamir. Where am I?\" You're shivering under the blanket. Tamir refused to light a fire tonight. He says it's work, and he cannot.",
     52   '"The Siloam Channel. It did not exist when your kind were still here."',
     53   'There it is again. "Your kind?"',
     54   '"The defectors. The nations. It has been two thousand years, so I would not expect you to remember. We do not forget so easily."',
     55   "Two thousand years.",
     56   "You're on Earth.",
     57   "...",
     58   '"What happened to the planet?"',
     59   "You're trudging through the Channel. It's dusk. You can feel the cold setting in.",
     60   '"You destroyed it, before you abandoned it. We remained, to pick up the pieces."',
     61   "You've encountered no other life on your journey along the Siloam.",
     62   '"We? Where are the others?"',
     63   '"The Poles. Or as near as they can be. Not many travel to the center. Few brave the Siloam. Perhaps once, to see the their home."',
     64   "...",
     65   "By the fire, Tamir continues.",
     66   '"When your people left, you left the earth scorched."',
     67   "You nod silently, and continue listening.",
     68   '"There was nothing left. We had to rebuild. The suit your wearing, which I have given you. It recycles your water. My blue goggles. I would be blind a hundred times over without them. The gel which healed your burns. This channel, which spans the world. Dug by hand. This is dedication.',
     69   "You fled. We did not give up. We migrated north and south. We moved down, under the soil, to remain in place.",
     70   "Anything to preserve our way of life. We do not have space ships, it is true. But we survive.",
     71   'Come. We shelter for the night, my friend. Tomorrow, we arrive at the Sand-Sunk City. Jerusalem."',
     72 ];
     73 
     74 self.addEventListener("keypress", progress);
     75 
     76 function progress(e) {
     77   if (e.code === "Enter" && phase < story.length && !typing) {
     78     switch (phase) {
     79       case 0: {
     80         const blinks = document.getElementsByClassName("blink");
     81         blinks.item(0).remove();
     82         blinks.item(0).remove();
     83       }
     84       // falls through
     85       default: {
     86         const paragraph = document.createElement("p");
     87         main.item(0).appendChild(paragraph);
     88 
     89         const text = story[phase];
     90         add(paragraph, text, 0);
     91 
     92         phase += 1;
     93       }
     94     }
     95   }
     96 }
     97 
     98 function add(p, t, i) {
     99   if (!typing) typing = true;
    100 
    101   const delay = Math.floor((Math.random() * 25) + 25);
    102   setTimeout(() => {
    103     p.innerHTML += t[i];
    104     p.scrollIntoView();
    105     if (i < t.length - 1) {
    106       add(p, t, i + 1);
    107     } else {
    108       typing = false;
    109     }
    110   }, delay);
    111 }