feat: add show and hide icons

This commit is contained in:
Aravinth Manivannan 2022-12-05 15:45:04 +05:30
parent 7bf28f0f93
commit 7e17f9de0a
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
4 changed files with 23 additions and 0 deletions

View File

@ -35,6 +35,22 @@ pub mod routes {
lazy_static! {
pub static ref ASSETS: Assets = Assets::new();
}
#[derive(Serialize)]
pub struct Svg {
pub eye_off: &'static str,
pub eye: &'static str,
}
impl Svg {
/// create new instance of Routes
pub fn new() -> Svg {
Svg {
eye: &static_files::assets::CSS,
eye_off: &static_files::assets::CSS,
}
}
}
#[derive(Serialize)]
/// Top-level routes data structure for V1 AP1
@ -42,6 +58,7 @@ pub mod routes {
/// Authentication routes
pub css: &'static str,
pub mobile_css: &'static str,
pub svg: Svg,
}
impl Assets {
@ -50,6 +67,7 @@ pub mod routes {
Assets {
css: &static_files::assets::CSS,
mobile_css: &static_files::assets::CSS,
svg: Svg::new(),
}
}
}

View File

@ -29,6 +29,9 @@ pub mod assets {
lazy_static! {
pub static ref CSS: &'static str = FILES.get("./static/cache/css/main.css").unwrap();
pub static ref EYE: &'static str = FILES.get("./static/cache/img/svg/eye.svg").unwrap();
pub static ref EYE_OFF: &'static str =
FILES.get("./static/cache/img/svg/eye-off.svg").unwrap();
pub static ref MOBILE_CSS: &'static str =
FILES.get("./static/cache/css/mobile.css").unwrap();
}

1
static/cache/img/svg/eye-off.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="52" height="52" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="icon" class="feather feather-eye-off"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"></path><line x1="1" y1="1" x2="23" y2="23"></line></svg>

After

Width:  |  Height:  |  Size: 470 B

1
static/cache/img/svg/eye.svg vendored Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="52" height="52" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="icon" class="feather feather-eye"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>

After

Width:  |  Height:  |  Size: 326 B