Add hi-res versions off all images
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
1
assets/images/artix_hi.png
Symbolic link
|
@ -0,0 +1 @@
|
|||
artix.png
|
Before Width: | Height: | Size: 8 KiB After Width: | Height: | Size: 6.3 KiB |
BIN
assets/images/bitogo_hi.jpg
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
assets/images/block_scrappapercircus_hi.jpg
Normal file
After Width: | Height: | Size: 540 KiB |
BIN
assets/images/chicanery_hi.jpg
Normal file
After Width: | Height: | Size: 414 KiB |
BIN
assets/images/classic_scrappapercircus_hi.jpg
Normal file
After Width: | Height: | Size: 614 KiB |
BIN
assets/images/coptic_scrappapercircus_hi.jpg
Normal file
After Width: | Height: | Size: 588 KiB |
BIN
assets/images/doggo_hi.jpg
Normal file
After Width: | Height: | Size: 1.9 MiB |
BIN
assets/images/dotfiles_hi.jpg
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
assets/images/hiking_hi.jpg
Normal file
After Width: | Height: | Size: 3.8 MiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
BIN
assets/images/me_hi.jpg
Normal file
After Width: | Height: | Size: 3.5 MiB |
BIN
assets/images/mta_hi.jpg
Normal file
After Width: | Height: | Size: 900 KiB |
BIN
assets/images/neumont_hi.jpg
Normal file
After Width: | Height: | Size: 98 KiB |
BIN
assets/images/nice_beat_hi.jpg
Normal file
After Width: | Height: | Size: 571 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 36 KiB |
BIN
assets/images/pac1_hi.jpg
Normal file
After Width: | Height: | Size: 1,024 KiB |
BIN
assets/images/pufferfish_hi.jpg
Normal file
After Width: | Height: | Size: 232 KiB |
BIN
assets/images/rovio_hi.jpg
Normal file
After Width: | Height: | Size: 209 KiB |
1
assets/images/saul_goodman_hi.jpg
Symbolic link
|
@ -0,0 +1 @@
|
|||
saul_goodman.jpg
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 68 KiB |
BIN
assets/images/scratch_medal_hi.jpg
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
assets/images/scratch_winner1_hi.jpg
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
assets/images/scratch_winner2_hi.jpg
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
assets/images/sonic_remix_hi.jpg
Normal file
After Width: | Height: | Size: 491 KiB |
16
src/app.rs
|
@ -63,6 +63,7 @@ pub enum ContextBlock {
|
|||
Image {
|
||||
alt_text: Arc<RwLock<Buffer>>,
|
||||
image: Image<'static>,
|
||||
hi_image: Image<'static>,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -233,16 +234,24 @@ impl ContextWindow {
|
|||
last_indent = buffer.indent.modifier;
|
||||
let buffer = if let Some(url) = buffer.image_url {
|
||||
let image;
|
||||
let hi_image;
|
||||
let url = url.split_once('#').unwrap();
|
||||
let size = url.1.split_once('x').unwrap();
|
||||
let size = Vec2::new(size.0.parse().unwrap(), size.1.parse().unwrap());
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
{
|
||||
image = Image::from_uri(format!(concat!(env!("PHOST"), "/{}"), url.0));
|
||||
let split = url.0.rsplit_once('.').unwrap();
|
||||
hi_image = Image::from_uri(format!(
|
||||
concat!(env!("PHOST"), "/{}_hi.{}"),
|
||||
split.0, split.1
|
||||
));
|
||||
}
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
image = Image::from_uri(format!("file://assets/{}", url.0));
|
||||
let split = url.0.rsplit_once('.').unwrap();
|
||||
hi_image = Image::from_uri(format!("file://assets/{}_hi.{}", split.0, split.1));
|
||||
}
|
||||
let mut res = (
|
||||
Rect::from_min_size(
|
||||
|
@ -253,6 +262,7 @@ impl ContextWindow {
|
|||
ContextBlock::Image {
|
||||
alt_text: Arc::new(RwLock::new(buffer.buffer)),
|
||||
image,
|
||||
hi_image,
|
||||
},
|
||||
);
|
||||
const IMAGE_PADDING: f32 = 8.0;
|
||||
|
@ -685,7 +695,9 @@ impl eframe::App for Portfolio {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
ContextBlock::Image { image, .. } => {
|
||||
ContextBlock::Image {
|
||||
image, hi_image, ..
|
||||
} => {
|
||||
let image_rect = context_block.0.translate(rect.min.to_vec2());
|
||||
|
||||
let image_response = ui.allocate_rect(image_rect, Sense::click());
|
||||
|
@ -752,7 +764,7 @@ impl eframe::App for Portfolio {
|
|||
),
|
||||
);
|
||||
|
||||
image
|
||||
hi_image
|
||||
.clone()
|
||||
.tint(Color32::WHITE.gamma_multiply(zoom_view_opacity))
|
||||
.paint_at(&ui, image_rect.lerp_towards(&fs_rect, t));
|
||||
|
|
|
@ -33,6 +33,7 @@ fn main() {
|
|||
eframe::WebLogger::init(log::LevelFilter::Debug).ok();
|
||||
|
||||
let web_options = eframe::WebOptions {
|
||||
follow_system_theme: false,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
|