Просмотр исходного кода

Prefix all CSS class names

To avoid conflicts with external style sheets like bootstrap
crobi 10 лет назад
Родитель
Сommit
eaa2c6edd2
3 измененных файлов: 46 добавлений и 44 удалений
  1. 22
    27
      generator/css/cards.css
  2. 7
    0
      generator/css/page.css
  3. 17
    17
      generator/js/cards.js

+ 22
- 27
generator/css/cards.css Просмотреть файл

1
-.bg-color {
2
-    background-color: #600a15;
3
-    color: white;
4
-}
5
-
6
 .card {
1
 .card {
7
     width:66mm;
2
     width:66mm;
8
     min-width:66mm;
3
     min-width:66mm;
16
     font-size: 8pt;
11
     font-size: 8pt;
17
 }
12
 }
18
 
13
 
19
-.content-container {
14
+.card-content-container {
20
     padding:2mm;
15
     padding:2mm;
21
     padding-top:1mm;
16
     padding-top:1mm;
22
     border-radius: 2mm;
17
     border-radius: 2mm;
50
     align-items: center;
45
     align-items: center;
51
 }
46
 }
52
 
47
 
53
-.back-icon {
48
+.card-back-icon {
54
     width: 30mm;
49
     width: 30mm;
55
     height: 30mm;
50
     height: 30mm;
56
     border: 4mm solid;
51
     border: 4mm solid;
60
     background-size: contain;
55
     background-size: contain;
61
 }
56
 }
62
 
57
 
63
-.title-icon {
58
+.card-title-icon {
64
     width: 12mm;
59
     width: 12mm;
65
     height: 12mm;
60
     height: 12mm;
66
     background-repeat: no-repeat;
61
     background-repeat: no-repeat;
68
     background-color: inherit;
63
     background-color: inherit;
69
     border-color: inherit;
64
     border-color: inherit;
70
 }
65
 }
71
-.title-icon-container {
66
+.card-title-icon-container {
72
     position: absolute;
67
     position: absolute;
73
     right: -1mm;
68
     right: -1mm;
74
     top: -1mm;
69
     top: -1mm;
78
     border-color: inherit;
73
     border-color: inherit;
79
 }
74
 }
80
 
75
 
81
-.title-inlineicon {
76
+.card-title-inlineicon {
82
     width: 7mm;
77
     width: 7mm;
83
     height: 7mm;
78
     height: 7mm;
84
     background-repeat: no-repeat;
79
     background-repeat: no-repeat;
86
     background-color: inherit;
81
     background-color: inherit;
87
     border-color: inherit;
82
     border-color: inherit;
88
 }
83
 }
89
-.title-inlineicon-container {
84
+.card-title-inlineicon-container {
90
     position: absolute;
85
     position: absolute;
91
     right: -1mm;
86
     right: -1mm;
92
     top: -1mm;
87
     top: -1mm;
96
     border-color: inherit;
91
     border-color: inherit;
97
 }
92
 }
98
 
93
 
99
-.title {
94
+.card-title {
100
     height: 8mm;
95
     height: 8mm;
101
     padding-left: 2mm;
96
     padding-left: 2mm;
102
     font-family: Lora, 'Calisto MT', 'Bookman Old Style', Bookman, 'Goudy Old Style', Garamond, 'Hoefler Text', 'Bitstream Charter', Georgia, serif;
97
     font-family: Lora, 'Calisto MT', 'Bookman Old Style', Bookman, 'Goudy Old Style', Garamond, 'Hoefler Text', 'Bitstream Charter', Georgia, serif;
105
     background-color: inherit;
100
     background-color: inherit;
106
     color: white;
101
     color: white;
107
 }
102
 }
108
-.title-big {
103
+.card-title-big {
109
     font-size: 6mm;
104
     font-size: 6mm;
110
     line-height: 6mm;
105
     line-height: 6mm;
111
 }
106
 }
112
-.title-normal {
107
+.card-title-normal {
113
     font-size: 5mm;
108
     font-size: 5mm;
114
     line-height: 6mm;
109
     line-height: 6mm;
115
 }
110
 }
116
-.title-small {
111
+.card-title-small {
117
     font-size: 4mm;
112
     font-size: 4mm;
118
     line-height: 6.5mm;
113
     line-height: 6.5mm;
119
 }
114
 }
120
-.title-tiny {
115
+.card-title-tiny {
121
     font-size: 3.5mm;
116
     font-size: 3.5mm;
122
     line-height: 6.75mm;
117
     line-height: 6.75mm;
123
 }
118
 }
124
 
119
 
