Skip to content

Commit

Permalink
botaoBiblioteca1
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuhgb committed Nov 23, 2024
1 parent 64c1f1a commit e6d7b03
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/components/sidebar/Sidebar.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import { Background } from "@xyflow/svelte";
import { backIn } from "svelte/easing";
export let nodes: any[]; // exportando a variável node, lista de objetos. let porque o valor varia
Expand All @@ -20,6 +21,21 @@
</script>

<aside>
<div class="mb-0"></div>
<div class="flexbox items-center justify-center">
<button class="button" on:click={() => {
const library = prompt("Digite o nome da biblioteca");
if (library) {
nodes.push({
name: library,
extras: {
type: "library",
description: "Biblioteca",
},
});
}
}}>Adicionar biblioteca</button>
</div>
<div class="mb-0"></div>
<div class="flexbox items-center justify-center">
{#each types as type}
Expand Down Expand Up @@ -78,4 +94,16 @@
color: #0f0a0a;
border-radius: 15px;
}
.button {
background-color: #171724;
color: white;
padding: 15px 35px;
cursor: pointer;
border-radius: 15px;
font-size: 12px;
text-align: center;
font-weight: bold;
margin: 50px;
margin-top: 17px;
}
</style>

0 comments on commit e6d7b03

Please sign in to comment.