-
Notifications
You must be signed in to change notification settings - Fork 2
/
40-css-buton-efekt.htm
127 lines (90 loc) · 4.04 KB
/
40-css-buton-efekt.htm
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
<!DOCTYPE html>
<html>
<head>
<title>CSS Buton Efekt</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- DIŞARIDAN YÜKLENEN KÜTÜPHANE DOSYALARI -->
<link rel="stylesheet" type="text/css" href="kutuphane/basic.css">
<script src="kutuphane/basic.js" type="text/javascript" charset="utf-8"></script>
<style>
/* normal hali */
.button-type1 {
cursor: pointer;
}
/* üzerine gelindiğinde */
.button-type1:hover {
/* Metin ve arkaplan rengini değiştirmek için kullanılabilir */
/*
background-color: orangered !important;
color: white !important;
*/
filter: brightness(120%);
}
/* basıldığında */
.button-type1:active {
filter: brightness(80%);
transform: scale(0.95);
}
</style>
<script>
// DEĞİŞKENLER
var myButton, myButton2, myButton3, myButton4, myButton5, myButton6
// BAŞLANGIÇ FONKSİYONLARI
// İlk çalışan fonksiyon.
var start = function() {
page.color = "lightgray"
myButton = createButton(50, 50)
that.text = "Buton 1"
that.textColor = "rgba(0, 0, 0, 0.65)"
that.color = "#689BD2"
// CSS ile geçişleri yumuşat.
that.setMotion("background-color 0.5s, color 0.5s, filter 0.5s, transform 0.5s")
// Yazdığımız CSS kodları ile bağlantısını sağla.
that.element.classList.add("button-type1")
myButton2 = createButton(50, 110)
that.text = "Buton 2"
that.color = "cadetblue"
that.textColor = "rgba(0, 0, 0, 0.65)"
that.setMotion("background-color 0.5s, color 0.5s, filter 0.5s, transform 0.5s")
that.element.classList.add("button-type1")
myButton3 = createButton(50, 170)
that.text = "Buton 3"
that.color = "tomato"
that.textColor = "rgba(0, 0, 0, 0.65)"
that.setMotion("background-color 0.5s, color 0.5s, filter 0.5s, transform 0.5s")
that.element.classList.add("button-type1")
myButton4 = createButton(50, 230)
that.text = "Buton 4"
that.color = "gold"
that.textColor = "rgba(0, 0, 0, 0.65)"
that.setMotion("background-color 0.5s, color 0.5s, filter 0.5s, transform 0.5s")
that.element.classList.add("button-type1")
myButton5 = createButton(50, 290)
that.text = "Buton 5"
that.color = "lightgray"
that.textColor = "rgba(0, 0, 0, 0.65)"
that.setMotion("background-color 0.5s, color 0.5s, filter 0.5s, transform 0.5s")
that.element.classList.add("button-type1")
myButton6 = createButton(50, 350)
that.text = "Buton 6"
that.color = "white"
that.textColor = "rgba(0, 0, 0, 0.65)"
that.setMotion("background-color 0.5s, color 0.5s, filter 0.5s, transform 0.5s")
that.element.classList.add("button-type1")
}
/*
Buton nesnesine, küçük ikonlar eklemek için,
https://www.w3schools.com/howto/howto_css_icon_buttons.asp
KULLANIMI:
myButton.text = "<i class='fa fa-folder'></i> Folder"
NOT: Bağlantıda verilen, font-awesome.min.css kütüphanesini sayfaya eklemeyi unutmayın.
Desteklenen diğer iconları da göremek için:
https://fontawesome.com/v4.7/icons/
*/
</script>
</head>
<body>
<!-- HTML içeriği -->
</body>
</html>