CodingSouls团队项目冲刺-个人概况(3)
团队冲刺第三天:
制作导航栏
完成页面的整体框架:
<!DOCTYPE html>
<html lang="zh-CN" style="position: fixed; width: 100%; overflow: hidden; ">
<head>
<meta charset="utf-8">
</head>
<body style="position: relative; margin-top: 49px; height: calc(100% - 49px); overflow-y: overlay; ">
<div class="ui fixed borderless menu" style="position: fixed; height: 49px; ">
<div class="ui container">
<a class="header item" href="/"><img src="<%= stdoj.config.logo.url %>" style="width: <%= width %>; height: <%= height %>; "></a>
<a class="header item" href="/"><span style="font-family: 'Exo 2'; font-size: 1.5em; font-weight: 600; "><%= stdoj.config.title %></span></a>
<a class="item<% if (active === '') { %> active<% } %>" href="/"><i class="home icon"></i> 首页</a>
<a class="item<% if (active.startsWith('problem')) { %> active<% } %>" href="/problems"><i class="list icon"></i> 题库</a>
<a class="item<% if (active.startsWith('discussion') || active.startsWith('article')) { %> active<% } %>" href="/discussion/global"><i class="comments icon"></i> 讨论</a>
<a class="item<% if (active.startsWith('ranklist')) { %> active<% } %>" href="/ranklist"><i class="signal icon"></i> 排名</a>
<a class="item<% if (active.startsWith('help')) { %> active<% } %>" href="/help"><i class="help circle icon"></i> 帮助</a>
<% if (typeof contest !== 'undefined' && contest && contest.id) { %>
<a id="back_to_contest" class="item" href="<%= stdoj.utils.makeUrl(['contest', contest.id]) %>"><i class="arrow left icon"></i> 返回比赛</a>
<% } %>
<div class="right menu">
<% if (user) { %>
<a href="<%= stdoj.utils.makeUrl(['user', user.id]) %>" style="color: inherit; ">
<div class="ui simple dropdown item">
<%= user.username %><% if (user.nameplate) { %><%- user.nameplate %><% } %> <i class="dropdown icon"></i>
<div class="menu">
<a class="item" href="<%= stdoj.utils.makeUrl(['user', user.id, 'edit']) %>"><i class="edit icon"></i>修改资料</a>
<% if (user.is_admin) { %>
<% } %>
<a class="item" href-post="<%= stdoj.utils.makeUrl(['logout'], { url: req.originalUrl }) %>"><i class="power icon"></i>注销</a>
</div>
</div>
</a>
<% } else { %>
<div class="item">
<a class="ui button" style="margin-right: 0.5em; " href="<%= syzoj.utils.makeUrl(['login'], { url: req.query['url'] || req.originalUrl }) %>">
登录
</a>
<a class="ui primary button" href="<%= stdoj.utils.makeUrl(['sign_up'], { url: req.query['url'] || req.originalUrl }) %>">
注册
</a>
</div>
<% } %>
</div>
</div>
</div>
<div style="margin-top: 28px; ">
<div class="ui main container">
未完待续。。。