tear-jekyll-theme 1.0.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.
Binary file
@@ -0,0 +1,12 @@
1
+ import { Application } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js";
2
+
3
+ import ThemeController from "./controllers/theme_controller.js";
4
+ import NavbarController from "./controllers/navbar_burger_controller.js";
5
+ import MessageController from "./controllers/message_controller.js";
6
+ import ThumbnailController from "./controllers/thumbnail_controller.js";
7
+
8
+ window.Stimulus = Application.start();
9
+ Stimulus.register("theme", ThemeController);
10
+ Stimulus.register("navbar", NavbarController);
11
+ Stimulus.register("message", MessageController);
12
+ Stimulus.register("thumbnail", ThumbnailController);
@@ -0,0 +1,7 @@
1
+ import { Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js";
2
+
3
+ export default class extends Controller {
4
+ hide() {
5
+ this.element.remove();
6
+ }
7
+ }
@@ -0,0 +1,9 @@
1
+ import { Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js";
2
+
3
+ export default class extends Controller {
4
+ static targets = ["menu"];
5
+
6
+ toggle() {
7
+ this.menuTarget.classList.toggle("hidden");
8
+ }
9
+ }
@@ -0,0 +1,45 @@
1
+ import { Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js";
2
+
3
+ export default class extends Controller {
4
+ static targets = ["icon"];
5
+
6
+ connect() {
7
+ this.loadTheme();
8
+ }
9
+
10
+ toggle() {
11
+ document.documentElement.classList.toggle("dark");
12
+ const isDark = document.documentElement.classList.contains("dark");
13
+ localStorage.setItem("theme", isDark ? "dark" : "light");
14
+ this.updateIcons(isDark);
15
+ }
16
+
17
+ loadTheme() {
18
+ const savedTheme = localStorage.getItem("theme");
19
+ const isDark = savedTheme === "dark";
20
+ document.documentElement.classList.toggle("dark", isDark);
21
+ this.updateIcons(isDark);
22
+ }
23
+
24
+ updateIcons(isDark) {
25
+ this.iconTargets.forEach((icon) => {
26
+ icon.innerHTML = isDark ? this.sunIcon() : this.moonIcon();
27
+ });
28
+ }
29
+
30
+ moonIcon() {
31
+ return `
32
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5">
33
+ <path stroke-linecap="round" stroke-linejoin="round" d="M21.752 15.002A9 9 0 1112 3a7.5 7.5 0 009.752 12.002z" />
34
+ </svg>
35
+ `;
36
+ }
37
+
38
+ sunIcon() {
39
+ return `
40
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6 text-yellow-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5">
41
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 3v2.25M12 18.75V21M4.219 4.219l1.591 1.591M18.19 18.189l1.591 1.591M3 12h2.25M18.75 12H21M4.219 19.781l1.591-1.591M18.19 5.811l1.591-1.591M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" />
42
+ </svg>
43
+ `;
44
+ }
45
+ }
@@ -0,0 +1,14 @@
1
+ import { Controller } from "https://unpkg.com/@hotwired/stimulus/dist/stimulus.js";
2
+
3
+ export default class extends Controller {
4
+ static targets = ["image"]
5
+
6
+ connect() {
7
+ this.imageTarget.addEventListener("mouseenter", () => {
8
+ this.imageTarget.classList.add("scale-135", "brightness-30")
9
+ })
10
+ this.imageTarget.addEventListener("mouseleave", () => {
11
+ this.imageTarget.classList.remove("scale-135", "brightness-30")
12
+ })
13
+ }
14
+ }
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tear-jekyll-theme
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Rokhimin
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-05-18 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.0'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '5.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '4.0'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '5.0'
32
+ email:
33
+ - Rokhim.whd@gmail.com
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - README.md
39
+ - _config.yml
40
+ - _includes/footer.html
41
+ - _includes/head.html
42
+ - _includes/navigation.html
43
+ - _layouts/about.html
44
+ - _layouts/default.html
45
+ - _layouts/home.html
46
+ - _layouts/post.html
47
+ - _layouts/projects.html
48
+ - assets/css/input.css
49
+ - assets/css/output.css
50
+ - assets/img/contoh_thumbnail.png
51
+ - assets/js/application.js
52
+ - assets/js/controllers/message_controller.js
53
+ - assets/js/controllers/navbar_burger_controller.js
54
+ - assets/js/controllers/theme_controller.js
55
+ - assets/js/controllers/thumbnail_controller.js
56
+ homepage: https://github.com/rokhimin/jekyll-tear
57
+ licenses:
58
+ - MIT
59
+ metadata: {}
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '2.7'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubygems_version: 3.6.3
75
+ specification_version: 4
76
+ summary: jekyll Theme Blog using Tailwind Css and Stimulus.js
77
+ test_files: []