125
-.subtitle {
120
+.card-subtitle {
126
     height: 18px;
121
     height: 18px;
127
     line-height: 18px;
122
     line-height: 18px;
128
     margin-bottom: 1mm;
123
     margin-bottom: 1mm;
131
     font-style: italic;
126
     font-style: italic;
132
 }
127
 }
133
 
128
 
134
-.property-line {
129
+.card-property-line {
135
     text-indent: -1em;
130
     text-indent: -1em;
136
     margin-left: 1em;
131
     margin-left: 1em;
137
 }
132
 }
138
 
133
 
139
-.property-name {
134
+.card-property-name {
140
     display: inline;
135
     display: inline;
141
 }
136
 }
142
-.property-text {
137
+.card-property-text {
143
     display: inline;
138
     display: inline;
144
 }
139
 }
145
 
140
 
146
-h3 {
141
+.card-section {
147
     border-bottom: 1px solid;
142
     border-bottom: 1px solid;
148
     font-size: 10pt;
143
     font-size: 10pt;
149
     font-variant: small-caps;
144
     font-variant: small-caps;
154
     border-color: inherit;
149
     border-color: inherit;
155
 }
150
 }
156
 
151
 
157
-p {
152
+.card-p {
158
     margin-top: 0.0em;
153
     margin-top: 0.0em;
159
     margin-bottom: 0.5em;
154
     margin-bottom: 0.5em;
160
 }
155
 }
161
 
156
 
162
-.fill {flex:1;}
157
+.card-fill {flex:1;}
163
 
158
 
164
-.description-line {
159
+.card-description-line {
165
     margin-bottom: 0.5em;
160
     margin-bottom: 0.5em;
166
 }
161
 }
167
-.description-name {
162
+.card-description-name {
168
     display: inline;
163
     display: inline;
169
 }
164
 }
170
-.description-text {
165
+.card-description-text {
171
     display: inline;
166
     display: inline;
172
 }
167
 }
173
 
168
 
174
-.ruler {
169
+.card-ruler {
175
     width: 100%;
170
     width: 100%;
176
     height: 1.0mm;
171
     height: 1.0mm;
177
     margin-top: 0.5em;
172
     margin-top: 0.5em;

+ 7
- 0
generator/css/page.css Просмотреть файл

24
     box-shadow: 0;
24
     box-shadow: 0;
25
     background-color: white;
25
     background-color: white;
26
   }
26
   }
27
+  #input-container {
28
+      display: none;
29
+  }
30
+  #output-container {
31
+      margin: 0;
32
+      padding: 0;
33
+  }
27
 }
34
 }
28
 
35
 
