VR 导航菜单效果
代码语言:html
所属分类:菜单导航
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> VR Navigation</title> <style> @import url("https://fonts.googleapis.com/css?family=Poppins:500,600&display=swap"); * { box-sizing: border-box; padding: 0; margin: 0; } body { font-family: "Poppins", sans-serif; background: linear-gradient(tobottom, hsl(250, 14%, 9%), hsl(250, 20%, 15%)); /* center the nav in the viewport */ min-height: 100vh; display: flex; justify-content: center; align-items: center; overflow: hidden; /* set a perspective for the nested nav */ perspective: 500px; } /* display the anchor links in three columns of equal width */ nav { display: grid; grid-template-columns: repeat(3, 100px); grid-column-gap: 4rem; padding: 2rem 3rem; justify-items: center; align-items: center; background: hsl(250, 16%, 26%); box-shadow: 0 0 15px hsla(250, 16%, 5%, 0.3); border-radius: 30px; color: hsl(250, 16%, 90%); /* translate the nav element backwards to offset the translation of the anchor links (otherwise the text would be fuzzy) */ transform: translateZ(-70px); transform-origin: 50% 100%; /* transition for the transform property the navigation is moved around the viewport with 3d transform */ transition-property: transform; transition-duration: 1.25s; transition-timing-function: cubic-bezier(0.175, 0.885.........完整代码请登录后点击上方下载按钮下载查看
网友评论0