chore(docs): add spinner to stop btn
This commit is contained in:
@@ -51,7 +51,7 @@ async function layoutGraph(direction) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="layoutflow">
|
<div class="layout-flow">
|
||||||
<VueFlow :nodes="nodes" :edges="edges" @nodes-initialized="layoutGraph('LR')">
|
<VueFlow :nodes="nodes" :edges="edges" @nodes-initialized="layoutGraph('LR')">
|
||||||
<template #node-process="props">
|
<template #node-process="props">
|
||||||
<ProcessNode :data="props.data" :source-position="props.sourcePosition" :target-position="props.targetPosition" />
|
<ProcessNode :data="props.data" :source-position="props.sourcePosition" :target-position="props.targetPosition" />
|
||||||
@@ -75,8 +75,9 @@ async function layoutGraph(direction) {
|
|||||||
|
|
||||||
<Panel class="process-panel" position="top-right">
|
<Panel class="process-panel" position="top-right">
|
||||||
<div class="layout-panel">
|
<div class="layout-panel">
|
||||||
<button v-if="isRunning" title="stop" @click="stop">
|
<button v-if="isRunning" class="stop-btn" title="stop" @click="stop">
|
||||||
<Icon name="stop" />
|
<Icon name="stop" />
|
||||||
|
<span class="spinner" />
|
||||||
</button>
|
</button>
|
||||||
<button v-else title="start" @click="run(nodes)">
|
<button v-else title="start" @click="run(nodes)">
|
||||||
<Icon name="play" />
|
<Icon name="play" />
|
||||||
@@ -105,7 +106,7 @@ async function layoutGraph(direction) {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.layoutflow {
|
.layout-flow {
|
||||||
background-color: #1a192b;
|
background-color: #1a192b;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -126,8 +127,7 @@ async function layoutGraph(direction) {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.process-panel button,
|
.process-panel button {
|
||||||
.layout-panel button {
|
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-color: #4a5568;
|
background-color: #4a5568;
|
||||||
@@ -161,4 +161,34 @@ async function layoutGraph(direction) {
|
|||||||
color: white;
|
color: white;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.stop-btn svg {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stop-btn:hover svg {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stop-btn:hover .spinner {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spinner {
|
||||||
|
border: 3px solid #f3f3f3;
|
||||||
|
border-top: 3px solid #2563eb;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -104,22 +104,4 @@ const processLabel = toRef(() => {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spinner {
|
|
||||||
border: 3px solid #f3f3f3;
|
|
||||||
border-top: 3px solid #2563eb;
|
|
||||||
border-radius: 50%;
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
animation: spin 1s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes spin {
|
|
||||||
0% {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user