migrate images
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
|
@ -0,0 +1,47 @@
|
|||
@use "sass:map";
|
||||
@use "sass:list";
|
||||
@mixin dark {
|
||||
@if map.get(jekyll-config(), "issue") {
|
||||
@content;
|
||||
} @else {
|
||||
@media (prefers-color-scheme: dark) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@mixin noissue {
|
||||
@if map.get(jekyll-config(), "issue") {
|
||||
} @else {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin imgurl($img, $style: "light", $scales: 4, $ext: "png") {
|
||||
background-image: url("#{getimgName($img, $style, 1, $ext)}");
|
||||
$imgset: ();
|
||||
@for $scale from 1 through $scales {
|
||||
$imgset: list.append(
|
||||
$imgset,
|
||||
url("#{getimgName($img, $style, $scale, $ext)}") #{$scale}x,
|
||||
comma
|
||||
);
|
||||
}
|
||||
@each $pfx in ("-webkit-", "") {
|
||||
background-image: #{$pfx}image-set($imgset);
|
||||
}
|
||||
}
|
||||
|
||||
@function getimgName($img, $style, $scale, $ext) {
|
||||
@if $scale == 1 {
|
||||
$scale: "";
|
||||
} @else {
|
||||
$scale: "@#{$scale}x";
|
||||
}
|
||||
@if $style == "light" {
|
||||
$style: "";
|
||||
} @else {
|
||||
$style: "-#{$style}";
|
||||
}
|
||||
@return "#{$img}#{$style}#{$scale}.#{$ext}";
|
||||
}
|
||||
|
|
@ -26,37 +26,13 @@
|
|||
@include utils.noissue {
|
||||
opacity: 0.5;
|
||||
filter: grayscale(0.2);
|
||||
background-image: url(/static/img/missing.png);
|
||||
background-image: -webkit-image-set(
|
||||
url("/static/img/missing.png") 1x,
|
||||
url("/static/img/missing@2x.png") 2x,
|
||||
url("/static/img/missing@3x.png") 3x,
|
||||
url("/static/img/missing@4x.png") 4x
|
||||
);
|
||||
background-image: image-set(
|
||||
url("/static/img/missing.png") 1x,
|
||||
url("/static/img/missing@2x.png") 2x,
|
||||
url("/static/img/missing@3x.png") 3x,
|
||||
url("/static/img/missing@4x.png") 4x
|
||||
);
|
||||
@include utils.imgurl("../imgs/missing", "light");
|
||||
}
|
||||
|
||||
@include utils.dark {
|
||||
opacity: 1;
|
||||
filter: none;
|
||||
background-image: url(/static/img/missing-dark.png);
|
||||
background-image: -webkit-image-set(
|
||||
url("/static/img/missing-dark.png") 1x,
|
||||
url("/static/img/missing-dark@2x.png") 2x,
|
||||
url("/static/img/missing-dark@3x.png") 3x,
|
||||
url("/static/img/missing-dark@4x.png") 4x
|
||||
);
|
||||
background-image: image-set(
|
||||
url("/static/img/missing-dark.png") 1x,
|
||||
url("/static/img/missing-dark@2x.png") 2x,
|
||||
url("/static/img/missing-dark@3x.png") 3x,
|
||||
url("/static/img/missing-dark@4x.png") 4x
|
||||
);
|
||||
@include utils.imgurl("../imgs/missing", "dark");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
@use "sass:map";
|
||||
@mixin dark {
|
||||
@if map.get(jekyll-config(), "issue") {
|
||||
@content;
|
||||
} @else {
|
||||
@media (prefers-color-scheme: dark) {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@mixin noissue {
|
||||
@if map.get(jekyll-config(), "issue") {
|
||||
} @else {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
"private": true,
|
||||
"homepage": "https://github.com/tuna/mirror-web",
|
||||
"scripts": {
|
||||
"format": "prettier --write \"_src/**\""
|
||||
"format": "prettier --write \"_src/**/*.vue\" \"_src/**/*.html\" \"_src/**/*.js\" \"_src/**/*.scss\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@vitejs/plugin-legacy": "^5.3.2",
|
||||
|
|
|
|||