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
1113251047Måns Grebäck2019-11-19Sweden
224161887Pizzadude - Jakob Fischer2019-11-19Denmark
34684052Johan Waldenström2019-11-19Sweden
43646388Carl Krull2019-11-19Denmark
53254769Fontourist - Hans Gerhard Meier2019-11-19Norway
63055299Johan Aakerlund2019-11-19Denmark
72783185Listemageren - Klaus Johansen2019-11-19Denmark
82520839CheapProFonts - Roger S. Nelsson2019-11-19Norway
92076356HENRIavecunK - Henrik2019-11-19Sweden
101302792Flight of the Dragon - Hasan Guven2019-11-19Norway
111139726Christian Munk2019-11-19Denmark
12773229Adam Ericsson2019-11-19Sweden
13756935bogstav2019-11-19Denmark
14719841Your Own Font - Ellinor Rapp2019-11-19Sweden
15562560Vinterstille TypeFaceLab - Klaus Nielsen2019-11-19Denmark
16514306Viktor Hammarberg2019-11-19Sweden
17493597Moonbase Press - Svein Kåre Gunnarson2019-11-19Norway
18410838Espen Morten Kvalheim2019-11-19Norway
19401989Thor Christopher Arisland2019-11-19Norway
20358272Staffan Vilcans2019-11-19Sweden
21348047Martin Holm2019-11-19Norway
22320894Jonas Borneland Hansen2019-11-19Denmark
23290987Lene Arensdorff2019-11-19Denmark
24238276Norwegian Ink / Design for Dough - Frode Nordbø2019-11-19Norway
25211940David Engelby2019-11-19Denmark
26208820Anton - Anton Lundström2019-11-19Sweden
27201053dawnland - Daniel Viberg2019-11-19Sweden
28182150211178 Creative Agency - Morten Talleivsen2019-11-19Norway
29144738Martin Sørensen2019-11-19Denmark
30123521Andreas Larsen2019-11-19Denmark
31115423Nils Kähler2019-11-19Denmark
32100441Bolahool Graphics2019-11-19Sweden
3394942McKack2019-11-19Norway
3490946Joaquim Marquès Nielsen2019-11-19Denmark
3590891Anton Bohlin2019-11-19Sweden
3683104Pär Lundkvist2019-11-19Sweden
3776176Digital Flame Studios - sindre små2019-11-19Norway
3873715Intense2019-11-19Norway
3972180Carl Enlund2019-11-19Sweden
4065628huskmelk - Rashid Akrim2019-11-19Norway
4161000Kyrre Honohan2019-11-19Norway
4255755Pia Hed Aspell2019-11-19Sweden
4354690Nadia Rosenfeldt2019-11-19Denmark
4452440Linn Mustanoja2019-11-19Sweden
4551395Lars Håhus2019-11-19Sweden
4645435ronjam - Ronja Melcker2019-11-19Sweden
4743004Atle Mo2019-11-19Norway
4837110Erik Jeddere-Fisher2019-11-19Norway
4934787Arman Ay2019-11-19Sweden
5034402benjamin rauber2019-11-19Sweden
5133613charmingfan2019-11-19Denmark
5233521Benjamin Blåholtz2019-11-19Sweden
5330251Studio Indigo - Helena Öhman2019-11-19Sweden
5428061Christian Koch2019-11-19Denmark
5527503Mark Lund2019-11-19Norway
5627384Botond Bokor2019-11-19Sweden
5727003Dan Thorup2019-11-19Denmark
5826326Andrew Nordquist2019-11-19Sweden
5925980Lisa2019-11-19Norway
6025145Aske Ching2019-11-19Denmark
6122170Erik Holm2019-11-19Norway
6221982Andreas2019-11-19Sweden
6321326Henrik Johansson2019-11-19Sweden
6421008Bull - Sandra Madsen2019-11-19Denmark
6520920David Lindecrantz2019-11-19Sweden
6620104Kristian Dalen2019-11-19Norway
6717447Mandy Pandy2019-11-19Sweden
6814197Alexander Rossebø2019-11-19Norway
6912881Johan Brodd2019-11-19Sweden
7011879Viktor Örneland2019-11-19Sweden
7110125Mathias Alvebring2019-11-19Sweden
729800Boksen2019-11-19Norway
737968vardcentralen2019-11-19Sweden
747768Mathias Rue2019-11-19Denmark
757342Manuela Hardy2019-11-19Norway
767338Gröt Havregrynsson2019-11-19Sweden
777014Caesar2019-11-19Sweden
786978Sara Lindberg2019-11-19Sweden
796542Mattis Folkestad2019-11-19Norway
806313Oliver Waldemar2019-11-19Sweden
815297Simon Jakobsson2019-11-19Sweden
824470KingDGaming - Elias Eriksson2019-11-19Sweden
83992Simon2019-11-19Sweden

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.