Browse Source

Update illustrations and enhance SVG handling in HTML (#2051)

Paweł Kuna 2 months ago
parent
commit
5cca710ac6

+ 0 - 1
.build/import-illustrations.js

@@ -12,7 +12,6 @@ const illustrations = glob
 		return path.basename(file, '.png')
 	})
 
-
 fs.writeFileSync(
 	path.join(__dirname, `../src/pages/_data/illustrations.json`),
 	JSON.stringify(illustrations)

+ 5 - 0
.changeset/hot-vans-peel.md

@@ -0,0 +1,5 @@
+---
+"@tabler/core": patch
+---
+
+Update illustrations and enhance SVG handling in HTML

+ 1 - 1
src/pages/_data/illustrations.json

@@ -1 +1 @@
-["weightlifting","wait","video","to-do","telescope","snowman","shield","search","project","not-found","neutral-info","music","mobile-computer","message","map-destination","loading","kite","icons","icons-workshop","icons-production","icons-ladder","icons-drawing","icons-drawing-run","ice-skates","guitar","good-news","girl-refresh","girl-phone","gift","folders","flowers","fingerprint","exit","error","email","electric-scooter","dart","dance","conversation","computer-fix","clock-and-cat","chart","chart-circle","calendar","building","boy","boy-with-key","boy-gives-flowers","boy-girl","boy-and-laptop","boy-and-cat","bicycle","bad-news","archive","ai"]
+["weightlifting","wait","video","to-do","tiredness","telescope","snowman","shield","search","project","printer","not-found","new-year","new-year-2","neutral-info","music","mobile-computer","message","map-destination","loading","kite","icons","icons-workshop","icons-production","icons-ladder","icons-drawing","icons-drawing-run","ice-skates","halloween-pumpkin","guitar","good-news","girl-refresh","girl-phone","gift","ghost","folders","flowers","fingerprint","exit","error","email","electric-scooter","dart","dance","conversation","computer-fix","clock-and-cat","christmas-tree","christmas-gifts","christmas-fireplace","chart","chart-circle","calendar","building","boy","boy-with-key","boy-refresh","boy-gives-flowers","boy-girl","boy-and-laptop","boy-and-cat","bicycle","bad-news","archive","ai"]

+ 4 - 4
src/pages/illustrations.html

@@ -14,7 +14,7 @@ illustrations = illustrations | push: illustration %} {% endif %} {% endfor %} {
 				<div class="col-md-7">
 					<div class="card">
 						<div class="card-body d-flex align-items-center">
-							<div id="current-illustration">{{ first_illustration }}</div>
+							<div id="current-illustration">{{ first_illustration | replace: '<svg ', '<svg class="w-100 h-auto" ' }}</div>
 						</div>
 					</div>
 				</div>
@@ -55,7 +55,7 @@ illustrations = illustrations | push: illustration %} {% endif %} {% endfor %} {
 												<label class="form-imagecheck mb-2">
 													<input name="form-imagecheck" type="radio" value="{{ illustration.slug }}" class="form-imagecheck-input js-select-illustration" {% if forloop.first %} checked{% endif %}>
 													<span class="form-imagecheck-figure">
-														{{ illustration }}
+														{{ illustration | replace: '<svg ', '<svg class="w-100 h-auto" ' }}
 													</span>
 												</label>
 											</div>
@@ -73,7 +73,7 @@ illustrations = illustrations | push: illustration %} {% endif %} {% endfor %} {
 </div>
 
 <h2 class="page-title my-5">
-	{{ site.illustrations.count | minus: 4 }} more SVG Illustrations
+	{{ site.data.illustrations | size | minus: 4 }} more SVG Illustrations
 </h2>
 
 <div class="row row-cards">
@@ -129,7 +129,7 @@ illustrations = illustrations | push: illustration %} {% endif %} {% endfor %} {
 	const illustrations = {
 	{% for illustration in illustrations %}
 		"{{ illustration.slug }}": {
-	      svg: '{{ illustration.content | quote | replace_regex: "\n", "\n" }}',
+	      svg: '{{ illustration.content | replace: '<svg ', '<svg class="w-100 h-auto" ' | quote | replace_regex: "\n", "\n" }}',
 		},
 	{% endfor %}
 	}

BIN
src/static/illustrations/dark/boy-refresh.png


BIN
src/static/illustrations/dark/christmas-fireplace.png


BIN
src/static/illustrations/dark/christmas-gifts.png


BIN
src/static/illustrations/dark/christmas-tree.png


BIN
src/static/illustrations/dark/ghost.png


BIN
src/static/illustrations/dark/halloween-pumpkin.png


Some files were not shown because too many files changed in this diff