Skip to content

Commit

Permalink
feat: home movie watched
Browse files Browse the repository at this point in the history
  • Loading branch information
eallion committed Dec 21, 2023
1 parent 5fbd037 commit 2012a85
Show file tree
Hide file tree
Showing 5 changed files with 606 additions and 160 deletions.
120 changes: 72 additions & 48 deletions layouts/index.en.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta name="referrer" content="no-referrer">
<div class="page home" {{- if ne $posts.enable false | or .Content -}} posts{{- end -}}>

<link rel="stylesheet" href="/assets/chromedev/css/dist/chrome.min.css?v=20231125" />
<link rel="stylesheet" href="/assets/chromedev/css/dist/chrome.min.css?v=20231221" />

<script type="module" src="/assets/chromedev/js/main.js"></script>

Expand Down Expand Up @@ -556,63 +556,87 @@ <h2 id="movie" data-text="Watched">
</header>

<div class="devsite-landing-row-group">
{{- range first 4 $movies.data -}}
{{- $title := .item.display_title -}}
{{- $rating := .item.rating -}}
{{- $movie_url := .item.url -}}
{{- $cover := .item.cover_image_url -}}
{{- $cover_name := path.Base $cover -}}
{{- $cate_movie := "movie" -}}
{{- $cate_tv := "tv" -}}
{{ $movie_details := getJSON "data/neodb/movie_details.json" }}
{{ range first 4 $movie_details }}
{{ $title := .display_title }}
{{ $orig_title := .orig_title }}
{{ $year := .year }}
{{ $rating := float .rating }}
{{ $rating_percent := mul $rating 10 }}
{{ $movie_url := .url }}
{{ $imdb := .imdb}}
{{ $cover := .cover_image_url }}
{{ $cover_name := path.Base $cover }}
{{ $brief := .brief }}
{{ $cate_movie := "movie" }}
{{ $cate_tv := "tv" }}
<div class="devsite-landing-row-item dcc-services-card"
description-position="bottom">
<div class="devsite-landing-row-item-media">
<figure class="devsite-landing-row-item-image">
<img alt="{{- $title -}}"
class="lazy" loading="lazy"
src="/assets/images/movie/cover/{{- $cover_name -}}">
</figure>
</div>

<div class="devsite-landing-row-item-description">
<div class="devsite-landing-row-item-body">
<h3 id="movie-title" data-text="Movie Title"
class="hide-from-toc no-link">
{{- $title -}}<span class="rating_star">({{- $rating -}})</span>
</h3>
<div class="card">
<div class="poster">
<img alt="{{- $title -}}" class="lazy" loading="lazy" src="/assets/images/movie/cover/{{- $cover_name -}}" data-src="/assets/images/movie/cover/{{- $cover_name -}}" no-view>
</div>
<div class="details">
<h2><a href="https://neodb.social{{- $movie_url -}}" target="_blank" rel="noreferrer noopener nofollow">{{- $title -}}</a><br><span>{{- $orig_title | default $title -}} ({{- $year -}})</span></h2>

