3 my $wordlist = 'wordlist.en.inc.pl';
4 my $limit = $get{v} // (exists $get{v} ? 4 : 3);
7 title => 'words cheat sheet',
9 description => "Visual words",
18 grid: auto-flow dense / repeat(auto-fit, minmax(200px, 1fr));
26 box-sizing: border-box;
29 display: inline-block;
35 @media (min-width: 403px) and (min-height: 266px) {
41 @media (min-width: 603px) and (min-height: 400px) {
42 p + ul > li:first-child > figure {
48 figure:hover ~ ul figure,
49 figure:hover ~ ul figcaption {
53 figure:hover ~ ul figcaption {
54 background: rgba(255, 255, 255, .5);
58 transition: all .5s ease-in;
60 li.parent:hover > figure > figcaption,
61 figure:hover > figcaption {
65 transform: translate(50%, 50%);
66 margin-left: -60%; /* keep width */
72 if (exists $get{debug}) {
74 include 'word-debug.css';
82 Zie ook <a href="/dieren">dieren</a>.
86 my $table = do $wordlist or die $@ // $!;
90 my ($imgname) = $name =~ /^([\w -]+)/;
91 $name =~ s/\w{4} [^aoeuiyc\W] [rl]?+ \K (?= [^aoeuiy\W] [rl]? [aoeuiy] \w)/­/gx;
92 $name =~ s{/(.*)}{ <small>($1)</small>}g;
93 my $hidden = $name =~ s/\?$//;
95 $name = "<q>$name</q>" if $name =~ s/\?$//;
96 $name = "<figcaption>$name</figcaption>";
98 if ($imgname and -e (my $img = "data/word/en/$imgname.jpg")) {
99 $name .= sprintf '<img src="/%s" alt="%s" />', $img, $imgname;
101 return sprintf '<figure%s>%s</figure>', $hidden && !exists $get{v} && ' hidden', $name;
107 my ($level, $mark, $title) = split /([a-z]*):/, $row, 2;
109 push @type, 'parent' if defined $table->{$row};
110 push @type, 'large' if $mark;
111 push @type, 'level'.($level || 0);
112 printf '<li%s>', @type ? sprintf ' class="%s"', join ' ', @type : '';
113 print showimg($title) if $level <= $limit;
114 printimgs(@{$_}) for $table->{$row} // ();
120 printimgs(@{$table->{''}});