css-transforms

CSS3: transform property not working as expected in chrome

怎甘沉沦 提交于 2019-11-28 02:12:52
I am trying to achieve the below thing ..And its working pretty well in firefox but the same css working in chrome is somewhat like this shown below I think -webkit-transform-origin: 50% 100%; doesnt work in chrome or its working but not as expected Demo Jsfiddle #flyDiv { width:720px; height:420px; transform-origin: 50% 100%; perspective: 300; transform: perspective(300px) rotateX(15deg); -webkit-transform: perspective(300px) rotateX(15deg); } Probably I have found an error ..This is hardware issue I have checked in many computers and found that pc in which their are graphic cards present

CSS 3d transform doesn't work if perspective is set in the end of property

左心房为你撑大大i 提交于 2019-11-28 02:07:02
I found transform property depends on perspective() position why is this happening? any other rules/limitations for transform ? though it feels strange to me, this not seems to be a bug as I am able to reproduce this in Chrome/FF box:nth-child(1):hover { transform: perspective(1000px) translate3d(0, 0, -100px); } box:nth-child(2):hover { transform: translate3d(0, 0, 100px) perspective(1000px); } box { padding: 20px; display: inline-flex; align-items: center; justify-content: center; font-family: monospace; transition: transform .4s; background: rgba(255, 0, 0, 0.3); margin: 20px; font-size:

Add a transform value to the current transforms that are already on the element?

妖精的绣舞 提交于 2019-11-28 02:04:30
Let's say I have a div that had translateX and translateY values added dynamically. <div class="object child0" style="-webkit-transform: translateX(873.5px) translateY(256px); width: 50px; height: 50px;"> I want to add rotateY(20deg) to the current transforms, but applying it via element.style.webkitTransform = "rotateX(20deg)" loses the other values. Is there a way to add the rotateY without losing the translateX and translateY transforms? You could use the += operator to append the rotateX(20deg) to the already existing transformation. el.style.webkitTransform += "rotateX(20deg)"; Note: I

Transforms are added…endlessly

…衆ロ難τιáo~ 提交于 2019-11-28 01:33:20
I'm creating a simple asteroids-like game in CSS and JS using the DOM over canvas for...experimentation purposes. My code is pretty small in this example to make it easy to see what's going on below. The ultimate goal: Let arrow keys smoothly rotate and translate the spaceship around the window without creating an infinite amount of transforms. I think I'm 90% there : Use the arrow keys to control the snippet below. 'use strict'; function defineDistances() { var distance = {}; distance.up = -1; distance.right = 1; distance.down = 1; distance.left = -1; return distance; } function defineKeys()

What is the math behind -webkit-perspective?

自闭症网瘾萝莉.ら 提交于 2019-11-28 01:21:11
问题 "Simple" question that I can't find the answer to -- What does -webkit-perspective actually do mathematically? (I know the effect it has, it basically acts like a focal-length control) e.g. what does -webkit-perspective: 500 mean?!? I need to find the on-screen location of something that's been moved using, among other things, -webkit-perspective 回答1: The CSS 3D Transforms Module working draft gives the following explanation: perspective(<number>) specifies a perspective projection matrix.

How to recreate perspective-origin effect by transforming child elements?

☆樱花仙子☆ 提交于 2019-11-28 00:19:23
So after struggeling with IE glitches and incompatibilities , I've finally got my correctly sized cuboid working ( update: here's an example of it). Animating requires to animate all sides separately instead of a single parent element, however this seems to be the only way to get it working in IE. Using a single cuboid works fine, multiple cuboids however are problematic, since perspective is applied to the single transformed elements (which is necessary in order to work in IE) they do all look the same, regardless of their position on the stage: http://jsfiddle.net/YsPmm/ If perspective would

Is it possible to style a div to be trapezoidal?

孤人 提交于 2019-11-27 23:41:24
I know it's possible to skew but I don't see a way to skew each corner with a particular degree. Here's the project I'm working on: http://map.ucf.edu/ Looking specifically at the tabs within the menu. Right now I'm using images, I would like to change that for capable browsers. I know it's possible to create a CSS trapazoid , but that is using borders without content. The end result also needs a bit of rounded corners. edit: Starting with Zoltan Toth's solution I was able to achieve this: demo div { height: 20px; padding:2px 5px 0 5px; color:white; background: rgba(0,0,0,.5); margin: 0 10px;

Chrome : Text blurry when skew back : skew(-10deg) -> skew(10deg)

和自甴很熟 提交于 2019-11-27 23:41:12
问题 I just want to skew the parent and skew it back on the child. Example : HTML <div class="parent"> <!-- skew(-10deg) --> <div class="child">Hello</div> <!-- skew(10deg) (skew back) --> </div> Example : CSS .parent { transform: skew(-10deg); } .child { transform: skew(10deg); } Text inside seems ok with Firefox, Safari. But not Chrome and Opera its a bit blurry I have to use -webkit-backface-visibility: hidden; for reduce box pixelated in Chrome Firefox : Chrome : Firefox vs Chrome : or zoomed

CSS slider with arrows using animation

北慕城南 提交于 2019-11-27 22:25:27
问题 I am trying to achieve a CSS only slider. When hover ing left and right arrows, the slider has to slide . Of course. I tried something using animation-play-state , animation-fill-mode (to keep the positions) and animation-direction but I'm not able to fully make it work. Starting with animation-play-state: paused , hover ing the arrows changes it to running . On hover of the right arrow, everything is fine. We can hover, leave, hover again. But, as soon as I hover the left arrow (that changes

Keep box-shadow direction consistent while rotating

本秂侑毒 提交于 2019-11-27 22:01:35
When giving e.g. a <div> a box-shadow as well as rotating it will cause a rotation of the box-shadow direction - which is problematic when the box-shadow should create an illusion of lighting. Example: https://jsfiddle.net/5h7z4swk/ div { width: 50px; height: 50px; margin: 20px; box-shadow: 10px 10px 10px #000; display: inline-block; } #box1 { background-color: #b00; } #box2 { background-color: #0b0; transform: rotate(30deg); } #box3 { background-color: #00b; transform: rotate(60deg); } #box4 { background-color: #b0b; transform: rotate(90deg); } @keyframes spin { from { transform: rotate(0deg)