<div class="rating">
<div class="rating_star">
<div class="rating_full"><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="M235.38 98.53A11.82 11.82 0 0 0 225 90.29l-59.45-5.14a4 4 0 0 1-3.32-2.44L139 27.36a11.95 11.95 0 0 0-22.06 0l-23.2 55.35a4 4 0 0 1-3.32 2.44L31 90.29a12 12 0 0 0-6.83 21.07l45.1 39.35a4 4 0 0 1 1.28 4L57 213.22a11.88 11.88 0 0 0 4.67 12.48a11.76 11.76 0 0 0 13.19.53l51.1-31a3.89 3.89 0 0 1 4.08 0l51.1 31a12 12 0 0 0 17.86-13l-13.52-58.54a4 4 0 0 1 1.28-4l45.1-39.35a11.89 11.89 0 0 0 3.52-12.81m-8.78 6.8l-45.1 39.35a12 12 0 0 0-3.82 11.8L191.2 215a4 4 0 0 1-1.56 4.2a3.86 3.86 0 0 1-4.35.17l-51.1-31a11.88 11.88 0 0 0-12.38 0l-51.1 31a3.86 3.86 0 0 1-4.35-.17a4 4 0 0 1-1.56-4.2l13.52-58.54a12 12 0 0 0-3.82-11.8l-45.1-39.33a4 4 0 0 1-1.18-4.33a4 4 0 0 1 3.44-2.75l59.45-5.14a12 12 0 0 0 10-7.31l23.22-55.36a4 4 0 0 1 7.32 0l23.22 55.36a12 12 0 0 0 10 7.31l59.45 5.14a4 4 0 0 1 3.44 2.75a4 4 0 0 1-1.16 4.33"/></svg><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="M235.38 98.53A11.82 11.82 0 0 0 225 90.29l-59.45-5.14a4 4 0 0 1-3.32-2.44L139 27.36a11.95 11.95 0 0 0-22.06 0l-23.2 55.35a4 4 0 0 1-3.32 2.44L31 90.29a12 12 0 0 0-6.83 21.07l45.1 39.35a4 4 0 0 1 1.28 4L57 213.22a11.88 11.88 0 0 0 4.67 12.48a11.76 11.76 0 0 0 13.19.53l51.1-31a3.89 3.89 0 0 1 4.08 0l51.1 31a12 12 0 0 0 17.86-13l-13.52-58.54a4 4 0 0 1 1.28-4l45.1-39.35a11.89 11.89 0 0 0 3.52-12.81m-8.78 6.8l-45.1 39.35a12 12 0 0 0-3.82 11.8L191.2 215a4 4 0 0 1-1.56 4.2a3.86 3.86 0 0 1-4.35.17l-51.1-31a11.88 11.88 0 0 0-12.38 0l-51.1 31a3.86 3.86 0 0 1-4.35-.17a4 4 0 0 1-1.56-4.2l13.52-58.54a12 12 0 0 0-3.82-11.8l-45.1-39.33a4 4 0 0 1-1.18-4.33a4 4 0 0 1 3.44-2.75l59.45-5.14a12 12 0 0 0 10-7.31l23.22-55.36a4 4 0 0 1 7.32 0l23.22 55.36a12 12 0 0 0 10 7.31l59.45 5.14a4 4 0 0 1 3.44 2.75a4 4 0 0 1-1.16 4.33"/></svg><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="M235.38 98.53A11.82 11.82 0 0 0 225 90.29l-59.45-5.14a4 4 0 0 1-3.32-2.44L139 27.36a11.95 11.95 0 0 0-22.06 0l-23.2 55.35a4 4 0 0 1-3.32 2.44L31 90.29a12 12 0 0 0-6.83 21.07l45.1 39.35a4 4 0 0 1 1.28 4L57 213.22a11.88 11.88 0 0 0 4.67 12.48a11.76 11.76 0 0 0 13.19.53l51.1-31a3.89 3.89 0 0 1 4.08 0l51.1 31a12 12 0 0 0 17.86-13l-13.52-58.54a4 4 0 0 1 1.28-4l45.1-39.35a11.89 11.89 0 0 0 3.52-12.81m-8.78 6.8l-45.1 39.35a12 12 0 0 0-3.82 11.8L191.2 215a4 4 0 0 1-1.56 4.2a3.86 3.86 0 0 1-4.35.17l-51.1-31a11.88 11.88 0 0 0-12.38 0l-51.1 31a3.86 3.86 0 0 1-4.35-.17a4 4 0 0 1-1.56-4.2l13.52-58.54a12 12 0 0 0-3.82-11.8l-45.1-39.33a4 4 0 0 1-1.18-4.33a4 4 0 0 1 3.44-2.75l59.45-5.14a12 12 0 0 0 10-7.31l23.22-55.36a4 4 0 0 1 7.32 0l23.22 55.36a12 12 0 0 0 10 7.31l59.45 5.14a4 4 0 0 1 3.44 2.75a4 4 0 0 1-1.16 4.33"/></svg><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="M235.38 98.53A11.82 11.82 0 0 0 225 90.29l-59.45-5.14a4 4 0 0 1-3.32-2.44L139 27.36a11.95 11.95 0 0 0-22.06 0l-23.2 55.35a4 4 0 0 1-3.32 2.44L31 90.29a12 12 0 0 0-6.83 21.07l45.1 39.35a4 4 0 0 1 1.28 4L57 213.22a11.88 11.88 0 0 0 4.67 12.48a11.76 11.76 0 0 0 13.19.53l51.1-31a3.89 3.89 0 0 1 4.08 0l51.1 31a12 12 0 0 0 17.86-13l-13.52-58.54a4 4 0 0 1 1.28-4l45.1-39.35a11.89 11.89 0 0 0 3.52-12.81m-8.78 6.8l-45.1 39.35a12 12 0 0 0-3.82 11.8L191.2 215a4 4 0 0 1-1.56 4.2a3.86 3.86 0 0 1-4.35.17l-51.1-31a11.88 11.88 0 0 0-12.38 0l-51.1 31a3.86 3.86 0 0 1-4.35-.17a4 4 0 0 1-1.56-4.2l13.52-58.54a12 12 0 0 0-3.82-11.8l-45.1-39.33a4 4 0 0 1-1.18-4.33a4 4 0 0 1 3.44-2.75l59.45-5.14a12 12 0 0 0 10-7.31l23.22-55.36a4 4 0 0 1 7.32 0l23.22 55.36a12 12 0 0 0 10 7.31l59.45 5.14a4 4 0 0 1 3.44 2.75a4 4 0 0 1-1.16 4.33"/></svg><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="M235.38 98.53A11.82 11.82 0 0 0 225 90.29l-59.45-5.14a4 4 0 0 1-3.32-2.44L139 27.36a11.95 11.95 0 0 0-22.06 0l-23.2 55.35a4 4 0 0 1-3.32 2.44L31 90.29a12 12 0 0 0-6.83 21.07l45.1 39.35a4 4 0 0 1 1.28 4L57 213.22a11.88 11.88 0 0 0 4.67 12.48a11.76 11.76 0 0 0 13.19.53l51.1-31a3.89 3.89 0 0 1 4.08 0l51.1 31a12 12 0 0 0 17.86-13l-13.52-58.54a4 4 0 0 1 1.28-4l45.1-39.35a11.89 11.89 0 0 0 3.52-12.81m-8.78 6.8l-45.1 39.35a12 12 0 0 0-3.82 11.8L191.2 215a4 4 0 0 1-1.56 4.2a3.86 3.86 0 0 1-4.35.17l-51.1-31a11.88 11.88 0 0 0-12.38 0l-51.1 31a3.86 3.86 0 0 1-4.35-.17a4 4 0 0 1-1.56-4.2l13.52-58.54a12 12 0 0 0-3.82-11.8l-45.1-39.33a4 4 0 0 1-1.18-4.33a4 4 0 0 1 3.44-2.75l59.45-5.14a12 12 0 0 0 10-7.31l23.22-55.36a4 4 0 0 1 7.32 0l23.22 55.36a12 12 0 0 0 10 7.31l59.45 5.14a4 4 0 0 1 3.44 2.75a4 4 0 0 1-1.16 4.33"/></svg></div>
<div class="rating_empty" style="width: {{- $rating_percent -}}%;"><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="m234.5 114.38l-45.1 39.36l13.51 58.6a16 16 0 0 1-23.84 17.34l-51.11-31l-51 31a16 16 0 0 1-23.84-17.34l13.49-58.54l-45.11-39.42a16 16 0 0 1 9.11-28.06l59.46-5.15l23.21-55.36a15.95 15.95 0 0 1 29.44 0L166 81.17l59.44 5.15a16 16 0 0 1 9.11 28.06Z"/></svg><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="m234.5 114.38l-45.1 39.36l13.51 58.6a16 16 0 0 1-23.84 17.34l-51.11-31l-51 31a16 16 0 0 1-23.84-17.34l13.49-58.54l-45.11-39.42a16 16 0 0 1 9.11-28.06l59.46-5.15l23.21-55.36a15.95 15.95 0 0 1 29.44 0L166 81.17l59.44 5.15a16 16 0 0 1 9.11 28.06Z"/></svg><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="m234.5 114.38l-45.1 39.36l13.51 58.6a16 16 0 0 1-23.84 17.34l-51.11-31l-51 31a16 16 0 0 1-23.84-17.34l13.49-58.54l-45.11-39.42a16 16 0 0 1 9.11-28.06l59.46-5.15l23.21-55.36a15.95 15.95 0 0 1 29.44 0L166 81.17l59.44 5.15a16 16 0 0 1 9.11 28.06Z"/></svg><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="m234.5 114.38l-45.1 39.36l13.51 58.6a16 16 0 0 1-23.84 17.34l-51.11-31l-51 31a16 16 0 0 1-23.84-17.34l13.49-58.54l-45.11-39.42a16 16 0 0 1 9.11-28.06l59.46-5.15l23.21-55.36a15.95 15.95 0 0 1 29.44 0L166 81.17l59.44 5.15a16 16 0 0 1 9.11 28.06Z"/></svg><svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" class="rating_icon"><path fill="currentColor" d="m234.5 114.38l-45.1 39.36l13.51 58.6a16 16 0 0 1-23.84 17.34l-51.11-31l-51 31a16 16 0 0 1-23.84-17.34l13.49-58.54l-45.11-39.42a16 16 0 0 1 9.11-28.06l59.46-5.15l23.21-55.36a15.95 15.95 0 0 1 29.44 0L166 81.17l59.44 5.15a16 16 0 0 1 9.11 28.06Z"/></svg></div>
</div>
<span>{{- $rating | default "Null" -}}</span>
</div>

