Hiram Q Sepulchrave Esq.

The next time an online scammer asks you to send them photo ID please feel free to supply them with this carefully crafted yet entirely nonsensical United States drivers license, featuring the best photograph ever taken of everyone’s favourite pervert cult leader Tony Alamo and the signature of one Elvis Presley.

(Please note that Denys P. Wyrm and Wyrmworld cannot be held in any way responsible for anything that happens to you should you be stupid enough to try and use this mockery of an ID for anything other than confusing scammers)

Down in the Tunnels, Tryin’a Make it Pay

Some years back (about 6 I think?) I spent a fair bit of time putting together a map of the post-apocalyptic Moscow Metro system of Dmitry Glukhovsky’s Metro 2033 series. While this was received pretty well by both the cartographic and Metro communities I was never 100% happy with it – in particular the way it echoed the inaccurate depiction of interchanges from the official map – and I always intended to go back and revise it.

So now I have.

After many hours of studying Moscow’s geography and trawling my way through the Russian Metro wikia (with the assistance of Google Translate) I have redrafted and updated my map to produce what is undoubtedly (by which I mean ‘doubtedly’) the best English map of the Metro ever produced!

A miracle of rare device! A sunny pleasure dome with caves… wait, that’s not even CLOSE to accurate…
Seize-Seize the means of production! Yes-Yes!

As is my wont I’ve included some information from the expanded “Universe of Metro 2033” books by other authors, despite some of them being a bit silly (I’m still not quite over there being Skaven on the Serpukhovsko–Timiryazevskaya line). I’ve also used some content from the Metro computer game series, which is based on the books but takes a number of serious liberties with them (any version of Metro 2033 where Artyom doesn’t spend a week being forced to shovel human waste out of toilet pits simply isn’t Metro 2033!).

My next insane project is a redraft of the regional Moscow map I found on the Russian wiki, which is highly deficient in various areas. I will take some time off first however – at least until I stop waking up in the morning with the names metro stations echoing in my head (ТеатральнаяТеатральнаяТеатральная…)

The Truth Behind the Lie

Here’s another idea for an RPG campaign that I’ll never get around to running, partially because organising even a single gaming session – let alone a campaign – when you get to my age requires a major effort, and partially because it touches on some tricky issues that I’m nowhere near good enough to handle in a suitably respectable fashion. Oh, and also because I’m explaining it here and my players are a bunch of dirty cheats who’d read this post in its entirety and spoil the whole thing.

So, it starts out as your standard fantasy RPG game, although the players would notice a few non-standard features of the setting. The PCs are all resistance fighters on the run, living rough in the wilderness while fighting back against the evil empire that has conquered the once prosperous realm. Sort of Robin Hood meets John Connor’s guys from The Terminator.

They need to sneak around, gathering resources to survive, making alliances with groups and individuals who may or may not be trustworthy and launching risky strikes against the foe whenever they can manage it. It’s a highly uneven battle – the enemy holds all the cards while the PCs have little but their determination and belief to keep them going.

While the warriors of the enemy are tough, the greatest threat to the PCs are the mind-bending magics of their sorcerers, capable of rewriting memories and personalities and turning trusted friends and allies to the side of evil. Being captured and subjected to mind-magic is the thing of nightmares and to be avoided by the PCs at all costs.

As the campaign progresses it should gradually become clear to the players that things aren’t all that they seem. As evidence mounts up it should slowly dawn on them that the PCs are not fantasy heroes valiantly fighting evil…

…they’re mentally ill homeless people living rough on the streets of a modern day city. The evil forces ranked against them are cops trying to maintain order and the terrifying mind-wiping sorcerers are social workers trying to get them into treatment.

As I said I could never pull this off in a way that firstly works, and secondly doesn’t make a mockery of the very serious issues of homelessness and mental health. But someone else might be able to manage, so have at it!

