Skip to content

Commit a38eee5

Browse files
committed
Css is good
1 parent 837f302 commit a38eee5

File tree

2 files changed

+41
-26
lines changed

2 files changed

+41
-26
lines changed

docs/css/main.css

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,37 @@ hr {
120120
gap: 20px;
121121
padding: 20px 0 20px 8px;
122122
}
123-
.res-preview {
124-
display:flex;
125-
flex-direction:column;
126-
justify-content:center;
127-
gap:15px;
123+
.map-preview {
124+
width: 105px;
125+
height: 105px;
126+
flex: 0 0 auto;
127+
position: relative;
128+
}
129+
.map-preview-background {
130+
width:105px;
128131
height:105px;
132+
background:url(/demo_map.svg);
133+
background-size:contain;
134+
}
135+
.res-previews {
136+
display: flex;
137+
flex-direction: column;
138+
justify-content: center;
139+
gap: 15px;
140+
height: 105px;
129141
}
130-
.res-preview-group {
142+
.res-preview-wrap {
131143
display: flex;
132144
align-items: center;
133145
gap: 4px;
134146
}
135-
textarea {
147+
canvas.res-preview {
148+
width:15px;
149+
height:15px;
150+
image-rendering:crisp-edges;
151+
image-rendering:pixelated;
152+
}
153+
textarea.svg-code {
136154
width: 100%;
137155
border: 0;
138156
overflow: scroll;
@@ -143,6 +161,8 @@ textarea {
143161
font-family: inherit;
144162
font-size: inherit;
145163
resize: none;
164+
height:105px;
165+
width: 100%;
146166
}
147167

148168
@media only screen and (max-width: 800px) {

docs/index.js

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function setupPage(pageData) {
6868
.append(iconId)
6969
),
7070
new Chainable('div')
71-
.setAttribute('style', 'display:flex;gap: 10px;')
71+
.setAttribute('class', 'links')
7272
.append(
7373
new Chainable('a')
7474
.setAttribute('href', `i/${iconId}.svg`)
@@ -92,65 +92,60 @@ function setupPage(pageData) {
9292
.setAttribute('class', 'icon-variants')
9393
.append(
9494
new Chainable('div')
95-
.setAttribute('class', 'res-preview')
95+
.setAttribute('class', 'res-previews')
9696
.append(
9797
new Chainable('div')
98-
.setAttribute('class', 'res-preview-group')
98+
.setAttribute('class', 'res-preview-wrap')
9999
.append(
100100
new Chainable('canvas')
101-
.setAttribute('class', 'icon')
101+
.setAttribute('class', 'res-preview icon')
102102
.setAttribute('icon', iconId)
103103
.setAttribute('scale', 1)
104104
.setAttribute('width', 15)
105-
.setAttribute('height', 15)
106-
.setAttribute('style', 'width:15px;height:15px;image-rendering:crisp-edges;image-rendering:pixelated;'),
105+
.setAttribute('height', 15),
107106
new Chainable('p')
108107
.append('1x')
109108
),
110109
new Chainable('div')
111-
.setAttribute('class', 'res-preview-group')
110+
.setAttribute('class', 'res-preview-wrap')
112111
.append(
113112
new Chainable('canvas')
114-
.setAttribute('class', 'icon')
113+
.setAttribute('class', 'res-preview icon')
115114
.setAttribute('icon', iconId)
116115
.setAttribute('scale', 2)
117116
.setAttribute('width', 30)
118-
.setAttribute('height', 30)
119-
.setAttribute('style', 'width:15px;height:15px;image-rendering:crisp-edges;image-rendering:pixelated;'),
117+
.setAttribute('height', 30),
120118
new Chainable('p')
121119
.append('2x')
122120
),
123121
new Chainable('div')
124-
.setAttribute('class', 'res-preview-group')
122+
.setAttribute('class', 'res-preview-wrap')
125123
.append(
126124
new Chainable('canvas')
127-
.setAttribute('class', 'icon')
125+
.setAttribute('class', 'res-preview icon')
128126
.setAttribute('icon', iconId)
129127
.setAttribute('scale', 3)
130128
.setAttribute('width', 45)
131-
.setAttribute('height', 45)
132-
.setAttribute('style', 'width:15px;height:15px;image-rendering:crisp-edges;image-rendering:pixelated;'),
129+
.setAttribute('height', 45),
133130
new Chainable('p')
134131
.append('3x')
135132
)
136133
),
137134
new Chainable('div')
138-
.setAttribute('style', `width:105px;height:105px;flex:0 0 auto;position:relative;`)
135+
.setAttribute("class", "map-preview")
139136
.append(
140137
new Chainable('div')
141-
.setAttribute('style', 'width:105px;height:105px;background:url(demo_map.svg);background-size:contain;')
142-
,
138+
.setAttribute("class", "map-preview-background"),
143139
new Chainable('div')
144140
.setAttribute('style', `width:15px;height:15px;position:absolute;top:45px;left:45px;filter:invert(1);`)
145-
.insertAdjacentHTML("afterbegin", icon.svg)
141+
.insertAdjacentHTML("afterbegin", icon.svg)
146142
),
147143
new Chainable('div')
148144
.setAttribute("class", "pixel-grid")
149145
.insertAdjacentHTML("afterbegin", icon.svg),
150146
new Chainable('textarea')
151147
.setAttribute('readonly', true)
152148
.setAttribute('class', 'svg-code')
153-
.setAttribute('style', 'height:105px;width: 100%;')
154149
.append(icon.svg)
155150
)
156151
].join(''));

0 commit comments

Comments
 (0)