-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redesigned the Rate Music page #315
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a9ae1d8
redesigned the Rate Music page
wyenelle 073f884
added name attribute to the input tag for accessibity convenience
wyenelle 2bb00d8
fixed
wyenelle 87e34b8
rating is now a must for every user
wyenelle 7017341
users must now rate songs
wyenelle cb1ffba
redeclared some variables
wyenelle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,31 +6,39 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="styles.css" /> | ||
<link href="star.ico" rel="icon" type="image/x-icon" /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap" rel="stylesheet"> | ||
<title>Rate Song</title> | ||
</head> | ||
</head>z | ||
<body> | ||
<form name="rating" netlify> | ||
<p> | ||
<label class="song-name" | ||
>Song Name: | ||
<select name="song[]" multiple required> | ||
<option value="christmas-song">Christmas Song</option> | ||
<option value="baby-it's-cold-outside">Baby It's Cold Outside</option> | ||
<option value="the-most-wonderful-time-of-the-year">The Most Wonderful Time of The Year</option> | ||
<option value="last-christmas">Last Christmas</option> | ||
<option value="little-saint-nick">Little Saint Nick</option> | ||
<option value="all-i-want-for-christmas">All I Want For Christmas</option> | ||
</select></label | ||
> | ||
</p> | ||
<p> | ||
<label class="rating" | ||
>Rating - Out of 10 <input type="number" name="number" min="0" max="10" required/></label | ||
></label> | ||
</p> | ||
<p> | ||
<h3 Id="review_msg"> | ||
hello | ||
</h3> | ||
<main> | ||
<h1>Ratings</h1> | ||
<form name="rating" id="submit" netlify> | ||
|
||
<label class="song-name">Song Name:</label><br/><br/> | ||
<select class="select" name="song[]"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control. |
||
<option value="--choose song">Choose Song</option> | ||
<option value="christmas-song">Christmas Song</option> | ||
<option value="baby-it's-cold-outside">Baby It's Cold Outside</option> | ||
<option value="the-most-wonderful-time-of-the-year">The Most Wonderful Time of The Year</option> | ||
<option value="last-christmas">Last Christmas</option> | ||
<option value="little-saint-nick">Little Saint Nick</option><option value="all-i-want-for-christmas">All I Want For Christmas</option> | ||
</select><br/><br/><br/> | ||
|
||
|
||
<label class="">Rating - Out of 10 : <span id="demo"></span></label><br/><br/> | ||
<input name='rating' type="range" id="rating" class="rating" max="10" step="1" value=0 onchange="handleChange()" required/><br/><br/> | ||
|
||
<button class="btn" type="submit">Submit Rating</button> | ||
</p> | ||
</form> | ||
</p> | ||
</form> | ||
<p id="demo"></p> | ||
</main> | ||
<script src="index.js"></script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// get the input | ||
const rating = document.getElementById("rating"); | ||
|
||
// handles changes in the input and renders values to the screen | ||
function handleChange() { | ||
const res = document.getElementById("demo"); | ||
res.innerHTML = rating.value; | ||
} | ||
// Actions that takes oplace once the form is submitted | ||
const submit = document.querySelector("#submit"); | ||
submit.addEventListener("submit", handleSubmit); | ||
|
||
function handleSubmit(e) { | ||
e.preventDefault(); // stops browser default behhaviour of automatically submitting | ||
|
||
if (rating.value === '0') { | ||
const review_msg = document.querySelector("#review_msg"); | ||
review_msg.style.visibility = "visible"; | ||
review_msg.innerText = "You must choose a rating" | ||
}else{ | ||
review_msg.style.visibility = 'visible' | ||
review_msg.innerText = 'Success' | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,129 @@ | ||
.song-name, | ||
.rating { | ||
color: limegreen; | ||
*{ | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
.song-name { | ||
width: 200px; | ||
body{ | ||
background: url('photo1.jpeg'); | ||
background-size: cover; | ||
width: 100%; | ||
display: column; | ||
align-items: center; | ||
justify-content: center; | ||
color: white; | ||
max-width: 100%; | ||
} | ||
|
||
input { | ||
color: red; | ||
main{ | ||
margin-top:3em; | ||
width: 100%; | ||
display: column; | ||
justify-content: center; | ||
align-items: center; | ||
height: 70vh; | ||
background: rgba(0,0,0, 0.9); | ||
} | ||
|
||
.btn { | ||
background-image: linear-gradient( | ||
to right, | ||
#d31027 0%, | ||
#ea384d 51%, | ||
#d31027 100% | ||
); | ||
margin: 10px; | ||
padding: 15px 45px; | ||
h1{ | ||
text-align: center; | ||
text-transform: uppercase; | ||
transition: 0.5s; | ||
background-size: 200% auto; | ||
margin: 1em; | ||
color: white; | ||
box-shadow: 0 0 20px #eee; | ||
padding: 10px; | ||
font-weight: 800; | ||
font-size: xx-large; | ||
font-family: 'Poppins',sans-serif; | ||
} | ||
h3{ | ||
border: ipx solid white; | ||
box-shadow: 6px 2px 2px rgba(0,0,0,0.15); | ||
width: 80%; | ||
height: 100px; | ||
padding: 30px; | ||
text-align: center; | ||
background-color: rgba(255,255,255,0.2); | ||
margin: auto; | ||
visibility: hidden; | ||
border-radius: 10px; | ||
display: block; | ||
} | ||
form{ | ||
margin: auto; | ||
width: 70%; | ||
text-align: center; | ||
} | ||
label{ | ||
font-family: 'Poppins', sans-serif | ||
|
||
} | ||
.select{ | ||
height:50px; | ||
text-align: center; | ||
border-radius: 5px; | ||
padding: 5px; | ||
color: white; | ||
margin: 5px; | ||
border: 1px solid white; | ||
background-color: black; | ||
} | ||
.rating{ | ||
width: 300px; | ||
color: purple; | ||
|
||
.btn:hover { | ||
background-position: right center; /* change the direction of the change here */ | ||
color: #fff; | ||
text-decoration: none; | ||
} | ||
.btn{ | ||
margin-top: 1rem; | ||
height: 50px; | ||
width: 140px; | ||
border: 1px solid white; | ||
border-radius: 5px; | ||
padding: 7px; | ||
color: white; | ||
font-weight: bolder; | ||
background-color: rgb(0,0,0); | ||
transform: scale(1); | ||
transition: 0.5s; | ||
|
||
body { | ||
max-width: 100%; | ||
overflow-x: hidden; | ||
} | ||
.btn:hover{ | ||
background: #f5f5f5; | ||
color: rgb(0, 0, 0); | ||
transform: scale(1.1); | ||
} | ||
/* for large screens */ | ||
@media screen and (min-width : 750px){ | ||
body{ | ||
background: url('./pink-wavy.jpg') no-repeat; | ||
background-size: cover; | ||
display: flex; | ||
width: 100%; | ||
height: 100%; | ||
color: black; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
main{ | ||
width: 70%; | ||
height: 80vh; | ||
margin-top: 3em; | ||
background-color: white; | ||
border-radius: 10px; | ||
} | ||
h1{ | ||
text-align: center; | ||
margin: 1em; | ||
color: black; | ||
padding: 10px; | ||
font-weight: 800; | ||
font-size: xx-large; | ||
font-family: 'Poppins',sans-serif; | ||
} | ||
.select{ | ||
height:50px; | ||
text-align: center; | ||
border-radius: 5px; | ||
padding: 5px; | ||
color: black; | ||
margin: 5px; | ||
border: 1px solid black; | ||
background-color: transparent; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const title = document.querySelector('#demo') | ||
|
||
console.log(title) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this element is missing an accessible name or label. That makes it hard for people using screen readers or voice control to use the control.