29
 .input-button {
36
 .input-button {

+ 17
- 17
generator/js/cards.js Просмотреть файл

44
 function card_element_title(card_data, options) {
44
 function card_element_title(card_data, options) {
45
     var title = card_data.title || "";
45
     var title = card_data.title || "";
46
     var title_size = card_data.title_size || options.default_title_size || 'normal';
46
     var title_size = card_data.title_size || options.default_title_size || 'normal';
47
-    return '<div class="title title-' + title_size + '">' + title + '</div>';
47
+    return '<div class="card-title card-title-' + title_size + '">' + title + '</div>';
48
 }
48
 }
49
 
49
 
50
 function card_element_icon(card_data, options) {
50
 function card_element_icon(card_data, options) {
55
     }
55
     }
56
 
56
 
57
     var result = "";
57
     var result = "";
58
-    result += '<div class="title-'+classname+'-container">';
59
-    result += '    <div class="title-' + classname + ' icon-' + icon + '">';
58
+    result += '<div class="card-title-' + classname + '-container">';
59
+    result += '    <div class="card-title-' + classname + ' icon-' + icon + '">';
60
     result += '    </div>';
60
     result += '    </div>';
61
     result += '</div>';
61
     result += '</div>';
62
     return result;
62
     return result;
64
 
64
 
65
 function card_element_subtitle(params, card_data, options) {
65
 function card_element_subtitle(params, card_data, options) {
66
     var subtitle = params[0] || "";
66
     var subtitle = params[0] || "";
67
-    return '<div class="subtitle">' + subtitle + '</div>';
67
+    return '<div class="card-subtitle">' + subtitle + '</div>';
68
 }
68
 }
69
 
69
 
70
 function card_element_ruler(params, card_data, options) {
70
 function card_element_ruler(params, card_data, options) {
73
     var stroke = 'stroke="' + color + '"';
73
     var stroke = 'stroke="' + color + '"';
74
 
74
 
75
     var result = "";
75
     var result = "";
76
-    result += '<svg class="ruler" height="1" width="100" viewbox="0 0 100 1" preserveaspectratio="none" xmlns="http://www.w3.org/2000/svg">';
76
+    result += '<svg class="card-ruler" height="1" width="100" viewbox="0 0 100 1" preserveaspectratio="none" xmlns="http://www.w3.org/2000/svg">';
77
     result += '    <polyline points="0,0 100,0.5 0,1" ' + fill + '></polyline>';
77
     result += '    <polyline points="0,0 100,0.5 0,1" ' + fill + '></polyline>';
78
     result += '</svg>';
78
     result += '</svg>';
79
     return result;
79
     return result;
81
 
81
 
82
 function card_element_property(params, card_data, options) {
82
 function card_element_property(params, card_data, options) {
83
     var result = "";
83
     var result = "";
84
-    result += '<div class="property-line">';
85
-    result += '   <h4 class="property-name">' + params[0] + '</h4>';
86
-    result += '   <p class="property-text">' + params[1] + '</p>';
84
+    result += '<div class="card-property-line">';
85
+    result += '   <h4 class="card-property-name">' + params[0] + '</h4>';
86
+    result += '   <p class="card-p card-property-text">' + params[1] + '</p>';
87
     result += '</div>';
87
     result += '</div>';
88
     return result;
88
     return result;
89
 }
89
 }
90
 
90
 
91
 function card_element_description(params, card_data, options) {
91
 function card_element_description(params, card_data, options) {
92
     var result = "";
92
     var result = "";
93
-    result += '<div class="description-line">';
94
-    result += '   <h4 class="description-name">' + params[0] + '</h4>';
95
-    result += '   <p class="description-text">' + params[1] + '</p>';
93
+    result += '<div class="card-description-line">';
94
+    result += '   <h4 class="card-description-name">' + params[0] + '</h4>';
95
+    result += '   <p class="card-p card-description-text">' + params[1] + '</p>';
96
     result += '</div>';
96
     result += '</div>';
97
     return result;
97
     return result;
98
 }
98
 }
99
 
99
 
100
 function card_element_text(params, card_data, options) {
100
 function card_element_text(params, card_data, options) {
101
     var result = "";
101
     var result = "";
102
-    result += '<div class="description-line">';
103
-    result += '   <p class="description-text">' + params[0] + '</p>';
102
+    result += '<div class="card-description-line">';
103
+    result += '   <p class="card-p card-description-text">' + params[0] + '</p>';
104
     result += '</div>';
104
     result += '</div>';
105
     return result;
105
     return result;
106
 }
106
 }
108
 function card_element_section(params, card_data, options) {
108
 function card_element_section(params, card_data, options) {
109
     var color = card_data_color_front(card_data, options);
109
     var color = card_data_color_front(card_data, options);
110
     var section = params[0] || "";
110
     var section = params[0] || "";
111
-    return '<h3 style="color:' + color + '">' + section + '</h3>';
111
+    return '<h3 class="card-section" style="color:' + color + '">' + section + '</h3>';
112
 }
112
 }
113
 
113
 
114
 function card_element_fill(params, card_data, options) {
114
 function card_element_fill(params, card_data, options) {
115
     var flex = params[0] || "1";
115
     var flex = params[0] || "1";
116
-    return '<div class="fill" style="flex:' + flex + '"></div>';
116
+    return '<div class="card-fill" style="flex:' + flex + '"></div>';
117
 }
117
 }
118
 
118
 
119
 function card_element_unknown(params, card_data, options) {
119
 function card_element_unknown(params, card_data, options) {
136
 
136
 
137
 function card_generate_contents(contents, card_data, options) {
137
 function card_generate_contents(contents, card_data, options) {
138
     var result = "";
138
     var result = "";
139
-    result += '<div class="content-container">';
139
+    result += '<div class="card-content-container">';
140
     result += contents.map(function (value) {
140
     result += contents.map(function (value) {
141
         var parts = card_data_split_params(value);
141
         var parts = card_data_split_params(value);
142
         var element_name = parts[0];
142
         var element_name = parts[0];
194
     result += '<div class="card" ' + style_color + '>';
194
     result += '<div class="card" ' + style_color + '>';
195
     result += '  <div class="card-back" ' + style_gradient + '>';
195
     result += '  <div class="card-back" ' + style_gradient + '>';
196
     result += '    <div class="card-back-inner">';
196
     result += '    <div class="card-back-inner">';
197
-    result += '      <div class="back-icon icon-' + icon + '" ' + style_color + '></div>';
197
+    result += '      <div class="card-back-icon icon-' + icon + '" ' + style_color + '></div>';
198
     result += '    </div>';
198
     result += '    </div>';
199
     result += '  </div>';
199
     result += '  </div>';
200
     result += '</div>';
200
     result += '</div>';

Загрузка…
Отмена
Сохранить