Git Product home page Git Product logo

button-ripple-effect's Introduction

button-ripple-effect

When the cursor is over the button, an effect will be applied on the button.

HEDEF: Imlecin buton üzerine gelmesiyle baloncuk efekti olusturulmasi hedeflenmektedir. ÖGRENME HEDEFI: Baloncugun baslama noktasi imlecin buton üzerine ilk girdigi nokta olmasi.

SUREC 1- a ve span elementleri kullanilarak bir buton olusturulur. 2- css ile görsel düzenlemeler yapilir. 3- Buton elementine baglanti saglanir.

  • addeventLidtener ile eylem atama.
  • eylem farenin üzerinden gecmesi ile baslar.
  • farenin butonun neresine geldiginin bulunmasi icin X ve Y noktalari tespit edilir.
  • Bunun icin de Butonun X ve Y boylamlarinda sayfanin nerede durdugu pageX ve pageY ile tespit edilir.
  • Buton üzerinde olusacak baloncuk ::before veya ::after ile olusturulu.
  • Olusturulan baloncugun merkezinin tespit edilen X ve Y noktalarinda baslayabilmesi icin CSS tarafinda Top ve Left bir degisken olarak tanimlanir.
  • Baloncugun merkezinin belirlenmesi ise; daha önce butonun durdugu noktadan - butonun Top ve Left kisimlar cikarili.
  • Böylece left:0 veya top:0 bulunur.
  • Bulunan degerler de CSSdeki degiskenlerin yerine atanir. Bu noktada setPropery kullanilir.

KABACA: Imlecin kabarcik cikarmasini istedigin noktayi matematik islemleriyle bul ve kabarcigin hover ile baslamasini istedigin Css özelligine ata.

Z-index özelligi her zaman position özellikleri ile birlikte kullanilir.!

setProperty style e.pageX e.pageY btn.offsetLeft btn.offsetTop

button-ripple-effect's People

Contributors

nsevindi87 avatar

Stargazers

 avatar

Watchers

 avatar

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.