Skip to content

Commit 88f1043

Browse files
committed
Merge pull request #40 from shgysk8zer0/feature/37
Create and use SVG icons. Fixes #37
2 parents 97f816a + ca562fe commit 88f1043

5 files changed

Lines changed: 73 additions & 129 deletions

File tree

components/contact-dialog.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,31 @@
88
$dialog->append('a', null, [
99
'href' => 'mailto:editor@kvsun.com',
1010
'title' => 'Email'
11-
])->append('img', null, [
12-
'src' => 'images/octicons/svg/mail-read.svg',
13-
'alt' => 'Email',
11+
])->append('svg', null, [
1412
'width' => 60,
1513
'height' => 60
16-
]);
14+
])->append('use', null, ['xlink:href' => 'images/icons.svg#mail-read']);
1715
$dialog->append('a', null, [
1816
'href' => 'https://gitter.im/KVSun/ad-insertion',
1917
'target' => '_blank',
2018
'title' => 'Chat on Gitter'
21-
])->append('img', null, [
22-
'src' => 'images/octicons/svg/comment.svg',
23-
'alt' => 'Gitter',
19+
])->append('svg', null, [
2420
'width' => 60,
2521
'height' => 60
26-
]);
22+
])->append('use', null, ['xlink:href' => 'images/icons.svg#comment']);
2723
$dialog->append('a', null, [
2824
'href' => 'https://github.com/KVSun/ad-insertion/',
2925
'target' => '_blank',
3026
'title' => 'GitHub'
31-
])->append('img', null, [
32-
'src' => 'images/octicons/svg/mark-github.svg',
33-
'alt' => 'GitHub',
27+
])->append('svg', null, [
3428
'width' => 60,
3529
'height' => 60
36-
]);
30+
])->append('use', null, ['xlink:href' => 'images/icons.svg#mark-github']);
3731
$dialog->append('a', null, [
3832
'href' => 'https://github.com/KVSun/ad-insertion/issues/new/',
3933
'target' => '_blank',
4034
'title' => 'Open Issue'
41-
])->append('img', null, [
42-
'src' => 'images/octicons/svg/issue-opened.svg',
43-
'alt' => 'Open Issue',
35+
])->append('svg', null, [
4436
'width' => 60,
4537
'height' => 60
46-
]);
38+
])->append('use', null, ['xlink:href' => 'images/icons.svg#issue-opened']);

components/footer.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@
1111
$footer->append('button', null, [
1212
'title' => 'Contact info',
1313
'data-show-modal' => '#contact-dialog'
14-
])->append('img', null, [
15-
'src' => 'images/octicons/svg/person.svg',
16-
'alt' => 'View contact info',
17-
'height' => 50
18-
]);;
14+
])->append('svg', null, [
15+
'height' => 50,
16+
'width' => 50
17+
])->append('use', null, [
18+
'xlink:href' => 'images/icons.svg#person'
19+
]);
1920
$footer->append('button', null, [
2021
'title' => 'View README/documentation',
2122
'data-show-modal' => "#{$readme->id}"
22-
])->append('img', null, [
23-
'src' => 'images/octicons/svg/book.svg',
24-
'alt' => 'View README',
25-
'height' => 50
23+
])->append('svg', null, [
24+
'height' => 50,
25+
'width' => 50
26+
])->append('use', null, [
27+
'xlink:href' => 'images/icons.svg#book'
2628
]);
2729
unset($parsedown, $readme);
2830
require_once './components/contact-dialog.php';

components/head.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88
]);
99
$dom->head->append('link', null, [
1010
'rel' => 'stylesheet',
11-
'href' => 'stylesheets/styles/import.css',
11+
'href' => 'stylesheets/styles/styles.css',
1212
'media' => 'all'
1313
]);
14+
$dom->head->append('link', null, [
15+
'rel' => 'prefetch',
16+
'href' => 'images/icons.svg',
17+
'type' => 'image/svg+xml'
18+
]);
1419
$dom->head->append('script', null, [
1520
'type' => 'application/javascript',
1621
'src' => 'scripts/std-js/prototypes.es6',

images/icons.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)