Skip to content

Commit b2d4753

Browse files
committed
Improve and Boost the Clog and Add new tiny Features 1.boobkmarking 2.Estimated read Time 3.On Paot ToC 4. Share Post and Etc.
1 parent 3a77c9b commit b2d4753

3 files changed

Lines changed: 418 additions & 49 deletions

File tree

Clog/index.html

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
<script src="/js/marked.min.js"></script>
4444
<link rel="stylesheet" href="/css/github-markdown.min.css">
4545

46+
<!-- global css used every page -->
4647
<link rel="stylesheet" href="/css/global.css">
48+
<!-- current page css -->
4749
<link rel="stylesheet" href="/css/clog.css">
4850

4951
</head>
@@ -120,7 +122,7 @@
120122
</header>
121123

122124
<main class="section">
123-
<div class="container">
125+
<div class="container" style="padding: 0 2.5rem;">
124126

125127
<div id="main-layout-wrapper">
126128

@@ -170,6 +172,9 @@
170172
</div>
171173
<div class="post-grid" id="publication-grid">
172174
</div>
175+
<div id="load-more-container" style="display: none; justify-content: center; margin-top: 2.5rem;">
176+
<button class="btn btn-out" id="load-more-btn" onclick="loadNextPage()">Load More Logs</button>
177+
</div>
173178
</div>
174179

175180
</div>
@@ -196,9 +201,34 @@ <h1 class="reader-title" id="full-title">Loading...</h1>
196201
<span class="meta-label">Published</span>
197202
<span class="meta-value" id="full-date">--/--/----</span>
198203
</div>
204+
<div class="meta-item">
205+
<span class="meta-label">Reading Time</span>
206+
<span class="meta-value" id="full-reading-time">-- min read</span>
207+
</div>
208+
<div class="meta-item" style="flex-direction: row; align-items: flex-end; gap: 0.5rem; margin-left: auto;">
209+
<button id="reader-bookmark-btn" class="btn btn-out" style="padding: 0.4rem 0.8rem; font-size: 0.75rem; border-radius: 8px; display: inline-flex; align-items: center; gap: 0.35rem;" onclick="toggleCurrentBookmark()" aria-label="Bookmark post">
210+
<svg class="icon" style="width: 14px; height: 14px; fill: none; stroke: currentColor;"><use href="/src/global.svg#icon-heart"></use></svg>
211+
<span id="bookmark-text">Bookmark</span>
212+
</button>
213+
<button class="btn btn-out" style="padding: 0.4rem 0.8rem; font-size: 0.75rem; border-radius: 8px; display: inline-flex; align-items: center; gap: 0.35rem;" onclick="shareCurrentPost()" aria-label="Share post">
214+
<svg class="icon" style="width: 14px; height: 14px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg>
215+
<span>Share</span>
216+
</button>
217+
</div>
199218
</div>
200219
</div>
201220

221+
<!-- Table of Contents Section -->
222+
<div id="reader-toc-container" class="glass-panel" style="display: none; margin-bottom: 2rem; padding: 1rem 1.25rem; border-radius: 12px;">
223+
<div class="toggleToc" onclick="toggleToC()">
224+
<h4 style="margin: 0; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 0.5rem; color: #fff;">
225+
<svg class="icon" style="width: 16px; height: 16px; color: var(--mrc);"><use href="/src/global.svg#icon-category"></use></svg> Table of Contents
226+
</h4>
227+
<svg id="toc-toggle-icon" class="icon" style="width: 16px; height: 16px; transition: transform 0.3s; color: var(--text-muted);"><use href="/src/global.svg#icon-chevron-down"></use></svg>
228+
</div>
229+
<div id="reader-toc" style="max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; margin-top: 0;"></div>
230+
</div>
231+
202232
<div class="markdown-body" id="full-body"></div>
203233
<div class="reader-meta-bottom">
204234
<div class="meta-item" style="flex-grow: 1;">
@@ -277,7 +307,7 @@ <h4 class="uppercase flex txt-main txt-center gap-1 font-md pos-rel">Connect</h4
277307
</div>
278308
<div class="footer-bottom">
279309
<div class="footer-copy">
280-
&copy; 2024-<span id="year">2024</span> MainRoute Core. <a class="txt-bold" href="/Redirect/?id=mrc target="_blank">M Ramzan Ch</a> | <a class="txt-bold" href="/Redirect/?id=pb" target="_blank"">Pro Bandey</a>. All Rights Reserved.
310+
&copy; 2024-<span id="year">2024</span> MainRoute Core. <a class="txt-bold" href="/Redirect/?id=mrc" target="_blank">M Ramzan Ch</a> | <a class="txt-bold" href="/Redirect/?id=pb" target="_blank">Pro Bandey</a>. All Rights Reserved.
281311
</div>
282312
<div class="footer-made-in">
283313
Engineered with <svg class="icon"
@@ -288,9 +318,10 @@ <h4 class="uppercase flex txt-main txt-center gap-1 font-md pos-rel">Connect</h4
288318
</div>
289319
</div>
290320
</footer>
291-
321+
<!-- handle loader , copyright year, animation and etc -->
292322
<script src="/js/global.js"></script>
323+
<!-- curentpage js -->
293324
<script src="/js/clog.js"></script>
294325