<div class="devsite-landing-row-item-buttons referrer">
{{- if eq .item.category $cate_movie -}}
<i class="fas fa-film fa-fw"></i>
{{- else if eq .item.category $cate_tv -}}
<i class="fas fa-tv fa-xs"></i>
{{- end -}}
<span class="neodb">
<a href="https://neodb.social{{- $movie_url -}}" target="_blank"
rel="noreferrer noopener nofollow">
<img class="lazy" src="/assets/images/movie/neodbsocial.jpg"
loading="lazy" alt="NeoDB" no-view>
</a>
</span>

{{- range .item.external_resources -}}
{{- $parsedURL := urls.Parse .url -}}
{{- $host := $parsedURL.Hostname -}}
{{- $title := .title -}}
<span class="external-resource">
<a href="{{- .url -}}" target="_blank"
rel="noreferrer noopener nofollow">
<img class="lazy" src="/assets/images/movie/{{- $host -}}.png"
loading="lazy" alt="{{- $title -}}" no-view>
</a>
</span>
{{- end -}}
<div class="tags">
{{ range first 5 .genre }}
<span class="">{{- . -}}</span>
{{ end }}
</div>

<div class="info">
</div>

<div class="star">
<h4>Info:</h4>
<ul>
<li class="neodb">
<a href="https://neodb.social{{- $movie_url -}}" target="_blank" rel="noreferrer noopener nofollow">
<img class="lazy" src="/assets/images/movie/neodbsocial.jpg" loading="lazy" alt="NeoDB" no-view>
</a>
</li>
{{ range .external_resources }}
{{ $parsedURL := urls.Parse .url }}
{{ $host := $parsedURL.Hostname }}
{{ $title := .title }}
{{ if not (strings.Contains .url "imdb.com") }}
<li class="external-resource">
<a href="{{- .url -}}" target="_blank" rel="noreferrer noopener nofollow">
<img class="lazy" src="/assets/images/movie/{{- $host -}}.png" loading="lazy" alt="{{- $title -}}" no-view>
</a>
</li>
{{ end }}
{{ end }}
{{ if and ($imdb) (ne $imdb "") }}
<li class="imdb">
<a href="https://www.imdb.com/title/{{- $imdb -}}" target="_blank" rel="noreferrer noopener nofollow">
<img class="lazy" src="/assets/images/movie/www.imdb.com.png" loading="lazy" alt="IMDB" no-view>
</a>
</li>
{{ end }}
</ul>

</div>
</div>
</div>

</div>

</div>
{{- end -}}
{{ end }}
</div>

</div>
</section>

Expand Down
Loading

0 comments on commit 2012a85

Please sign in to comment.