-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
105 lines (94 loc) · 3.41 KB
/
index.html
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
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Total Internal Reflection Visualization - Joon Shakya</title>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="theme-color" content="#000000">
<meta property="og:type" content="profile" />
<meta property="og:title" content="Total Internal Reflection Visualization - Joon Shakya" />
<meta property="og:description" content="This is a visualization of total internal refraction coded by Joon Shakya" />
<meta property="og:image" content="https://refraction.joonshakya.com.np/favicon/thumbnail.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:url" content="https://refraction.joonshakya.com.np/" />
<meta property="fb:app_id" content="1265498347173300" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<link rel="shortcut icon" href="./favicon/favicon.ico" />
<link rel="icon" type="image/gif" href="./favicon/animated_favicon1.gif" />
<link rel="apple-touch-icon" href="./favicon/apple-touch-icon.png" />
<script language="javascript" type="text/javascript" src="./js/p5.min.js"></script>
<!-- uncomment lines below to include extra p5 libraries -->
<script language="javascript" src="./js/p5.dom.min.js"></script>
<!--<script language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.sound.min.js"></script>-->
<!-- this line removes any default padding and style. you might only need one of these values set. -->
<style>
html {
-webkit-tap-highlight-color: rgba(0, 0, 0, .05);
}
body {
background: rgb(51, 51, 51);
min-height: 100vh;
padding: 0;
margin: 0;
}
input {
-webkit-appearance: none;
width: 100%;
height: 24px;
background: linear-gradient(#00000000 25%, #d3d3d3, #00000000 75%);
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
}
input:hover {
opacity: 1;
}
input::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 24px;
height: 24px;
background: #4CAF50;
cursor: pointer;
border-radius: 50%;
}
input::-moz-range-thumb {
width: 24px;
height: 24px;
background: #4CAF50;
cursor: pointer;
border-radius: 50%;
}
</style>
</head>
<body>
<script language="javascript" type="text/javascript" src="./js/sketch.js"></script>
<script>
var winWidth = document.documentElement.clientWidth;
var winHeight = document.documentElement.clientHeight;
var landS = winWidth > winHeight * 1.3;
var portT = winHeight > winWidth * 1.3;
var moveBody = (winWidth - winHeight / 1.3) / 2;
var newBodyW = winHeight / 1.3;
if (!landS && !portT) {
document.body.style.transform = "translateX(" + moveBody + "px)";
document.body.style.width = newBodyW + "px";
}
window.addEventListener('load', e => {
registerSW();
function registerSW() {
if ('serviceWorker' in navigator) {
try {
navigator.serviceWorker.register("sw.js");
} catch (e) {
alert('ServiceWorker registration failed. Sorry about that.');
}
}
}
});
</script>
</body>
</html>