GithubHelp home page GithubHelp logo

Drawer sliding animation about vuetensils HOT 4 CLOSED

lbineau avatar lbineau commented on June 9, 2024
Drawer sliding animation

from vuetensils.

Comments (4)

AustinGil avatar AustinGil commented on June 9, 2024

Yep. This is a small typo in the docs due to the nature of how the styles are added. The styles in the docs don't actually effect the demos. I have to maintain those as a separate stylesheet. As a result, I have to maintain the same styles in both places. I got it right in the stylesheet here, but not in the docs.

Vue transitions changed how they handle class naming a while back. To fix your issue, replace .slide-right-enter with .slide-right-enter-from.

Thanks for catching this. I want these demos to be easy, copy/paste options. I'll fix it right now.

from vuetensils.

AustinGil avatar AustinGil commented on June 9, 2024

Actually, there was also a problem introduced with Vue's transition changes that makes coordinating transitions kind of weird and makes your desired effect kind of weird. It works, but I want to find a better solution. Here's what will get you where you want to be

<template>
  <VDrawer
    bg-transition="slide-right"
    :classes="{ bg: 'bg-black-alpha', content: 'bg-white' }"
  >
    <template #toggle="{ bind, on }">
      <button v-bind="bind" v-on="on">
        Toggle Drawer
      </button>
    </template>

    My drawer content
  </VDrawer>
</template>


<script>
import { VDrawer } from 'vuetensils/src/components';
export default {
  name: "App",
  components: {
    VDrawer,
  },
};
</script>

<style>
.vts-drawer__content {
  padding: 20px;
  color: #FFF;
  background: #222;
}

.slide-right-enter-active,
.slide-right-leave-active {
  transition: transform 0.5s ease;
}

.slide-right-enter-from,
.slide-right-leave-to {
  transform: translateX(-100%);
}

</style>

from vuetensils.

lbineau avatar lbineau commented on June 9, 2024

Thank you for the fast answer, it seems to work!
I've updated the demo: https://codesandbox.io/s/crimson-lake-16dhk3?file=/src/App.vue

I just wonder how we can make it work with a fading black background in combination under the sliding panel, I'm not sure to understand it from the documentation.
It works for slideIn but not slideOut https://codesandbox.io/s/hungry-sinoussi-hd5bny?file=/src/App.vue

from vuetensils.

AustinGil avatar AustinGil commented on June 9, 2024

Yeah, that's exactly the issue I ran into when Vue changed how things worked. The example I have you slides the whole component in. To have a fading background, you'd have to only slide in the panel.

The component right now uses two transitions, one nested in the other. I think that may be the problem. If I switch it to one transition, it would make things possible with a slightly more complicated transition CSS, but definitely doable. But that would also introduce a breaking change :/

If you want to try cloning the component into your project and playing around with it to make it work then submitting a PR, I'd really appreciate it :)

from vuetensils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.