summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorBigCoke233 <hi@guhub.cn>2020-04-03 20:59:00 +0800
committerBigCoke233 <hi@guhub.cn>2020-04-03 20:59:00 +0800
commit00dca7e1606eb14b9ccb387560a1980d43e730f9 (patch)
treef129a97554b316ae94f9b32e6fb92c8d5d4867d9 /includes
parente5b7bf6f957c5d3f8af2a3e7e95d351e1d76b380 (diff)
🔖 Perf: 优化页面的 ARIA
Diffstat (limited to 'includes')
-rw-r--r--includes/comments.php4
-rw-r--r--includes/header.php12
2 files changed, 8 insertions, 8 deletions
diff --git a/includes/comments.php b/includes/comments.php
index c873a04..1b5ace5 100644
--- a/includes/comments.php
+++ b/includes/comments.php
@@ -9,7 +9,7 @@
}
$commentLevelClass = $comments->_levels > 0 ? ' comment-child' : ' comment-parent'; //评论层数大于0为子级,否则是父级
?>
-<div id="<?php $comments->theId(); ?>" class="comment-body<?php
+<div role="comment" id="<?php $comments->theId(); ?>" class="comment-body<?php
if ($comments->_levels > 0) {
echo ' comment-child';
$comments->levelsAlt(' comment-level-odd', ' comment-level-even');
@@ -57,7 +57,7 @@ echo $commentClass;
<div class="comment-container">
<h3 class="comment-title" id="response"><?php $this->commentsNum(_t('暂无评论'), _t('已有 1 条评论'), _t('已有 %d 条评论')); ?></h3>
<?php $comments->listComments(array(
- 'before' => '<div class="comment-list">',
+ 'before' => '<div class="comment-list" role="list">',
'after' => '</div>',
'avatarSize' => 200,
'dateFormat' => 'Y-m-d H:i'
diff --git a/includes/header.php b/includes/header.php
index 2d2e9ba..6b910a1 100644
--- a/includes/header.php
+++ b/includes/header.php
@@ -37,7 +37,7 @@
<div class="mobile-menu ready">
<button class="mobile-menu-close ready" id="toggle-mobile-menu-close"><i class="iconfont icon-x"></i></button>
<h2 class="mobile-menu-title">页面导航</h2>
- <div class="mobile-menu-pagelist"><div class="container-fluid"><div class="row">
+ <div class="mobile-menu-pagelist" role="navigation"><div class="container-fluid"><div class="row">
<?php
if($this->options->customNav=='') {
$this->widget('Widget_Contents_Page_List')
@@ -54,7 +54,7 @@
<!-- -小屏幕导航 -->
<nav class="small-screen nav nav-mobile nav-fixed"<?php if($this->options->navStyle==1): ?> style="display:none!important"<?php endif; ?> id="navBarMobile">
- <div class="nav-mobile-content">
+ <div class="nav-mobile-content" role="navigation">
<a href="<?php $this->options->SiteUrl(); ?>" style="float:left"><i class="iconfont icon-xuanzhongshangcheng"></i></a>
<a id="search-open-mobile" style="float:left"><i class="iconfont icon-chaxun"></i></a>
<a id="login-open-mobile" style="float:left"><i class="iconfont icon-user"></i></a>
@@ -69,7 +69,7 @@
<!-- -大屏幕导航 -->
<nav class="large-screen nav nav-fixed" id="navBar">
<div class="container">
- <p class="nav-content">
+ <p class="nav-content" role="navigation">
<a href="<?php $this->options->SiteUrl(); ?>" class="nav-title"><?php $this->options->title(); ?></a>
<span class="nav-content-item">
<?php
@@ -124,11 +124,11 @@
<header>
<!-- Banner -->
<?php if($this->is('post') || $this->is('page')): ?>
- <div class="index-banner" style="background-position:center;<?php if($this->fields->banner && $this->fields->banner=!''): ?>background:url('<?php $this->fields->banner(); ?>') no-repeat;<?php else: ?>background-color:#f1f1f1;<?php endif; ?>height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;">
+ <div role="banner" class="index-banner" style="background-position:center;<?php if($this->fields->banner && $this->fields->banner=!''): ?>background:url('<?php $this->fields->banner(); ?>') no-repeat;<?php else: ?>background-color:#f1f1f1;<?php endif; ?>height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;">
<?php elseif($this->is('archive')): ?>
- <div class="index-banner" style="height:<?php $this->options->bannerHeight(); ?>vh;background-position:center;<?php if($this->options->bannerUrl!=''): echo $this->options->bannerUrl(); endif; ?>">
+ <div role="banner" class="index-banner" style="height:<?php $this->options->bannerHeight(); ?>vh;background-position:center;<?php if($this->options->bannerUrl!=''): echo $this->options->bannerUrl(); endif; ?>">
<?php else: ?>
- <div class="index-banner" style="background-position:center;background:url('<?php $this->options->bannerUrl(); ?>') no-repeat;height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;">
+ <div role="banner" class="index-banner" style="background-position:center;background:url('<?php $this->options->bannerUrl(); ?>') no-repeat;height:<?php $this->options->bannerHeight(); ?>vh;background-size:cover;">
<?php endif; ?>
<!-- 遮罩 -->
<div class="banner-mask"<?php if($this->is('post') || $this->is('page')):?><?php if($this->fields->banner==''):?> style="background:rgba(0,0,0,0)!important"<?php endif;?><?php endif; ?><?php if($this->is('index')):?><?php if($this->options->bannerUrl && $this->options->bannerUrl=!''): ?><?php else:?> style="background:rgba(0,0,0,0)!important"<?php endif;?><?php endif;?>>