Add history navigation
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Isaac Mills 2024-03-19 21:26:42 -04:00
parent 2fb2cd59a9
commit b8f59fef2a
Signed by: fnmain
GPG key ID: B67D7410F33A0F61
7 changed files with 177 additions and 71 deletions

View file

@ -1,6 +1,2 @@
# clipboard api is still unstable, so web-sys requires the below flag to be passed for copy (ctrl + c) to work
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
# check status at https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
# we don't use `[build]` because of rust analyzer's build cache invalidation https://github.com/emilk/eframe_template/issues/93
[target.wasm32-unknown-unknown]
rustflags = ["--cfg=web_sys_unstable_apis"]
rustflags = ["-C", "target-feature=+simd128", "--cfg=web_sys_unstable_apis"]

115
Cargo.lock generated
View file

@ -115,9 +115,9 @@ dependencies = [
[[package]]
name = "aho-corasick"
version = "1.1.2"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
dependencies = [
"memchr",
]
@ -135,7 +135,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289"
dependencies = [
"android-properties",
"bitflags 2.4.2",
"bitflags 2.5.0",
"cc",
"cesu8",
"jni",
@ -180,6 +180,12 @@ dependencies = [
"x11rb",
]
[[package]]
name = "arc-swap"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b3d0060af21e8d11a926981cc00c6c1541aa91dd64b9f881985c3da1094425f"
[[package]]
name = "arrayvec"
version = "0.7.4"
@ -234,7 +240,7 @@ dependencies = [
"async-task",
"concurrent-queue",
"fastrand 2.0.1",
"futures-lite 2.2.0",
"futures-lite 2.3.0",
"slab",
]
@ -280,10 +286,10 @@ dependencies = [
"cfg-if",
"concurrent-queue",
"futures-io",
"futures-lite 2.2.0",
"futures-lite 2.3.0",
"parking",
"polling 3.5.0",
"rustix 0.38.31",
"rustix 0.38.32",
"slab",
"tracing",
"windows-sys 0.52.0",
@ -328,15 +334,15 @@ dependencies = [
"cfg-if",
"event-listener 3.1.0",
"futures-lite 1.13.0",
"rustix 0.38.31",
"rustix 0.38.32",
"windows-sys 0.48.0",
]
[[package]]
name = "async-recursion"
version = "1.0.5"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0"
checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5"
dependencies = [
"proc-macro2",
"quote",
@ -355,7 +361,7 @@ dependencies = [
"cfg-if",
"futures-core",
"futures-io",
"rustix 0.38.31",
"rustix 0.38.32",
"signal-hook-registry",
"slab",
"windows-sys 0.48.0",
@ -473,9 +479,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.4.2"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
[[package]]
name = "block"
@ -541,7 +547,7 @@ dependencies = [
"async-task",
"fastrand 2.0.1",
"futures-io",
"futures-lite 2.2.0",
"futures-lite 2.3.0",
"piper",
"tracing",
]
@ -590,10 +596,10 @@ version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"log",
"polling 3.5.0",
"rustix 0.38.31",
"rustix 0.38.32",
"slab",
"thiserror",
]
@ -605,7 +611,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02"
dependencies = [
"calloop",
"rustix 0.38.31",
"rustix 0.38.32",
"wayland-backend",
"wayland-client",
]
@ -806,7 +812,7 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c578f2b9abb4d5f3fbb12aba4008084d435dc6a8425c195cfe0b3594bfea0c25"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"fontdb",
"libm",
"log",
@ -894,7 +900,7 @@ version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"libloading 0.8.3",
"winapi",
]
@ -1503,9 +1509,9 @@ dependencies = [
[[package]]
name = "futures-lite"
version = "2.2.0"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba"
checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
dependencies = [
"fastrand 2.0.1",
"futures-core",
@ -1644,7 +1650,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"gpu-alloc-types",
]
@ -1654,7 +1660,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
]
[[package]]
@ -1676,7 +1682,7 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"gpu-descriptor-types",
"hashbrown",
]
@ -1687,7 +1693,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
]
[[package]]
@ -1716,7 +1722,7 @@ version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"com",
"libc",
"libloading 0.8.3",
@ -1965,7 +1971,7 @@ version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"libc",
"redox_syscall 0.4.1",
]
@ -2061,7 +2067,7 @@ version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"block",
"core-graphics-types",
"foreign-types",
@ -2103,7 +2109,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843"
dependencies = [
"bit-set",
"bitflags 2.4.2",
"bitflags 2.5.0",
"codespan-reporting",
"hexf-parse",
"indexmap",
@ -2122,7 +2128,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"jni-sys",
"log",
"ndk-sys",
@ -2424,7 +2430,7 @@ dependencies = [
"cfg-if",
"concurrent-queue",
"pin-project-lite",
"rustix 0.38.31",
"rustix 0.38.32",
"tracing",
"windows-sys 0.52.0",
]
@ -2439,6 +2445,7 @@ checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2"
name = "portfolio"
version = "0.1.0"
dependencies = [
"arc-swap",
"cosmic-jotdown",
"databake",
"eframe",
@ -2453,7 +2460,9 @@ dependencies = [
"keyframe",
"log",
"range-map",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"wgpu",
]
@ -2718,11 +2727,11 @@ dependencies = [
[[package]]
name = "rustix"
version = "0.38.31"
version = "0.38.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949"
checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"errno",
"libc",
"linux-raw-sys 0.4.13",
@ -2766,7 +2775,7 @@ version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0ae5692c5beaad6a9e22830deeed7874eae8a4e3ba4076fb48e12c56856222c"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"bytemuck",
"libm",
"smallvec",
@ -2891,14 +2900,14 @@ version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"calloop",
"calloop-wayland-source",
"cursor-icon",
"libc",
"log",
"memmap2",
"rustix 0.38.31",
"rustix 0.38.32",
"thiserror",
"wayland-backend",
"wayland-client",
@ -2955,7 +2964,7 @@ version = "0.3.0+sdk-1.3.268.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
]
[[package]]
@ -3037,7 +3046,7 @@ checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
dependencies = [
"cfg-if",
"fastrand 2.0.1",
"rustix 0.38.31",
"rustix 0.38.32",
"windows-sys 0.52.0",
]
@ -3401,7 +3410,7 @@ checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40"
dependencies = [
"cc",
"downcast-rs",
"rustix 0.38.31",
"rustix 0.38.32",
"scoped-tls",
"smallvec",
"wayland-sys",
@ -3413,8 +3422,8 @@ version = "0.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f"
dependencies = [
"bitflags 2.4.2",
"rustix 0.38.31",
"bitflags 2.5.0",
"rustix 0.38.32",
"wayland-backend",
"wayland-scanner",
]
@ -3425,7 +3434,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"cursor-icon",
"wayland-backend",
]
@ -3436,7 +3445,7 @@ version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba"
dependencies = [
"rustix 0.38.31",
"rustix 0.38.32",
"wayland-client",
"xcursor",
]
@ -3447,7 +3456,7 @@ version = "0.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"wayland-backend",
"wayland-client",
"wayland-scanner",
@ -3459,7 +3468,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"wayland-backend",
"wayland-client",
"wayland-protocols",
@ -3472,7 +3481,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"wayland-backend",
"wayland-client",
"wayland-protocols",
@ -3587,7 +3596,7 @@ checksum = "f9f6b033c2f00ae0bc8ea872c5989777c60bc241aac4e58b24774faa8b391f78"
dependencies = [
"arrayvec",
"bit-vec",
"bitflags 2.4.2",
"bitflags 2.5.0",
"cfg_aliases",
"codespan-reporting",
"indexmap",
@ -3615,7 +3624,7 @@ dependencies = [
"arrayvec",
"ash",
"bit-set",
"bitflags 2.4.2",
"bitflags 2.5.0",
"block",
"cfg_aliases",
"core-graphics-types",
@ -3656,7 +3665,7 @@ version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"js-sys",
"web-sys",
]
@ -3957,7 +3966,7 @@ dependencies = [
"ahash",
"android-activity",
"atomic-waker",
"bitflags 2.4.2",
"bitflags 2.5.0",
"bytemuck",
"calloop",
"cfg_aliases",
@ -3977,7 +3986,7 @@ dependencies = [
"percent-encoding",
"raw-window-handle 0.6.0",
"redox_syscall 0.3.5",
"rustix 0.38.31",
"rustix 0.38.32",
"smithay-client-toolkit",
"smol_str",
"unicode-segmentation",
@ -4026,7 +4035,7 @@ dependencies = [
"libc",
"libloading 0.8.3",
"once_cell",
"rustix 0.38.31",
"rustix 0.38.32",
"x11rb-protocol",
]
@ -4058,7 +4067,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5"
dependencies = [
"bitflags 2.4.2",
"bitflags 2.5.0",
"dlib",
"log",
"once_cell",

View file

@ -7,6 +7,7 @@ rust-version = "1.72"
[dependencies]
arc-swap = "1.7.0"
cosmic-jotdown = { git = "https://git.nations.lol/fnmain/cosmic-jotdown" }
eframe = { version = "0.26.2", default-features = false, features = [
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
@ -23,6 +24,8 @@ image = { version = "0.24.9", features = ["jpeg", "png"] }
keyframe = { version = "1.1.1", default-features = false }
log = "0.4"
range-map = "0.2.0"
wasm-bindgen = "0.2.92"
web-sys = { version = "0.3.69", features = ["Window", "History", "PopStateEvent"] }
# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

View file

@ -1,2 +0,0 @@
[target.wasm32-unknown-unknown]
rustflags = ["-C", "target-feature=+simd128"]

View file

@ -1,8 +1,13 @@
use std as alloc;
use std::borrow::Cow;
use std::ops::DerefMut;
use std::rc::Rc;
use std::sync::Arc;
use alloc::cell::RefCell;
use alloc::mem::ManuallyDrop;
use alloc::ops::Deref;
use arc_swap::ArcSwapAny;
use cosmic_jotdown::jotdown::{self, Event, ListKind};
use cosmic_jotdown::{Indent, INDENT_AMOUNT};
use eframe::egui::mutex::{Mutex, RwLock};
@ -19,7 +24,7 @@ use encase::ShaderType;
use glam::Mat2;
use glyphon::{Buffer, FontSystem, Metrics};
use keyframe::functions;
use range_map::{RangeMap, RangeSet};
use range_map::RangeMap;
use wgpu::util::DeviceExt;
/// We derive Deserialize/Serialize so we can persist app state on shutdown.
@ -42,12 +47,21 @@ pub struct Portfolio {
window: ContextWindow,
buffer_size: Vec2,
max_size: Rect,
states: Rc<RefCell<Vec<State>>>,
next_state: Rc<ArcSwapAny<Option<Rc<State>>>>,
}
#[derive(Clone, Copy)]
pub enum State {
Home,
Context(Option<Mat2>, &'static Cow<'static, [Event<'static>]>),
}
#[derive(Default)]
pub struct ContextWindow {
pub size: Vec2,
pub text: Vec<(Rect, Indent, ContextBlock)>,
pub name: &'static str,
}
pub struct ContextIcon {
@ -211,9 +225,12 @@ const NAME_PLATE: [&str; 3] = [
impl ContextWindow {
pub fn set_content(
&mut self,
content: &Cow<'static, [Event<'static>]>,
content: &'static Cow<'static, [Event<'static>]>,
transform: Option<Mat2>,
name: Option<&'static str>,
font_system: &mut FontSystem,
mut max_width: f32,
states: &mut Vec<State>,
) {
self.size = Vec2::new(max_width / 1.5, 0.0);
let mut last_indent = None;
@ -325,6 +342,18 @@ impl ContextWindow {
if let Some(size) = last_image_size {
self.size.y += size.y;
}
if let Some(name) = name {
self.name = name;
let state = states.len();
states.push(State::Context(transform, content));
web_sys::window()
.unwrap()
.history()
.unwrap()
.push_state(&wasm_bindgen::JsValue::from(state), name)
.unwrap();
}
}
}
@ -381,6 +410,29 @@ impl Portfolio {
// Load previous app state (if any).
// Note that you must enable the `persistence` feature for this to work.
let states = Rc::new(RefCell::new(Vec::new()));
let pop_state = Rc::clone(&states);
let next_state = Rc::new(ArcSwapAny::new(None));
let pop_next_state = Rc::clone(&next_state);
let popstate_closure =
ManuallyDrop::new(wasm_bindgen::closure::Closure::<dyn FnMut(_)>::new(
move |s: web_sys::PopStateEvent| {
let state = s.state();
if state.is_null() {
pop_next_state.store(Some(Rc::new(State::Home)));
} else {
let state = state.as_f64().unwrap() as usize;
let pop_state = pop_state.borrow();
pop_next_state.store(pop_state.get(state).map(|s| Rc::new(*s)));
}
},
));
web_sys::window()
.unwrap()
.set_onpopstate(Some(wasm_bindgen::JsCast::unchecked_ref(
popstate_closure.as_ref(),
)));
egui_extras::install_image_loaders(&cc.egui_ctx);
let mut font_system = FontSystem::new();
font_system
@ -434,10 +486,12 @@ impl Portfolio {
buffer_size,
window: ContextWindow::default(),
max_size: Rect::ZERO,
states,
next_state,
}
}
pub fn click(&mut self, ui: &egui::Ui, transform: Option<Mat2>) {
pub fn click(&mut self, ui: &egui::Ui, transform: Option<Mat2>, push_state: bool) {
self.from_size = self.to_size;
self.from_pos = self.to_pos;
self.click_time_offset = ui.input(|i| i.time);
@ -445,6 +499,17 @@ impl Portfolio {
self.to_size = 0.6;
self.to_pos = [0.0, 0.0];
self.zoomed = false;
if push_state {
let mut states = self.states.borrow_mut();
let state = states.len();
states.push(State::Home);
web_sys::window()
.unwrap()
.history()
.unwrap()
.push_state(&wasm_bindgen::JsValue::from(state), self.window.name)
.unwrap();
}
} else {
self.to_size = 0.1;
if let Some(transform) = transform {
@ -530,6 +595,31 @@ impl Portfolio {
HOVER_TIME,
);
}
fn update_state(&mut self, ui: &mut egui::Ui) {
if let Some(state) = self.next_state.load().deref() {
log::info!("update_state");
match state.deref() {
State::Home => {
self.zoomed = true;
self.click(ui, None, false);
}
State::Context(transform, content) => {
self.zoomed = false;
self.click(ui, *transform, false);
self.window.set_content(
content,
*transform,
None,
self.font_system.lock().deref_mut(),
ui.max_rect().width(),
self.states.borrow_mut().deref_mut(),
);
}
}
self.next_state.store(None);
}
}
}
impl eframe::App for Portfolio {
@ -542,6 +632,7 @@ impl eframe::App for Portfolio {
.frame(Frame::default().fill(Color32::BLACK))
.show(ctx, |ui| {
self.update_customs(ui);
self.update_state(ui);
self.custom.custom_painting(ui);
if ui.max_rect() != self.max_size {
let scale = Vec2::from(self.custom.resolution.to_array())
@ -830,7 +921,7 @@ impl eframe::App for Portfolio {
self.image_zoomed = false;
});
} else if icon_link.is_none() {
self.click(ui, None);
self.click(ui, None, true);
}
}
} else {
@ -847,11 +938,14 @@ impl eframe::App for Portfolio {
}
if name_resp.clicked() {
self.click(ui, None);
self.click(ui, None, true);
self.window.set_content(
&ABOUT_ME,
None,
Some("About Me"),
self.font_system.lock().deref_mut(),
ui.max_rect().width(),
self.states.borrow_mut().deref_mut(),
);
}
@ -897,10 +991,13 @@ impl eframe::App for Portfolio {
if response.clicked() {
self.window.set_content(
i.content,
Some(transform),
Some(i.name),
self.font_system.lock().deref_mut(),
ui.max_rect().width(),
self.states.borrow_mut().deref_mut(),
);
self.click(ui, Some(transform));
self.click(ui, Some(transform), true);
scroll_area.state.offset = Vec2::ZERO;
scroll_area.state.store(ui.ctx(), scroll_area.id);
}
@ -914,17 +1011,18 @@ impl eframe::App for Portfolio {
}
if let Some(icon) = icon_link {
let transform = glam::Mat2::from_angle((-icon.angle_at).to_radians());
self.window.set_content(
icon.content,
Some(transform),
Some(icon.name),
self.font_system.lock().deref_mut(),
ui.max_rect().width(),
self.states.borrow_mut().deref_mut(),
);
self.zoomed = false;
self.click(
ui,
Some(glam::Mat2::from_angle((-icon.angle_at).to_radians())),
);
self.click(ui, Some(transform), true);
self.zoomed = true;
scroll_area.state.offset = Vec2::ZERO;

View file

@ -13,6 +13,8 @@ I've been daily driving Linux since the beginning of 2020, and have been hosting
- [Vaultwarden](https://github.com/dani-garcia/vaultwarden)
- [scrutiny](https://github.com/AnalogJ/scrutiny)
The server is used within my family to back up their phones. It's also very useful to my father, who works as a pilot for Southwest and needs a VPN when traveling abroad.
My daily driver right now, and the distro my server is running on, is the S6 variant of [Artix Linux](https://artixlinux.org/).
![Artix Linux](images/artix.png#128x128)

View file

@ -1,6 +1,6 @@
# REAPER Experience
*REAPER* is a lot like Audacity, but paid and _waaaay_ better.
*REAPER* is a lot like Audacity, but paid, and _waaaay_ better.
- This is a short piece of upbeat music I made in REAPER. [You can listen to it here](https://nations.lol/s/pbAN8y6rRw8T6nr)