Skip to content

Commit

Permalink
disable scroll and improve UI
Browse files Browse the repository at this point in the history
  • Loading branch information
davidxuan committed Mar 2, 2019
1 parent 2a7a5c6 commit aecbeae
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 71 deletions.
13 changes: 12 additions & 1 deletion assets/mindmap/content/main.01f2ceab.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/mindmap/initial_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var max_scale = 5;
var translate_x = 0;
var translate_y = 0;

//html = '<svg class="mindmap-svg" viewBox="-356.80451500765685 -486.5010822596126 637.1347523470067 551.1287262462758" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: white;">';
//html = '<svg class="mindmap-svg" viewBox="-356.8045150076568 -486.5010822596126 637.1347523470067 551.1287262462758" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: white;">';

html = '<g id="mindmap-subnodes"></g><g></g><g>';

Expand Down
81 changes: 12 additions & 69 deletions page-map.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
into the {body} of the default.hbs template --}}

<!DOCTYPE html>
<!-- saved from url=(0047)https://dotamania.herokuapp.com/scrape/dk4qmwuz -->
<html lang="en" class="gr__dotamania_herokuapp_com">

<header class="site-header outer">
<div class="inner">
Expand All @@ -27,75 +25,13 @@ into the {body} of the default.hbs template --}}
{{#post}}

<main id="site-main" class="site-main outer" role="main">
<div class="inner">

<article class="post-full {{post_class}} {{#unless feature_image}}no-image{{/unless}}">

<header class="post-full-header">
{{!-- <h1 class="post-full-title" style="color:#292929; font-size:30px ; ">{{title}}</h1> --}}
<div id='site-nav'></div>
<span id='pos'></span>
</header>
<button id="scrollBtn" class="fa fa-angle-up" title="Go to top"></button>
<section class="post-full-content">
<svg class="mindmap-svg" id="mindmap-svg"
viewBox="-336.80451500765685 -486.5010822596126 637.1347523470067 551.1287262462758"
style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: lightblue;">
</svg>
{{!-- {{content}} --}}
</section>
</article>
</div>
<div id='site-nav'></div>
<svg class="mindmap-svg" id="mindmap-svg"
viewBox="-336.80451500765685 -486.5010822596126 637.1347523470067 551.1287262462758"
style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); background: lightblue;">
</svg>
</main>

{{!-- Links to Previous/Next posts --}}
<aside class="read-next outer">
<div class="inner">
<div class="read-next-feed">
{{#if primary_tag}}
{{#get "posts" filter="tags:{{primary_tag.slug}}+id:-{{id}}" limit="3" as |related_posts|}}
{{#if related_posts}}
<article class="read-next-card" {{#if ../primary_tag.feature_image}}
style="background-image: url({{../primary_tag.feature_image}})" {{else}} {{#if @blog.cover_image}}
style="background-image: url({{@blog.cover_image}})" {{/if}} {{/if}}>
<header class="read-next-card-header">
<small class="read-next-card-header-sitetitle">&mdash; {{@blog.title}} &mdash;</small>
{{#../primary_tag}}
<h3 class="read-next-card-header-title"><a href="{{url}}">{{name}}</a></h3>
{{/../primary_tag}}
</header>
<div class="read-next-divider">{{> "icons/infinity"}}</div>
<div class="read-next-card-content">
<ul>
{{#foreach related_posts}}
<li><a href="{{url}}">{{title}}</a></li>
{{/foreach}}
</ul>
</div>

{{!-- <footer class="read-next-card-footer">
<a href="{{#../primary_tag}}{{url}}{{/../primary_tag}}">{{plural meta.pagination.total empty='No posts' singular='% post' plural='See all % posts'}}
→</a>
</footer> --}}
</article>
{{/if}}
{{/get}}
{{/if}}

{{!-- If there's a next post, display it using the same markup included from - partials/post-card.hbs --}}
{{#next_post}}
{{> "post-card"}}
{{/next_post}}

{{!-- If there's a previous post, display it using the same markup included from - partials/post-card.hbs --}}
{{#prev_post}}
{{> "post-card"}}
{{/prev_post}}

</div>
</div>
</aside>

{{!-- Floating header which appears on-scroll, included from includes/floating-header.hbs --}}
{{> floating-header}}

Expand All @@ -109,8 +45,15 @@ into the {body} of the default.hbs template --}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"></script>
<script>
$(document).ready(function () {
if ($(document).height() > $(window).height()) {
var scrollTop = ($('html').scrollTop()) ? $('html').scrollTop() : $('body').scrollTop(); // Works for Chrome, Firefox, IE...
$('html').addClass('noscroll').css('top', -scrollTop);
}
g = document.getElementsByClassName('mindmap-svg')[0].getElementsByTagName('g');
// diable scrolling on map
var box = $('.mindmap-svg'),
height = box.height(),
scrollHeight = box.get(0).scrollHeight;
Expand Down

0 comments on commit aecbeae

Please sign in to comment.