styles and some fixes

This commit is contained in:
shabinder 2021-03-16 20:39:51 +05:30
parent 31c9a2aa57
commit cf9ed5e885
4 changed files with 26 additions and 16 deletions

View File

@ -5,8 +5,10 @@ import com.shabinder.common.main.SpotiFlyerMain
import com.shabinder.common.main.SpotiFlyerMain.State import com.shabinder.common.main.SpotiFlyerMain.State
import com.shabinder.common.models.AllPlatforms import com.shabinder.common.models.AllPlatforms
import extras.RenderableComponent import extras.RenderableComponent
import kotlinx.browser.document
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.css.* import kotlinx.css.*
import kotlinx.dom.appendElement
import react.* import react.*
import styled.css import styled.css
import styled.styledDiv import styled.styledDiv
@ -17,6 +19,19 @@ class HomeScreen(
props, props,
initialState = State() initialState = State()
) { ) {
override fun componentDidMount() {
super.componentDidMount()
val form = document.getElementById("razorpay-form")!!
repeat(form.childNodes.length){
form.childNodes.item(0)?.let { it1 -> form.removeChild(it1) }
form.childNodes.item(it)?.let { it1 -> form.removeChild(it1) }
}
form.appendElement("script"){
this.setAttribute("src","https://checkout.razorpay.com/v1/payment-button.js")
this.setAttribute("async", true.toString())
this.setAttribute("data-payment_button_id", "pl_GnKuuDBdBu0ank")
}
}
override val stateFlow: Flow<SpotiFlyerMain.State> = model.models override val stateFlow: Flow<SpotiFlyerMain.State> = model.models
@ -56,8 +71,8 @@ class HomeScreen(
private val platformIconList = mapOf( private val platformIconList = mapOf(
"spotify.svg" to "https://open.spotify.com/", "spotify.svg" to "https://open.spotify.com/",
"gaana.svg" to "https://www.gaana.com/", "gaana.svg" to "https://www.gaana.com/",
"youtube.svg" to "https://www.youtube.com/", //"youtube.svg" to "https://www.youtube.com/",
"youtube_music.svg" to "https://music.youtube.com/" //"youtube_music.svg" to "https://music.youtube.com/"
) )
private val badges = mapOf( private val badges = mapOf(
"https://img.shields.io/github/v/release/Shabinder/SpotiFlyer?color=7885FF&label=SpotiFlyer&logo=android&style=for-the-badge" "https://img.shields.io/github/v/release/Shabinder/SpotiFlyer?color=7885FF&label=SpotiFlyer&logo=android&style=for-the-badge"

View File

@ -25,18 +25,6 @@ fun RBuilder.IconList(handler:IconListProps.() -> Unit): ReactElement {
private val iconList = functionalComponent<IconListProps>("IconList") { props -> private val iconList = functionalComponent<IconListProps>("IconList") { props ->
useEffect {
val form = document.getElementById("razorpay-form")!!
repeat(form.childNodes.length){
form.childNodes.item(it)?.let { it1 -> form.removeChild(it1) }
}
form.appendElement("script"){
this.setAttribute("src","https://checkout.razorpay.com/v1/payment-button.js")
this.setAttribute("async", true.toString())
this.setAttribute("data-payment_button_id", "pl_GnKuuDBdBu0ank")
}
}
styledDiv { styledDiv {
css { css {
margin(18.px) margin(18.px)

View File

@ -1,5 +1,6 @@
package list package list
import kotlinx.css.marginRight
import kotlinx.css.px import kotlinx.css.px
import kotlinx.css.width import kotlinx.css.width
import react.* import react.*
@ -24,6 +25,7 @@ private val loadingSpinner = functionalComponent<RProps>("Loading-Spinner") {
css{ css{
classes = mutableListOf("lds-ring") classes = mutableListOf("lds-ring")
width = 50.px width = 50.px
marginRight = 8.px
} }
} }
} }

View File

@ -28,14 +28,19 @@ body, html {
font-weight: 100; font-weight: 100;
text-shadow: 0.3px 0.5px #ffffff; text-shadow: 0.3px 0.5px #ffffff;
} }
.headingTitle{ .headingTitle{
text-align: center; text-align: center;
margin: 10px; margin: 10px;
font-family: 'RocknRoll One', sans-serif; font-family: 'RocknRoll One', sans-serif;
} }
.glow-button:hover { .glow-button, .PaymentButton {
transition: all .2s ease-in-out;
}
.glow-button:hover, .PaymentButton:hover {
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
box-shadow: 0 5px 15px rgb(105, 44, 143); box-shadow: 0 5px 15px rgb(105, 44, 143);
transform: scale(1.1);
} }
/*Loading Spinner*/ /*Loading Spinner*/
@ -295,7 +300,7 @@ input.cmn-toggle-round-flat:checked + label:after {
flex-direction: column; flex-direction: column;
} }
.searchInput { .searchInput {
width: 35vw; width: 60vw;
padding: 0 6px; padding: 0 6px;
} }
.search-icon { .search-icon {