mirror of
https://github.com/dyzulk/portfolio---react.git
synced 2026-01-26 13:31:56 +07:00
Add files via upload
This commit is contained in:
44
public/index.html
Normal file
44
public/index.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content="Web site created using create-react-app" />
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;500;700;900&display=swap" rel="stylesheet" />
|
||||
<title>Muhammad Herdy Iskandar</title>
|
||||
|
||||
<script>
|
||||
window.onload = function () {
|
||||
// Tanggal lahir Anda
|
||||
var tanggalLahir = new Date('2003-04-20');
|
||||
|
||||
// Tanggal sekarang
|
||||
var tanggalSekarang = new Date();
|
||||
|
||||
// Menghitung selisih tahun
|
||||
var selisihTahun = tanggalSekarang.getFullYear() - tanggalLahir.getFullYear();
|
||||
|
||||
// Periksa apakah ulang tahun sudah lewat atau belum
|
||||
if (tanggalSekarang.getMonth() < tanggalLahir.getMonth() || (tanggalSekarang.getMonth() === tanggalLahir.getMonth() && tanggalSekarang.getDate() < tanggalLahir.getDate())) {
|
||||
selisihTahun--;
|
||||
}
|
||||
|
||||
// Menampilkan umur
|
||||
document.getElementById("umur").innerHTML = "Umur Anda adalah " + selisihTahun + " tahun.";
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
* {
|
||||
font-family: 'Roboto', sans-serif;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user