-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
executable file
·151 lines (125 loc) · 4.87 KB
/
home.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
<?php
include "page_template.html"
?>
<div id="temp-content" style="display: none;">
<div id="gallery-container">
<div id="central-image">
<br><br><br>
<p style="text-align: center; font: white;">
Welcome to my website!<br>
I hope you will enjoy it and find useful stuff!<br>
</p>
</div>
<div class="home-img-container" >
<a href="about.php">
<img src="img/jump-250px-square.png" onmouseover="this.style.filter='grayscale(100%)'; this.style.opacity='0.5'"
onmouseout="this.style.filter='grayscale(0%)'; this.style.opacity='1'">
<div class="img-desc"><b>ABOUT</b></div>
</a>
</div>
<div class="home-img-container" >
<a href="research.php">
<img src="img/research-250px.jpg" onmouseover="this.style.filter='grayscale(100%)'; this.style.opacity='0.5'"
onmouseout="this.style.filter='grayscale(0%)'; this.style.opacity='1'">
<div class="img-desc"><b>RESEARCH</b></div>
</a>
</div>
<div class="home-img-container" >
<a href="programming.php">
<img src="img/programming6-250px.jpg" onmouseover="this.style.filter='grayscale(100%)'; this.style.opacity='0.5'"
onmouseout="this.style.filter='grayscale(0%)'; this.style.opacity='1'">
<div class="img-desc"><b>PROGRAMMING</b></div>
</a>
</div>
<div class="home-img-container" >
<a href="contact.php">
<img src="img/contact3-250px.jpg" onmouseover="this.style.filter='grayscale(100%)'; this.style.opacity='0.5'"
onmouseout="this.style.filter='grayscale(0%)'; this.style.opacity='1'">
<div class="img-desc"><b>CONTACT</b></div>
</a>
</div>
<div class="home-img-container" >
<a href="teaching.php">
<img src="img/teaching-250px.jpg" onmouseover="this.style.filter='grayscale(100%)'; this.style.opacity='0.5'"
onmouseout="this.style.filter='grayscale(0%)'; this.style.opacity='1'">
<div class="img-desc"><b>TEACHING</b></div>
</a>
</div>
</div>
</div>
<script>
var chapter = 'home' ;
var x = document.getElementById('temp-content') ;
document.getElementById('main').innerHTML = x.innerHTML ;
</script>
<script>
var radians, radius, originX, originY;
var x, y;
var angle;
var num_element;
var t;
var rect;
var img_width, img_height;
// set main background
t = document.getElementById('main') ;
t.style.backgroundColor = 'transparent';
img_width = '175';
img_height = '175';
radius = 275; // radius of the big circle
// gallery-container style
t = document.getElementById('gallery-container');
//t.innerHTML = t.offsetTop + ", " + t.offsetLeft + "-- " + t.offsetBottom + ", " + t.offsetRight ;
t.style.position = 'relative' ;
t.style.margin = '0 auto' ;
t.style.textAlign = 'center' ;
//t.style.top = '100';
//t.style.left = '100';
t.style.width = '750px';
var temp;
temp = parseInt(2*radius) + parseInt(img_height) ;
t.style.height = temp.toString() + 'px'; //'100%';
//t.style.backgroundColor = 'white';
rect = t.getBoundingClientRect();
//t.innerHTML = rect.top + ", " + rect.left + " -- " + rect.bottom + ", " + rect.right ;
// set origin in the middle of the container
originX = (rect.right-rect.left)/2 - img_width/2;
originY = (rect.bottom-rect.top)/2 - img_height/2 - 100;
// central element
t = document.getElementById('central-image');
x = originX;
y = originY;
t.style.left = x + 'px';
t.style.top = y + 'px';
//t.innerHTML = x + ',' + y;
// central-image style
t = document.getElementById('central-image');
t.style.position = 'absolute' ;
//t.style.border = '1px solid black';
t.style.borderRadius = '50%';
t.style.width = img_width + 'px';
t.style.height = img_height + 'px';
t = document.getElementsByClassName('home-img-container');
num_element = t.length / 2; // not clear why t.lenght returns
// twice the supposed length... ?????
angle = 2*Math.PI/num_element ;
// home-img-container style
for (i = 0; i < num_element; i++) {
t[i].style.paddingBottom = '40px';
t[i].style.position = 'absolute' ;
//t[i].style.border = '1px solid black';
t[i].style.borderRadius = '50%';
//t[i].style.margin = '30px';
t[i].style.width = img_width + 'px';
t[i].style.height = img_height + 'px';
t[i].getElementsByClassName('img-desc')[0].style.color = '#707070';
// circle parameters
t[i].getElementsByTagName('img')[0].style.height = img_width + 'px';
t[i].getElementsByTagName('img')[0].style.width = img_height + 'px';
t[i].getElementsByTagName('img')[0].style.borderRadius = '50%';
x = originX + ((4/4)*Math.cos(angle*(i) - Math.PI/2 - angle/2) * radius);
y = originY + ((4/4)*Math.sin(angle*(i) - Math.PI/2 - angle/2) * radius);
t[i].style.left = x + 'px';
t[i].style.top = y + 'px';
//t.innerHTML = x + ',' + y + '<br> t' + i.toString() + '<br> a=' + angle*i ;
}
</script>