-
Notifications
You must be signed in to change notification settings - Fork 350
/
RatingStyle.css
103 lines (86 loc) · 2.54 KB
/
RatingStyle.css
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
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
display: flex;
align-items: flex-start; /* Align items at the start of the container */
justify-content: space-between; /* Space between elements */
gap: 20px; /* Optional gap between form and rating section */
height: auto; /* Adjust height if necessary */
}
.form-section {
width: 70%; /* Adjust width as needed */
}
.rating-wrap {
width: 30%; /* Adjust width as needed */
text-align: left;
transition: all;
}
.center {
width: auto;
display: inline-flex; /* Align stars and rating count in a row */
align-items: center;
gap: 10px; /* Add some space between the stars and the count */
}
#rating-value {
font-size: 1.2rem; /* Adjust font size */
font-weight: bold;
color: black; /* Optional: change the color to match the theme */
}
.rating {
border: none;
display: flex; /* Use flexbox for better layout */
justify-content: center; /* Center the stars horizontally */
align-items: center; /* Vertically align them */
gap: 5px; /* Add a small gap between stars */
padding: 10px 0; /* Optional: add padding for spacing */
}
.rating > input {
display: none;
}
.rating > label:before {
content: '\f005';
font-family: FontAwesome;
margin: 5px;
font-size: 1.5rem;
display: inline-block;
cursor: pointer;
transition: color 0.2s ease-in-out; /* Smooth color transition */
}
.rating > .half:before {
content: '\f089';
position: absolute;
cursor: pointer;
}
.rating > label {
color: #ddd; /* Empty stars initially */
float: right;
cursor: pointer;
}
/* Highlight stars when checked */
.rating > input:checked ~ label,
.rating > input:checked ~ label ~ label {
color: rgb(230, 166, 17); /* Gold color for selected stars */
}
/* Highlight stars on hover */
.rating > label:hover,
.rating > label:hover ~ label {
color: rgb(239, 127, 6); /* Brighter orange on hover */
}
/* Filled stars on hover and selection */
.rating > input:checked ~ label,
.rating:not(:checked) > label {
color: #ddd; /* Keep stars empty until interaction */
}
.rating > input:checked ~ label,
.rating > input:checked ~ label:hover,
.rating > input:checked ~ label:hover ~ label {
color: rgb(230, 166, 17); /* Green for filled stars */
}
.rating > label:hover ~ label,
.rating > label:hover {
color:rgb(239, 127, 6); /* Green hover effect */
}