Skip to content

Commit

Permalink
fade in
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrishik-Koley committed Nov 26, 2024
1 parent b56c4a8 commit 756b484
Show file tree
Hide file tree
Showing 23 changed files with 716 additions and 1 deletion.
9 changes: 9 additions & 0 deletions assets/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.fade-in-hidden {
opacity: 0; /* Hidden by default */
transition: opacity 4s ease-in; /* Smooth fade-in over 4 seconds */
}

.fade-in-visible {
opacity: 1; /* Fully visible */
}

8 changes: 8 additions & 0 deletions assets/js/fade-in.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Add this in your JavaScript file (e.g., `assets/js/main.js`) or inline
document.addEventListener("DOMContentLoaded", function () {
const fadeInElement = document.getElementById("fade-in-element");

// Add the 'fade-in-visible' class to start the fade-in effect
fadeInElement.classList.add("fade-in-visible");
});

25 changes: 25 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language }}">
<head>
{{ partial "head.html" . }}
</head>

{{ block "body" . }}
<body>
{{ end }}

<div class="container">
{{ partial "header.html" . }}

<div class="content">
{{ block "main" . }}{{ end }}
</div>

{{ block "footer" . }}
{{ partial "footer.html" . }}
{{ end }}
</div>

{{ partial "javascript.html" . }}
</body>
</html>
35 changes: 35 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ define "main" }}
{{ $paginator := .Paginate .Data.Pages }}

<main class="posts">
<h1>{{ .Title }}</h1>

{{ if .Content }}
<div class="content">{{ .Content }}</div>
{{ end }}

{{ range $paginator.Pages.GroupByDate "2006" }}
<div class="posts-group">
<div class="post-year">{{ .Key }}</div>

<ul class="posts-list">
{{ range .Pages }}
<li class="post-item">
<a href="{{.Permalink}}">
<span class="post-title">{{.Title}}</span>
<span class="post-day">
{{ if .Site.Params.dateformShort }}
{{ .Date.Format .Site.Params.dateformShort }}
{{ else }}
{{ .Date.Format "Jan 2"}}
{{ end }}
</span>
</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ partial "pagination-list.html" . }}
</main>
{{ end }}
58 changes: 58 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{ define "main" }}
<main class="post">

<div class="post-info">
{{ if .IsTranslated }}
{{ if not .Params.hidelanguage }}
{{ range .Translations }}
{{ i18n "postAvailable" }}
<a href="{{ .Permalink }}"><span class="flag flag-icon flag-icon-{{ index $.Site.Data.langFlags (.Lang) }} flag-icon-squared"></span></a>
{{ end}}
{{ end }}
{{ end }}
</p>
</div>

<article>
{{if .Params.hideTitle }}
{{ else }}
<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
{{ end }}


{{ if .Params.Cover }}
<figure class="post-cover">
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title }}" />

{{ if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }}

{{ if .Params.toc }}
<hr />
<aside id="toc">
<div class="toc-title">{{ i18n "tableOfContents" }}</div>
{{ .TableOfContents }}
</aside>
<hr />
{{ end }}

<div class="post-content">
{{ .Content }}
</div>
</article>

<hr />

<div class="post-info">
{{ partial "tags.html" .Params.tags }}
{{ partial "categories.html" . }}

{{- if .GitInfo }}
<p><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg><a href="{{ .Site.Params.gitUrl -}}{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a> @ {{ if .Site.Params.dateformNum }}{{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local }}{{ else }}{{ dateFormat "2006-01-02" .GitInfo.AuthorDate.Local }}{{ end }}</p>
{{- end }}
</div>
</main>
{{ end }}
3 changes: 2 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
{{ if .Site.Params.Portrait.Path }}
<img src="{{ .Site.Params.Portrait.Path }}" class="circle" alt="{{ .Site.Params.Portrait.Alt }}" style="max-width: {{ .Site.Params.Portrait.MaxWidth }}" />
{{ end }}

<div id="fade-in-element" class="fade-in-hidden">
<h1>{{ .Site.Params.homeTitle }}</h1>
{{ partial "subtitle.html" . }}
</div>
<!-- Start Posts -->
{{ if .Site.Params.showPosts }}
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
Expand Down
9 changes: 9 additions & 0 deletions layouts/partials/categories.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{ with .Params.categories }}
<p>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-folder meta-icon"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg>