295326
</body>
296-
</html>
327+
</html>

css/clog.css

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
.search-input {
5656
flex-grow: 1;
5757
background: transparent;
58-
color:var(--text-main);
58+
color: var(--text-main);
5959
padding: 0.5rem 1rem 0.5rem 0;
6060
outline: none;
6161
border: none;
@@ -137,25 +137,27 @@
137137

138138
.sort-select {
139139
background: transparent;
140-
color:var(--text-main);
140+
color: var(--text-main);
141141
padding: 0.5rem 1rem 0.5rem 0;
142142
outline: none;
143143
border: none;
144144
font-size: 0.95rem;
145145
font-family: var(--font-sans);
146146
transition: opacity 0.3s;
147-
width: 100%;
147+
width: 100%;
148148
-webkit-appearance: none;
149149
appearance: none;
150150
}
151151

152152
.sort-wrapper.expanded .sort-input {
153153
opacity: 1;
154154
}
155+
155156
.sort-select option {
156157
color: var(--text-main);
157158
background: var(--bg-dark);
158159
}
160+
159161
.clearSort {
160162
position: absolute;
161163
right: 10px;
@@ -168,7 +170,7 @@
168170
}
169171

170172
.sort-wrapper.expanded .clearSort {
171-
display: block;
173+
display: block;
172174
}
173175

174176
.clearSort:hover,
@@ -220,6 +222,12 @@
220222
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
221223
}
222224

225+
.cat-list hr {
226+
border: none;
227+
border-top: 1px solid var(--glass-border);
228+
height: 0;
229+
}
230+
223231
.cat-item {
224232
display: flex;
225233
justify-content: space-between;
@@ -525,6 +533,7 @@
525533
.reader-meta {
526534
display: flex;
527535
flex-wrap: wrap;
536+
align-items: flex-end;
528537
gap: 1rem;
529538
border-bottom: 1px solid var(--glass-border);
530539
padding-bottom: 1.5rem;
@@ -578,6 +587,71 @@
578587
margin-top: 0.5rem;
579588
}
580589

590+
#reader-bookmark-btn.bookmarked {
591+
background: rgba(244, 66, 52, 0.15);
592+
border-color: rgba(244, 66, 52, 0.5);
593+
color: var(--mrc);
594+
}
595+
596+
#reader-bookmark-btn.bookmarked svg {
597+
fill: var(--mrc);
598+
stroke: var(--mrc);
599+
}
600+
601+
.toc-list {
602+
list-style: none;
603+
padding: 0;
604+
margin: 0;
605+
display: flex;
606+
flex-direction: column;
607+
gap: 0.35rem;
608+
}
609+
610+
.toc-link {
611+
display: block;
612+
padding: 0.35rem 0.5rem;
613+
font-size: 0.9rem;
614+
color: var(--text-muted);
615+
text-decoration: none;
616+
border-left: 2px solid transparent;
617+
transition: all 0.2s ease-in-out;
618+
}
619+
620+
.toc-link:hover {
621+
color: var(--mrc);
622+
background: rgba(255, 255, 255, 0.02);
623+
border-left-color: var(--mrc);
624+
}
625+
626+
.toc-depth-3 {
627+
padding-left: 1.5rem;
628+
font-size: 0.825rem;
629+
}
630+
631+
#reader-toc-container {
632+
transition: border-color 0.3s;
633+
}
634+
635+
#reader-toc-container:hover {
636+
border-color: rgba(255, 255, 255, 0.15);
637+
}
638+
639+
.toggleToc {
640+
display: flex;
641+
font-weight: 700;
642+
text-transform: uppercase;
643+
letter-spacing: 0.1em;
644+
padding-bottom: 1rem;
645+
cursor: pointer;
646+
border-bottom: 1px solid var(--text-muted);
647+
font-size: 0.9rem;
648+
margin-bottom: 1rem;
649+
color: var(--text-muted);
650+
user-select: none;
651+
transition: color 0.3s;
652+
justify-content: flex-start;
653+
}
654+
581655
.markdown-body {
582656
color: var(--text-main);
583657
background: transparent !important;

0 commit comments

Comments
 (0)