-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
141 lines (126 loc) · 5.97 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Linecision</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="favicon.ico" rel="icon">
<link href="style.css" rel="stylesheet">
<script src="script.js"></script>
<script src="Linecision.js"></script>
<script src="i18n/i18n.js"></script>
<script src="theme.js"></script>
</head>
<body class="light">
<!-- header -->
<header>
<h1 class="title" data-i18n="title"></h1>
<div class="spacer"></div>
<!-- theme selection -->
<button class="gray" onclick="changeTheme()"
style="display: flex; align-items: center; justify-content: center; padding: 3px; width: 64px; height: 64px;">
<img class="hide-light" alt="L" src="icons/sun-fill.svg" height="75%" style="filter: invert();" />
<img class="hide-dark" alt="D" src="icons/moon-fill.svg" height="75%" />
</button>
<!-- Language selection -->
<div style="position: relative;">
<button class="primary" onclick="document.getElementById('change-language').classList.toggle('invisible')"
data-i18n="language.change" style="height:100%;"></button>
<fieldset id="change-language" class="gray invisible"
onchange="changeLanguage([...document.getElementById('change-language').getElementsByTagName('input')].filter(e => e.checked)[0].value);"
onmouseout="const el = event.toElement || event.relatedTarget; if(this == el || this.contains(el)) return; document.getElementById('change-language').classList.add('invisible');">
<legend data-i18n="language.selection.title"></legend>
<input type="radio" id="change-language-en" name="language" value="en">
<div class="label">
<label for="change-language-en">🇺🇸</label>
<label for="change-language-en">English</label>
</div>
<input type="radio" id="change-language-de" name="language" value="de">
<div class="label">
<label for="change-language-de">🇩🇪</label>
<label for="change-language-de">Deutsch</label>
</div>
<input type="radio" id="change-language-ca" name="language" value="ca">
<div class="label">
<label for="change-language-ca">🐈</label>
<label for="change-language-ca">Lolcat</label>
</div>
<script type="text/javascript">
document.getElementById('change-language-' + detectLanguage()).checked = true;
</script>
</fieldset>
</div>
</header>
<!-- inputs -->
<div id="inputs">
<!-- dimensions -->
<div>
<span data-i18n="inputs.dimensions"></span><span>: </span>
<input type="number" min="1" step="1" value="3" size="4"
onchange="window.linecision.setDimensons(event.target.value);" style="width: auto" />
</div>
<!-- line 1 -->
<div class="line-def" id="line1">
<span>g<sub>1</sub>: <span class="vector-symbol">X</span> = </span>
<div class="vector" id="start1"></div>
<span>+ λ ×</span>
<div class="vector" id="direction1"></div>
<span>; λ ∈ ℝ</span>
</div>
<!-- line 2 -->
<div class="line-def" id="line2">
<span>g<sub>2</sub>: <span class="vector-symbol">X</span> = </span>
<div class="vector" id="start2"></div>
<span>+ μ ×</span>
<div class="vector" id="direction2"></div>
<span>; μ ∈ ℝ</span>
</div>
<!-- button -->
<button class="secondary" data-i18n="inputs.calculate"
onclick="updateFlags(window.linecision.calculate())"></button>
</div>
<!-- output -->
<div id="output">
<!-- 1 -->
<div>
<div class="outputitem" id="question-parallel" data-i18n="outputs.question.parallel"></div>
</div>
<!-- 2 -->
<div>
<div class="outputitem" id="question-same" data-i18n="outputs.question.same"></div>
<div class="outputitem" id="question-cuttingpoint" data-i18n="outputs.question.cuttingpoint"></div>
</div>
<!-- 3 -->
<div>
<div class="outputitem" id="final-parallel" data-i18n="outputs.final.parallel"></div>
<div class="outputitem" id="final-same" data-i18n="outputs.final.same"></div>
<div class="outputitem" id="question-perpendicular" data-i18n="outputs.question.perpendicular"></div>
<div class="outputitem" id="final-none" data-i18n="outputs.final.none"></div>
</div>
<!-- 4 -->
<div>
<div class="outputitem" id="final-cuttingpoint" data-i18n="outputs.final.cuttingpoint"></div>
<div class="outputitem" id="final-perpendicular" data-i18n="outputs.final.perpendicular"></div>
</div>
</div>
<!-- call init funcitons that need the body to exist -->
<script type="text/javascript">
updateTheme();
window.linecision = new Linecision(
{
'start': document.getElementById('start1'),
'direction': document.getElementById('direction1')
},
{
'start': document.getElementById('start2'),
'direction': document.getElementById('direction2')
}
);
initScript();
</script>
<!-- i18n strings for js -->
<div style="display: none">
<div id="i18n-error.input.nan" data-i18n="error.input.nan"></div>
</div>
</body>
</html>