mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 13:36:25 -08:00
chicken chicken chicken chicken
This commit is contained in:
parent
b20f04f3fd
commit
55e10f5408
|
@ -54,12 +54,28 @@
|
||||||
flex-grow:1;
|
flex-grow:1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type=text],input[type=password] {
|
||||||
|
border:none;
|
||||||
|
border-radius:0;
|
||||||
|
width:100%;
|
||||||
|
padding:5px;
|
||||||
|
background-color:#333333;
|
||||||
|
color:#dddddd;
|
||||||
|
outline:none;
|
||||||
|
|
||||||
|
@media screen and (max-width: 500px) {
|
||||||
|
font-size:16px;
|
||||||
|
padding:10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.lgBtnContainer {
|
.lgBtnContainer {
|
||||||
display:flex;
|
display:flex;
|
||||||
position:relative;
|
position:relative;
|
||||||
left:20px;
|
left:20px;
|
||||||
width:calc( 100% - 40px );
|
width:calc( 100% - 40px );
|
||||||
gap:10px;
|
gap:10px;
|
||||||
|
overflow:clip;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fields {
|
.fields {
|
||||||
|
@ -69,16 +85,7 @@
|
||||||
left:20px;
|
left:20px;
|
||||||
width:calc( 100% - 40px );
|
width:calc( 100% - 40px );
|
||||||
gap:5px;
|
gap:5px;
|
||||||
|
overflow:clip;
|
||||||
input {
|
|
||||||
border:none;
|
|
||||||
border-radius:0;
|
|
||||||
width:100%;
|
|
||||||
padding:5px;
|
|
||||||
background-color:#333333;
|
|
||||||
color:#dddddd;
|
|
||||||
outline:none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { _void } from "./transition/_void.js";
|
import { _void } from "./transition/_void.js";
|
||||||
|
import { padding_scaleY } from "./transition/padding_scaleY.js"
|
||||||
import { fade } from "svelte/transition";
|
import { fade } from "svelte/transition";
|
||||||
import { circIn, circOut } from "svelte/easing";
|
import { circIn, circOut } from "svelte/easing";
|
||||||
|
|
||||||
|
@ -109,23 +110,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// animation
|
// animation
|
||||||
|
|
||||||
function padding_scaleY(node, { duration, easingFunc, padY, padX, op }) {
|
|
||||||
let rect = node.getBoundingClientRect()
|
|
||||||
|
|
||||||
return {
|
|
||||||
duration: duration||300,
|
|
||||||
css: t => {
|
|
||||||
let eased = (easingFunc || circOut)(t)
|
|
||||||
|
|
||||||
return `
|
|
||||||
height: ${eased*(rect.height-(padY||0))}px;
|
|
||||||
${padX&&padY ? `padding: ${(eased)*(padY)}px ${(padX)}px;` : ""}
|
|
||||||
${op ? `opacity: ${eased};` : ""}
|
|
||||||
`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function fileTransition(node) {
|
function fileTransition(node) {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import Pulldown from "./Pulldown.svelte"
|
import Pulldown from "./Pulldown.svelte"
|
||||||
import { _void } from "../transition/_void"
|
import { padding_scaleY } from "../transition/padding_scaleY"
|
||||||
|
import { circIn,circOut } from "svelte/easing"
|
||||||
|
|
||||||
let targetAction
|
let targetAction
|
||||||
</script>
|
</script>
|
||||||
|
@ -13,15 +14,15 @@
|
||||||
|
|
||||||
{#if targetAction}
|
{#if targetAction}
|
||||||
|
|
||||||
<div class="fields" transition:_void|local>
|
<div class="fields" out:padding_scaleY|local={{easingFunc:circIn}} in:padding_scaleY|local>
|
||||||
<input placeholder="username">
|
<input placeholder="username" type="text">
|
||||||
<input placeholder="password" type="password">
|
<input placeholder="password" type="password">
|
||||||
<button>{targetAction=="login" ? "Log in" : "Create account"}</button>
|
<button>{targetAction=="login" ? "Log in" : "Create account"}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{:else}
|
{:else}
|
||||||
|
|
||||||
<div class="lgBtnContainer" transition:_void|local>
|
<div class="lgBtnContainer" out:padding_scaleY|local={{easingFunc:circIn}} in:padding_scaleY|local>
|
||||||
<button on:click={() => targetAction="login"}>Log in</button>
|
<button on:click={() => targetAction="login"}>Log in</button>
|
||||||
<button on:click={() => targetAction="create"}>Sign up</button>
|
<button on:click={() => targetAction="create"}>Sign up</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
18
src/svelte/elem/transition/padding_scaleY.js
Normal file
18
src/svelte/elem/transition/padding_scaleY.js
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import { circIn, circOut } from "svelte/easing"
|
||||||
|
|
||||||
|
export function padding_scaleY(node, { duration, easingFunc, padY, padX, op }) {
|
||||||
|
let rect = node.getBoundingClientRect()
|
||||||
|
|
||||||
|
return {
|
||||||
|
duration: duration||300,
|
||||||
|
css: t => {
|
||||||
|
let eased = (easingFunc || circOut)(t)
|
||||||
|
|
||||||
|
return `
|
||||||
|
height: ${eased*(rect.height-(padY||0))}px;
|
||||||
|
${padX&&padY ? `padding: ${(eased)*(padY)}px ${(padX)}px;` : ""}
|
||||||
|
${op ? `opacity: ${eased};` : ""}
|
||||||
|
`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue