GithubHelp home page GithubHelp logo

marcinskic / image-slider-odin Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 8 KB

Simple image slider made with vanilla js

HTML 35.75% JavaScript 51.14% CSS 13.12%
css html javascript theodinproject

image-slider-odin's Introduction

Image slider

Simple image slider made with vanilla js

Possible solutions

1. Stacked images controlled by classes

  • All images are -200px / 200px to right and one is at 0px.
  • No need to manipulate DOM, images always at the same positions
  • Position of images recognized by 'left', 'shown' and 'right' classes
  • Difficult operation that can lag when reaching edges

2. Stacked images controlled by DOM placement

  • Similarly like above but displayed image is always middle one in DOM
  • When moving slider edge image must move to beginning or end of container
  • Removes edge problem

3. Gradually moving hidden images

  • Hidden images are literally hidden with CSS and they smoothly transition from -200px through 0 to 200px
  • Or images are really further (200px, 400px, 600px) but after halfway they swap (from 600px to -600px): it should fix images overlapping when fast sliding
  • When image is in one of 3 edge states it should be visible (-200 px, currentIndex, 200px) so that animation works correctly
  • All images must be updated on every slide
  • There shouldn't be any difference on which image is clicked

odin-head

Used technologies

JS CSS HTML

image-slider-odin's People

Contributors

marcinskic avatar

Watchers

 avatar  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.