Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions css/mistica-common.css
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,140 @@ button.mistica-display-card:has(.mistica-card__media):active:after {
opacity: initial; /* avoid applying 0.5 opacity twice */
}

/* FeedbackScreen */

@keyframes mistica-animation-shake {
10%,
90% {
transform: translateX(3px);
}
20%,
80% {
transform: translateX(6px);
}
30%,
50%,
70% {
transform: translateX(0);
}
40%,
60% {
transform: translateX(8px);
}
}

@keyframes mistica-animation-text-appear {
0% {
opacity: 0;
transform: translateY(var(--text-appear-distance));
}
100% {
opacity: 1;
transform: translateY(0);
}
}

.mistica-feedback-screen {
--text-animation: mistica-animation-text-appear 1s both cubic-bezier(0.215, 0.61, 0.355, 1);
--text-appear-distance: 16px;
padding: 64px 0 16px;
}

@media (min-width: 1024px) {
.mistica-feedback-screen {
--text-appear-distance: 40px;
margin-top: 64px;
border-radius: var(--mistica-border-radius-legacyDisplay);
border: var(--mistica-boxed-border);
background: var(--mistica-color-backgroundContainer);
padding: 64px;
}

.mistica-feedback-screen > .mistica-fixed-footer-buttons {
margin-top: 40px;
}
}

@media (max-width: 1023px) {
.mistica-feedback-screen {
/* Space for fixed buttons */
padding-bottom: 142px;
}
}

.mistica-feedback-screen__asset {
--asset-animation: mistica-animation-shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
width: 48px;
height: 48px;
margin-bottom: 24px;
}

.mistica-feedback-screen__asset-error-inside {
animation: var(--asset-animation);
animation-delay: 0.8s;
}

.mistica-feedback-screen__asset-error-outside {
animation: var(--asset-animation);
animation-delay: 0.84s;
}

.mistica-feedback-screen__title {
font-size: var(--mistica-font-size-6);
line-height: var(--mistica-line-height-6);
font-weight: var(--mistica-font-weight-6);
color: var(--mistica-color-textPrimary);
animation: var(--text-animation);
animation-delay: 0.6s;
}

.mistica-feedback-screen__description {
margin-top: 16px;
font-size: var(--mistica-font-size-3);
line-height: var(--mistica-line-height-3);
font-weight: 400;
color: var(--mistica-color-textSecondary);
animation: var(--text-animation);
animation-delay: 0.8s;
}

.mistica-feedback-screen__slot {
margin-top: 16px;
animation: var(--text-animation);
color: var(--mistica-color-textSecondary);
animation-delay: 1s;
}

.mistica-fixed-footer-buttons {
display: flex;
gap: 16px;
}

@media (max-width: 1023px) {
.mistica-fixed-footer,
.mistica-fixed-footer-buttons {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: var(--mistica-color-background);
box-shadow: 0 -2px 8px 0 rgba(0, 0, 0, 0.1);
}

.mistica-fixed-footer-buttons {
padding: 16px;
display: flex;
flex-direction: column;
gap: 16px;
}
}

@media (min-width: 768px) and (max-width: 1023px) {
.mistica-fixed-footer-buttons {
padding: 32px 24px;
}
}

