create button

This commit is contained in:
––AsTroLog 2023-10-20 13:45:27 +00:00
parent 1656f10967
commit ff7db5aa74
2 changed files with 19 additions and 12 deletions

View File

@ -1,4 +1,4 @@
<div style="@leftFrameStyle" class="left_frame">
<div id="leftframe" class="left_frame">
<div class="logo">
@ -8,7 +8,7 @@
<div class="menu">
<a @onclick="ChangeButtonStyle" class="button_close_menu">
<a id="button_close" class="button_close_menu">
<span></span>
<span></span>
<span></span>
@ -52,19 +52,25 @@
</div>
<script>
function changetyle() {
var element = document.getElementById('leftframe');
var computedStyles = getComputedStyle(element);
var transformValue = computedStyles.transform;
if (transformValue === 'matrix(1, 0, 0, 1, 0, 0)') {
element.style.transform = 'translateX(-110%)';
} else {
element.style.transform = 'translateX(0%)';
}
}
document.getElementById('button_close').addEventListener('click', changetyle);
</script>
@code {
private string leftFrameStyle = "transform: translateX(0%);";
private void ChangeButtonStyle()
{
if (leftFrameStyle.Contains("transform: translateX(0%);"))
{
leftFrameStyle = "transform: translateX(-110%);";
}
}
private List<Models.Wishlist> wishlist;
protected override async Task OnInitializedAsync()

View File

@ -4,6 +4,7 @@
height: 100%;
width: 100%;
transition: 1s;
transform: translateX(0%);
}
.logo {
height: 5em;