-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
206 lines (202 loc) · 5.72 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
199
200
201
202
203
204
205
206
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>DEMO · GitHub Corners - PHP Version</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="GitHub Corners - PHP Version: A configurable github-corners icon written with PHP.">
<meta name="author" content="https://github.com/jxmot">
<style>
.outer {
margin-top: 25px;
height: 200px;
display: -webkit-flex;
display: flex;
}
.box {
padding: 10px;
height: 100%;
border: 2px solid black;
position: relative;
width: 200px;
margin: 0 auto;
}
</style>
</head>
<body>
<div style="position:fixed;right:0;top:0;">
<?php
$_SESSION['ghcfill'] = 'grey';
$_SESSION['ghccolor'] = 'black';
require './githubcorner.php';
?>
</div>
<div style="position:fixed;left:0;top:0;">
<?php
$_SESSION['ghcside'] = 'left';
$_SESSION['ghcfill'] = 'black';
$_SESSION['ghccolor'] = 'grey';
require './githubcorner.php';
?>
</div>
<h2 style="text-align:center;">
DEMO - GitHub Corners - PHP Version
</h2>
<div style="width:75%;margin: 0 auto;">
<p>
This demonstrates a modified version of the <i>original</i> <strong>github-corners</strong>
project.
<br>
The following settings are configured with a text file:
<ul>
<li>corner side</li>
<li>backgound color</li>
<li>foreground color</li>
<li>CSS file</li>
<li>target repo</li>
<li>link title</li>
</ul>
<br>
Text file example:
<pre style=""><code><strong>
./githubcorner.css,right,black,white,https://github.com/jxmot/github-corners-php,View source on GitHub
</strong></code></pre>
<br>
Here is an example of you would use the text file above and display the icon in a chosen corner:
</p>
</div>
<div style="width:50%;margin: 0 auto;overflow: auto;border: 1px solid black;">
<pre style=""><code><strong>
<div class="outer">
<div class="box">
<?php
// githubcorner.txt is the default configuration file
require './githubcorner.php';
?>
</div>
</div>
</strong></code></pre>
</div>
<br>
<!--
Render it in the corner of a <div>, change some
of the settings for each...
-->
<h4 style="text-align:center;">using githubcorner.txt</h4>
<div class="outer">
<div class="box">
<?php
require './githubcorner.php';
?>
</div>
</div>
<br>
<br>
<br>
<br>
<br>
<h3 style="text-align:center;">
GitHub Corners PHP - Additional Examples
</h3>
<br>
<p>
<div style="width:50%;margin: 0 auto;overflow: auto;border: 1px solid black;">
<pre style=""><code><strong>
<div class="outer">
<div class="box">
<?php
// specify a different config file
$_SESSION['ghccfg'] = './ghc-right-grey-orange.txt';
require './githubcorner.php';
?>
</div>
</div>
</strong></code></pre>
</div>
</p>
<br>
<h4 style="text-align:center;">ghc-right-grey-orange.txt</h4>
<div class="outer">
<div class="box">
<?php
$_SESSION['ghccfg'] = './ghc-right-grey-orange.txt';
require './githubcorner.php';
?>
</div>
</div>
<br>
<br>
<br>
<h4 style="text-align:center;">ghc-left-green-yellow.txt</h4>
<div class="outer">
<div class="box">
<?php
$_SESSION['ghccfg'] = './ghc-left-green-yellow.txt';
require './githubcorner.php';
?>
</div>
</div>
<br>
<br>
<br>
<div style="width:75%;margin: 0 auto;">
<p style="text-align:center;">
It is also possible to over-ride any one or
all settings in the text file.
</p>
</div>
<div style="width:50%;margin: 0 auto;overflow: auto;border: 1px solid black;">
<pre style=""><code><strong>
<div class="outer">
<div class="box">
<?php
// configuration file
$_SESSION['ghccfg'] = './githubcorner.txt';
$_SESSION['ghccolor'] = 'green';
$_SESSION['ghcside'] = 'left';
require './githubcorner.php';
?>
</div>
</div>
</strong></code></pre>
</div>
<br>
<h4 style="text-align:center;">githubcorner.txt</h4>
<div class="outer">
<div class="box">
<?php
$_SESSION['ghccfg'] = './githubcorner.txt';
$_SESSION['ghccolor'] = 'green';
$_SESSION['ghcside'] = 'left';
require './githubcorner.php';
?>
</div>
</div>
<br>
<br>
<br>
<div style="width:50%;margin: 0 auto;">
<p style="text-align:justify;">
To make it "stick" to the top of the page like it is
here, wrap it in a <div>.
<br><br><strong>Like this:</strong>
</p>
</div>
<div style="width:50%;margin: 0 auto;overflow: auto;border: 1px solid black;">
<pre style=""><code><strong>
<!--
NOTE: To move to the left side, change the text file
or over-ride the setting. But <u>make sure to also change</u>
the outer <div> style from "right:0" to "left:0".
-->
<div style="position:fixed;right:0;top:0;">
<?php
$_SESSION['ghcfill'] = 'grey';
$_SESSION['ghccolor'] = 'black';
require './githubcorner.php';
?>
</div>
</strong></code></pre>
</div>
</body>
</html>