first commit
This commit is contained in:
56
public/style/vendor/star-rating/jquery.star-rating-svg.js
vendored
Normal file
56
public/style/vendor/star-rating/jquery.star-rating-svg.js
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
/* 1. Visualizing things on Hover - See next part for action on click */
|
||||
$('#stars li').on('mouseover', function(){
|
||||
var onStar = parseInt($(this).data('value'), 10); // The star currently mouse on
|
||||
|
||||
// Now highlight all the stars that's not after the current hovered star
|
||||
$(this).parent().children('li.star').each(function(e){
|
||||
if (e < onStar) {
|
||||
$(this).addClass('hover');
|
||||
}
|
||||
else {
|
||||
$(this).removeClass('hover');
|
||||
}
|
||||
});
|
||||
|
||||
}).on('mouseout', function(){
|
||||
$(this).parent().children('li.star').each(function(e){
|
||||
$(this).removeClass('hover');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/* 2. Action to perform on click */
|
||||
$('#stars li').on('click', function(){
|
||||
var onStar = parseInt($(this).data('value'), 10); // The star currently selected
|
||||
var stars = $(this).parent().children('li.star');
|
||||
|
||||
for (i = 0; i < stars.length; i++) {
|
||||
$(stars[i]).removeClass('selected');
|
||||
}
|
||||
|
||||
for (i = 0; i < onStar; i++) {
|
||||
$(stars[i]).addClass('selected');
|
||||
}
|
||||
|
||||
// JUST RESPONSE (Not needed)
|
||||
var ratingValue = parseInt($('#stars li.selected').last().data('value'), 10);
|
||||
var msg = "";
|
||||
if (ratingValue > 1) {
|
||||
msg = "Thanks! You rated this " + ratingValue + " stars.";
|
||||
}
|
||||
else {
|
||||
msg = "We will improve ourselves. You rated this " + ratingValue + " stars.";
|
||||
}
|
||||
responseMessage(msg);
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function responseMessage(msg) {
|
||||
alert(msg);
|
||||
}
|
89
public/style/vendor/star-rating/star-rating-svg.css
vendored
Normal file
89
public/style/vendor/star-rating/star-rating-svg.css
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
|
||||
* {
|
||||
-webkit-box-sizing:border-box;
|
||||
-moz-box-sizing:border-box;
|
||||
box-sizing:border-box;
|
||||
}
|
||||
|
||||
*:before, *:after {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
a:hover {
|
||||
color: #2196f3;
|
||||
}
|
||||
|
||||
pre {
|
||||
display: block;
|
||||
padding: 9.5px;
|
||||
margin: 0 0 10px;
|
||||
font-size: 13px;
|
||||
line-height: 1.42857143;
|
||||
color: #333;
|
||||
word-break: break-all;
|
||||
word-wrap: break-word;
|
||||
background-color: #F5F5F5;
|
||||
border: 1px solid #CCC;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#a-footer {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.new-react-version {
|
||||
padding: 20px 20px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0,0,0,0.1);
|
||||
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.new-react-version .react-svg-logo {
|
||||
text-align: center;
|
||||
max-width: 60px;
|
||||
margin: 20px auto;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Rating Star Widgets Style */
|
||||
.rating-stars ul {
|
||||
list-style-type:none;
|
||||
padding:0;
|
||||
|
||||
-moz-user-select:none;
|
||||
-webkit-user-select:none;
|
||||
}
|
||||
.rating-stars ul > li.star {
|
||||
display:inline-block;
|
||||
|
||||
}
|
||||
|
||||
/* Idle State of the stars */
|
||||
.rating-stars ul > li.star > i.fa {
|
||||
font-size:14px; /* Change the size of the stars */
|
||||
color:#ccc; /* Color on idle state */
|
||||
}
|
||||
|
||||
/* Hover state of the stars */
|
||||
.rating-stars ul > li.star.hover > i.fa {
|
||||
color:#FFCC36;
|
||||
}
|
||||
|
||||
/* Selected state of the stars */
|
||||
.rating-stars ul > li.star.selected > i.fa {
|
||||
color:#FF912C;
|
||||
}
|
Reference in New Issue
Block a user