changeset 1363:a05ea7fa43ec

Generate CSS rule for key frames
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 18 Feb 2011 10:37:44 +0800
parents bb76f9d57363
children aa7cbf2cbf34
files pyink/html5css3.py
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pyink/html5css3.py	Fri Feb 18 09:00:02 2011 +0800
+++ b/pyink/html5css3.py	Fri Feb 18 10:37:44 2011 +0800
@@ -234,7 +234,7 @@
     def _write_css(self, selector, css_props, out):
         print >> out, '%s {' % (selector)
         for prop_name, prop_value in css_props.items():
-            print >> out, '    %s: %s' % (prop_name, prop_value)
+            print >> out, '    %s: %s;' % (prop_name, prop_value)
             pass
         print >> out, '}'
         pass
@@ -324,6 +324,14 @@
         
         return pairs
 
+    def _make_scene_group_style(self, frame_idx, layer_idx):
+        scene_group = self._parser.get_scene_group(frame_idx, layer_idx)
+        gid = scene_group.getAttribute('id')
+        selector = '.frame%04d #%s' % (frame_idx, gid)
+        style = {'display': 'inline'}
+        self._stylesheet[selector] = style
+        pass
+
     def _handle_transition_layer(self, layer_idx):
         parser = self._parser
         maxframe = parser.get_maxframe()
@@ -336,6 +344,8 @@
                 frame_idx = frame_idx + 1
                 continue
             
+            self._make_scene_group_style(frame_idx, layer_idx)
+            
             start, end, tween_type = scene
             if start == end:
                 frame_idx = frame_idx + 1
@@ -362,7 +372,7 @@
                                                        stop_node,
                                                        duration)
                 node_id = start_node.getAttribute('id')
-                selector = '.transition%d #%s' % (start, node_id)
+                selector = '.frame%04d #%s' % (start, node_id)
                 stylesheet[selector] = css_props
                 pass