-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDOMProject.html
More file actions
107 lines (99 loc) · 2.97 KB
/
DOMProject.html
File metadata and controls
107 lines (99 loc) · 2.97 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<style>
body{
font-family: Arial, sans-serif;
}
.button{
background-color: black;
color: white;
width: 90px;
padding: 10px;
border-radius: 50px;
font-weight: bold;
margin-bottom: 30px;
transition: transform 0.3s ease;
cursor: pointer;
}
.sbuscribeButton{
background-color: rgba(240, 255, 255, 0.918);
color: black;
border: none;
transition: transform 0.3s ease;
}
input{
padding: 10px;
width: 180px;
border: 1px solid black;
border-radius: 3px;
}
.calculateButton{
background-color: rgb(22, 193, 22);
color: white;
font-weight: bold;
font-size: 15px;
padding: 10px;
width: 90px;
border: none;
border-radius: 4px;
transition: transform 0.3s ease;
cursor: pointer;
}
.button:hover,
.sbuscribeButton:hover,
.calculateButton:hover{
transform: scale(1.1);
}
</style>
</head>
<body>
<p>Youtube Subscribe Button</p>
<button title="God Job!"
class="js-button button"
onclick="Subscribe()"
>Subscribe</button>
<p>Amazon Shipping Calculator</p>
<p>Orders under $40 = +$10 shipping.</p>
<p>Orders over $40 = FREE shipping.</p>
<input type= "text" placeholder="Enter Cost" class="js-input" onkeydown="handleOnkekeyDown(event)">
<button class="calculateButton" onclick="CalculateCost()">Calculate</button>
<p class="js-inputresult"></p>
<p style="margin-top: 50px;">Rock Paper Scissor Game</p>
<a href="Rock-paperscissor-game-project/RockPapperSessiorGame.html">click here</a>
<script>
document.title = 'DOM';
function Subscribe()
{
let button = document.querySelector('.js-button');
if(button.innerText === 'Subscribe')
{
button.innerHTML = 'Subscribed';
button.classList.add('sbuscribeButton');
}
else
{
button.innerHTML = 'Subscribe';
button.classList.remove('sbuscribeButton');
}
}
function CalculateCost()
{
let num = Number(document.querySelector('.js-input').value);
let res = document.querySelector('.js-inputresult');
if(isNaN(num))
res.innerHTML = 'please enter a valid Number';
else if(num < 40)
res.innerHTML = `$${num + 10}`;
else
res.innerHTML = `$${num}`;
}
function handleOnkekeyDown(event)
{
if(event.key === 'Enter')
CalculateCost();
}
</script>
</body>
</html>