Skip to content

Commit 8029a7d

Browse files
committed
Added license
1 parent cf39fcc commit 8029a7d

File tree

2 files changed

+75
-1
lines changed

2 files changed

+75
-1
lines changed

Calc.html

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@
599599
}
600600

601601
.history-content {
602-
padding-right: 75px;
602+
padding-right: 105px;
603603
}
604604

605605
.history-expression {
@@ -668,6 +668,16 @@
668668
transform: scale(1.1);
669669
}
670670

671+
.history-btn.delete {
672+
background: #ffebee;
673+
color: #c62828;
674+
}
675+
676+
.history-btn.delete:hover {
677+
background: #ffcdd2;
678+
transform: scale(1.1);
679+
}
680+
671681
.copied-toast {
672682
position: fixed;
673683
bottom: 30px;
@@ -702,6 +712,22 @@
702712
font-style: italic;
703713
}
704714

715+
/* Fade out animation for deleted items */
716+
@keyframes fadeOut {
717+
from {
718+
opacity: 1;
719+
transform: translateX(0);
720+
}
721+
to {
722+
opacity: 0;
723+
transform: translateX(100%);
724+
}
725+
}
726+
727+
.history-item.deleting {
728+
animation: fadeOut 0.3s ease forwards;
729+
}
730+
705731
/* Scrollbar styling */
706732
.history-list::-webkit-scrollbar,
707733
.memory-display::-webkit-scrollbar {
@@ -1641,6 +1667,30 @@ <h2 class="history-title">
16411667
updateHistoryDisplay();
16421668
}
16431669

1670+
function deleteHistoryItem(index) {
1671+
// Add animation class to the item
1672+
const historyList = document.getElementById('historyList');
1673+
const items = historyList.querySelectorAll('.history-item');
1674+
1675+
if (items[index]) {
1676+
items[index].classList.add('deleting');
1677+
1678+
// Wait for animation to complete before removing
1679+
setTimeout(() => {
1680+
history.splice(index, 1);
1681+
saveHistory();
1682+
const searchTerm = document.getElementById('searchInput').value.toLowerCase();
1683+
updateHistoryDisplay(searchTerm);
1684+
}, 300);
1685+
} else {
1686+
// Fallback if element not found
1687+
history.splice(index, 1);
1688+
saveHistory();
1689+
const searchTerm = document.getElementById('searchInput').value.toLowerCase();
1690+
updateHistoryDisplay(searchTerm);
1691+
}
1692+
}
1693+
16441694
function searchHistory() {
16451695
const searchTerm = document.getElementById('searchInput').value.toLowerCase();
16461696
updateHistoryDisplay(searchTerm);
@@ -1686,6 +1736,9 @@ <h2 class="history-title">
16861736
<button class="history-btn transfer" onclick="transferToCalculator(${originalIndex})" title="Use in calculator">
16871737
<i class="fas fa-calculator"></i>
16881738
</button>
1739+
<button class="history-btn delete" onclick="deleteHistoryItem(${originalIndex})" title="Delete">
1740+
<i class="fas fa-trash"></i>
1741+
</button>
16891742
</div>
16901743
</div>
16911744
`;

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Valentyn Kolesnikov <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)