35 lines
713 B
Svelte
35 lines
713 B
Svelte
|
<script>
|
||
|
export let onKeyPress; // Funktion för att hantera knapptryckningar
|
||
|
</script>
|
||
|
|
||
|
<div class="keyboard">
|
||
|
{#each ['7', '8', '9', '/', '4', '5', '6', '*', '1', '2', '3', '-', '0', 'C', '=', '+'] as key}
|
||
|
<button on:click={() => onKeyPress(key)}>
|
||
|
{key}
|
||
|
</button>
|
||
|
{/each}
|
||
|
</div>
|
||
|
|
||
|
<style lang="scss">
|
||
|
.keyboard {
|
||
|
display: grid;
|
||
|
grid-template-columns: repeat(4, 1fr);
|
||
|
gap: 10px;
|
||
|
padding: 20px;
|
||
|
}
|
||
|
|
||
|
button {
|
||
|
background-color: #4A90E2;
|
||
|
color: white;
|
||
|
font-size: 1.5rem;
|
||
|
padding: 20px;
|
||
|
border: none;
|
||
|
border-radius: 5px;
|
||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
|
||
|
cursor: pointer;
|
||
|
}
|
||
|
|
||
|
button:hover {
|
||
|
background-color: #357ABD;
|
||
|
}
|
||
|
</style>
|