(Inspirations for this concept include the Tube Station scene in Neil Gaiman’s Neverwhere and Dirt Merchant Games’ extremely messed up – and extremely funny – “LARP” Freebase, which is well worth looking up.)

Sweetness and Light

In these times of plague and disaster, who better to turn to for help than an ancient snake god whose cult pretty much consisted of Alexander of Abonoteichus perfecting his ventriloquist routine?

Glycon, protect us from the plague clouds! And David Strassman!

Simply print out copies of this stylish icon of Glycon (aka ‘Sweetie’) and post them about your local area. Not only will your neighbours be extremely confused, but the ancient sock puppet himself will be guaranteed* to protect both you and them from any menacing plague clouds hovering in the vicinity!

If Glycon’s good enough for Alan Moore, he’s good enough for you!

(*not guaranteed)

Power Armour Through the Ages

Let me tell you, discovering that your site isn’t running is just a GREAT way to start the day. Turns out MySQL fell over for some reason. I’ll need to keep an eye on that…

Anyway here’s yet another blank 40k template, this time for all 8 Marks of classic Astartes Power Armour.

Trump declares himself “Wrath of God”

Exclusive image of ex-President Trump departing Washington for Florida

Ex-President Trump departed Washington on a raft for Florida this morning, skipping the inauguration of his successor Joe Biden.

Aides close to the President state that during the trip down the Potomac he declared himself “The Wrath of God” and announced his intention to marry his daughter, found “the purest dynasty the world has ever seen” and rule the entire north American continent.

He then proceeded to interrogate several squirrel monkeys, demanding to know which of them were “with him”.

Tech Support

Hello there! This post intended for a specific individual that I’m helping with their website. If you’re not that specific individual then it won’t be much use to you – here’s a link where you can go and see some cute goats.

Now, assuming you’re the person I’ve written this for, you should open up the link I sent you to the test page. The first step is to make sure the menus do what you want them to do on mobile. If they do, carry on to find out how I did it. If they don’t, message me and tell me where I went wrong!

Using jQuery to make Javascript stuff Easier

Assuming I’m remembering correctly the issue was getting control of the dropdown menus on mobile devices where there’s no cursor to hover with. The easiest solution for this is to use some Javascript, and the easiest way to use Javascript is with jQuery.

jQuery is an API, a collection of prewritten code that removes most of the heavy lifting for common tasks. With an API you can tell the webpage WHAT to do without having to explain every single step of HOW to do it.

If you view the source of the test page and look at line 17 you’ll see the include line for jQuery….

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

I’ve used the version hosted by Google, but you can easily just save the file – jquery.min.js – and host it locally if you prefer. In either case including the file in the page like this is all you need to make jQuery available.

Changes I’ve made to the Page Code

As I mentioned the other day, a hazard of getting a web developer to look at your code is that they just can’t stop themselves from messing with stuff other than that you asked them to. As such I’ve made a number of changes to the code of the test page, and will detail them here so you can tell what is important to getting the dropdowns working and what isn’t.

  • I rearranged the header section to put the <title> and <description> tags right at the top. Search Engine Optimisation is a hodgepodge of rumour and voodoo, but at least some of the legends claim that putting this info at the top of the header gives a slight boost to rankings.
  • Any <tag> that doesn’t have an ending </tag> should ideally get a slash put at the end of it, for instance…
        <meta charset="utf-8"/>
<img src="blah.png" alt="blah blah" />
<br/>

I’ve done this to the meta tags, image tags and <br/> tags through the page.

  • It’s not mandatory but <style> and <script> tags can include a “type” attribute telling the browser exactly what’s inside them. Browsers these days are smart enough to figure this out for themselves, but telling them might save a few milliseconds of rendering time. The types to fill in are…
        <style type="text/css">
