… | |
… | |
9 | |
9 | |
10 | my $arch; |
10 | my $arch; |
11 | |
11 | |
12 | umask 022; |
12 | umask 022; |
13 | |
13 | |
14 | our $VERSION = '1.0'; |
14 | our $VERSION = '1.01'; |
15 | |
15 | |
16 | sub escape_html($) { |
16 | sub escape_html($) { |
17 | local $_ = shift; |
17 | local $_ = shift; |
18 | s/([<>&])/sprintf "&#%d;", ord $1/ge; |
18 | s/([<>&])/sprintf "&#%d;", ord $1/ge; |
19 | $_ |
19 | $_ |
… | |
… | |
49 | "<head>", |
49 | "<head>", |
50 | "<title>Crossfire Map \"$path\"</title>", |
50 | "<title>Crossfire Map \"$path\"</title>", |
51 | "<style type='text/css'><!--\n", |
51 | "<style type='text/css'><!--\n", |
52 | "body { background: white; text-color: black; }\n", |
52 | "body { background: white; text-color: black; }\n", |
53 | "a { text-color: blue; }\n", |
53 | "a { text-color: blue; }\n", |
54 | "a:hover { text-color: red; }\n", |
|
|
55 | "a:visited { text-color: #008; }\n", |
54 | "a:visited { text-color: #008; }\n", |
|
|
55 | "img { display: block; }\n", |
56 | |
56 | |
57 | "#nav { border-spacing: 0px; margin: 10px; padding: 0px; }\n", |
57 | "#nav { border-spacing: 0px; margin: 10px; padding: 0px; }\n", |
58 | "#nav td { margin: 0px; padding: 0px; border: 0px; }\n", |
58 | "#nav td { margin: 0px; padding: 0px; border: 0px; }\n", |
59 | "#thumb { border: 2px solid yellow; width: $meta->{width}px; height: $meta->{height}px; padding: 0px; }\n", |
59 | "#thumb { border: 3px solid yellow; width: $meta->{width}px; height: $meta->{height}px; padding: 0px; }\n", |
|
|
60 | ".tile { border: 3px solid blue; }\n", |
|
|
61 | ".tile:hover { border: 3px solid yellow; }\n", |
60 | |
62 | |
61 | "#map { table-layout: fixed; width: ${W}px; height: ${H}px; border: 2px solid #777; border-spacing: 0px; ", |
63 | "#map { table-layout: fixed; width: ${W}px; height: ${H}px; border: 2px solid #777; border-spacing: 0px; ", |
62 | "background-image: url($path[-1].png); background-position: 0px 0px; background-repeat: no-repeat; background-attachment: relative; }\n", |
64 | "background-image: url($path[-1].png); background-position: 0px 0px; background-repeat: no-repeat; background-attachment: relative; }\n", |
63 | "#map tr { width: ${W}px; height: ${T}px; border-style: none; margin: 0px; padding: 0px; }\n", |
65 | "#map tr { width: ${W}px; height: ${T}px; border-style: none; margin: 0px; padding: 0px; }\n", |
64 | |
66 | |
… | |
… | |
85 | print "<a href='/", (join "/", @path[0..$_]), "/'>$path[$_]</a> / "; |
87 | print "<a href='/", (join "/", @path[0..$_]), "/'>$path[$_]</a> / "; |
86 | } |
88 | } |
87 | |
89 | |
88 | my @tile = map { |
90 | my @tile = map { |
89 | $meta->{info}{"tile_path_$_"} |
91 | $meta->{info}{"tile_path_$_"} |
90 | ? "<a href='$meta->{info}{\"tile_path_$_\"}.html'><img style='border: 2px solid blue;' src='$meta->{info}{\"tile_path_$_\"}.jpg'/></a>" |
92 | ? "<a href='$meta->{info}{\"tile_path_$_\"}.html'><img class='tile' src='$meta->{info}{\"tile_path_$_\"}.jpg'/></a>" |
91 | : "" |
93 | : "" |
92 | } 1..4; |
94 | } 1..4; |
93 | #"}"# vim misparses without this comment |
95 | #"}"# vim misparses without this comment |
94 | |
96 | |
95 | print "$path[-1]", |
97 | print "$path[-1]", |
… | |
… | |
157 | print "</td>"; |
159 | print "</td>"; |
158 | } |
160 | } |
159 | print "</tr>"; |
161 | print "</tr>"; |
160 | } |
162 | } |
161 | |
163 | |
162 | print "</table></p><hr/><p style='font-size: 6pt'>created by <b>cfmap2html</b> version $VERSION</p>", |
164 | print "</table></p><hr/><p style='font-size: 8pt'>created by <b>cfmap2html</b> version $VERSION</p>", |
163 | "<p style='height: 600px;'/></body></html>"; |
165 | "<p style='height: 600px;'/></body></html>"; |
164 | |
166 | |
165 | close $fh; |
167 | close $fh; |
166 | |
168 | |
167 | system "gzip", "-7f", "$path.html"; |
169 | system "gzip", "-7f", "$path.html"; |