-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: redesigned the Rate Music page (#315)
* redesigned the Rate Music page * added name attribute to the input tag for accessibity convenience * fixed * rating is now a must for every user * users must now rate songs * redeclared some variables
- Loading branch information
Showing
6 changed files
with
175 additions
and
53 deletions.
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
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) |