Skip to content

Commit

Permalink
[#] 主题优化
Browse files Browse the repository at this point in the history
  • Loading branch information
WangNingkai committed Dec 25, 2020
1 parent 723faac commit 6639b20
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ _ide_helper.php
_ide_helper_models.php
.phpstorm.meta.php
/resources/vue/node_modules
/storage/laravels.conf
/storage/laravels.pid
/storage/laravels-custom-processes.pid
14 changes: 7 additions & 7 deletions resources/views/mdui/layouts/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
integrity="sha384-cLRrMq39HOZdvE0j6yBojO4+1PrHfB7a9l5qLcmRm/fiWXYY+CndJPmyu5FV/9Tw"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="https://cdn.staticfile.org/github-markdown-css/4.0.0/github-markdown.min.css">
<link rel="stylesheet" href="{{ asset('css/mdui.css') }}">
@stack('stylesheet')
{!! setting('stats_code') !!}
Expand Down Expand Up @@ -45,7 +46,7 @@
@yield('content')
<a
id="scrolltop"
class="mdui-fab mdui-fab-fixed mdui-ripple mdui-color-theme-accent mdui-fab-hide"
class="mdui-fab mdui-fab-fixed mdui-ripple mdui-color-theme-accent "
onclick="toTop()"
><i class="mdui-icon material-icons">keyboard_arrow_up</i></a
>
Expand All @@ -62,14 +63,13 @@ class="mdui-fab mdui-fab-fixed mdui-ripple mdui-color-theme-accent mdui-fab-hide
document.querySelector('#top').scrollIntoView({ behavior: 'smooth', block: 'start' })
}
window.addEventListener('scroll', () => {
console.log('scroll')
if (!(document.body.scrollTop > 100 || document.documentElement.scrollTop > 100)) {
if ($('#scrolltop').hasClass('mdui-fab-hide')) {
$(this).removeClass('mdui-fab-hide')
if ((document.body.scrollTop > 100 || document.documentElement.scrollTop > 100)) {
if ($("#scrolltop").hasClass('mdui-fab-hide')) {
$("#scrolltop").removeClass('mdui-fab-hide')
}
} else {
if (!$('#scrolltop').hasClass('mdui-fab-hide')) {
$(this).addClass('mdui-fab-hide')
if (!$("#scrolltop").hasClass('mdui-fab-hide')) {
$("#scrolltop").addClass('mdui-fab-hide')
}
}
})
Expand Down
16 changes: 14 additions & 2 deletions resources/views/mdui/one.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@extends('mdui.layouts.main')
@section('title', setting('site_name','OLAINDEX'))
@section('content')
<div class="mdui-container mdui-m-t-5">
<div class="mdui-container mdui-m-y-5">
<div class="breadcrumb mdui-p-x-2">
<div class="mdui-chip" mdui-menu="{target: '#choose_user', subMenuTrigger: 'hover'}"
mdui-tooltip="{content: '切换账号'}">
Expand Down Expand Up @@ -152,9 +152,21 @@ class="list-item mdui-list-item mdui-ripple"
</li>
@endif
</ul>
{{ $list->appends(['sortBy'=> request()->get('sortBy'),'keywords' => request()->get('keywords')])->links('mdui.components.page') }}
</div>
</div>

<div class="mdui-card">
<div class="mdui-card-header">
<div class="mdui-chip">
<span class="mdui-chip-icon"> <i class="mdui-icon material-icons">lightbulb_outline</i></span>
<span class="mdui-chip-title">README</span>
</div>
</div>
<div class="mdui-card-content markdown-body">
{!! marked($doc['readme']) !!}
</div>
</div>
{{ $list->appends(['sortBy'=> request()->get('sortBy'),'keywords' => request()->get('keywords')])->links('mdui.components.page') }}
</div>
@stop
@push('scripts')
Expand Down

0 comments on commit 6639b20

Please sign in to comment.