From 2d7a7d40fed38ecab56f6cf228beb0ef87cd33ef Mon Sep 17 00:00:00 2001 From: Rodrigo Sakae Date: Thu, 17 Aug 2023 16:12:08 -0300 Subject: [PATCH] refactor: css changing on selection --- src/App.css | 53 +++++++++++++++++++++++++++++++++-- src/components/Acao.jsx | 15 ++++++++-- src/components/AcaoCustom.jsx | 50 +++++++++++++++++++++++++++++++++ src/components/Acoes.jsx | 4 ++- src/components/Timer.jsx | 2 +- src/conteudo/acoes.js | 4 +-- 6 files changed, 119 insertions(+), 9 deletions(-) create mode 100644 src/components/AcaoCustom.jsx diff --git a/src/App.css b/src/App.css index 90e8648..1f23f81 100644 --- a/src/App.css +++ b/src/App.css @@ -188,6 +188,25 @@ header p { justify-content: space-between; } +.selected { + background-image: linear-gradient(62deg, #d62424 0%, #ed810d 100%); + color: #ffffff; + font-weight: 700; + box-shadow: 0 0 0.2em rgba(0, 0, 0, 0.0625); +} + +@media screen and (max-width: 480px) { + .item { + width: 94vw; + padding: 0.5em 0.3em; + display: flex; + align-items: center; + justify-content: space-between; + line-height: 1.3rem; + text-align: left; + } +} + .dark .item { background: rgb(28,28,52); background: linear-gradient(90deg, rgba(28,28,52,1) 43%, rgba(24,24,50,1) 100%); @@ -197,7 +216,7 @@ header p { box-shadow: 0px 5px 94px -13px rgba(0,0,0,0.75); } -.itemLucas { +/* .itemLucas { align-items: center; background-image: linear-gradient(62deg, #f77c6a 0%, #f1ae9e 100%); border-radius: 1em; @@ -214,7 +233,7 @@ box-shadow: 0px 5px 94px -13px rgba(0,0,0,0.75); -webkit-box-shadow: 0px 5px 94px -13px rgba(0,0,0,0.75); -moz-box-shadow: 0px 5px 94px -13px rgba(0,0,0,0.75); box-shadow: 0px 5px 94px -13px rgba(0,0,0,0.75); -} +} */ .item-product input { margin-right: 15px; @@ -256,6 +275,12 @@ box-shadow: 0px 5px 94px -13px rgba(0,0,0,0.75); padding: 2em; } +@media screen and (max-width: 480px) { + .cronometro { + max-width: 95vw; + } +} + .dark .cronometro { background: var(--weirdGradientColor); -webkit-box-shadow: 0px 5px 67px -23px rgba(0,0,0,0.75); @@ -498,4 +523,26 @@ blockquote:after { color: inherit; } - /*--------- END --------*/ \ No newline at end of file + .customInput { + max-width: 50px; + min-height: 30px; + text-align: center; + font-size: large; + letter-spacing: 0.1rem; + margin: 0 -20px 0 5px; + } + + /* Chrome, Safari, Edge, Opera */ +input::-webkit-outer-spin-button, +input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +/* Firefox */ +input[type=number] { + -moz-appearance: textfield; +} + + + /*--------- END --------*/ diff --git a/src/components/Acao.jsx b/src/components/Acao.jsx index a10c970..4fcb256 100644 --- a/src/components/Acao.jsx +++ b/src/components/Acao.jsx @@ -1,18 +1,29 @@ import React, { Component } from 'react'; export default class Acao extends Component { + state = { + selected: false, + } + + selection = (e) => { + this.props.check(e); + this.setState(prev => ({ ...prev, selected: !prev.selected })) + } + render() { const { content, value, name } = this.props.frase; + + return (