pretty modal hell yeah
This commit is contained in:
parent
0f889f6361
commit
98faeb2f1b
4 changed files with 221 additions and 180 deletions
|
|
@ -20,7 +20,7 @@
|
|||
}
|
||||
|
||||
.create-offer-step {
|
||||
width: 100%;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.checkbox-row {
|
||||
|
|
@ -62,6 +62,8 @@
|
|||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 70%;
|
||||
min-width: 500px;
|
||||
max-width: 95%;
|
||||
}
|
||||
|
||||
.checkbox-row {
|
||||
|
|
@ -80,15 +82,6 @@
|
|||
margin: 10px 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#create-offer-root {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#view-my-offers-root {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#view-my-offers-root {
|
||||
|
|
@ -110,7 +103,7 @@
|
|||
.myoffer-card {
|
||||
display: grid;
|
||||
grid-template-columns: 48% 4% 48%;
|
||||
grid-template-rows: 25% 1% 30% 1% 18% 1% 14% 1% 10%;
|
||||
grid-template-rows: 25% 1% 30% 1% 18% 1% 14% 1% 10%;
|
||||
}
|
||||
|
||||
.myoffer-card > div {
|
||||
|
|
@ -180,7 +173,7 @@
|
|||
grid-row: 3;
|
||||
text-align: left;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.when-desc {
|
||||
|
|
@ -188,7 +181,7 @@
|
|||
grid-row: 3;
|
||||
text-align: right;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.bitcoin-methods-desc {
|
||||
|
|
@ -227,18 +220,22 @@
|
|||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#create-offer-controls {
|
||||
text-align: center;
|
||||
overflow-y: auto;
|
||||
max-height: 800px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.create-offer-step {
|
||||
text-align: center;
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 0 13px #ccc;
|
||||
padding: 20px 0;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.create-offer-step h3 {
|
||||
|
|
@ -387,3 +384,8 @@
|
|||
#button-submit-offer {
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
#close-offer {
|
||||
margin-left: auto;
|
||||
margin-right:auto;
|
||||
}
|
||||
|
|
@ -13,7 +13,6 @@
|
|||
}
|
||||
|
||||
.button-medium {
|
||||
height: 3em;
|
||||
padding: 0.5em 1em;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
|
@ -37,7 +36,6 @@
|
|||
}
|
||||
|
||||
.button-medium {
|
||||
height: 3em;
|
||||
padding: 1em;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
|
@ -118,6 +116,34 @@ h1 {
|
|||
height: 50px;
|
||||
}
|
||||
|
||||
.full-screen-modal-background {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: rgba(0, 0, 0, 0.75);
|
||||
transition: all 0.5s ease-in-out;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.full-screen-modal-background.shown {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
.full-screen-modal {
|
||||
background-color: white;
|
||||
border-radius: 20px;
|
||||
padding: 10px;
|
||||
width: fit-content;
|
||||
max-width: 95%;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.button-group button {
|
||||
border: 0;
|
||||
padding: 1em;
|
||||
|
|
@ -197,6 +223,19 @@ h1 {
|
|||
cursor: default;
|
||||
}
|
||||
|
||||
.button-secondary {
|
||||
background: white;
|
||||
border: 0;
|
||||
color: #e1c300;
|
||||
cursor: pointer;
|
||||
border: 3px solid #e1c300;
|
||||
transition: all 0.5 ease-in-out;
|
||||
}
|
||||
|
||||
.button-secondary:hover {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.button-large {
|
||||
font-weight: bold;
|
||||
font-size: 1.5em;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ const buttonStartCreateOffer = document.getElementById(
|
|||
'button-start-create-offer'
|
||||
);
|
||||
const buttonViewMyOffers = document.getElementById('button-view-my-offers');
|
||||
const closeOfferControls = document.getElementById('close-offer-controls-x');
|
||||
const createOfferRoot = document.getElementById('create-offer-root');
|
||||
const closeOffer = document.getElementById('close-offer');
|
||||
const createOfferModalRoot = document.getElementById('create-offer-modal-root');
|
||||
const viewMyOffersRoot = document.getElementById('view-my-offers-root');
|
||||
const buyOrSellButtonGroup = document.getElementById(
|
||||
'button-group-buy-or-sell'
|
||||
|
|
@ -48,9 +48,8 @@ const offerCreatedPopup = document.getElementById('offer-created-confirmation');
|
|||
|
||||
const ownOffersContainer = document.getElementById('own-offers-container');
|
||||
|
||||
function toggleCreateOfferControls() {
|
||||
createOfferRoot.style.display =
|
||||
createOfferRoot.style.display === 'block' ? 'none' : 'block';
|
||||
function toggleCreateOfferModal() {
|
||||
createOfferModalRoot.classList.toggle('shown');
|
||||
}
|
||||
|
||||
function toggleViewMyOffersPanel() {
|
||||
|
|
@ -171,7 +170,7 @@ async function publishOffer() {
|
|||
offerCreatedPopup.classList.add('max-size-zero');
|
||||
}, 4000);
|
||||
|
||||
toggleCreateOfferControls();
|
||||
toggleCreateOfferModal();
|
||||
}
|
||||
|
||||
class Offer {
|
||||
|
|
@ -575,7 +574,7 @@ class MyOffers {
|
|||
}
|
||||
|
||||
buttonStartCreateOffer.addEventListener('click', () => {
|
||||
toggleCreateOfferControls();
|
||||
toggleCreateOfferModal();
|
||||
});
|
||||
|
||||
buttonViewMyOffers.addEventListener('click', async () => {
|
||||
|
|
@ -584,8 +583,8 @@ buttonViewMyOffers.addEventListener('click', async () => {
|
|||
toggleViewMyOffersPanel();
|
||||
});
|
||||
|
||||
closeOfferControls.addEventListener('click', () => {
|
||||
toggleCreateOfferControls();
|
||||
closeOffer.addEventListener('click', () => {
|
||||
toggleCreateOfferModal();
|
||||
});
|
||||
|
||||
buyOrSellButtons.forEach((button) => {
|
||||
|
|
|
|||
|
|
@ -25,164 +25,165 @@
|
|||
Crear nueva oferta
|
||||
</button>
|
||||
</div>
|
||||
<div class="over-background" id="create-offer-root">
|
||||
<div id="create-offer-controls">
|
||||
<div id="close-offer-controls-area">
|
||||
<img
|
||||
id="close-offer-controls-x"
|
||||
src="/img/circle-xmark.svg"
|
||||
class="clickable"
|
||||
/>
|
||||
</div>
|
||||
<h2>Añade los detalles de tu oferta</h2>
|
||||
<div id="buy-or-sell-area" class="create-offer-step">
|
||||
<div id="button-group-buy-or-sell" class="button-group">
|
||||
<div id="create-offer-modal-root" class="full-screen-modal-background">
|
||||
<div class="full-screen-modal" id="create-offer-root">
|
||||
<div id="create-offer-controls">
|
||||
<h2>Añade los detalles de tu oferta</h2>
|
||||
<div id="buy-or-sell-area" class="create-offer-step">
|
||||
<div id="button-group-buy-or-sell" class="button-group">
|
||||
<button
|
||||
data-value="buy-bitcoin"
|
||||
id="button-buy-bitcoin"
|
||||
class="selected"
|
||||
>
|
||||
Quiero comprar Bitcoin</button
|
||||
><button data-value="sell-bitcoin" id="button-sell-bitcoin">
|
||||
Quiero vender Bitcoin
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="premium-area" class="create-offer-step">
|
||||
<h3>Premium</h3>
|
||||
<div id="premium-content-area">
|
||||
<div id="premium-selector-area">
|
||||
<div id="premium-value">0%</div>
|
||||
<div id="premium-buttons-container">
|
||||
<button class="premium-button" id="button-increase-premium">
|
||||
+</button
|
||||
><button class="premium-button" id="button-decrease-premium">
|
||||
-
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="premium-price-display-area">
|
||||
<p id="offer-price-paragraph">
|
||||
Tu precio: <span id="offer-price">90 000</span>€/BTC
|
||||
</p>
|
||||
<p id="market-price-paragraph">
|
||||
(Precio mercado: <span>83 000</span>€/BTC)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="amount-area" class="create-offer-step">
|
||||
<h3>¿Cuánto?</h3>
|
||||
<div id="amount-area-content">
|
||||
<div id="eur-amount" class="money-amount-input-area">
|
||||
<input
|
||||
id="input-eur-amount"
|
||||
type="text"
|
||||
class="money-input input-money-amount"
|
||||
value="100"
|
||||
required
|
||||
/>
|
||||
<div id="eur-symbol" class="curr-symbol">
|
||||
<span id="eur-character" class="curr-character">€</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="btc-amount" class="money-amount-input-area">
|
||||
<input
|
||||
id="input-btc-amount"
|
||||
type="text"
|
||||
class="money-input input-money-amount"
|
||||
disabled
|
||||
/>
|
||||
<div id="sats-symbol" class="curr-symbol">
|
||||
<span id="sats-character" class="curr-character">SAT</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="place-and-time-area" class="create-offer-step">
|
||||
<h3>¿Dónde y cuándo?</h3>
|
||||
<div id="place-and-time-boxes">
|
||||
<textarea
|
||||
id="place-input"
|
||||
class="place-and-time-box"
|
||||
autocomplete="on"
|
||||
maxlength="140"
|
||||
placeholder='¿Dónde? Ej."Eixample", "La Maquinista", "Cualquier lugar en BCN", "Meetup BBO"'
|
||||
></textarea>
|
||||
<textarea
|
||||
id="time-input"
|
||||
class="place-and-time-box"
|
||||
autocomplete="on"
|
||||
maxlength="140"
|
||||
placeholder='¿Cuándo? Ej."Cualquier hora", "19:00-21:00", "Finde"'
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bitcoin-methods-area" class="create-offer-step">
|
||||
<h3>¿Cómo se mueve el Bitcoin?</h3>
|
||||
<div id="onchain-checkbox-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="onchain"
|
||||
id="onchain-checkbox"
|
||||
checked
|
||||
/><label for="onchain">Onchain</label>
|
||||
</div>
|
||||
<div id="lightning-checkbox-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="lightning"
|
||||
id="lightning-checkbox"
|
||||
checked
|
||||
/><label for="lightning">Lightning</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="trust-area" class="create-offer-step">
|
||||
<h3>¿Quién puede ver la oferta?</h3>
|
||||
<div id="my-trusted-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="my-trusted"
|
||||
id="my-trusted-checkbox"
|
||||
checked
|
||||
disabled
|
||||
/><label for="my-trusted">Mis confiados</label>
|
||||
</div>
|
||||
<div id="my-trusted-trusted-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="my-trusted-trusted"
|
||||
id="my-trusted-trusted-checkbox"
|
||||
checked
|
||||
/><label for="my-trusted-trusted"
|
||||
>Los confiados de mis confiados</label
|
||||
>
|
||||
</div>
|
||||
<div id="all-members-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="all-members"
|
||||
id="all-members-checkbox"
|
||||
/><label for="all-members">Todos los miembros</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="other-area" class="create-offer-step">
|
||||
<h3>Extras</h3>
|
||||
<div id="large-bills-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="large-bills"
|
||||
id="large-bills-checkbox"
|
||||
/><label for="large-bills"
|
||||
>Se pueden usar billetes grandes (100€, 200€, 500€)</label
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div id="submit-button-area">
|
||||
<button
|
||||
data-value="buy-bitcoin"
|
||||
id="button-buy-bitcoin"
|
||||
class="selected"
|
||||
id="button-submit-offer"
|
||||
class="button-primary button-large"
|
||||
>
|
||||
Quiero comprar Bitcoin</button
|
||||
><button data-value="sell-bitcoin" id="button-sell-bitcoin">
|
||||
Quiero vender Bitcoin
|
||||
Publicar oferta
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="premium-area" class="create-offer-step">
|
||||
<h3>Premium</h3>
|
||||
<div id="premium-content-area">
|
||||
<div id="premium-selector-area">
|
||||
<div id="premium-value">0%</div>
|
||||
<div id="premium-buttons-container">
|
||||
<button class="premium-button" id="button-increase-premium">
|
||||
+</button
|
||||
><button class="premium-button" id="button-decrease-premium">
|
||||
-
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="premium-price-display-area">
|
||||
<p id="offer-price-paragraph">
|
||||
Tu precio: <span id="offer-price">90 000</span>€/BTC
|
||||
</p>
|
||||
<p id="market-price-paragraph">
|
||||
(Precio mercado: <span>83 000</span>€/BTC)
|
||||
</p>
|
||||
</div>
|
||||
<div id="close-offer-controls-area">
|
||||
<button id="close-offer" class="button-secondary button-medium">Volver</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="amount-area" class="create-offer-step">
|
||||
<h3>¿Cuánto?</h3>
|
||||
<div id="amount-area-content">
|
||||
<div id="eur-amount" class="money-amount-input-area">
|
||||
<input
|
||||
id="input-eur-amount"
|
||||
type="text"
|
||||
class="money-input input-money-amount"
|
||||
value="100"
|
||||
required
|
||||
/>
|
||||
<div id="eur-symbol" class="curr-symbol">
|
||||
<span id="eur-character" class="curr-character">€</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="btc-amount" class="money-amount-input-area">
|
||||
<input
|
||||
id="input-btc-amount"
|
||||
type="text"
|
||||
class="money-input input-money-amount"
|
||||
disabled
|
||||
/>
|
||||
<div id="sats-symbol" class="curr-symbol">
|
||||
<span id="sats-character" class="curr-character">SAT</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="place-and-time-area" class="create-offer-step">
|
||||
<h3>¿Dónde y cuándo?</h3>
|
||||
<div id="place-and-time-boxes">
|
||||
<textarea
|
||||
id="place-input"
|
||||
class="place-and-time-box"
|
||||
autocomplete="on"
|
||||
maxlength="140"
|
||||
placeholder='¿Dónde? Ej."Eixample", "La Maquinista", "Cualquier lugar en BCN", "Meetup BBO"'
|
||||
></textarea>
|
||||
<textarea
|
||||
id="time-input"
|
||||
class="place-and-time-box"
|
||||
autocomplete="on"
|
||||
maxlength="140"
|
||||
placeholder='¿Cuándo? Ej."Cualquier hora", "19:00-21:00", "Finde"'
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bitcoin-methods-area" class="create-offer-step">
|
||||
<h3>¿Cómo se mueve el Bitcoin?</h3>
|
||||
<div id="onchain-checkbox-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="onchain"
|
||||
id="onchain-checkbox"
|
||||
checked
|
||||
/><label for="onchain">Onchain</label>
|
||||
</div>
|
||||
<div id="lightning-checkbox-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="lightning"
|
||||
id="lightning-checkbox"
|
||||
checked
|
||||
/><label for="lightning">Lightning</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="trust-area" class="create-offer-step">
|
||||
<h3>¿Quién puede ver la oferta?</h3>
|
||||
<div id="my-trusted-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="my-trusted"
|
||||
id="my-trusted-checkbox"
|
||||
checked
|
||||
disabled
|
||||
/><label for="my-trusted">Mis confiados</label>
|
||||
</div>
|
||||
<div id="my-trusted-trusted-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="my-trusted-trusted"
|
||||
id="my-trusted-trusted-checkbox"
|
||||
checked
|
||||
/><label for="my-trusted-trusted"
|
||||
>Los confiados de mis confiados</label
|
||||
>
|
||||
</div>
|
||||
<div id="all-members-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="all-members"
|
||||
id="all-members-checkbox"
|
||||
/><label for="all-members">Todos los miembros</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="other-area" class="create-offer-step">
|
||||
<h3>Extras</h3>
|
||||
<div id="large-bills-area" class="checkbox-row">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="large-bills"
|
||||
id="large-bills-checkbox"
|
||||
/><label for="large-bills"
|
||||
>Se pueden usar billetes grandes (100€, 200€, 500€)</label
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div id="submit-button-area">
|
||||
<button id="button-submit-offer" class="button-primary button-large">
|
||||
Publicar oferta
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="over-background" id="view-my-offers-root">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue