Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bugfix + allow little galleries

  • Loading branch information...
commit 62d675e8de6bfe4e1bf441bd13aa3405c695b6d8 1 parent 86ec6b4
@padenot padenot authored
Showing with 24 additions and 17 deletions.
  1. +11 −9 css/style.css
  2. +1 −0  html/yadfig.html
  3. +4 −1 js/script.js
  4. +8 −7 py/yadfig.py
View
20 css/style.css
@@ -202,6 +202,7 @@ table { border-collapse: collapse; border-spacing: 0; }
========================================================================== */
body {
+ margin: auto;
font-family: "Palatino", Serif;
background-image: -webkit-gradient(
linear,
@@ -210,12 +211,17 @@ body {
color-stop(0, rgb(179,179,179)),
color-stop(0.59, rgb(255,255,255))
);
- background-image: -moz-linear-gradient(
+ background: -moz-linear-gradient(
center bottom,
rgb(179,179,179) 0%,
rgb(255,255,255) 100%
);
+ background-color: rgb(179, 179, 179);
background-repeat: no-repeat;
+ -webkit-background-size: cover;
+ -moz-background-size: cover;
+ -o-background-size: cover;
+ background-size: cover;
}
a {
@@ -261,16 +267,13 @@ hgroup > p {
-webkit-transform-origin: left top;
-o-transform: rotate(90deg);
-o-transform-origin: left top;
- font-size: 15em;
font-variant: small-caps;
font-weight: 700;
- left: 100%;
- margin-top: -0.5em;
+ left: 99%;
+ top: 10%;
opacity: 0.3;
- padding-left: 0;
position: absolute;
- right: -1em;
- width: 100%;
+ font-size: 13em;
}
.wrapper > .row {
@@ -419,9 +422,8 @@ hgroup > p {
}
footer {
- text-align: right;
margin-bottom: 1em;
- margin-right: 2em;
+ margin-left : 2em;
font-size: 1em;
}
View
1  html/yadfig.html
@@ -22,6 +22,7 @@
<a name="top" id="top"></a>
+
<header>
<hgroup>
<h1>__TITLE__</h1>
View
5 js/script.js
@@ -61,7 +61,10 @@ function onClickImage(e) {
function init() {
var title = $("hgroup h1").innerHTML;
- $(".rotated").innerHTML = title;
+ var rotated = $(".rotated")
+ var body = $("html")
+ rotated.innerHTML = title;
+
images = $$('.thumb');
for (var i = 0; i < images.length; i++) {
images[i].addEventListener("click", onClickImage, false);
View
15 py/yadfig.py
@@ -55,9 +55,10 @@ def list_files():
filenames = os.listdir(DIR)
for name in filenames:
- name = os.path.join(DIR, name)
- if is_image(str(mimetypes.guess_type(name)[0])):
- metadata = pyexiv2.ImageMetadata(name)
+ full_name = os.path.join(DIR, name)
+ print name
+ if is_image(str(mimetypes.guess_type(full_name)[0])):
+ metadata = pyexiv2.ImageMetadata(full_name)
metadata.read()
images.append([name, metadata])
if len(images) == 0:
@@ -76,7 +77,7 @@ def get_pictures():
out+='<div class="cell"><img class="thumb" src=".c/'
out+=image[0]
out+='"><p>'
- out+=image[0]
+ out+=os.path.basename(image[0])
out+='</p></div>'
i=i+1
out+="</div>"
@@ -114,15 +115,15 @@ def output_html():
template = template.replace('__DATE__', get_date_interval()+',')
pics = get_pictures()
template = template.replace('__GALLERY__', pics);
- f = open("index.html", "w")
+ f = open(os.path.join(DIR, "index.html"), "w")
f.write(template)
f.close()
def create_thumbs():
for i in images:
- im = Image.open(i[0])
+ im = Image.open(os.path.join(DIR, i[0]))
im.thumbnail([im.size[0]/4, im.size[0]/4], Image.ANTIALIAS)
- thumb = os.path.join(os.path.dirname(i[0]), THUMB_DIR, os.path.basename(i[0]))
+ thumb = os.path.join(DIR, THUMB_DIR, os.path.basename(i[0]))
im.save(thumb)
Please sign in to comment.
Something went wrong with that request. Please try again.