summaryrefslogtreecommitdiff
path: root/themes/cranky/layouts/shortcodes/prj.html
blob: 246a8e127f69b8ec38082571c3b942aaeec44622 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<div class="container">
  <!-- Loop through all projects -->
  {{ range first 3 (where .Site.RegularPages "Section" "projects") }}
  <a class="card" href="{{ .Permalink }}">
    <h3 class="title">{{ .Title }}</h3>
    <div class="bar">
      <div class="emptybar"></div>
      <div class="filledbar"></div>
    </div>
    <p class="summary">{{ .Summary | truncate 220 "..." }}</p>
  </a>
  <!-- End the loop -->
  {{ end }}
</div>
<a class="button projects" href="/projects">More Projects</a>
<style>
  .container {
    position: relative;
    height: auto;
    width: 600px;
    left: calc(50% - 300px);
    display: flex;
    margin-bottom: 30px;
  }

  .card {
    display: flex;
    height: auto;
    width: 230px;
    margin-top: 20px;
    /* background-color: #222d32; */
    background: linear-gradient(-45deg, #111a1f, #222d32);
    color: var(--text-fg);
    border-radius: 10px;
    box-shadow: -1rem 0 3rem #000;
    /* margin-left: -50px; */
    transition: 0.4s ease-out;
    position: relative;
    left: 0px;
  }

  .card:not(:first-child) {
    margin-left: -50px;
  }

  .card:hover {
    box-shadow: 0 0 4rem #554;
    transform: translateY(-20px);
    transition: 0.4s ease-out;
    color: var(--text-fg);
  }

  .card:hover ~ .card {
    position: relative;
    left: 70px;
    transition: 0.4s ease-out;
  }

  .title {
    color: var(--text-fg);
    font-weight: bold;
    position: absolute;
    left: 20px;
    top: 15px;
  }

  .card:hover > .title {
    color: var(--header-fg);
    transition: 0.4s ease-out;
  }

  .bar {
    position: absolute;
    top: 70px;
    left: 20px;
    height: 5px;
    width: 150px;
  }

  .summary {
    /* position: relative; */
    margin-top: 80px;
    margin-left: 10px;
    margin-right: 10px;
    top: 70px;
    left: 20px;
  }

  .emptybar {
    background-color: #2e3033;
    width: 100%;
    height: 100%;
  }

  .filledbar {
    position: absolute;
    top: 0px;
    z-index: 3;
    width: 0px;
    height: 100%;
    background: linear-gradient(90deg, #66aabb 0%, #8ea374 22%, #ebcb88 100%);
    transition: 0.6s ease-out;
  }

  .card:hover .filledbar {
    width: 120px;
    transition: 0.4s ease-out;
  }
  /* center the button */
  .projects {
    position: relative;
    left: calc(50% - 50px);
    margin-top: 30px;
    margin-bottom: 30px;
  }
</style>