-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
198 lines (168 loc) · 7.61 KB
/
index.php
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?php
$package_raw = file_get_contents('package.json');
$package_json = json_decode($package_raw,true);
$version = $package_json['version'];
?>
<!DOCTYPE html>
<html>
<head>
<title>Cevi-Logo Generator</title>
<meta name="og:image" content="https://logo.cevi.ch/assets/images/logo.svg">
<meta name="description" content="Logo Generator für dein eigenes Cevi-Logo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="author" content="Beat Temperli v/o Zottel">
<link rel="icon" type="image/png" href="assets/images/favicon.png">
<link rel="stylesheet" href="assets/css/styles.css?v<?php echo $version; ?>" />
</head>
<body>
<?php
require_once 'ApiHelper.php';
$show_iframe = key_exists('iframe', $_GET) && $_GET['iframe'] === 'true';
$input_logo['left'] = 'CEVI';
$input_logo['right'] = 'SCHWEIZ';
$input_logo['right-second'] = '';
$claim['left'] = 'VIELFALT GEMEINSAM';
$claim['right'] = ' ERLEBEN.';
$color = 'web';
$api_helper = new ApiHelper();
$id = $api_helper->getNewSessionId();
foreach (array_keys($input_logo) as $key) {
if (isset($_GET['logo-' . $key])) {
$input_logo[$key] = $_GET['logo-' . $key];
}
}
foreach (array_keys($claim) as $key) {
if (isset($_GET['claim-' . $key])) {
$claim[$key] = $_GET['claim-' . $key];
}
}
if (isset($_GET['color'])) {
$color = $_GET['color'];
}
?>
<?php if (!$show_iframe): ?>
<header class="header-bar">
<div class="logowrapper">
<a href="https://logo.cevi.ch/" class="logo">
<img alt="Logo Cevi Schweiz" class="image" src="assets/images/logo.svg">
<img alt="Kurzes Logo Cevi Schweiz" class="image -short" src="assets/images/logo.svg">
</a>
</div>
</header>
<?php endif; ?>
<div class="logo-generator <?php if ($show_iframe): echo '-iframe'; endif; ?>">
<h1>Cevi Logo Generator <small>[v<?php echo $version; ?>]</small></h1>
<form name="logoGeneratorForm" class="userinputform">
<div class="userinputs">
<div class="form-wrapper inputwrapper">
<label for="input-logo-left">Logo links</label>
<input id="input-logo-left" class="input" name="left" value="<?php echo $input_logo['left']; ?>">
</div>
<div class="form-wrapper inputwrapper">
<label for="input-logo-right">Logo rechts (1. Zeile)</label>
<input id="input-logo-right" class="input" name="logo-right" value="<?php echo $input_logo['right']; ?>">
</div>
<div class="form-wrapper inputwrapper">
<label for="input-logo-right-second">Logo rechts (2. Zeile)</label>
<input id="input-logo-right-second" class="input" name="logo-right-second" value="<?php echo $input_logo['right-second']; ?>">
</div>
<div class="form-wrapper inputwrapper">
<label for="input-claim-left">Claim links</label>
<input id="input-claim-left" class="input" name="claim-left" value="<?php echo $claim['left']; ?>">
</div>
<div class="form-wrapper inputwrapper">
<label for="input-claim-right">Claim rechts</label>
<input id="input-claim-right" class="input" name="claim-right" value="<?php echo $claim['right']; ?>">
</div>
</div>
<div class="form-wrapper">
<legend>Farben für die Ausgabe</legend>
<div>
<input type="radio" id="web"
name="color" value="web" <?php if ($color === 'web') { echo 'checked'; } ?> />
<label class="-radio" for="web">RGB (Web / Online)</label>
</div>
<div>
<input type="radio" id="print"
name="color" value="print" <?php if ($color === 'print') { echo 'checked'; } ?> />
<label class="-radio" for="print">CMYK (Druck / Druckerei)</label>
</div>
<div>
<input type="radio" id="black"
name="color" value="black" <?php if ($color === 'black') { echo 'checked'; } ?> />
<label class="-radio" for="black">Schwarz</label>
</div>
</div>
</form>
<h2>Generierte Logos</h2>
<div class="generatoroutput">
<div class="info">SVG Logo (Vektorgrafik)</div>
<div class="svgwrapper" id="svg-logo-output"></div>
<div class="linkwrapper">
<a class="link" href="#" target="_blank" id="svg-logo-link" download="logo.svg">Download SVG Logo</a>
<a class="link -share js-share-link" href="#" target="_blank">Share SVG Logo</a>
</div>
</div>
<div class="generatoroutput">
<div class="info">
PNG Logo
</div>
<img src="#" alt="Logo Ausgabe im Format PNG" id="png-logo-output"/>
<div class="linkwrapper">
<a class="link" href="#" target="_blank" id="png-logo-link" download="logo.png">Download PNG Logo</a>
<a class="link -share js-share-link" href="#" target="_blank">Share PNG Logo</a>
</div>
</div>
<div class="generatoroutput">
<div class="info">
JPG Logo
</div>
<img src="#" alt="Logo Ausgabe im Format JPG" id="jpg-logo-output"/>
<div class="linkwrapper">
<a class="link" href="#" target="_blank" id="jpg-logo-link" download="logo.jpg">Download JPG Logo</a>
<a class="link -share js-share-link" href="#" target="_blank">Share JPG Logo</a>
</div>
</div>
<div class="clear-fix"></div>
<h2>Generierte Claims</h2>
<div class="generatoroutput -claim">
<div class="info">SVG Claim (Vektorgrafik)</div>
<div class="svgwrapper" id="svg-claim-output"></div>
<div class="linkwrapper">
<a class="link" href="#" target="_blank" id="svg-claim-link" download="claim.svg">Download SVG Claim</a>
<a class="link -share js-share-link" href="#" target="_blank">Share SVG Claim</a>
</div>
</div>
<div class="generatoroutput -claim">
<div class="info">
PNG Claim (teilweise transparent)
</div>
<img src="#" alt="Claim Ausgabe im Format PNG" id="png-claim-output"/>
<div class="linkwrapper">
<a class="link" href="#" target="_blank" id="png-claim-link" download="claim.png">Download PNG Claim</a>
<a class="link -share js-share-link" href="#" target="_blank">Share PNG Claim</a>
</div>
</div>
<div class="clear-fix"></div>
<div class="generatoroutput hidden">
<div class="info">
CANVAS LOGO
</div>
<canvas id="canvas-logo-output" />
</div>
<div class="generatoroutput hidden">
<div class="info">
CANVAS CLAIM
</div>
<canvas id="canvas-claim-output" />
</div>
<div class="generatoroutput hidden">
<svg id="svg-test"></svg>
</div>
</div>
<script>
document.session_id = '<?php echo $id; ?>';
</script>
<script src="assets/js/scripts.min.js?v<?php echo $version; ?>"></script>
</body>
</html>