-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
425 lines (404 loc) · 16.6 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
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
<!DOCTYPE HTML>
<!--
Dimension by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<noscript>
<meta http-equiv="refresh" content="0;url=noscript">
</noscript>
<title>Mate-Romania</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<noscript>
<link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
<link href="/images/favicon.ico" rel="icon" type="image/x-icon" />
<meta name="referrer" content="no-referrer">
</head>
<body class="is-preload">
<!-- Wrapper -->
<div id="wrapper">
<!-- Header -->
<header id="header">
<div class="logo">
<span class="fa fa-infinity"></span>
</div>
<div class="content">
<div class="inner">
<h1>Mate-Romania</h1>
<p>Un website creat de elevi pentru elevi</p>
</div>
</div>
<nav>
<ul>
<li><a href="#proiecte">Proiecte</a></li>
<!-- <li><a href="#work">Work</a></li> -->
<li><a href="#despre">Despre</a></li>
<li><a href="#contact">Contact</a></li>
<!-- <li><a href="#elements">Elements</a></li> -->
</ul>
</nav>
</header>
<!-- Main -->
<div id="main">
<!-- proiecte -->
<article id="proiecte">
<h2 class="major">proiecte</h2>
<button class="buton1" onClick="document.getElementById('radical').scrollIntoView();"><i class="fas fa-square-root-alt"></i> Radical</button>
<button class="buton2" onClick="document.getElementById('cmmdc').scrollIntoView();"><i class="fas fa-angle-right"></i> CMMDC/CMMMC</button>
<button class="buton3" onClick="document.getElementById('medii').scrollIntoView();"><i class="fas fa-wave-square"></i> Medii</button>
<button class="buton4" onClick="document.getElementById('permutari').scrollIntoView();"><i class="fas fa-memory"></i> Permutari</button>
<button class="buton5" onClick="document.getElementById('factoriprimi').scrollIntoView();"><i class="fas fa-sort"></i> Descompunere</button>
<style>
#butonsus {
/* position: fixed; */
display: flex;
justify-content: center;
bottom: 10px;
/* width: 40%; */
}
</style>
<p> </p>
<div id="radical">
<h3>Program pentru scoaterea factorilor de sub radical:</h3>
<p>Exemplu: radical din <i>48</i> este egal cu 4 radical din 3.</p>
<p>
</p>
<p id="sout"></p>
<h4>Numarul de sub radical: </h4>
<input type="text" name="Numarul sub radical:" id="inputnr">
<h4> </h4>
<button onclick="sdsr()" id="buton0">Trimite</button>
<script>
var input = document.getElementById("inputnr");
input.addEventListener("keyup", function(event)
{
if (event.keyCode === 13)
{
event.preventDefault();
document.getElementById("buton0").click();
}
});
function sdsr()
{
var i, n, n2, aux1, aux2;
aux1 = 0;
aux2 = 1;
n = document.getElementById("inputnr").value;
if (isNaN(n))
document.getElementById("sout").innerHTML = "<b>Rezultat:</b><br> Scrie un numar format din <b>cifre</b>!";
else
if (n == 0)
document.getElementById("sout").innerHTML = "<b>Rezultat:</b><br> Numarul cu radical este egal cu 0 (radical din 0 este egal cu 0).";
else
{
n2 = n;
for (i = 2; i <= n; i++)
{
if ((n % i) == 0)
{
if (i == aux1)
{
aux2 = aux2 * aux1;
aux1 = 0;
}
else
{
aux1 = i;
}
n /= i;
i--;
}
}
n = n2 / (aux2 * aux2);
if (aux2 != 1 && n != 1)
var sir = "<b>Rezultat:</b><br> Numarul cu radical este egal cu " + aux2 + " radical din " + n + ".";
else
if (aux2 != 1)
var sir = "<b>Rezultat:</b><br> Numarul cu radical este egal cu " + aux2 + ".";
else
var sir = "<b>Rezultat:</b><br> Numarul de sub radical este compus din numere prime, deci rezultatul este numarul initial, radical din " + n + ".";
document.getElementById("sout").innerHTML = sir;
}
}
</script>
</div>
<p> </p>
<div id="cmmdc">
<h3>Program pentru aflarea CMMDC si CMMMC a doua numere:</h3>
<p>Exemplu: CMMDC si CMMMC pentru numerele <i>36</i> si <i>24</i> este 12, respectiv, 72.</p>
<p id="sout2"></p>
<h4>Primul numar:</h4>
<input type="text" name="primulnr" id="inputnr1">
<pre>
</pre>
<h4>Al doilea numar:</h4>
<input type="text" name="aldoileanr" id="inputnr2">
<h4> </h4>
<button onclick="cmm_c()" id="buton1">Trimite</button>
<script>
var input2 = document.getElementById("inputnr2");
input2.addEventListener("keyup", function(event)
{
if (event.keyCode === 13)
{
event.preventDefault();
document.getElementById("buton1").click();
}
});
function cmm_c()
{
var a, b, m, t;
a = document.getElementById("inputnr1").value;
b = document.getElementById("inputnr2").value;
if (isNaN(a) || isNaN(b))
document.getElementById("sout2").innerHTML = "<b>Rezultat:</b><br> Scrie un numar format din <b>cifre</b>!";
else
if (a == 0 && b == 0)
document.getElementById("sout2").innerHTML = "<b>Rezultat:</b><br> CMMDC=0; <br>CMMMC=0.";
else
{
m = a * b;
while (b != 0)
{
t = b;
b = a % b;
a = t;
}
var sir = "<b>Rezultat:</b><br> CMMDC=" + a + ";<br>CMMMC=" + m / a + ".";
document.getElementById("sout2").innerHTML = sir;
}
}
</script>
</div>
<p> </p>
<div id="medii">
<h3>Program pentru aflarea mediilor: aritmetice, geometrice, armonoice si patratice:</h3>
<p>Exemplu: Pentru numerele <i>2</i> si <i>200</i>, ma=101, mg=20, mh=3.9603 si mp=141.4284.</p>
<p>
</p>
<p id="sout3"></p>
<h4>Primul numar:</h4>
<input type="text" name="primul" id="inputunu">
<pre>
</pre>
<h4>Al doilea numar:</h4>
<input type="text" name="al doilea" id="inputdoi">
<h4> </h4>
<button onclick="medie()" id="buton2">Trimite</button>
<p> </p>
<!-- <p> </p> -->
<script>
var input = document.getElementById("inputdoi");
input.addEventListener("keyup", function(event)
{
if (event.keyCode === 13)
{
event.preventDefault();
document.getElementById("buton2").click();
}
});
function medie()
{
var ma, mg, mh, mp, nr1, nr2;
nr1 = document.getElementById("inputunu").value;
nr2 = document.getElementById("inputdoi").value;
if (isNaN(nr1) || isNaN(nr2))
document.getElementById("sout3").innerHTML = "<b>Rezultat:</b> Numerele sunt formate din <b>cifre</b>!";
else
{
ma = (Number(nr1) + Number(nr2)) / 2;
if (nr1 != 0 && nr2 != 0)
mh = (Number(nr1) * Number(nr2) * 2) / (Number(nr1) + Number(nr2));
else
mh = 0;
mp = Math.sqrt((nr1 * nr1 + nr2 * nr2) / 2);
mg = Math.sqrt(Math.abs((nr1 * nr2)));
var sir = "<b>Rezultat:</b> <br> Media Aritmetica: " + ma + "; <br> Media Geometrica: " + mg + "; <br> Media Armonica: " + mh + "; <br> Media Patratica: " + mp + ".";
document.getElementById("sout3").innerHTML = sir;
}
}
</script>
</div>
<div id=permutari>
<p> </p>
<h3>Numarul maxim de permutari al unui sir:</h3>
<p>Exemplu: <i>175</i> are maxim 6 permutari, iar <i>ABCD</i> are 24.</p>
<p>
</p>
<p id="sout4"></p>
<h4>Sirul:</h4>
<input type="text" name="primul" id="input1">
<h4> </h4>
<button onclick="len()" id="butonn">Trimite</button>
<script>
var inputt = document.getElementById("input1");
inputt.addEventListener("keyup", function(event)
{
if (event.keyCode === 13)
{
event.preventDefault();
document.getElementById("butonn").click();
}
});
function fact(n)
{
var ans = 1;
for (var i = 2; i <= n; i++)
{
ans = ans * i;
}
return ans;
}
function len()
{
nr1 = document.getElementById("input1").value;
var in_len = nr1.length;
if (in_len < 2)
var sir = "<b>Rezultat:</b> <br> Sirul nu are permutari, este un singur caracter.";
else
var sir = "<b>Rezultat:</b> <br> Sirul are maxim " + fact(in_len) + " permutari.";
document.getElementById("sout4").innerHTML = sir;
}
</script>
</div>
<!-- nou -->
<div id=factoriprimi>
<p> </p>
<h3>Descompunerea in factori primi a unui numar natural:</h3>
<p>Exemplu: <i>1600</i> = 2<sup>6</sup> * 5<sup>2</sup>.</p>
<p>
</p>
<p id="sout5"></p>
<h4>Numarul:</h4>
<input type="text" name="primul" id="inputul">
<h4> </h4>
<button onclick="factorip()" id="butonp">Trimite</button>
<script>
var inputt = document.getElementById("inputul");
inputt.addEventListener("keyup", function(event)
{
if (event.keyCode === 13)
{
event.preventDefault();
document.getElementById("butonp").click();
}
});
function factorip()
{
n = document.getElementById("inputul").value;
var d = 2;
var sirwhile = n + " = " + "<b>";
var booltemp = 0;
var naux = n;
if (n) //daca e undefined, null, empty string, 0, NaN, fals nu va intra in if
{
while (n > 1)
{
var p = 0;
while (n % d === 0)
{
p++;
n = n / d;
}
if (p > 0)
{
switch (booltemp)
{
case 0:
sirwhile = sirwhile + d + "<sup>" + p + "</sup>";
booltemp = 1;
break;
case 1:
sirwhile = sirwhile + " * " + d + "<sup>" + p + "</sup>";
break;
default:
sirwhile = sirwhile + d + "<sup>" + p + "</sup>";
}
}
d++;
}
}
if (isNaN(naux))
var sir = "<b>Rezultat:</b> <br> Numerele sunt formate din <b>cifre</b>!";
else if (naux <= -1)
var sir = "<b>Rezultat:</b> <br> Scrie numere <b>pozitive</b>!"
else if (naux < 1)
var sir = "<b>Rezultat:</b> <br> Numarul 0 = <b>0</b>.";
else if (naux < 2)
var sir = "<b>Rezultat:</b> <br> Numarul 1 = <b>1</b>.";
else
var sir = "<b>Rezultat:</b> <br> Numarul " + sirwhile + "</b>.";
document.getElementById("sout5").innerHTML = sir;
}
</script>
</div>
<!-- END nou -->
<div id="butonsus" style="text-align:center;">
<button class="sus" onClick="document.getElementById('wrapper').scrollIntoView();"><i class="fas fa-angle-double-up"></i>Sus</button>
</div>
</article>
<!-- despre -->
<article id="despre">
<h2 class="major">despre</h2>
<!-- <span class="image main"><img src="images/pic03.jpg" alt="" /></span> -->
<b> Mate-Romania: </b>
<p>Mate-Romania este un website fondat de Maxim Sabin pentru a ajuta elevii din clasele V-VIII din Romania cu formulele plictisitoare si repetitive din matematica cu algoritmi ce fac toata munca inutila si elimina timpul pierdut.
Principalul scop al proiectului este incurajarea elevilor de a lucra mai multe probleme de performanta unice, dar si eliminarea "tocitului" la matematica. Alt scop ar fi dezvoltarea mea personala in HTML/CSS/JS, dar si alte
framework-uri/platforme legate de cele mentionate. Pentru informatii de contact mergeti la sectiunea <a href="#contact">Contact </a>.</p>
<b> Proiecte: </b>
<p>Proiectele de pe prima pagina sunt in majoritate programe (mai multe in curand!) realizate in HTML si JavaScript care automatizeaza mai multe calcule (nu promit ca sunt facute in cel mai eficient mod). Calculele sunt facute client-side,
iar codul lor le puteti gasi in sursa pagini.</p>
<b> Gazduire web, donatii si altele: </b>
<p>Website-ul este gazduit pe <a href="https://pages.github.com/">GitHub Pages</a>, gratuit. Mai multe servicii/tehnologii folosite puteti gasi in <i>README</i>-ul de pe <a href="https://github.com/sabinM1/MateRO#technologies-used">pagina de GitHub </a> a site-ului.</p>
</article>
<!-- Contact -->
<article id="contact">
<h2 class="major">Contact</h2>
<p> Pentru contact, sugestii sau raportare de bug-uri va rugam sa completati formularul de mai jos sau sa ne contactati la una dintre platformele de sub formular. </p>
<form method="POST" action="https://formspree.io/xgenalbw">
<div class="fields">
<div class="field half">
<label for="name">Nume complet</label>
<input type="text" name="name" id="name" />
</div>
<div class="field half">
<label for="email">Email</label>
<input type="text" name="email" id="email" />
</div>
<div class="field">
<label for="message">Mesaj</label>
<textarea name="message" id="message" rows="4"></textarea>
</div>
</div>
<ul class="actions">
<li><input type="submit" value="Trimite" class="primary" /></li>
<li><input type="reset" value="Reset" /></li>
</ul>
</form>
<ul class="icons">
<li><a href="https://github.com/sabinM1" class="icon brands fa-github"><span class="label">GitHub</span></a></li>
<li><a href="https://www.reddit.com/user/sabin_M1" class="icon brands fa-reddit-alien"><span class="label">Reddit</span></a></li>
</ul>
</article>
</div>
<!-- Footer -->
<footer id="footer">
<p class="copyright">© 2020-2021 Mate-Romania. <a href="https://sabinm1.github.io/MateRO/policy">Privacy Policy</a>.</p>
<p class="copyright"> Background: <a href="https://unsplash.com/@giamboscaro">Giammarco Boscaro</a>.</p>
<p class="copyright"> Design: <a href="https://html5up.net">HTML5 UP</a>. </p>
</footer>
</div>
<!-- BG -->
<div id="bg"></div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>