This commit is contained in:
Vicky 2018-03-25 12:29:01 -04:00
parent 8d23938eed
commit 1083561c7b

View file

@ -9,7 +9,7 @@
<div class="column is-half"> {{ else if eq (.Site.Params.projectColumns | default "3") "3" }}
<div class="column is-one-third"> {{ end }}
<!-- Hey Vicky, show half column if number is even. -->
<div {{ if not .Params.external_link }} id="project{{.Title | urlize}}" {{ end }} class="card">
<div {{ if not .Params.external_link }} id="project{{ $card := .Title | urlize }}{{ replace $card "%" ""}}" {{ end }} class="card">
<div class="card-image">
<figure class="image is-3by2">
<a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}>
@ -32,7 +32,7 @@
<!-- Projects modals -->
{{ range sort .Pages }} {{ if eq .Section "projects" }} {{ if not .Params.external_link }}
<div class="modal" id="modal{{.Title | urlize}}">
<div class="modal" id="modal{{ $card := .Title | urlize }}{{ replace $card "%" ""}}">
<div class="modal-background"></div>
<div class="modal-card">
{{ with .Title }}
@ -49,14 +49,14 @@
</section>
{{ end }}
</div>
<button class="modal-close is-large" aria-label="close" id="close{{.Title | urlize}}"></button>
<button class="modal-close is-large" aria-label="close" id="close{{ $card := .Title | urlize }}{{ replace $card "%" ""}}"></button>
</div>
<script>
$('#project{{.Title | urlize}}').click(function() {
$('#modal{{.Title | urlize}}').addClass('is-active');
$('#project{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').click(function() {
$('#modal{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').addClass('is-active');
});
$('#close{{.Title | urlize}}').click(function() {
$('#modal{{.Title | urlize}}').removeClass('is-active');
$('#close{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').click(function() {
$('#modal{{ $card := .Title | urlize }}{{ replace $card "%" ""}}').removeClass('is-active');
});
</script>
{{ end }} {{ end }} {{ end }}