{{ range . -}}
<span class="tag"><a href="{{ "categories/" | absLangURL }}{{ . | urlize }}/">{{.}}</a></span>
{{ end }}
</p>
{{ end }}
7 changes: 7 additions & 0 deletions layouts/partials/favicons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="{{"apple-touch-icon.png" | relURL}}">
<link rel="icon" type="image/png" sizes="32x32" href="{{"favicon-32x32.png" | relURL}}">
<link rel="icon" type="image/png" sizes="16x16" href="{{"favicon-16x16.png" | relURL}}">
<link rel="manifest" href="{{"site.webmanifest" | relURL}}">
<link rel="mask-icon" href="{{"safari-pinned-tab.svg" | relURL}}" color="{{.Site.Params.favicon.mask}}">
<link rel="shortcut icon" href="{{"favicon.ico" | relURL}}">
<meta name="msapplication-TileColor" content="{{.Site.Params.favicon.msapplication}}">
35 changes: 35 additions & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<footer class="footer">
{{ if (.Site.Params.footer.topText) }}
<div class="footer__inner">
{{ range .Site.Params.footer.topText }}<span>{{ . | safeHTML}}</span>{{ end }}
</div>
{{ end }}
<script src="{{ "js/main.js" | relURL }}" defer></script>
{{ if .Site.Params.footer.socialIcons }}
<div class="footer__inner">
<ul class="icons">
{{- with .Site.Params.social }}
{{ partial "social-icons.html" . }}
{{- end }}
{{ if .Site.Params.footer.rss }}
<li><a href="{{ "posts/index.xml" | absLangURL }}" target="_blank" title="rss" class="icon fa-solid fa-rss"></a></li>
{{ end }}
</ul>
</div>
{{ end }}
{{if or (.Site.Params.footer.trademark) (.Site.Params.footer.author) (.Site.Params.footer.copyright) }}
<div class="footer__inner">
{{ if .Site.Params.footer.trademark }}<span>&copy;{{ now.Format "2006" }}</span>&nbsp;{{ end }}
{{ if .Site.Params.footer.author }}<span><a href="{{ .Site.BaseURL }}">{{ .Site.Params.author.name }}</a></span>&nbsp;{{ end }}
{{ if .Site.Params.footer.copyright }}<span>{{ .Site.Copyright| safeHTML }}</span>{{ end }}
</div>
{{ end }}
<div class="footer__inner">
<div class="footer__content">
{{ if .Site.Params.version }}<span>{{ .Site.Params.version }}</span>{{ end }}
{{with .Site.Params.footer.bottomText}}
{{ range . }}<span>{{ . | safeHTML}}</span>{{ end }}
</div>
{{ end }}
</div>
</footer>
99 changes: 99 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="author" content="{{ .Site.Params.author.name }}">
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.homeSubtitle }}{{ else }}{{ if .Params.Description }}{{ .Params.Description }}{{ else }}{{ .Summary | plainify }}{{ end }}{{ end }}" />
<meta name="keywords" content="{{ .Site.Params.keywords }}{{ if .Params.tags }}{{ range .Params.tags }}, {{ . }}{{ end }}{{ end }}" />
<meta name="robots" content="noodp" />
<meta name="theme-color" content="{{ .Site.Params.themeColor }}" />
<link rel="canonical" href="{{ .Permalink }}" />

{{ block "title" . }}
<title>
{{ if .IsHome }}
{{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }} {{ end }}
{{ else }}
{{ .Title }} :: {{ $.Site.Title }} {{ with $.Site.Params.Subtitle }} — {{ . }}{{ end }}
{{ end }}
</title>
{{ end }}

<!-- CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.5.0/css/flag-icon.min.css" rel="stylesheet"
type="text/css">

