crobi před 10 roky
rodič
revize
0db22d85e7

+ 7
- 10
generator/components-test.html Zobrazit soubor

@@ -2,18 +2,11 @@
2 2
 <html lang="en">
3 3
 <head>
4 4
     <title>RPG cards</title>
5
-    <!-- Library: jQuery -->
6
-    <script type="text/javascript" src="lib/svg-injector/svg-injector.js" charset="utf-8"></script>
7 5
     <!-- CSS -->
8 6
     <link rel=" stylesheet" type="text/css" href="css/output.css">
9 7
     <link rel="stylesheet" type="text/css" href="css/card-size.css">
10 8
     <!-- Components -->
11
-    <link rel="import" href="components/card-front.html">
12
-    <link rel="import" href="components/card-title.html">
13
-    <link rel="import" href="components/card-icon.html">
14
-    <link rel="import" href="components/card-contents.html">
15
-    <link rel="import" href="components/card-rule.html">
16
-    <link rel="import" href="components/card-subtitle.html">
9
+    <link rel="import" href="components/card.html">
17 10
 </head>
18 11
 <body class="page-background">
19 12
     <card-front class="card-size-25x35" color="maroon">
@@ -25,7 +18,11 @@
25 18
         <card-contents>
26 19
             <card-subtitle>Mage spell</card-subtitle>
27 20
             <card-rule></card-rule>
28
-            <card-description>Test</card-description>
21
+            <card-property><h4>Casting time</h4><p>1 action</p></card-property>
22
+            <card-property><h4>Range</h4><p>Self (15ft cone)</p></card-property>
23
+            <card-property><h4>Components</h4><p>V,S,Some obscure long named material</p></card-property>
24
+            <card-rule></card-rule>
25
+            <card-description><h4>Mechanics</h4><p>Each creature in a 15-foot cone must make a Dexterity saving throw. A creature takes 3d6 fire damage on a failed save, or half as much damage on a successful one.</p></card-description>
29 26
         </card-contents>
30 27
     </card-front>
31 28
     &nbsp;
@@ -38,7 +35,7 @@
38 35
         <card-contents>
39 36
             <card-subtitle>Medium beast</card-subtitle>
40 37
             <card-rule></card-rule>
41
-            <card-description>Test</card-description>
38
+            <card-property>Test</card-property>
42 39
         </card-contents>
43 40
     </card-front>
44 41
 </body>

+ 55
- 0
generator/components/card-description.html Zobrazit soubor

@@ -0,0 +1,55 @@
1
+
2
+<template id="card-description">
3
+    <style>
4
+        div {
5
+            margin-top: 0.5em;
6
+            margin-bottom: 0.0em;
7
+            font-size: inherit;
8
+        }
9
+
10
+        ::content > * {
11
+            display: inline;
12
+            font-size: inherit;
13
+            color: black;
14
+        }
15
+
16
+        ::content > h4 {
17
+            font-weight: bold;
18
+            font-size: inherit;
19
+            font-style: italic;
20
+        }
21
+
22
+        ::content > h4:after {
23
+            content: ".";
24
+        }
25
+
26
+        ::content > h4 + p {
27
+            margin-left: 0.4em;
28
+        }
29
+    </style>
30
+
31
+    <div>
32
+        <content></content>
33
+    </div>
34
+</template>
35
+
36
+<script>
37
+    (function (window, document) {
38
+        var elemName = 'card-description';
39
+        var mainDoc = document;
40
+        var importDoc = document.currentScript.ownerDocument;
41
+
42
+        var proto = Object.create(HTMLElement.prototype);
43
+        proto.createdCallback = function () {
44
+            var template = importDoc.getElementById(elemName);
45
+            var clone = mainDoc.importNode(template.content, true);
46
+            var root = this.createShadowRoot();
47
+            root.appendChild(clone);
48
+        }
49
+
50
+        mainDoc.registerElement(elemName, { prototype: proto });
51
+
52
+    })(window, document);
53
+</script>
54
+
55
+

+ 1
- 3
generator/components/card-front.html Zobrazit soubor

@@ -1,6 +1,4 @@
1
-<!--
2
-    <link href='http://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
3
--->
1
+<link href='http://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
4 2
 
5 3
 <template id="card-front">
6 4
     <style type='text/css'>

+ 50
- 0
generator/components/card-property.html Zobrazit soubor

@@ -0,0 +1,50 @@
1
+
2
+<template id="card-property">
3
+    <style>
4
+        div {
5
+            /* Indenting everything EXCEPT the first line. */
6
+            text-indent: -1em;
7
+            margin-left: 1em;
8
+            font-size: inherit;
9
+        }
10
+
11
+        ::content > * {
12
+            display: inline;
13
+            font-size: inherit;
14
+            color: black;
15
+        }
16
+
17
+        ::content > h4 {
18
+            font-weight: bold;
19
+        }
20
+
21
+        ::content > h4 + p {
22
+            margin-left: 0.4em;
23
+        }
24
+    </style>
25
+
26
+    <div>
27
+        <content></content>
28
+    </div>
29
+</template>
30
+
31
+<script>
32
+    (function (window, document) {
33
+        var elemName = 'card-property';
34
+        var mainDoc = document;
35
+        var importDoc = document.currentScript.ownerDocument;
36
+
37
+        var proto = Object.create(HTMLElement.prototype);
38
+        proto.createdCallback = function () {
39
+            var template = importDoc.getElementById(elemName);
40
+            var clone = mainDoc.importNode(template.content, true);
41
+            var root = this.createShadowRoot();
42
+            root.appendChild(clone);
43
+        }
44
+
45
+        mainDoc.registerElement(elemName, { prototype: proto });
46
+
47
+    })(window, document);
48
+</script>
49
+
50
+

+ 1
- 3
generator/components/card-title.html Zobrazit soubor

@@ -1,6 +1,4 @@
1
-<!--
2
-    <link href='http://fonts.googleapis.com/css?family=Lora:700' rel='stylesheet' type='text/css'>
3
--->
1
+<link href='http://fonts.googleapis.com/css?family=Lora:700' rel='stylesheet' type='text/css'>
4 2
 
5 3
 <template id="card-title">
6 4
     <style>

+ 17
- 0
generator/components/card.html Zobrazit soubor

@@ -0,0 +1,17 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+    <title>Component import file</title>
5
+    <link rel="import" href="./card-front.html">
6
+    <link rel="import" href="./card-title.html">
7
+    <link rel="import" href="./card-icon.html">
8
+    <link rel="import" href="./card-contents.html">
9
+    <link rel="import" href="./card-rule.html">
10
+    <link rel="import" href="./card-subtitle.html">
11
+    <link rel="import" href="./card-property.html">
12
+    <link rel="import" href="./card-description.html">
13
+</head>
14
+<body>
15
+
16
+</body>
17
+</html>

Loading…
Zrušit
Uložit