html5如何创造像templatemonster一样的效果?
我对html5一无所知,我需要制作一个具有HTML效果的网站(根本没有flash) 任何人都知道是否有可用的html5源代码可以共享html5如何创造像templatemonster一样的效果?,html,Html,我对html5一无所知,我需要制作一个具有HTML效果的网站(根本没有flash) 任何人都知道是否有可用的html5源代码可以共享 非常感谢。使用CSS 3D转换、CSS转换和一点JavaScript是可行的。当然,浏览器支持可能会受到限制 下面是一个10分钟内完成的示例(仅限Webkit!) 有趣的是: 变换:透视图 #box { // perspective() changes the "depth"; // rotateY() - rotation; // a
非常感谢。使用CSS 3D转换、CSS转换和一点JavaScript是可行的。当然,浏览器支持可能会受到限制 下面是一个10分钟内完成的示例(仅限Webkit!) 有趣的是: 变换:透视图
#box {
// perspective() changes the "depth";
// rotateY() - rotation;
// and translateZ() makes the whole area react to mouse pointer;
-webkit-transform: perspective( 800px ) rotateY( 45deg ) translateZ(100px);
}
了解更多信息:
变换使红色方块随动画出现/消失
.grid .row > div span {
position:absolute;
bottom:20px;
height:0;
overflow:hidden;
// define which properties should animate (height: and bottom: )
// and how fast the animation should be (200ms);
-webkit-transition: height 200ms ease-in, bottom 200ms;
}
.grid .row > div:hover span {
height:100%;
bottom:0;
}
了解更多信息:
JavaScript在光标向左/向右移动时更改透视图
var box = document.getElementById('box');
var move = function(e){
var s = "perspective( 500px ) rotateY( deg ) translateZ(100px)";
// this calculation is a random guess, just to make it work. should be something more carefully crafted;
s = s.replace( 'deg', ((e.clientX-200) / 400) * 45 + 'deg' );
box.style.webkitTransform = s;
}
document.body.addEventListener( 'mousemove', move, true );
要使其在Firefox和现代IE中工作,应该添加CSS和JavaScript代码。tbh,您必须非常擅长html5/canvas/js才能实现这样的效果……它似乎是Flash。无论如何如果不想使用Flash,您必须熟悉HTML5中的画布绘制。也许这是一个起点。搜索“HTML5 3d画布”,你可能会找到你想要的东西