Skip to content

Commit 17867fd

Browse files
committed
add toast notification system, refactor app.js into sub-modules
1 parent 1a1c68e commit 17867fd

File tree

12 files changed

+1871
-1295
lines changed

12 files changed

+1871
-1295
lines changed

assets/css/style.css

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,3 +942,147 @@ a.btn-icon {
942942
height: 50vh;
943943
}
944944
}
945+
946+
/* Toast Notifications */
947+
.toast-container {
948+
position: fixed;
949+
top: 20px;
950+
right: 20px;
951+
z-index: 10001;
952+
display: flex;
953+
flex-direction: column;
954+
gap: 12px;
955+
max-width: 400px;
956+
pointer-events: none;
957+
}
958+
959+
.toast {
960+
display: flex;
961+
align-items: center;
962+
gap: 12px;
963+
padding: 14px 16px;
964+
background-color: var(--surface);
965+
border-radius: 8px;
966+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
967+
opacity: 0;
968+
transform: translateX(100%);
969+
transition: opacity 0.3s ease, transform 0.3s ease;
970+
pointer-events: auto;
971+
min-width: 300px;
972+
max-width: 400px;
973+
}
974+
975+
.toast.show {
976+
opacity: 1;
977+
transform: translateX(0);
978+
}
979+
980+
.toast.dismissing {
981+
opacity: 0;
982+
transform: translateX(100%);
983+
}
984+
985+
.toast-icon {
986+
flex-shrink: 0;
987+
width: 20px;
988+
height: 20px;
989+
display: flex;
990+
align-items: center;
991+
justify-content: center;
992+
border-radius: 50%;
993+
font-size: 14px;
994+
font-weight: bold;
995+
line-height: 1;
996+
}
997+
998+
.toast-message {
999+
flex: 1;
1000+
color: var(--text);
1001+
font-size: 14px;
1002+
line-height: 1.4;
1003+
}
1004+
1005+
.toast-close {
1006+
flex-shrink: 0;
1007+
background: none;
1008+
border: none;
1009+
color: var(--text-light);
1010+
font-size: 20px;
1011+
line-height: 1;
1012+
cursor: pointer;
1013+
padding: 0;
1014+
width: 20px;
1015+
height: 20px;
1016+
display: flex;
1017+
align-items: center;
1018+
justify-content: center;
1019+
border-radius: 4px;
1020+
transition: background-color 0.2s, color 0.2s;
1021+
}
1022+
1023+
.toast-close:hover {
1024+
background-color: var(--border);
1025+
color: var(--text);
1026+
}
1027+
1028+
/* Toast Types */
1029+
.toast-success {
1030+
border-left: 4px solid var(--success);
1031+
}
1032+
1033+
.toast-success .toast-icon {
1034+
background-color: var(--success);
1035+
color: white;
1036+
}
1037+
1038+
.toast-error {
1039+
border-left: 4px solid var(--error);
1040+
}
1041+
1042+
.toast-error .toast-icon {
1043+
background-color: var(--error);
1044+
color: white;
1045+
}
1046+
1047+
.toast-info {
1048+
border-left: 4px solid var(--primary-color);
1049+
}
1050+
1051+
.toast-info .toast-icon {
1052+
background-color: var(--primary-color);
1053+
color: white;
1054+
}
1055+
1056+
.toast-warning {
1057+
border-left: 4px solid #ff9800;
1058+
}
1059+
1060+
.toast-warning .toast-icon {
1061+
background-color: #ff9800;
1062+
color: white;
1063+
}
1064+
1065+
/* Dark theme adjustments for toasts */
1066+
[data-theme="dark"] .toast {
1067+
background-color: var(--surface);
1068+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
1069+
}
1070+
1071+
[data-theme="dark"] .toast-close:hover {
1072+
background-color: var(--border);
1073+
}
1074+
1075+
/* Mobile responsiveness */
1076+
@media (max-width: 768px) {
1077+
.toast-container {
1078+
top: 10px;
1079+
right: 10px;
1080+
left: 10px;
1081+
max-width: none;
1082+
}
1083+
1084+
.toast {
1085+
min-width: auto;
1086+
max-width: none;
1087+
}
1088+
}

0 commit comments

Comments
 (0)