/* TextField */
.mistica-text-field {
--border-width: 1px;
Expand Down
114 changes: 114 additions & 0 deletions examples/css/error-feedback.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mistica CSS Example</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body data-mistica-skin="movistar" data-mistica-color-scheme="auto">
<div class="mistica-responsive-layout">
<div class="mistica-feedback-screen">
<svg
role="presentation"
class="mistica-feedback-screen__asset"
viewBox="0 0 64 64"
overflow="visible"
>
<g
stroke="var(--mistica-color-error)"
fill="none"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
stroke-miterlimit="10"
>
<g class="mistica-feedback-screen__asset-error-outside">
<path
fill="none"
stroke-width="2"
stroke-miterlimit="10"
d="M 31.9 0.9 C 52.5 0.9 62.9 11.4 62.9 31.9 C 62.9 52.5 52.5 62.9 31.9 62.9 C 11.3 62.9 0.9 52.5 0.9 31.9 C 0.9 11.3 11.3 0.9 31.9 0.9 Z"
transform="rotate(90 32 32)"
stroke-dasharray="202"
stroke-dashoffset="202"
>
<animate
attributeName="stroke-dashoffset"
from="202"
to="0"
dur="0.7"
repeatCount="1"
begin="0.3s"
fill="freeze"
keyTimes="0;1"
calcMode="spline"
keySplines="0.65 0 0.25 1"
></animate>
</path>
</g>
<g class="mistica-feedback-screen__asset-error-inside">
<line
x1="31.9"
y1="20.9"
x2="31.9"
y2="36.9"
stroke-dasharray="17"
stroke-dashoffset="17"
>
<animate
attributeName="stroke-dashoffset"
from="17"
to="0"
dur="0.7"
repeatCount="1"
begin="0.7s"
fill="freeze"
keyTimes="0;1"
calcMode="spline"
keySplines="0.65 0 0.25 1"
></animate>
</line>
<circle
stroke="var(--mistica-color-error)"
fill="var(--mistica-color-error)"
stroke-width="1"
cx="31.9"
cy="43.9"
r="1.5"
opacity="0"
>
<animate
attributeName="opacity"
from="0"
to="1"
dur="0.4"
repeatCount="1"
begin="1s"
fill="freeze"
keyTimes="0;1"
calcMode="spline"
keySplines="0.65 0 0.25 1"
></animate>
</circle>
</g>
</g>
</svg>
<h1 class="mistica-feedback-screen__title">Title</h1>
<p class="mistica-feedback-screen__description">Description</p>
<p class="mistica-feedback-screen__slot mistica-text-2">Error reference: #95001</p>
<div class="mistica-fixed-footer-buttons">
<a class="mistica-button-primary" href="#">Action</a>
<a class="mistica-button-link" href="#"
>Link<svg style="margin-left: 2px" width="0.5em" height="0.5em" viewBox="0 0 8 8">
<path
d="M6.32595 3.46071L3.03801 0.158595L3.03292 0.153747L3.032 0.152903L3.02931 0.150463L3.02848 0.149738L3.02248 0.144353C2.88533 0.021206 2.71386 -0.0126731 2.56343 0.00394249C2.41648 0.0201739 2.27272 0.0856702 2.16886 0.18711C2.06893 0.281844 2.01209 0.42816 2.00175 0.567065C1.99083 0.71377 2.02925 0.889583 2.16869 1.02392L5.24446 4.00145L2.15859 6.96199L2.15375 6.96708L2.1529 6.968L2.15046 6.97069L2.14974 6.97152L2.14435 6.97752C2.02121 7.11467 1.98733 7.28614 2.00394 7.43657C2.02017 7.58352 2.08567 7.72728 2.18711 7.83114C2.28184 7.93107 2.42816 7.98791 2.56706 7.99825C2.71377 8.00917 2.88958 7.97075 3.02392 7.83132L6.32595 4.5422V4.5422C6.6246 4.24355 6.6246 3.75935 6.32595 3.46071V3.46071Z"
fill="currentColor"
/></svg
></a>
</div>
</div>
</div>
</body>
</html>
6 changes: 6 additions & 0 deletions examples/css/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ <h3 class="mistica-text-title2">Tag</h3>
<div class="mistica-tag-warning">Warning</div>
<div class="mistica-tag-error">Error</div>
</div>
<h3 class="mistica-text-title2">FeedbackScreen</h3>
<div>
<a class="mistica-button-primary" href="/mistica-css/error-feedback.html"
>See ErrorFeedbackScreen</a
>
</div>

<h3 class="mistica-text-title2">TextFields</h3>
<h4 class="mistica-text-title1">TextField</h4>
Expand Down
2 changes: 1 addition & 1 deletion examples/css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build --base=\"/mistica-css/\"",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
Expand Down
17 changes: 17 additions & 0 deletions examples/css/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {dirname, resolve} from 'node:path';
import {fileURLToPath} from 'node:url';
import {defineConfig} from 'vite';

const __dirname = dirname(fileURLToPath(import.meta.url));

export default defineConfig({
base: '/mistica-css/',
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
'error-feedback': resolve(__dirname, 'error-feedback.html'),
},
},
},
});
Loading