Skip to content

Commit b16945c

Browse files
committed
Update BrowserIcons and @cssnr/vitepress-swiper
1 parent d39403c commit b16945c

File tree

4 files changed

+36
-28
lines changed

4 files changed

+36
-28
lines changed

.vitepress/theme/components/BrowserIcons.vue

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,30 @@ import 'animate.css'
55
const chrome_url = 'https://chromewebstore.google.com/detail/django-files/abpbiefojfkekhkjnpakpekkpeibnjej'
66
const firefox_url = 'https://addons.mozilla.org/addon/django-files'
77
8-
// Browsers
9-
const baseUrl = 'https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1'
10-
const browsers = [
11-
{ name: 'Chrome', url: chrome_url, img: 'chrome/chrome_48x48.png' },
12-
{ name: 'Firefox', url: firefox_url, img: 'firefox/firefox_48x48.png' },
13-
{ name: 'Edge', url: chrome_url, img: 'edge/edge_48x48.png' },
14-
{ name: 'Opera', url: chrome_url, img: 'opera/opera_48x48.png' },
15-
{ name: 'Brave', url: chrome_url, img: 'brave/brave_48x48.png' },
16-
// { name: 'Chromium', url: chrome_url, img: 'chromium/chromium_48x48.png' },
17-
]
18-
19-
// Style from Props
8+
// Props
209
const props = defineProps({
2110
animation: { type: String, default: null },
2211
centered: { type: Boolean, default: false },
2312
margin: { type: String, default: null },
13+
size: { type: String, default: '48' }, // 16,24,32,48,64,128,256,512
2414
})
2515
16+
// Browsers
17+
const baseUrl = 'https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1'
18+
const browsers = [
19+
{ name: 'Chrome', url: chrome_url, img: 'chrome/chrome' },
20+
{ name: 'Firefox', url: firefox_url, img: 'firefox/firefox' },
21+
{ name: 'Edge', url: chrome_url, img: 'edge/edge' },
22+
{ name: 'Opera', url: chrome_url, img: 'opera/opera' },
23+
{ name: 'Brave', url: chrome_url, img: 'brave/brave' },
24+
// { name: 'Chromium', url: chrome_url, img: 'chromium/chromium' },
25+
]
26+
27+
// Class
2628
const imageClass = props.animation ? `animate__animated ${props.animation}` : null
2729
28-
const iconStyle = {}
30+
// Style
31+
const iconStyle = { minHeight: `${props.size}px` }
2932
if (props.centered) iconStyle.textAlign = 'center'
3033
if (props.margin) iconStyle.margin = props.margin
3134
</script>
@@ -41,19 +44,20 @@ if (props.margin) iconStyle.margin = props.margin
4144
target="_blank"
4245
rel="noopener"
4346
>
44-
<img :alt="browser.name" :src="`${baseUrl}/${browser.img}`" :class="imageClass" width="48" height="48" />
47+
<img
48+
:alt="browser.name"
49+
:width="props.size"
50+
:height="props.size"
51+
:src="`${baseUrl}/${browser.img}_${props.size}x${props.size}.png`"
52+
:class="imageClass"
53+
/>
4554
</a>
4655
</div>
4756
</template>
4857

4958
<style scoped>
50-
.browser-icons {
51-
min-height: 48px;
52-
}
53-
.browser-icons img {
54-
margin-right: 6px;
55-
}
5659
.browser-icons a {
60+
margin-right: 8px;
5761
display: inline-block;
5862
vertical-align: middle;
5963
transform: translateZ(0);

.vitepress/theme/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ summary {
1414
cursor: pointer;
1515
}
1616

17+
table th {
18+
text-wrap: nowrap;
19+
}
20+
1721
.search-keywords {
1822
display: none;
1923
}

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"dependencies": {
1111
"@cssnr/vitepress-plugin-contributors": "^0.0.3",
12-
"@cssnr/vitepress-swiper": "^0.1.1",
12+
"@cssnr/vitepress-swiper": "^0.2.0",
1313
"animate.css": "^4.1.1",
1414
"vitepress": "^1.6.4"
1515
},

0 commit comments

Comments
 (0)