模仿知乎首页代码

闲来无事,就根据知乎的首页,参考了一些资料模拟写了下,包含了动态的背景,以及登录和注册功能

登录这里使用的是spring security

注册是ajax发送的

具体代码很简单,一看就知道,包含了数据的检查等

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="jquery/jquery.js"></script>
	<style>
		body{padding: 0;margin: 0;background: #F7FAFC;}
		a{text-decoration: none;}
		.index-box{width:300px;height: auto;margin:0 auto;margin-top: 40px;}		
		.logo{background:url(images/header/headerNew4.png) no-repeat;;width: 350px;height: 100px;margin:0 auto}
		.title{font-size: 18px;text-align: center;color: #707171;font-weight: bold;margin: 30px auto;}		
		.index-body{text-align: center;}
		.nav-sliders{position: relative;display: inline-block;margin-bottom: 20px;}
		.nav-sliders>a{font-size: 20px;display: inline-block;width:60px ;font-family: "微软雅黑";color: #999;cursor: pointer;float: left;$width}
		.nav-sliders>a.active{color: #0f88eb;}
		.nav-sliders>span{position: absolute;height: 2px;background:#0f88eb;display:block;left: 5px;width: 50px;bottom:-8px;}

    	.stage{position:absolute;left:0;top:0;width:100%;height:100%;background:#F7FAFC;}

		
		.login-box{width: 300px;}
		.wrap{border:1px solid #d5d5d5;border-radius: 5px;background: #fff;}
		.wrap>div{position: relative;overflow: hidden;}
		.wrap>div>input{width: 95%;border:none;padding:17px 2.5%;border-radius: 5px;}
		.wrap>div>label.error{position: absolute;color: #c33;top: 0;line-height: 50px;transform: translate(25px,0);transition: all 0.5s ease-out;-webkit-transform: translate(25px,0);-moz-transform: translate(25px,0);opacity: 0;visibility:hidden;cursor: text;}
		.wrap>div>label.move{transform: translate(0,0);transition: all 0.5s ease-out;-webkit-transform: translate(0,0);-moz-transform: translate(0,0);opacity: 1;visibility: visible;}
		.password{border-top: solid 1px #d5d5d5 ;}
		.code{right:115px ;}
		.name{right:5px ;}
		.loginName{right:5px ;}
		.loginPass{right:5px ;}
		.pass{right:5px ;}
		.passagain{right:5px ;}
		.button{height: 40px;background:#0f88eb;text-align: center;line-height: 40px;border-radius: 5px;margin-top: 25px;color: #fff;font-family: "微软雅黑";cursor: pointer;}
		.remember{text-align: left;margin-top: 20px;font-family: "微软雅黑";color: #666666;}
		.remember>a{float:right;cursor: pointer;color: #666666;}
		.other{text-align: left;margin-top: 20px;font-family: "微软雅黑";color: #666666;overflow: hidden;}
		.other>span{font-size: 14px;float: left;margin-top: 2px;cursor: pointer;}
		.other>div{float: left; transition: all 1s ease-in;-webkit-transition: all 0.3s ease-in;opacity: 0;transform: translateX(-20px);-webkit-transform: translateX(-18px);-moz-transform: translateX(-18px);visibility: hidden;}
		.other>div>a{margin-left: 20px;color: #666666;font-size: 15px;}
		.other>.hidden{ transition: all 1s ease-in;display: block;-webkit-transition: all 0.3s ease-in;opacity: 1;transform: translateX(0);-webkit-transform: translateX(0);-moz-transform: translateX(0);visibility: visible;}
		.download{border:solid 1px #0f88eb;height: 40px;line-height: 40px;border-radius: 5px;co
  • 5
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你好!要实现 Android 上的知乎模仿,你可以参考以下步骤: 1. 设计用户界面:参考知乎的界面风格,使用 Android Studio 创建相应的布局文件,并使用合适的控件和样式来构建界面。 2. 实现登录和注册功能:创建用户账户系统,包括用户注册和登录功能。你可以使用 Firebase 或者自己搭建后端服务器来处理用户认证和数据存储。 3. 创建问题和回答界面:允许用户创建问题和发布回答。你可以使用 RecyclerView 来展示问题列表,并使用适配器来填充数据。 4. 实现点赞和评论功能:允许用户对回答进行点赞或评论。你可以使用数据库(如 Firebase 实时数据库)来存储点赞和评论信息,并更新相应界面。 5. 添加搜索功能:为用户提供搜索功能,允许他们按关键词搜索问题或回答。你可以使用搜索框和过滤器来实现这个功能。 6. 设计个人主页:允许用户查看和编辑个人信息,包括用户头像、昵称、简介等。你可以使用图片加载库来显示用户头像,并使用表单来编辑个人信息。 7. 实现消息通知:为用户提供消息通知功能,包括收到的私信、回答被点赞等。你可以使用推送通知服务(如 Firebase Cloud Messaging)来实现这个功能。 8. 添加关注和粉丝功能:允许用户关注其他用户,并查看自己的粉丝列表。你可以使用数据库来存储关注关系和粉丝列表。 9. 实现个性化推荐:根据用户的兴趣和行为,为其推荐相关问题和回答。你可以使用机器学习算法来实现个性化推荐。 这只是一个概述,具体实现细节取决于你的需求和技术选择。希望对你有所帮助!如果有更多问题,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值