{{ $options := (dict "targetPath" "main.css" "outputStyle" "compressed" "enableSourceMap" true) }}
{{ $style := resources.Get "scss/main.scss" | resources.ToCSS $options | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}">

{{ range $val := $.Site.Params.customCSS }}
{{ if gt (len $val) 0 }}
<link rel="stylesheet" type="text/css" href="{{ $val }}">
{{ end }}
{{ end }}

{{ if .Site.Params.fontAwesome }}
{{ with.Site.Params.fontAwesome }}
{{ if .kitURL }}
<script src="{{ .kitURL }}" crossorigin="anonymous"></script>
{{ else }}
<link href="/static/fontawesome/css/fontawesome.min.css" rel="stylesheet" />
{{ if .all }}
<link href="/static/fontawesome/css/all.min.css" rel="stylesheet" />
{{ end }}

{{ if .brands }}
<link href="/static/fontawesome/css/brands.min.css" rel="stylesheet" />
{{ end }}

{{ if .solid }}
<link href="/static/fontawesome/css/solid.min.css" rel="stylesheet" />
{{ end }}

{{ if .regular }}
<link href="/static/fontawesome/css/regular.min.css" rel="stylesheet" />
{{ end }}

{{ end }}
{{ end }}
{{ end }}

<!-- Icons -->
{{- partial "favicons.html" . }}

{{ template "_internal/schema.html" . }}
{{ template "_internal/twitter_cards.html" . }}

{{ if isset .Site.Taxonomies "series" }}
{{ template "_internal/opengraph.html" . }}
{{ end }}

{{ range .Params.categories }}
<meta property="article:section" content="{{ . }}" />
{{ end }}

{{ if isset .Params "date" }}
<meta property="article:published_time" content="{{ time .Date }}" />
{{ end }}

<!-- RSS -->
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}

<!-- JSON Feed -->
{{ if .OutputFormats.Get "json" }}
<link href="{{ if .OutputFormats.Get "json" }}{{ .Site.BaseURL }}feed.json{{ end }}" rel="alternate"
type="application/json" title="{{ .Site.Title }}" />
{{ end }}

<!-- Custom head tags -->
{{- if templates.Exists "partials/extra-head.html" -}}
{{ partial "extra-head.html" . }}
{{- end }}

<!-- Google Analytics internal template -->
{{- if .Site.Config.Services.GoogleAnalytics.ID }}
{{ template "_internal/google_analytics.html" . }}
{{- end}}
21 changes: 21 additions & 0 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<header class="header">
<span class="header__inner">
{{ partial "logo.html" . }}

<span class="header__right">
{{ if len .Site.Menus }}
{{ partial "menu.html" . }}
<span class="menu-trigger">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/>
</svg>
</span>
{{ end }}

{{- if .Site.Params.EnableThemeToggle }}
<span class="theme-toggle not-selectable">{{ partial "theme-toggle-icon.html" . }}</span>
{{- end}}
</span>
</span>
</header>
11 changes: 11 additions & 0 deletions layouts/partials/javascript.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ $main := resources.Get "js/main.js" }}
{{ $menu := resources.Get "js/menu.js" }}
{{ $prism := resources.Get "js/prism.js" }}
{{ $secureJS := slice $main $menu $prism | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $secureJS.RelPermalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>

{{ range $val := $.Site.Params.customJS }}
{{ if gt (len $val) 0 }}
<script src="{{ $val }}"></script>
{{ end }}
{{ end }}
10 changes: 10 additions & 0 deletions layouts/partials/lastmod.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ $hourInSec := 3600 }}

{{ if gt .Lastmod (add (time .Date).Unix $hourInSec) }}
{{ with .Lastmod }}
<span class="post-moddate">
({{ $.Site.Params.LastModDisplay }}
{{ .Format ($.Site.Params.DateFormatSingle | default "2006-01-02") }})
</span>
{{ end }}
{{ end }}
15 changes: 15 additions & 0 deletions layouts/partials/logo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<a href="{{ if .Site.Params.Logo.LogoHomeLink }}{{ .Site.Params.Logo.LogoHomeLink }}{{ else }}{{ .Site.BaseURL | relLangURL }}{{ end }}" style="text-decoration: none;">
<div class="logo">
{{ if .Site.Params.Logo.path }}
<img src="{{ .Site.Params.Logo.path }}" alt="{{ .Site.Params.Logo.alt }}" />
{{ else }}
<span class="logo__mark">{{ with .Site.Params.Logo.logoMark }}{{ . }}{{ else }}>{{ end }}</span>
<span class="logo__text">{{ with .Site.Params.Logo.logoText }}{{ . }}{{ else }}hello{{ end }}</span>
<span class="logo__cursor" style=
"{{ with.Site.Params.Logo.logoCursorDisabled }}visibility:hidden;{{ end }}
{{ with.Site.Params.Logo.logoCursorColor }}background-color:{{ . }};{{ end }}
{{ with.Site.Params.Logo.logoCursorAnimate }}animation-duration:{{ . }};{{ end }}">
</span>
{{ end }}
</div>
</a>
Loading

0 comments on commit 756b484

Please sign in to comment.