<script type="text/javascript">
  • For some reason the way I uploaded the test page has added a chunk of Javascript code into the top-container div at lines 24 to 26. Please pretend this isn’t there 😀
  • Indenting your code takes up more space, but makes it much easier to read. Basically when you open a new element, such as a <div> you jump to a new line and add a tab, then when you close the element you jump to a new line and go back a tab. For instance instead of…
  <div>
  <div class="some-class">
  <img src="/headerlogo.png" width="900px" alt="Logo"/>
  </div>
  </div>

you arrange the code like this…

  <div>
       <div class="some-class">
            <img src="/headerlogo.png" width="900px" alt="Logo"/>
       </div>
  </div>
  • The character entity &copy; is displayed more reliably across browsers, fonts and languages than a the literal © character
  • I took the liberty of moving the script block before the </body> tag, because it was bothering me 🙂
  • You can put as much Javascript as you like inside a single script block rather than opening and closing new ones for each bit of code.

The Actual Javascript

OK, on to the actual Javascript that makes everything work. I rewrote the functions you already had on the page to use jQuery for consistancy’s sake. Because all the code seems to have run together in the test file I’ll copy it all here and run through what it does and how it does it.

  $(window).scroll(function() { myFunctionSticky() });
  $(window).click(function() { $(".dropdown-content").hide(); });
  $('#menu').click(function(event){ event.stopPropagation(); });

These three lines add some behaviors to objects on the page. The first line is the jQuery equivalent of the code you already had telling the page to run the “myFunctionSticky” function whenever the page scrolls. It grabs the ‘window’ object (which is effectively the webpage), attaches the ‘scroll’ trigger to it and then runs ‘myfunctionSticky()’ when the trigger fires.

The second line also grabs the ‘window’ (which is to say page) object, and adds a ‘click’ trigger, which will fire whenever anything on the page is clicked. This then calls the code

$(“.dropdown-content”).hide();

which tells jQuery to find all items on the page with the class “dropdown-content” and hide them by making them invisible. This means that clicking anything anywhere on the page will close all open dropdown menus.

The third line is a bit complicated, but you don’t need to know too much about it. It grabs the div with the id menu object and isolates it from the click trigger defined on the line before. This means that clicking the menu object (and anything inside it) will NOT close the dropdown menus. If we didn’t do this then clicking to open a dropdown menu would immediately close all the dropdown menus and they’d never appear at all.

  var stickyheader = $("#menubar");
  var stickyoffset = stickyheader.offset();

  function myFunctionSticky() {
    if ($(window).scrollTop() > stickyoffset.top) {
      stickyheader.addClass("sticky");
    } else {
      stickyheader.removeClass("sticky");
    }
  }

This block of code is the jQuery version of the stickyheader code you already had. The only really differences are that

document.getElementById(“menubar”)

is replaced with the shorter jQuery version

$(“#menubar”)

and the “sticky” class is added and removed with addClass and removeClass

  // When the user clicks on the button, 
  // toggle between hiding and showing the dropdown content 
  function myFunction(the_button) {
    var the_dropdown = $(the_button).closest('div').find(".dropdown-content");
    $(the_dropdown).toggle();
  }

This final bit of code is the jQuery version of the function that turns the menus on and off when clicked. The major change is the definition of “the_button” in between the round brackets of the function definition. If you have a look back up at the buttons in the menu you’ll see that the onclick definitions now read…

"myFunction(this)"

“this” is a javascript codeword that represents the current element. So when the button is clicked, “this” becomes a reference to the button, which is then passed to the function, and the function assigns it to “the_button”.

If that’s confusing, basically it means that in the function, ‘the_button’ refers to the button that was clicked to trigger it.

The first line of the function (starting with var the_dropdown) uses jQuery to find the appropriate dropdown-content object. “Closest” gets the button’s parent div, and “find” gets anything with the class “dropdown_content” within that div.

Once we have the dropdown, we use the built in jQuery toggle() command to turn it on or off.

Conclusion

So, that’s everything! Let me know if any of this makes sense, and if you have any problems getting it working.

Close Bitnami banner
Bitnami