Interactive jQuery Menu

A few days ago I was asked to update the layout of the website for a store I used to work at.

I thought this was a good chance to get to know jQuery animations, so I put together a bunch of stock images as background, edited pictures of frames and put some text in the frames for the icons.

I worked with artboards in Affinity Designer so I could export multiple images to different files, I also worked with groups and a transparent background so I could make .png files of the frames and put them on top of the background images.

That way I used the background-image css property, with display set to block and could superimpose a png with transparency over another image.

With jQuery I selected all images, where each image has a class “RT” and I used the reserved word this to select the particular instance for mouseover and mouseleave events.

With this I managed to make a fun little menu where the frame with the text grows and shrinks according to mouse-events.

The result can be seen here.

Fontstats Plugin

Today I finished a little WordPress plugin I’ve been working on.

It’s a two part plugin, one php script collects data from any Norwegian designer on DaFont by visiting each site, and by the power of Regex-Grayskull it inserts it into a database on my website.

The WordPress plugin then selects the last sampled date and displays it in a HTML-table on any post or page where I insert the registered shortcode.

Here’s the result:

No.DownloadsDesignerDate SampledCountry
1114253161Måns Grebäck2020-01-07Sweden
224310894Pizzadude - Jakob Fischer2020-01-07Denmark
34706444Johan Waldenström2020-01-07Sweden
43688142Carl Krull2020-01-07Denmark
53257837Fontourist - Hans Gerhard Meier2020-01-07Norway
63103842Johan Aakerlund2020-01-07Denmark
72791199Listemageren - Klaus Johansen2020-01-07Denmark
82535567CheapProFonts - Roger S. Nelsson2020-01-07Norway
92118812HENRIavecunK - Henrik2020-01-07Sweden
101307625Flight of the Dragon - Hasan Guven2020-01-07Norway
111147906Christian Munk2020-01-07Denmark
12788476Adam Ericsson2020-01-07Sweden
13771942bogstav2020-01-07Denmark
14720588Your Own Font - Ellinor Rapp2020-01-07Sweden
15563651Vinterstille TypeFaceLab - Klaus Nielsen2020-01-07Denmark
16517542Viktor Hammarberg2020-01-07Sweden
17499359Moonbase Press - Svein Kåre Gunnarson2020-01-07Norway
18411324Espen Morten Kvalheim2020-01-07Norway
19406960Thor Christopher Arisland2020-01-07Norway
20359132Staffan Vilcans2020-01-07Sweden
21350604Martin Holm2020-01-07Norway
22321480Jonas Borneland Hansen2020-01-07Denmark
23293541Lene Arensdorff2020-01-07Denmark
24238736Norwegian Ink / Design for Dough - Frode Nordbø2020-01-07Norway
25212548David Engelby2020-01-07Denmark
26209131Anton - Anton Lundström2020-01-07Sweden
27201343dawnland - Daniel Viberg2020-01-07Sweden
28182792211178 Creative Agency - Morten Talleivsen2020-01-07Norway
29145805Martin Sørensen2020-01-07Denmark
30126793Andreas Larsen2020-01-07Denmark
31117780Nils Kähler2020-01-07Denmark
32100964Bolahool Graphics2020-01-07Sweden
3395010McKack2020-01-07Norway
3491763Anton Bohlin2020-01-07Sweden
3591116Joaquim Marquès Nielsen2020-01-07Denmark
3683165Pär Lundkvist2020-01-07Sweden
3777342Carl Enlund2020-01-07Sweden
3876231Digital Flame Studios - sindre små2020-01-07Norway
3973819Intense2020-01-07Norway
4065842huskmelk - Rashid Akrim2020-01-07Norway
4161062Kyrre Honohan2020-01-07Norway
4255835Pia Hed Aspell2020-01-07Sweden
4354804Nadia Rosenfeldt2020-01-07Denmark
4452527Linn Mustanoja2020-01-07Sweden
4551626Lars Håhus2020-01-07Sweden
4645557ronjam - Ronja Melcker2020-01-07Sweden
4743167Atle Mo2020-01-07Norway
4837189Erik Jeddere-Fisher2020-01-07Norway
4935049Arman Ay2020-01-07Sweden
5035008Benjamin Blåholtz2020-01-07Sweden
5134626benjamin rauber2020-01-07Sweden
5233652charmingfan2020-01-07Denmark
5330867Studio Indigo - Helena Öhman2020-01-07Sweden
5428446Christian Koch2020-01-07Denmark
5527551Mark Lund2020-01-07Norway
5627495Botond Bokor2020-01-07Sweden
5727099Dan Thorup2020-01-07Denmark
5826377Andrew Nordquist2020-01-07Sweden
5925999Lisa2020-01-07Norway
6025194Aske Ching2020-01-07Denmark
6122367Erik Holm2020-01-07Norway
6222010Andreas2020-01-07Sweden
6321430Henrik Johansson2020-01-07Sweden
6421048Bull - Sandra Madsen2020-01-07Denmark
6520972David Lindecrantz2020-01-07Sweden
6620119Kristian Dalen2020-01-07Norway
6717480Mandy Pandy2020-01-07Sweden
6814389Alexander Rossebø2020-01-07Norway
6912902Johan Brodd2020-01-07Sweden
7011934Viktor Örneland2020-01-07Sweden
7110165Mathias Alvebring2020-01-07Sweden
729833Boksen2020-01-07Norway
737992vardcentralen2020-01-07Sweden
747783Mathias Rue2020-01-07Denmark
757407Gröt Havregrynsson2020-01-07Sweden
767383Manuela Hardy2020-01-07Norway
777044Caesar2020-01-07Sweden
787006Sara Lindberg2020-01-07Sweden
796567Mattis Folkestad2020-01-07Norway
806389Oliver Waldemar2020-01-07Sweden
815325Simon Jakobsson2020-01-07Sweden
824486KingDGaming - Elias Eriksson2020-01-07Sweden
831322Simon2020-01-07Sweden

Regex 101

Today I received an email from the store I used to work at asking me to make a printer friendly version of an online table of information.

As I learned more about regular expressions from the “INF3331” course I took this fall, solving this problem proved to be way easier than any previous attempts at the likes of it.

At times I’ve thought that regexes are harder to read and debug than ordinary programming languages, but with a good editor like Atom or the regex101 page, it all became a lot less stressful.

As far as editors go, I have to admit that I still use emacs when I’m not using an IDE or GUI-editor.

Note to self about regular expressions.

(.*?) to capture zero or more characters in a non-greedy manner

(?:.*?) for the same grouping without backreferences.

$1 or $[group-number] for backreferences in JavaScript and Atom

\1 or \[group-number] for backreferences in Python, PHP.

Perl and PHP also uses \g1 or \g[group-number] for backreferences.

The following characters need to be escaped in regex:

.^$*+?()[{\|

What week is this?

Today I was a bit impulsive and registered the domain name weeknum.org.

Then I made a little php-application showing the day of the week, with the background color calculated using the week number, month and day to create a hex code.

I might even try out some AJAX and jQuery on this page and see if I can make it a little more stylish and interactive.

If you want to check start and end dates of another week number, just add the suffix /[week number] to the URL.

For example, if you want to find information about week number 42, then go to weeknum.org/42.