mirror of
https://github.com/samsonjs/mit-license.git
synced 2026-04-27 15:07:42 +00:00
created new theme option, adding the default and adding the one @flesch contributed, which closes #49
This commit is contained in:
parent
490f7ed74f
commit
a7bfe5ff89
5 changed files with 34 additions and 13 deletions
16
LICENSE.html
16
LICENSE.html
|
|
@ -30,19 +30,9 @@
|
||||||
- @rem
|
- @rem
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<style>
|
<!-- for HTML5 el styling -->
|
||||||
html { background: #eee; }
|
<script>document.createElement('article');document.createElement('footer');</script>
|
||||||
body { margin: 0; font-family: monospace; font-size: 1.4em; }
|
<link rel="stylesheet" href="/themes/{{theme}}.css">
|
||||||
article, footer {
|
|
||||||
display: block; margin: 1em auto; min-width: 320px; width: 90%;
|
|
||||||
}
|
|
||||||
<!-- article { display: block; margin: 1em auto; min-width: 320px; width: 90%; border: 1px solid #ccc; padding: 1em; background: #fff; border-radius: 5px; box-shadow: 0 5px 20px rgba(0,0,0,0.25);}-->
|
|
||||||
article { display: block; margin: 2em auto; min-width: 360px; max-width: 900px; width: 80%; border: 1px solid #ccc; padding: 2em; background: #fff; border-radius: 5px; box-shadow: 0 5px 10px rgba(0,0,0,0.25);}
|
|
||||||
h1 { margin-top: 0; }
|
|
||||||
p:last-child { margin-bottom: 0; }
|
|
||||||
footer a { display: block; text-align: center; color: #999; font-weight: bold; text-shadow: 0 1px 1px #fff; }
|
|
||||||
footer a:hover, footer a:focus { color: #333; }
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<article>
|
<article>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
date_default_timezone_set('Europe/London'); // stop php from whining
|
date_default_timezone_set('Europe/London'); // stop php from whining
|
||||||
|
|
||||||
$format = 'html';
|
$format = 'html';
|
||||||
|
$theme = 'default';
|
||||||
$user_file = preg_replace('/\.mit-license\..*$/', '', $_SERVER["HTTP_HOST"]);
|
$user_file = preg_replace('/\.mit-license\..*$/', '', $_SERVER["HTTP_HOST"]);
|
||||||
|
|
||||||
// sanitise user (not for DNS, but for file reading, I don't know
|
// sanitise user (not for DNS, but for file reading, I don't know
|
||||||
|
|
@ -22,6 +23,12 @@
|
||||||
$format = 'txt';
|
$format = 'txt';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (property_exists($user, 'theme')) {
|
||||||
|
if (file_exists('themes/' . $user->theme . '.css')) {
|
||||||
|
$theme = $user->theme;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$holder = "<copyright holders>";
|
$holder = "<copyright holders>";
|
||||||
}
|
}
|
||||||
|
|
@ -68,6 +75,7 @@
|
||||||
// replace info tag and display
|
// replace info tag and display
|
||||||
$info = date('Y') . ' ' . $holder;
|
$info = date('Y') . ' ' . $holder;
|
||||||
$license = str_replace('{{info}}', $info, $license);
|
$license = str_replace('{{info}}', $info, $license);
|
||||||
|
$license = str_replace('{{theme}}', $theme, $license);
|
||||||
|
|
||||||
// if we want text format, strip out the license from the article tag
|
// if we want text format, strip out the license from the article tag
|
||||||
// and then strip any other tags in the license.
|
// and then strip any other tags in the license.
|
||||||
|
|
|
||||||
11
themes/default.css
Normal file
11
themes/default.css
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
html { background: #eee; }
|
||||||
|
body { margin: 0; font-family: monospace; font-size: 1.4em; }
|
||||||
|
article, footer {
|
||||||
|
display: block; margin: 1em auto; min-width: 320px; width: 90%;
|
||||||
|
}
|
||||||
|
article { display: block; margin: 2em auto; min-width: 360px; max-width: 900px; width: 80%; border: 1px solid #ccc; padding: 2em; background: #fff; border-radius: 5px; box-shadow: 0 5px 10px rgba(0,0,0,0.25);}
|
||||||
|
h1 { margin-top: 0; }
|
||||||
|
p:last-child { margin-bottom: 0; }
|
||||||
|
footer a { display: block; text-align: center; color: #999; font-weight: bold; text-shadow: 0 1px 1px #fff; }
|
||||||
|
footer a:hover, footer a:focus { color: #333; }
|
||||||
|
|
||||||
12
themes/flesch.css
Normal file
12
themes/flesch.css
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
body {
|
||||||
|
margin:0; padding: 50px;
|
||||||
|
background: #fff url(/themes/flesch.png);
|
||||||
|
font: 16px/28px "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; color: #252519;
|
||||||
|
}
|
||||||
|
article, footer { display:block; max-width:720px; margin:0; }
|
||||||
|
article { padding:28px; background:#fff; border:1px solid #ccc; }
|
||||||
|
footer { padding:0 28px; text-align:center; }
|
||||||
|
h1 { margin:0; font-size: 24px; line-height: 32px;}
|
||||||
|
a, a:visited { color:#105cb6; padding:4px; text-decoration:none; }
|
||||||
|
a:active, a:hover { color:#003; }
|
||||||
|
a img { position: absolute; top: 0; right: 0; border: 0; }
|
||||||
BIN
themes/flesch.png
Normal file
BIN
themes/flesch.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Loading…
Reference in a new issue