Tips for creating a mobile-friendly 3D carousel

My current challenge involves making a 3D carousel responsive on mobile devices. I attempted to use the img-fluid class with Bootstrap, but encountered issues that affected my web view.

Below is the CSS code within HTML:

var angle = 0; 
    function galleryspin(sign) { 
    spinner = document.querySelector("#spinner");
    if (!sign) { angle = angle + 45; } else { angle = angle - 45; }
    spinner.setAttribute("style","-webkit-transform: rotateY("+ angle+"deg); -moz-transform:rotateY("+    angle +"deg); transform: rotateY("+ angle+"deg);");
    }
div#carousel { 
    perspective: 1200px; 
    background: black; 
    padding-top: 10%; 
    font-size:0; 
    margin-bottom: 3rem; 
    overflow: hidden; 
}
figure#spinner { 
    transform-style: preserve-3d; 
    height: 300px; 
    ... (CSS code continues)
<body>
  <base href="https://picsum.photos/200/300">
  <div id="carousel">
  ... (HTML code continues)
</body>

I came across information online suggesting that adding specific code could make a website mobile-responsive. Do you think this approach alone is sufficient, or would it be better to incorporate Bootstrap for responsiveness?

Answer №1

Is this what you are referring to?: example

<!DOCTYPE html>
<html>
<head>
<style> 
div {
  width: 100px;
  height: 100px;
  background-color: red;
  animation-name: example;
  animation-duration: 4s;
}

@keyframes example {
  from {transform: rotateY(0deg)}
    to {transform: rotateY(360deg)}
}
</style>
</head>
<body>

<h1>CSS Animation</h1>

<div></div>


</body>
</html>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Troubleshooting Problems with Node.js and MongoDB Integration during the .save() Process

Welcome to my sample website, powered by a basic Node.js server. I have managed to set up user creation and posting functionalities successfully. However, there seems to be an issue with saving user data to the database as the saved user object cannot be l ...

What is the best way to incorporate background colors into menu items?

<div class="container"> <div class="row"> <div class="col-lg-3 col-md-3 col-sm-12 fl logo"> <a href="#"><img src="images/main-logo.png" alt="logo" /> </a> ...

Error: The server is unable to process the POST request to /api

Currently following a tutorial on YouTube: https://www.youtube.com/watch?v=4ECVE6TXKLQ&list=PLI-gk4ISRzCPlJjCz3yuAhL8vnmK6KWr7&index=11 After setting up a server listening on port 8080 and connecting to MongoDB Atlas successfully, the next step ...

Is the Node.js debugger programmed to issue SIGINT/SIGTERM signals upon exiting via Ctrl-C?

During my testing process, I've encountered a situation where a server that I started doesn't close properly when exiting the Node.js debugger. This issue seems to be preventing the debugger from stopping listening on port 5858. debug> (To e ...

What is preventing me from accessing the hidden article using the URL with the hashname?

I've been searching for a solution, but so far nothing seems to work for me. I have a page with header and content sections. The content section is currently not visible. When I click on an item in the navigation menu, I want to hide the header and di ...

The process of ensuring an element is ready for interaction in Selenium with Javascript

I am currently working on creating an automated test for a Single Page Application built with VueJs. When I click on the registration button, a form is loaded onto the page with various elements. However, since the elements are loaded dynamically, they are ...

Unexpected Website Homepage (Vue / Javascript)

I am looking to display a different .vue file each time a visitor refreshes the Home page. Currently, I only have one page called Home.vue. I am attempting to randomly load either Home1.vue or Home2.vue with each refresh. { path: '/', name: ...

Step-by-step guide on making a duplicate of a Search bar

I have a search field in my application that I want to duplicate. The goal is to create two identical search fields, one on the left side of the page and another on the right side. How can I achieve this using JavaScript? Here is my JavaScript code: doc ...

What is preventing setAttribute from successfully setting the class for the li element?

Currently, I am diving into the world of DOM Manipulation. I have successfully created a new li element, but unfortunately, the fontSize styling is not being applied to it as expected. const title = document.querySelector("#main-heading"); title.styl ...

Switch out the smaller thumbnail image with a more enlarged image

Im pretty new to web programming and im working on a site now. In one part of this site, I have collections of 3 pictures. 1 larger one and two smaller thumbnails below it. The goal is to create a way in which i can click on one of the thumbnails and the ...

Modify the filtered class of ng-repeat using the $index value from the controller

Here is my ng-repeat code: <div class="{{event.who_seen_it | newEvent}}" ng-repeat="event in eventList" ng-click="openEvet(event.title,$index)"> <h3 class="event-title">{{event.title}}</h3> </div> I am using the {{event.who_se ...

What is causing the image to move to the following line?

(https://i.stack.imgur.com/5oi7s.png) The image appears to be shifting to the next line inexplicably. I have experimented with various methods to address this issue, including utilizing the built-in Image component which seemed to show improvement. However ...

The conditional comment designed for browsers other than Internet Explorer may not work properly on outdated versions of

I find myself in a predicament where I must dynamically load one of two stylesheets depending on the browser accessing the page: If any browser other than IE, then load the "new" stylesheet If IE is version 9 or higher, then load the "new" stylesheet ...

Is there a way to incorporate multiple plan tiers on Stripe's platform?

//api/stripe import { auth, currentUser } from "@clerk/nextjs/server"; import { NextResponse } from "next/server"; import { prismadb } from "@/lib/prismadb"; import { stripe } from "@/lib/stripe"; import { absoluteUr ...

Changed the form to become scrollable once it reaches a designated section during scrolling

Seeking assistance! I am currently working on a website using Bootstrap 5, and I have a registration form within the banner section, specifically within a row > col-md-5. The position of the form is fixed, but I want to make it scrollable once it reache ...

How to modify this to return a function and eliminate the need for declaring a function

Greetings! I understand that this may seem simple to some of you, but I am feeling quite lost. I've been tasked with removing the function declaration and converting it into a return function. Any assistance would be greatly appreciated. const canView ...

Achieving Automatic Scrolling of Drawer in Material UI React JS

Looking for assistance, can anyone lend a hand with this code snippet I've been working on? See it here: https://codesandbox.io/s/5xoj9zw56l I referenced this code as part of my project development: https://codesandbox.io/s/6jr75xj8y3 ...

Is it possible to transition to React without having a comprehensive understanding of JavaScript?

After building a foundation in JS, I am eager to delve into learning more about es6 and beyond. Would it be advisable for me to begin exploring React or Vue at this point? Since graduating recently, I have noticed that many companies value candidates who ...

Using PHP to make an Ajax call that takes users to an action page when they submit a form

I'm struggling with an ajax call in my PHP code that keeps navigating to the action page instead of staying on the same page and only updating a specific part. Can anyone point out what I might be doing wrong here? <form method="post" id="holderSa ...

JavaScript: Implementing lodash/fp flow to retrieve a collection of objects

Currently, I am in the process of transitioning a series of functions from _.chain to _fp.flow. However, I am encountering some challenges when dealing with currying complex objects within the flow. My goal is to: Transform an array of objects using grou ...