Skip to content

Commit 3a09c05

Browse files
committed
add contribute banner to all pages
1 parent 94e773b commit 3a09c05

File tree

5 files changed

+86
-66
lines changed

5 files changed

+86
-66
lines changed

build/templates/header.template

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
</div>
77
<div class="threejs_header">
88
<h1><a href="{{langInfo.home}}">threejsfundamentals.org</a></h1>
9+
{{{include "build/templates/repobanner.template"}}}
910
</div>
1011

build/templates/index.template

+1-66
Original file line numberDiff line numberDiff line change
@@ -98,73 +98,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9898
</div>
9999
</div>
100100
</div>
101+
{{{include "build/templates/repobanner.template"}}}
101102
<iframe class="background" src="/threejs/background.html"></iframe>
102-
<style>
103-
#forkongithub a {
104-
background: #000;
105-
color: #fff;
106-
text-decoration: none;
107-
font-family: arial,sans-serif;
108-
text-align: center;
109-
font-weight: bold;
110-
padding: 5px 40px;
111-
font-size: 0.9rem;
112-
line-height: 2rem;
113-
position: relative;
114-
transition: 0.5s;
115-
display: block;
116-
width: 300px;
117-
position: absolute;
118-
top: 0;
119-
right: 0;
120-
transform: translateX(150px) rotate(45deg) translate(10px,70px);
121-
box-shadow: 4px 4px 10px rgba(0,0,0,0.8);
122-
pointer-events: auto;
123-
}
124-
#forkongithub a:hover {
125-
background: #c11;
126-
color: #fff;
127-
}
128-
#forkongithub a::before,#forkongithub a::after {
129-
content: "";
130-
width: 100%;
131-
display: block;
132-
position: absolute;
133-
top: 1px;
134-
left: 0;
135-
height: 1px;
136-
background: #fff;
137-
}
138-
#forkongithub a::after {
139-
bottom: 1px;
140-
top: auto;
141-
}
142-
143-
#forkongithub{
144-
z-index: 9999;
145-
/* needed for firefox */
146-
overflow: hidden;
147-
width: 300px;
148-
height: 300px;
149-
position: absolute;
150-
right: 0;
151-
top: 0;
152-
pointer-events: none;
153-
}
154-
@media (max-width: 900px) {
155-
#forkongithub a{
156-
line-height: 1.2rem;
157-
}
158-
}
159-
@media (max-width: 410px) {
160-
#forkongithub a{
161-
font-size: 0.7rem;
162-
transform: translateX(150px) rotate(45deg) translate(20px,40px);
163-
}
164-
}
165-
166-
</style>
167-
<div id="forkongithub"><a href="https://github.com/gfxfundamentals/threejsfundamentals">Fix or Fork me on GitHub</a></div>
168103
</body>
169104
<script src="/3rdparty/jquery-3.3.1.slim.min.js"></script>
170105
<script src="/threejs/lessons/resources/lesson.js"></script>

build/templates/octocat-icon.svg

+7
Loading

build/templates/repobanner.template

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<style>
2+
#forkongithub a {
3+
background: #000;
4+
color: #fff;
5+
text-decoration: none;
6+
font-family: arial,sans-serif;
7+
text-align: center;
8+
font-weight: bold;
9+
padding: 5px 40px;
10+
font-size: 0.9rem;
11+
line-height: 2rem;
12+
position: relative;
13+
transition: 0.5s;
14+
display: block;
15+
width: 300px;
16+
position: absolute;
17+
top: 0;
18+
right: 0;
19+
transform: translateX(150px) rotate(45deg) translate(10px,70px);
20+
box-shadow: 4px 4px 10px rgba(0,0,0,0.8);
21+
pointer-events: auto;
22+
}
23+
#forkongithub a:hover {
24+
background: #c11;
25+
color: #fff;
26+
}
27+
#forkongithub a::before,#forkongithub a::after {
28+
content: "";
29+
width: 100%;
30+
display: block;
31+
position: absolute;
32+
top: 1px;
33+
left: 0;
34+
height: 1px;
35+
background: #fff;
36+
}
37+
#forkongithub a::after {
38+
bottom: 1px;
39+
top: auto;
40+
}
41+
42+
#forkongithub{
43+
z-index: 9999;
44+
/* needed for firefox */
45+
overflow: hidden;
46+
width: 300px;
47+
height: 300px;
48+
position: absolute;
49+
right: 0;
50+
top: 0;
51+
pointer-events: none;
52+
}
53+
#forkongithub svg{
54+
width: 1em;
55+
height: 1em;
56+
vertical-align: middle;
57+
}
58+
@media (max-width: 900px) {
59+
#forkongithub a{
60+
line-height: 1.2rem;
61+
}
62+
}
63+
@media (max-width: 700px) {
64+
#forkongithub {
65+
display: none;
66+
}
67+
}
68+
@media (max-width: 410px) {
69+
#forkongithub a{
70+
font-size: 0.7rem;
71+
transform: translateX(150px) rotate(45deg) translate(20px,40px);
72+
}
73+
}
74+
75+
</style>
76+
<div id="forkongithub"><a href="https://github.com/gfxfundamentals/threejsfundamentals">Fix, Fork, Contribute {{{include "build/templates/octocat-icon.svg"}}}</a></div>

threejs/lessons/resources/lesson.css

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ div[data-diagram] {
123123
background-position: center, center;
124124
padding: 1em;
125125
text-align: center;
126+
position: relative;
126127
}
127128
.threejs_header h1 {
128129
font-size: 5vw;

0 commit comments

Comments
 (0)