Skip to content

Commit

Permalink
remove gesture navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
le4ker committed Jan 5, 2024
1 parent f323f80 commit 25c0c03
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 142 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ You can watch it in action
- Archive page
- Syntax highlighting
- Emojis
- Gesture navigation in archive and post pages by swiping
- Hashtags
- Categories
- Disqus comments
Expand Down Expand Up @@ -96,8 +95,7 @@ docker-compose up
One of the reasons { Personal } is real is the following OSS projects:

1. [Grayscale](http://startbootstrap.com/template-overviews/grayscale/)
2. [hammer.js](https://hammerjs.github.io/)
3. [highlightjs](https://highlightjs.org/)
4. [RRSSB](https://github.com/kni-labs/rrssb)
5. [Timeline](https://github.com/kirbyt/timeline-jekyll-theme)
6. [typed.js](https://github.com/mattboldt/typed.js/)
2. [highlightjs](https://highlightjs.org/)
3. [RRSSB](https://github.com/kni-labs/rrssb)
4. [Timeline](https://github.com/kirbyt/timeline-jekyll-theme)
5. [typed.js](https://github.com/mattboldt/typed.js/)
114 changes: 0 additions & 114 deletions _includes/js.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,118 +200,4 @@

{% endif %}

<script>
function addTohistory() {
if (!window.location.host.startsWith("127.0.0.1")) {
history.pushState(
{},
"{{page.title}}",
"{{site.url}}{{site.baseurl}}{{page.url}}",
);
}
}
</script>

<!-- Gesture Navigation / Swipe Instruction Start -->
{% if site.enable-gesture-navigation %} {% if page.section-type == "post" %}

<!-- Post Gesture Navigation Start -->

<script type="text/javascript" src="{{site.baseurl}}/js/hammer.min.js"></script>

<script>
var post = document.getElementById('post');

new Hammer(post).on('swipeleft', function(event) {
addTohistory();
{% if site.baseurl == "" and page.previous == nil %}
document.location.replace("/");
{% else %}
document.location.replace("{{site.baseurl}}{{page.previous.url}}");
{% endif %}
});

new Hammer(post).on('swiperight', function(event) {
addTohistory();
{% if site.baseurl == "" and page.next == nil %}
document.location.replace("/");
{% else %}
document.location.replace("{{site.baseurl}}{{page.next.url}}");
{% endif %}
});
</script>

<!-- Post Gesture Navigation Start -->

{% endif %} {% if page.section-type == "blog" %}

<!-- Blog Gesture Navigation Start -->

<script type="text/javascript" src="{{site.baseurl}}/js/hammer.min.js"></script>

<script>
var page = document.getElementById('page');

new Hammer(page).on('swipeleft', function(event) {
addTohistory();
{% if site.baseurl == "" and paginator.next_page_path == nil %}
document.location.replace("/");
{% else %}
document.location.replace("{{site.baseurl}}{{paginator.next_page_path}}");
{% endif %}
});
new Hammer(page).on('swiperight', function(event) {
addTohistory();
{% if site.baseurl == "" and paginator.previous_page_path == nil %}
document.location.replace("/");
{% else %}
document.location.replace("{{site.baseurl}}{{paginator.previous_page_path}}");
{% endif %}
});
</script>

<!-- Blog Gesture Navigation Start -->

{% endif %} {% if page.section-type == "blog" %}

<!-- Swipe Instructions for Blog Start -->

<script>
$(document).ready(function () {
if (!localStorage.getItem("blog-swipeshowed")) {
$("#swipe-instruction").fadeIn();
$("#swipe-instruction .close-swipe-instruction").click(function () {
$("#swipe-instruction").fadeOut();
});
localStorage.setItem("blog-swipeshowed", true);
}
});
</script>

<!-- Swipe Instructions for Blog End -->

{% endif %} {% if page.section-type == "post" %}

<!-- Swipe Instructions for Post Start -->

<script>
$(document).ready(function () {
if (!localStorage.getItem("post-swipeshowed")) {
$("#swipe-instruction").fadeIn();
$("#swipe-instruction .close-swipe-instruction").click(function () {
$("#swipe-instruction").fadeOut();
});
localStorage.setItem("post-swipeshowed", true);
}
});
</script>

<!-- Swipe Instructions for Post End -->

{% endif %}

<!-- Gesture Navigation / Swipe Instruction End -->

{% endif %}

<!-- Javascript End -->
9 changes: 1 addition & 8 deletions _includes/swipe-instructions.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
<div>
<p><br /><br /><br /></p>
<i id="hand-swipe" class="fa fa-hand-o-up"></i>
<p>
<strong>
{% if page.section-type == "blog" %} Did you know that you can navigate
the archive pages by swiping left and right? {% elsif page.section-type
== "post" %} Did you know that you can navigate the posts by swiping
left and right? {% endif %}
</strong>
</p>
<p></p>
<button
type="button"
class="btn btn-default ok-btn close-swipe-instruction"
Expand Down
7 changes: 0 additions & 7 deletions css/grayscale.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ h6 {
letter-spacing: 1px;
}

/* Added in { Personal } */
h4 {
a.category {
color: inherit;
Expand Down Expand Up @@ -243,14 +242,12 @@ a {
margin-top: 125px;
padding-top: 125px;
}
/* Added in { Personal } for responsive images in posts and section contents */
img {
display: block;
max-width: 100%;
height: auto;
margin: 0 auto;
}
/* Added in { Personal } */
ul,
ol {
text-align: left;
Expand All @@ -270,7 +267,6 @@ a {
display: inline !important;
}

/* Added in { Personal } */
&#post {
div.author img {
border: 0px;
Expand Down Expand Up @@ -301,7 +297,6 @@ a {
background-color: $secondary-color;
}

/* Added in { Personal } */
ul.social-buttons li a {
display: block;
width: 40px;
Expand Down Expand Up @@ -362,7 +357,6 @@ body {
font-weight: 500;
}

/* Added in { Personal } for Typed Cursor in Header */
.typed-cursor{
opacity: 1;
-webkit-animation: blink 0.7s infinite;
Expand All @@ -389,5 +383,4 @@ body {
50% { opacity:0; }
100% { opacity:1; }
}
/* END Added in { Personal } for Typed Cursor in Header */

Loading

0 comments on commit 25c0c03

Please sign in to comment.