focus-theme 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,136 @@
1
+ // alertbar later
2
+ $(document).scroll(function () {
3
+ var y = $(this).scrollTop();
4
+ if (y > 280) {
5
+ $('.alertbar').fadeIn();
6
+ } else {
7
+ $('.alertbar').fadeOut();
8
+ }
9
+ });
10
+
11
+
12
+ // Hide Header on on scroll down
13
+ var didScroll;
14
+ var lastScrollTop = 0;
15
+ var delta = 5;
16
+ var navbarHeight = $('nav').outerHeight();
17
+
18
+ $(window).scroll(function(event){
19
+ didScroll = true;
20
+ });
21
+
22
+ setInterval(function() {
23
+ if (didScroll) {
24
+ hasScrolled();
25
+ didScroll = false;
26
+ }
27
+ }, 250);
28
+
29
+ function hasScrolled() {
30
+ var st = $(this).scrollTop();
31
+
32
+ // Make sure they scroll more than delta
33
+ if(Math.abs(lastScrollTop - st) <= delta)
34
+ return;
35
+
36
+ // If they scrolled down and are past the navbar, add class .nav-up.
37
+ // This is necessary so you never see what is "behind" the navbar.
38
+ if (st > lastScrollTop && st > navbarHeight){
39
+ // Scroll Down
40
+ $('nav').removeClass('nav-down').addClass('nav-up');
41
+ $('.nav-up').css('top', - $('nav').outerHeight() + 'px');
42
+
43
+ } else {
44
+ // Scroll Up
45
+ if(st + $(window).height() < $(document).height()) {
46
+ $('nav').removeClass('nav-up').addClass('nav-down');
47
+ $('.nav-up, .nav-down').css('top', '0px');
48
+ }
49
+ }
50
+
51
+ lastScrollTop = st;
52
+ }
53
+
54
+
55
+ $('.site-content').css('margin-top', $('header').outerHeight() + 'px');
56
+
57
+
58
+ function loadSearch(){
59
+ // Create a new Index
60
+ idx = lunr(function(){
61
+ this.field('id')
62
+ this.field('title', { boost: 10 })
63
+ this.field('summary')
64
+ })
65
+
66
+ // Send a request to get the content json file
67
+ $.getJSON('/content.json', function(data){
68
+
69
+ // Put the data into the window global so it can be used later
70
+ window.searchData = data
71
+
72
+ // Loop through each entry and add it to the index
73
+ $.each(data, function(index, entry){
74
+ idx.add($.extend({"id": index}, entry))
75
+ })
76
+ })
77
+
78
+ // When search is pressed on the menu toggle the search box
79
+ $('#search').on('click', function(){
80
+ $('.searchForm').toggleClass('show')
81
+ })
82
+
83
+ // When the search form is submitted
84
+ $('#searchForm').on('submit', function(e){
85
+ // Stop the default action
86
+ e.preventDefault()
87
+
88
+ // Find the results from lunr
89
+ results = idx.search($('#searchField').val())
90
+
91
+ // Empty #content and put a list in for the results
92
+ $('#content').html('<h1>Search Results (' + results.length + ')</h1>')
93
+ $('#content').append('<ul id="searchResults"></ul>')
94
+
95
+ // Loop through results
96
+ $.each(results, function(index, result){
97
+ // Get the entry from the window global
98
+ entry = window.searchData[result.ref]
99
+
100
+ // Append the entry to the list.
101
+ $('#searchResults').append('<li><a href="' + entry.url + '">' + entry.title + '</li>')
102
+ })
103
+ })
104
+ }
105
+
106
+
107
+
108
+ // Smooth on external page
109
+ $(function() {
110
+ setTimeout(function() {
111
+ if (location.hash) {
112
+ /* we need to scroll to the top of the window first, because the browser will always jump to the anchor first before JavaScript is ready, thanks Stack Overflow: http://stackoverflow.com/a/3659116 */
113
+ window.scrollTo(0, 0);
114
+ target = location.hash.split('#');
115
+ smoothScrollTo($('#'+target[1]));
116
+ }
117
+ }, 1);
118
+
119
+ // taken from: https://css-tricks.com/snippets/jquery/smooth-scrolling/
120
+ $('a[href*=\\#]:not([href=\\#])').click(function() {
121
+ if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
122
+ smoothScrollTo($(this.hash));
123
+ return false;
124
+ }
125
+ });
126
+
127
+ function smoothScrollTo(target) {
128
+ target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
129
+
130
+ if (target.length) {
131
+ $('html,body').animate({
132
+ scrollTop: target.offset().top
133
+ }, 1000);
134
+ }
135
+ }
136
+ });
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: focus-theme
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Global Nomad LLC
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2024-12-23 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: jekyll
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '4.3'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '4.3'
26
+ - !ruby/object:Gem::Dependency
27
+ name: bundler
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: rake
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '12.0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '12.0'
54
+ description: Focus is a clean, minimal, and responsive theme for Jekyll, perfect for
55
+ personal blogs and professional portfolios.
56
+ email:
57
+ - contact@globalnomadllc.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - README.md
63
+ - _includes/comments.html
64
+ - _includes/main-loop-card.html
65
+ - _includes/meta-read-time.html
66
+ - _includes/search-lunr.html
67
+ - _includes/sidebar-featured.html
68
+ - _includes/sidebar.html
69
+ - _layouts/default.html
70
+ - _layouts/page-sidebar.html
71
+ - _layouts/page.html
72
+ - _layouts/post.html
73
+ - assets/css/main.css
74
+ - assets/css/theme.css
75
+ - assets/images/1.jpg
76
+ - assets/images/10.jpg
77
+ - assets/images/11.jpg
78
+ - assets/images/12.jpg
79
+ - assets/images/13.jpg
80
+ - assets/images/14.jpg
81
+ - assets/images/15.jpg
82
+ - assets/images/16.jpg
83
+ - assets/images/17.jpg
84
+ - assets/images/2.jpg
85
+ - assets/images/3.jpg
86
+ - assets/images/4.jpg
87
+ - assets/images/5.jpg
88
+ - assets/images/6.jpg
89
+ - assets/images/7.jpg
90
+ - assets/images/8.jpg
91
+ - assets/images/9.jpg
92
+ - assets/images/avatar1.jpg
93
+ - assets/images/avatar2.jpg
94
+ - assets/images/demo1.jpg
95
+ - assets/images/favicon.ico
96
+ - assets/images/home.jpg
97
+ - assets/images/jekyll.svg
98
+ - assets/images/screenshot.jpg
99
+ - assets/js/bootstrap.js
100
+ - assets/js/lunr.js
101
+ - assets/js/theme.js
102
+ homepage: https://github.com/globalnomadllc/focus
103
+ licenses:
104
+ - MIT
105
+ metadata: {}
106
+ rdoc_options: []
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '3.0'
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ requirements: []
120
+ rubygems_version: 3.6.1
121
+ specification_version: 4
122
+ summary: A clean, minimal, and responsive theme for Jekyll.
123
+ test_files: []