A short explanation. . .
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Two 3x4 Portrait Cards on One 4x6</title>
<style>
@page {
size: 6in 4in;
margin: 0;
}
:root {
--sheet-w: 6in;
--sheet-h: 4in;
--card-w: 3in;
--card-h: 4in;
--pad-top: 0.20in;
--pad-side: 0.18in;
--pad-bottom: 0.12in;
--name-bar-h: calc(var(--card-h) * 0.18);
/* Updated name bar colors */
--name-bg: #ffffff;
--name-color: #000000;
--name-font: 16px;
}
body {
margin: 0;
padding: 0;
background: #ffffff;
}
.sheet {
width: var(--sheet-w);
height: var(--sheet-h);
position: relative;
background: #ffffff;
page-break-after: always;
box-sizing: border-box;
}
.card {
width: var(--card-w);
height: var(--card-h);
position: absolute;
top: 0;
background: #ffffff;
overflow: hidden;
box-sizing: border-box;
}
.card.left { left: 0; }
.card.right { left: var(--card-w); }
.photo-area {
position: absolute;
left: var(--pad-side);
right: var(--pad-side);
top: var(--pad-top);
bottom: calc(var(--name-bar-h) + var(--pad-bottom));
overflow: hidden;
background: #ffffff;
box-sizing: border-box;
}
.photo-area img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.name-box {
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: var(--name-bar-h);
background: var(--name-bg);
color: var(--name-color);
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-size: var(--name-font);
font-family: Avenir, Helvetica, Arial, sans-serif;
line-height: 1.1;
padding: 0 0.12in;
box-sizing: border-box;
}
</style>
</head>
<body>
{% for person in people %}
{% if person.photo_url and person.photo_url != '' %}
{% assign idx = forloop.index0 %}
{% assign mod = idx | modulo: 2 %}
{% if mod == 0 %}
<div class="sheet">
<div class="card left">
<div class="photo-area">
<img src="{{ person.photo_url }}" alt="{{ person.first_name }} {{ person.last_name }}">
</div>
<div class="name-box">
{{ person.first_name }} {{ person.last_name }}
</div>
</div>
{% else %}
<div class="card right">
<div class="photo-area">
<img src="{{ person.photo_url }}" alt="{{ person.first_name }} {{ person.last_name }}">
</div>
<div class="name-box">
{{ person.first_name }} {{ person.last_name }}
</div>
</div>
</div>
{% endif %}
{% if forloop.last and mod == 0 %}
</div>
{% endif %}
{% endif %}
{% endfor %}
</body>
</html>