Skip to content

Commit

Permalink
drop down
Browse files Browse the repository at this point in the history
  • Loading branch information
goldentoaste committed May 21, 2023
1 parent 6ac8c6d commit c91f04d
Showing 1 changed file with 21 additions and 58 deletions.
79 changes: 21 additions & 58 deletions web_service/src/lib/ContentDrop.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,13 @@
let show = false;
</script>

{#if show}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="shadow"
on:click={() => (show = false)}
transition:fade={{ duration: 200 }}
/>

<div class="displayRoot" transition:fly={{duration:200, y:-35 }}>
<div class="dropRoot">
<img
alt="checkmark"
src={`icons/${
!isYes ? "check.svg" : "cross.svg"
}`}
/>

<p>
{#if isYes}
{yes}
{:else}
{no}
{/if}
</p>
</div>
<p>
{content}
</p>
</div>

<!-- svelte-ignore a11y-click-events-have-key-events -->
{/if}

<!-- svelte-ignore a11y-click-events-have-key-events -->
<div class="dropRoot" on:click={() => (show = true)}>
<div class="dropRoot" on:click={() => (show = !show)}>
<img
alt="checkmark"
src={`https://watchdog-iota.vercel.app/icons/${
src={`icons/${
!isYes ? "check.svg" : "cross.svg"
}`}
/>
Expand All @@ -59,52 +28,44 @@
{/if}
</p>

<div class="arrow">
<div class="arrow" class:down={show}>
<div class="line1" />
<div class="line2" />
</div>

</div>

{#if show}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div class="displayRoot" transition:fly={{duration:200, y:-35 }}>
<p>
{content}
</p>
</div>
{/if}

<style>
.displayRoot {
position: fixed;
background-color: #fafafa;
top: 50%;
left: 50%;
width: calc(100vw - 2rem);
width: auto;
height: auto;
max-height: 500px;
z-index: 10;
transform: translate(-50%, -50%);
}
.displayRoot > .dropRoot > p{
font-size: larger;
.down{
transform: rotate(45deg) !important;;
}
.displayRoot > p {
margin: 1rem;
font-size: larger!important;
}
.shadow {
position: fixed;
top: 0;
left: 0;
background-color: black;
opacity: 0.4;
width: 100%;
height: 100%;
z-index: 5;
}
.dropRoot {
display: flex;
Expand Down Expand Up @@ -141,10 +102,12 @@
width: 0.5rem;
height: 0.5rem;
transform: rotate(45deg);
transform: rotate(135deg);
margin-left: auto;
margin-right: 0.5rem;
transition:transform 0.3s ease-out;
}
.line1 {
Expand Down

1 comment on commit c91f04d

@vercel
Copy link

@vercel vercel bot commented on c91f04d May 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

watchdog – ./

watchdog-dfriend01.vercel.app
watchdog-iota.vercel.app
watchdog-git-main-dfriend01.vercel.app

Please sign in to comment.