improve confirm modal style

This commit is contained in:
SrGooglo 2025-04-09 14:15:22 +00:00
parent 564cecd2f0
commit d2ce57f843
2 changed files with 106 additions and 82 deletions

View File

@ -32,8 +32,8 @@ function ConfirmModal(props) {
} }
return ( return (
<div className="drawer_close_confirm"> <div className="app-modal_confirm">
<div className="drawer_close_confirm_content"> <div className="app-modal_confirm_content">
<h1>{props.headerText ?? "Are you sure?"}</h1> <h1>{props.headerText ?? "Are you sure?"}</h1>
{props.descriptionText && <p>{props.descriptionText}</p>} {props.descriptionText && <p>{props.descriptionText}</p>}
@ -41,7 +41,7 @@ function ConfirmModal(props) {
{typeof props.render === "function" && props.render()} {typeof props.render === "function" && props.render()}
<div className="drawer_close_confirm_actions"> <div className="app-modal_confirm_actions">
<Button <Button
onClick={() => close({ confirm: false })} onClick={() => close({ confirm: false })}
disabled={loading} disabled={loading}

View File

@ -1,119 +1,143 @@
@import "@styles/vars.less"; @import "@styles/vars.less";
.app_modal_wrapper { .app_modal_wrapper {
box-sizing: border-box; box-sizing: border-box;
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
transition: all 150ms ease-in-out; transition: all 150ms ease-in-out;
#mask_trigger { font-size: 0.9rem;
position: fixed;
top: 0; #mask_trigger {
left: 0; position: fixed;
top: 0;
left: 0;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
} }
&.framed { &.framed {
.app_modal_content { .app_modal_content {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 30px; padding: 20px;
background-color: var(--background-color-accent); background-color: var(--background-color-accent);
border: 2px solid var(--border-color); border: 2px solid var(--border-color);
border-radius: 12px; border-radius: 12px;
} }
} }
&.active { &.active {
background-color: rgba(var(--bg_color_6), 0.1); background-color: rgba(var(--bg_color_6), 0.1);
backdrop-filter: blur(@modal_background_blur); backdrop-filter: blur(@modal_background_blur);
-webkit-backdrop-filter: blur(@modal_background_blur); -webkit-backdrop-filter: blur(@modal_background_blur);
.app_modal_content { .app_modal_content {
opacity: 1; opacity: 1;
transform: translateY(0); transform: translateY(0);
} }
} }
.app_modal_content { .app_modal_content {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
opacity: 0; opacity: 0;
transform: translateY(100px); transform: translateY(100px);
height: fit-content; height: fit-content;
width: 40vw; width: 40vw;
max-width: 600px; max-width: 600px;
transition: all 150ms ease-in-out; transition: all 150ms ease-in-out;
.app_modal_close { .app_modal_close {
position: sticky; position: sticky;
align-self: flex-end; align-self: flex-end;
top: 0; top: 0;
right: 0; right: 0;
font-size: 1.5rem; font-size: 1.5rem;
cursor: pointer; cursor: pointer;
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
padding: 5px; padding: 5px;
border-radius: 12px; border-radius: 12px;
svg { svg {
margin: 0; margin: 0;
color: var(--text-color); color: var(--text-color);
} }
} }
// fixments // fixments
.postCreator { .postCreator {
box-shadow: @card-shadow; box-shadow: @card-shadow;
-webkit-box-shadow: @card-shadow; -webkit-box-shadow: @card-shadow;
-moz-box-shadow: @card-shadow; -moz-box-shadow: @card-shadow;
} }
.searcher { .searcher {
box-sizing: border-box; box-sizing: border-box;
width: 48vw; width: 48vw;
height: 80vh; height: 80vh;
} }
} }
} }
.app-modal_confirm {
display: flex;
flex-direction: column;
gap: 15px;
width: 100%;
.app-modal_confirm_content {
display: flex;
flex-direction: column;
gap: 2px;
}
.app-modal_confirm_actions {
display: flex;
flex-direction: row;
gap: 10px;
}
}