From 2f8b72cc9ba78b748877ea85f50949fe1e354c5a Mon Sep 17 00:00:00 2001 From: TonyFord <tonyford@strategy-investor.de> Date: Tue, 3 Mar 2020 18:02:03 +0100 Subject: [PATCH] a lot of improvements --- _config.yml | 2 +- _data/categories/{ex => fairex}/FAIR_ETH.yml | 3 + _data/categories/{ex => fairex}/FAIR_EUR.yml | 0 _data/form-fairex.yml | 83 ++++++++++++ _includes/fairex-orders.html | 47 +++++++ _includes/fairex.html | 60 ++------- _includes/form-fairex.html | 94 ++++++++++++++ _includes/form.html | 4 +- _includes/menu.html | 28 ++-- _includes/overview.html | 8 +- _layouts/default.html | 2 +- _layouts/selectln.html | 13 +- assets/js/script.js | 103 +++++++++------ css/main.scss | 128 ++++++++++++++++++- de/{ex.html => fairex.html} | 3 +- de/form-fairex.md | 10 ++ en/{ex.html => fairex.html} | 3 +- en/form-fairex.md | 10 ++ 18 files changed, 489 insertions(+), 112 deletions(-) rename _data/categories/{ex => fairex}/FAIR_ETH.yml (75%) rename _data/categories/{ex => fairex}/FAIR_EUR.yml (100%) create mode 100644 _data/form-fairex.yml create mode 100644 _includes/fairex-orders.html create mode 100644 _includes/form-fairex.html rename de/{ex.html => fairex.html} (71%) create mode 100644 de/form-fairex.md rename en/{ex.html => fairex.html} (71%) create mode 100644 en/form-fairex.md diff --git a/_config.yml b/_config.yml index c6f59c0..8c25a9b 100644 --- a/_config.yml +++ b/_config.yml @@ -7,9 +7,9 @@ # Site settings title: -- de: "P2P Marktplatz" en: "P2P marketplace" + url: "http://127.0.0.1" github_username: "tonyford" color_theme: "rgb(15, 21, 57)" diff --git a/_data/categories/ex/FAIR_ETH.yml b/_data/categories/fairex/FAIR_ETH.yml similarity index 75% rename from _data/categories/ex/FAIR_ETH.yml rename to _data/categories/fairex/FAIR_ETH.yml index 03e756a..d8ec5c8 100644 --- a/_data/categories/ex/FAIR_ETH.yml +++ b/_data/categories/fairex/FAIR_ETH.yml @@ -10,3 +10,6 @@ Tags: wallet: en: 'wallet' de: 'wallet' + BotC-w2w: + en: 'BotC-w2w' + de: 'BotC-w2w' diff --git a/_data/categories/ex/FAIR_EUR.yml b/_data/categories/fairex/FAIR_EUR.yml similarity index 100% rename from _data/categories/ex/FAIR_EUR.yml rename to _data/categories/fairex/FAIR_EUR.yml diff --git a/_data/form-fairex.yml b/_data/form-fairex.yml new file mode 100644 index 0000000..6e33ae4 --- /dev/null +++ b/_data/form-fairex.yml @@ -0,0 +1,83 @@ +fields: + + fairex: + type: selection + class: readonly + translation: + de: 'Währungstausch' + en: 'Currency exchange' + help: + de: 'unveränderlich' + en: 'unchangeable' + values: + - true + - false + default: true + + tags: + type: selection-tags + translation: + de: 'Kategorie' + en: 'Category' + help: + de: 'Auswahl ist erforderlich!' + en: 'Selection is mandatory!' + default: FAIR_EUR,SEPA + + bid-ask: + type: selection + translation: + de: 'Biete / Benötige' + en: 'bid / ask' + help: + de: 'Auswahl ist erforderlich!' + en: 'Selection is mandatory!' + default: bid + values: + - bid + - ask + + min-size: + type: input-text + class: form-decimals + maxlength: 32 + translation: + de: 'minimale Menge' + en: 'minimal size' + help: + de: 'in Bezug auf die ausgewählte Mengeneinheit' + en: 'in relation to the selected size unit' + default: 0 + + max-size: + type: input-text + class: form-decimals + maxlength: 32 + translation: + de: 'Gesamtmenge' + en: 'maximum size' + help: + de: 'in Bezug auf die ausgewählte Mengeneinheit' + en: 'in relation to the selected size unit' + default: 1 + + price-reference: + type: selection-price + translation: + de: 'Preisreferenz' + en: 'pricereference' + help: + de: 'Bitte eine Datenquelle auswählen oder einen Preis selbst definieren!' + en: 'please select a data source or define a fixed price!' + default: [FAIR,FAIRO,fairo] + + price-per-unit: + type: input-text + class: decimals + translation: + de: 'Preis je Mengeneinheit' + en: 'price per size unit' + help: + de: 'in Referenzwährung' + en: 'in reference currency' + default: 1 diff --git a/_includes/fairex-orders.html b/_includes/fairex-orders.html new file mode 100644 index 0000000..5836532 --- /dev/null +++ b/_includes/fairex-orders.html @@ -0,0 +1,47 @@ +<div class="fairex-orders"> + {% for o in posts %} + <div class="orderlist-div hide orderlist-ex {% for tag in o.tags %} tag-{{ tag }}{% endfor %}"> + + <div class="orderlist-title fairex"> + <small><{{ o.bid-ask }}>{% if o.bid-ask == 'ask' %}<span class="feather-icon icon-help-circle"></span> ask{% else %}<span class="feather-icon icon-alert-circle"></span> bid{% endif %}</{{ o.bid-ask }}> <a href="{{ o.git-repo }}/blob/master/{{ o.order-title }}" target="git-order"><span class="feather-icon icon-gitlab" title="{{ o.git-repo }}/blob/master/{{ o.order-title }}"></span></a> <a href="{{ o.git-profile }}" target="git-profile"><span class="feather-icon icon-user" title="{{ o.git-profile }}"></span></a> <a href="{{ o.git-repo }}/issues/new?issue[title]={{ o.order-title }}" target="git-contact"><span class="feather-icon icon-mail" title="{{ o.git-repo }}/issues/new?issue[title]={{ o.order-title }}"></span></a> <a href="https://www.latlong.net/c/?lat={{ o.latitude }}&long={{ o.longitude }}" target="latlong" title="latitude:{{ o.latitude }} | longitude: {{ o.longitude }}"><span class="d-none distance-data">{{ o.latitude }},{{ o.longitude }},{{ o.country-code }}</span> <span class="distance"></span></a> + <a href="form-fairex.html?language-code={{ o.language-code }}&tags={{ o.tags | slice:0,2 | join: ',' }}&bid-ask={{ o.bid-ask }}&headline={{ o.headline | escape }}&condition={{ o.condition }}&description={{ o.description | escape }}&unit={{ o.unit }}&min-size={{ o.min-size }}&max-size={{ o.max-size }}&price-reference={{ o.price-reference | join: ','}}&price-per-unit={{ o.price-per-unit }}"><span class="feather-icon icon-copy"></span></a></small><br> + <small> + {% for tag in o.tags %} + <tags class="li-tags li-tag-{{ tag }} clickable" title="{{ tag }}" onclick="getByTag( ['{{ o.tags[0] }}', '{{ tag }}'], $(this).hasClass('active') )"><span class="feather-icon icon-tag"></span> + {% if forloop.index == 1 %} + {{ site.data.categories.ex | map: o.tags[0] | map: "title" | map: include.ln }} + {% else %} + {% capture Tag %}{{ site.data.categories.ex | map: o.tags[0] | map: "Tags" | map: tag | map: include.ln }}{% endcapture %} + {% if Tag == '' %}<custom>{{ tag }}</custom>{% else %}{{ Tag }}{% endif %} + {% endif %} + </tags> + {% endfor %}</small><br> + <div><small>{{ o.description }}</small></div> + </div> + {% capture priceref %}{{ o.price-reference[0] | join: '-' }}{% endcapture %} + {% capture price_ex %} + {% if site.data.price-sources[priceref] != null %} + {{ site.data.price-sources[priceref].price | plus: 0.00001 | round: 4 }} + {% else %} + 0 + {% endif %} + {% endcapture %}{% assign price_ex = price_ex | times: 1 %} + {% capture price %}{% if price_ex != "" %}{{price_ex}}{% else %}{{ o.price-source }}{% endif %}{% endcapture %} + {% capture pricel %}{{ o.price-per-unit }}{% endcapture %} + {% capture pricelimit %} + {% if o.bid-ask == 'bid' and pricel < price %} + {{ price }} + {% elsif o.bid-ask == 'ask' and pricel > price %} + {{ price }} + {% else %} + {{ o.price-per-unit }} + {% endif %} + {% endcapture %} + + <div class="orderlist-price"> + {% if o.min-size > 0 %}{{ o.min-size }}..{% endif %}{{ o.max-size }} {{ o.price-reference[0][0] }} ( {{ pricelimit | times: o.max-size | decimals }} {{ o.price-reference[0][1] }} ) <font class="faircoin-price">{{ pricelimit | decimals }} {{ o.price-reference[0][1] }}</font><br><span class="fairex">{% if price_ex > 0 %}<i>( <a href="{{ site.data.price-sources[priceref].www }}">{{ priceref }}</a> {{ price }} {{ site.data.price-sources[priceref].currency }} / {{ o.price-reference[0][0] }} )<br>{% else %}<i>fixed price{% endif %}</i></span> + + </div> + </div> + {% endfor %} +</div> diff --git a/_includes/fairex.html b/_includes/fairex.html index ef22212..3c17195 100644 --- a/_includes/fairex.html +++ b/_includes/fairex.html @@ -4,72 +4,28 @@ <h2>No Categories found</h2> {% else %} - <div class="tags"> + <div class="fairex-tags"> <ul> {% for c in cat %} - {% capture ID %}{{ site.data.categories.ex[c].ID }}{% endcapture %} - <li class="li-tags li-tag-{{ID}}" title="{{ ID }}" onclick="getByTag(['{{ID}}'])">{{ site.data.categories.ex[c].title[include.ln] }} [{{ site.tags[ID] | size }}]</li> - {% for tag in site.data.categories.ex[c].Tags %} - <tags class="li-subtags li-subtag-of-{{ID}} d-none li-tag-{{tag[0]}}" title="{{ tag[0] }}" onclick="getByTag(['{{ID}}', '{{tag[0]}}'])"><span class="feather-icon icon-tag"></span>{{ tag[1] | map: include.ln }}</tags> - {% endfor %} + {% capture ID %}{{ site.data.categories.fairex[c].ID }}{% endcapture %} + <li class="li-tags li-tag-{{ID}}" title="{{ ID }}" onclick="getByTag(['{{ID}}'], false)">{{ site.data.categories.fairex[c].title[include.ln] }} [{{ site.tags[ID] | size }}]</li> {% endfor %} </ul> </div> {% endif %} + {% assign posts = site.posts | where_exp: "item", "item.fairex == true" | where: "bid-ask","ask" | sort: "price-per-unit" | reverse %} + {% include fairex-orders.html %} + {% assign posts = site.posts | where_exp: "item", "item.fairex == true" | where: "bid-ask","bid" | sort: "price-per-unit" %} + {% include fairex-orders.html %} - <div class="orders"> - {% for o in site.posts %} - <div class="orderlist-div orderlist-ex {% for tag in o.tags %} tag-{{ tag }}{% endfor %}"> - <div class="orderlist-title"> - <a href="{{ o.git-repo }}/blob/master/{{ o.order-title }}" target="git-order"><u>{{ o.bid-ask }} {{ o.price-reference[0][0] }}</u></a> <a href="{{ o.git-profile }}" target="git-profile"><span class="feather-icon icon-user"></span></a> <a href="{{ o.git-repo }}/issues/new?issue[title]={{ o.order-title }}" target="git-contact"><span class="feather-icon icon-mail"></span></a><br> - <small><lang><span class="feather-icon icon-tag"></span>{{ o.language-code }}</lang> <a href="https://www.latlong.net/c/?lat={{ o.latitude }}&long={{ o.longitude }}" target="latlong" title="latitude:{{ o.latitude }} | longitude: {{ o.longitude }}"><span class="d-none distance-data">{{ o.latitude }},{{ o.longitude }},{{ o.country-code }}</span> <span class="distance"></span></a> - {% for tag in o.tags %} - <tags class="li-tags li-tag-{{ tag }} clickable" title="{{ tag }}" onclick="getByTag( ['{{ o.tags[0] }}', '{{ tag }}'] )"><span class="feather-icon icon-tag"></span> - {% if forloop.index == 1 %} - {{ site.data.categories.ex | map: o.tags[0] | map: "title" | map: include.ln }} - {% else %} - {% capture Tag %}{{ site.data.categories.ex | map: o.tags[0] | map: "Tags" | map: tag | map: include.ln }}{% endcapture %} - {% if Tag == '' %}<custom>{{ tag }}</custom>{% else %}{{ Tag }}{% endif %} - {% endif %} - </tags> - {% endfor %}</small><br> - <div><small>{{ o.description }}</small></div> - </div> - {% capture priceref %}{{ o.price-reference[0] | join: '-' }}{% endcapture %} - {% capture price_ex %} - {% if site.data.price-sources[priceref] != null %} - {{ site.data.price-sources[priceref].price | plus: 0.00001 | round: 4 }} - {% else %} - 0 - {% endif %} - {% endcapture %}{% assign price_ex = price_ex | times: 1 %} - {% capture price %}{% if price_ex != "" %}{{price_ex}}{% else %}{{ o.price-source }}{% endif %}{% endcapture %} - {% capture pricel %}{{ o.price-per-unit }}{% endcapture %} - {% capture pricelimit %} - {% if o.bid-ask == 'bid' and pricel < price %} - {{ price }} - {% elsif o.bid-ask == 'ask' and pricel > price %} - {{ price }} - {% else %} - {{ o.price-per-unit }} - {% endif %} - {% endcapture %} - - <div class="orderlist-price"> - ( {{ pricelimit | times: o.max-size | decimals }} {{ o.price-reference[0][1] }} ) <font class="faircoin-price">{{ pricelimit | decimals }} {{ o.price-reference[0][1] }}</font><br>{% if o.min-size > 0 %}{{ o.min-size }}..{% endif %}{{ o.max-size }} {{ o.price-reference[0][0] }}<br>{% if price_ex > 0 %}( <a href="{{ site.data.price-sources[priceref].www }}">{{ priceref }}</a> {{ price }} {{ site.data.price-sources[priceref].currency }} / {{ o.price-reference[0][0] }} )<br><i>{% else %}fixed price{% endif %}</i> - - </div> - </div> - {% endfor %} - </div> </div> <script> $( document ).ready(function() { getDistancesTags(); - getByTag(['FAIR_EUR']); + getByTag(['FAIR_EUR'], false ); }); </script> diff --git a/_includes/form-fairex.html b/_includes/form-fairex.html new file mode 100644 index 0000000..f731fd3 --- /dev/null +++ b/_includes/form-fairex.html @@ -0,0 +1,94 @@ +<form> + {% for fields in site.data.form-fairex.fields %} + {% for f in fields %} + {% case f.type %} + {% when 'selection' %} + {% assign fvalues=f[1] | map: 'values' | clean %} + <div class="form-group"> + <label>{{ f.translation | map: include.ln }}</label> + <select id="{{ fields[0] }}" class="order-form form-control {{ f.class }}" onchange="createYml()"> + {% for v in f.values %}<option value="{{ v }}" title="{{ v }}"{% if f.default == v %} selected{% endif %}>{{ v }}</option>{% endfor %} + </select> + <small class="form-text text-muted">{{ f.help | map: include.ln }}</small> + </div> + {% when 'selection-tags' %} + {% assign fvalues=site.data.categories.fairex %} + <div class="form-group"> + <label>{{ f.translation | map: include.ln }}</label> + <select id="{{ fields[0] }}" class="order-form form-control" onchange="createYml()"> + {% for v in fvalues %} + <optgroup label="{{ v[1].title | map: include.ln }}"> + {% for tag in v[1].Tags %} + {% capture val %}{{ v[0]}},{{ tag[0] }}{% endcapture %} + <option value="{{ v[0]}},{{ tag[0] }}" title="{{ v[0]}},{{ tag[0] }}"{% if f.default == val %} selected{% endif %}>{{ tag[1] | map: include.ln }}</option> + {% endfor %} + </optgroup> + {% endfor %} + </select> + <small class="form-text text-muted">{{ f.help | map: include.ln }}</small> + </div> + {% when 'selection-condition' %} + {% assign fvalues=site.data.condition | sort %} + <div class="form-group"> + <label>{{ f.translation | map: include.ln }}</label> + <select id="{{ fields[0] }}" class="order-form form-control" onchange="createYml()"> + {% for v in fvalues %} + <option value="{{ v[0] }}" title="{{ v[0] }}"{% if f.default == v[0] %} selected{% endif %}>{{ v[1] | map: 'description' | map: include.ln }}</option> + {% endfor %} + </select> + <small class="form-text text-muted">{{ f.help | map: include.ln }}</small> + </div> + {% when 'selection-img' %} + <div class="form-group"> + <label>{{ f.translation | map: include.ln }}</label> + <select id="{{ fields[0] }}" class="order-form form-control"> + {% for v in f.values %} + <option value="{{ v }}" title="{{ v[0] }}"{% if f.default == v[0] %} selected{% endif %}>{{ v }}</option> + {% endfor %} + </select> + <small class="form-text text-muted">{{ f.help | map: include.ln }}</small> + </div> + {% when 'selection-price' %} + {% assign fvalues=site.data.currencies | sort %} + <div class="form-group"> + <label>{{ f.translation | map: include.ln }}</label> + <select id="{{ fields[0] }}" class="order-form form-control" onchange="createYml()"> + {% for v in fvalues %} + <optgroup label="{{ v[0] }}">{% assign ps=v[1] | map: 'price-sources' | clean %} + {% for w in ps %} + {% for y in w[1] %} + <option value="{{ v[0] }},{{ w[0] }},{{ y[0] }}" title="">{{ w[0] }},{{ y[0] }}</option> + {% endfor %} + {% endfor %} + </optgroup> + {% endfor %} + </select> + <small class="form-text text-muted">{{ f.help | map: include.ln }}</small> + </div> + {% when 'input-text' %} + <div class="form-group"> + <label>{{ f.translation | map: include.ln }}</label> + <input id="{{ fields[0] }}" type="text" class="order-form form-control {{ f.class }}" maxlength="{{ f.maxlength }}" onkeyup="formInput(this)" onchange="createYml()" value="{{ f.default }}"> + <small class="form-text text-muted">{{ f.help | map: include.ln }}</small> + </div> + {% when 'textarea' %} + <div class="form-group"> + <label>{{ f.translation | map: include.ln }}</label> + <textarea id="{{ fields[0] }}" class="order-form form-control {{ f.class }}" maxlength="{{ f.maxlength }}" onchange="createYml()">{{ f.default }}</textarea> + <small class="form-text text-muted">{{ f.help | map: include.ln }}</small> + </div> + {% endcase %} + {% endfor %} + {% endfor %} + <button class="form-control" type="button" onclick="importYml()">import from *.yml</button> +</form> +<div class="order-yml"> + <h4>*.yml</h4> + <textarea id="order-yml"></textarea> +</div> +<script> +$( document ).ready(function() { + GetValues(); + createYml(); +}); +</script> diff --git a/_includes/form.html b/_includes/form.html index 22a7d7c..408b8c3 100644 --- a/_includes/form.html +++ b/_includes/form.html @@ -19,7 +19,7 @@ {% for v in fvalues %} <optgroup label="{{ v[1].title | map: include.ln }}"> {% for tag in v[1].Tags %} - <option value="[{{ v[0]}},{{ tag[0] }}]" title="[ {{ v[0]}},{{ tag[0] }} ]"{% if default == val %} selected{% endif %}>{{ tag[1] | map: include.ln }}</option> + <option value="{{ v[0]}},{{ tag[0] }}" title="{{ v[0]}},{{ tag[0] }}"{% if default == val %} selected{% endif %}>{{ tag[1] | map: include.ln }}</option> {% endfor %} </optgroup> {% endfor %} @@ -54,7 +54,6 @@ <select id="{{ fields[0] }}" class="order-form form-control" onchange="createYml()"> {% for v in fvalues %} <optgroup label="{{ v[0] }}">{% assign ps=v[1] | map: 'price-sources' | clean %} - {{ ps }} {% for w in ps %} {% for y in w[1] %} <option value="{{ v[0] }},{{ w[0] }},{{ y[0] }}" title="">{{ w[0] }},{{ y[0] }}</option> @@ -88,6 +87,7 @@ </div> <script> $( document ).ready(function() { + GetValues(); createYml(); }); </script> diff --git a/_includes/menu.html b/_includes/menu.html index 3e2ecb0..c797716 100644 --- a/_includes/menu.html +++ b/_includes/menu.html @@ -2,10 +2,10 @@ <div class="size margin menu--content container align-items-center justify-content-between"> <div class="" data-aos="fade-right" data-aos-delay="" data-aos-offset="0"> - <a href="{{ site.baseurl }}/"><span>FairCoin |</span> {{ site.title | map: include.ln }}</a> + <a href="./"><span>FairCoin |</span> {{ site.title | map: include.ln }}</a> </div> - <header class="d-none"> + <header class="" style="opacity:0;"> <div class="header container align-items-center justify-content-center"> <div class="header--block size margin container column"> @@ -29,16 +29,20 @@ </header> - <a href="https://faircoin.co" data-aos="fade-left" data-aos-delay="" data-aos-offset="0"> - <div class="container align-items-baseline back-to-site"> - <div class=""> - <span class="feather-icon icon-external-link"></span> - </div> - <div class="back-to-site-text"> - Back to faircoin.co - </div> - </div> - </a> + <div class="navm" data-aos="fade-right" data-aos-delay="" data-aos-offset="0"> + <a href="../{% if include.forward != "" %}?fw={{ include.forward }}{% endif %}" data-aos="fade-left" data-aos-delay="" data-aos-offset="0"> + <div class="back-to-site-text"> + <span class="feather-icon icon-log-out"></span> + {{ include.ln }} + </div> + </a> + + + <a href="./"><span class="feather-icon icon-globe" title="{{ site.title | map: include.ln }}"></span></a> + <a href="./fairex.html"><span class="feather-icon icon-refresh-cw"></span></a> + <a href="form{% if include.forward == 'fairex.html'%}-fairex{% endif %}.html"><span class="feather-icon icon-edit"></span></a> + + </div> <!-- <nav class="masthead-nav"> {% for page in site.pages %} {% if page.title %} diff --git a/_includes/overview.html b/_includes/overview.html index 3d093f8..0c468ab 100644 --- a/_includes/overview.html +++ b/_includes/overview.html @@ -42,8 +42,12 @@ </div> <div class="orderlist-title"> - <a href="{{ o.git-repo }}/blob/master/{{ o.order-title }}" target="git-order"><u>{{ o.headline | truncate: 32 }}</u></a> <a href="{{ o.git-profile }}" target="git-profile"><span class="feather-icon icon-user"></span></a> <a href="{{ o.git-repo }}/issues/new?issue[title]={{ o.order-title }}" target="git-contact"><span class="feather-icon icon-mail"></span></a><br> - <small><lang><span class="feather-icon icon-tag"></span>{{ o.language-code }}</lang> <a href="https://www.latlong.net/c/?lat={{ o.latitude }}&long={{ o.longitude }}" target="latlong" title="latitude:{{ o.latitude }} | longitude: {{ o.longitude }}"><span class="d-none distance-data">{{ o.latitude }},{{ o.longitude }},{{ o.country-code }}</span> <span class="distance"></span></a> <used><span class="feather-icon icon-tag"></span>{{ o.condition }}</used> + <a href="{{ o.git-repo }}/blob/master/{{ o.order-title }}" target="git-order"><u>{{ o.headline | truncate: 32 }}</u></a> <a href="{{ o.git-profile }}" target="git-profile"><span class="feather-icon icon-user"></span></a> <a href="{{ o.git-repo }}/issues/new?issue[title]={{ o.order-title }}" target="git-contact"><span class="feather-icon icon-mail"></span></a> + + <a href="form.html?language-code={{ o.language-code }}&tags={{ o.tags | slice:0,2 | join: ',' }}&bid-ask={{ o.bid-ask }}&headline={{ o.headline | escape }}&condition={{ o.condition }}&description={{ o.description | escape }}&unit={{ o.unit }}&min-size={{ o.min-size }}&max-size={{ o.max-size }}&price-reference={{ o.price-reference | join: ','}}&price-per-unit={{ o.price-per-unit }}"><span class="feather-icon icon-copy"></span></a> + + <br> + <small><bidask>{% if o.bid-ask == 'ask' %}<span class="feather-icon icon-help-circle"></span> ask{% else %}<span class="feather-icon icon-alert-circle"></span> bid{% endif %}</bidask> <lang><span class="feather-icon icon-tag"></span>{{ o.language-code }}</lang> <a href="https://www.latlong.net/c/?lat={{ o.latitude }}&long={{ o.longitude }}" target="latlong" title="latitude:{{ o.latitude }} | longitude: {{ o.longitude }}"><span class="d-none distance-data">{{ o.latitude }},{{ o.longitude }},{{ o.country-code }}</span> <span class="distance"></span></a> <used><span class="feather-icon icon-tag"></span>{{ o.condition }}</used> {% for tag in o.tags %} <tags class="li-tags li-tag-{{ tag }} clickable" title="{{ tag }}" onclick="getByTag( ['{{ o.tags[0] }}', '{{ tag }}'] )"><span class="feather-icon icon-tag"></span> {% if forloop.index == 1 %} diff --git a/_layouts/default.html b/_layouts/default.html index ef47fb8..c5de9c0 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -3,7 +3,7 @@ <body> <script src="../assets/js/jquery.min.js"></script> <div class=""> - {% include menu.html ln=page.ln %} + {% include menu.html ln=page.ln forward=page.forward %} {{ content }} diff --git a/_layouts/selectln.html b/_layouts/selectln.html index c7a5a98..4049ec5 100644 --- a/_layouts/selectln.html +++ b/_layouts/selectln.html @@ -1,11 +1,22 @@ {% include head.html assetpath="./" %} <body style="text-align:center;"> + <script src="../assets/js/jquery.min.js"></script> + <script src="../assets/js/script.js"></script> <h1>select language</h1> <ul style="list-style:none;"> {% for ln in page.ln %} - <li><a href="./{{ ln }}">{{ ln }}</a></li> + <li><a class="ll" href="./{{ ln }}">{{ ln }}</a></li> {% endfor %} </ul> {{ content }} + <script> + $( document ).ready(function() { + $.each( $('.ll'), + function(i,v){ + v.href+='/'+getQueryVariable('fw'); + } + ); + }); + </script> </body> </html> diff --git a/assets/js/script.js b/assets/js/script.js index 89d770c..7b17942 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -16,7 +16,9 @@ function deg2rad(deg) { return deg * (Math.PI/180) } -function getByTag(tags){ +function getByTag( tags, is_active ){ + + $('.orderlist-div').toggleClass('hide',false); if( tags[0] == undefined ){ $('.orderlist-div').toggleClass('d-none',false); @@ -24,49 +26,66 @@ function getByTag(tags){ var subtag=''; } else { - $('.orderlist-div').toggleClass('d-none',true); - $('.li-tags').toggleClass('active', false ); - $('.li-subtags').toggleClass('active', false ).toggleClass('d-none',true); + if( is_active ) return; + $('.orderlist-div').toggleClass('hide',true); - var tag_class=''; + setTimeout(function(){ + $('.orderlist-div').toggleClass('d-none',true); - tags.forEach( - function(v,i){ - if( v == null || v == '' ) return; - tag_class+='.tag-'+v; - console.log( tag_class ); - $('.li-tag-'+v).toggleClass('active',true); - $('.li-subtag-of-'+v).toggleClass('d-none', false); - } - ); + // manage tags + $('.li-tags').toggleClass('active', false ); + $('.li-subtags').toggleClass('active', false ).toggleClass('d-none',true); - $(tag_class).toggleClass('d-none',false); - var tag=tags[0]; - var subtag=tags[1]; - } + var tag_class=''; - var p=['tag','subtag','lat','long']; + tags.forEach( + function(v,i){ + if( v == null || v == '' ) return; + tag_class+='.tag-'+v; + $('.li-tag-'+v).toggleClass('active',true); + $('.li-subtag-of-'+v).toggleClass('d-none', false); + } + ); - var lat=undefined; - var long=undefined; + $(tag_class).toggleClass('d-none',false); + var tag=tags[0]; + var subtag=tags[1]; - var param=[]; + // manage url params + var p=['tag','subtag','lat','long']; - p.forEach( - function(v){ - if( eval(v) != undefined ){ - var pp=eval(v); - } else { - var pp=getQueryVariable(v); - } - if( pp != undefined ){ - if( pp != '' ){ - param.push(v + '='+pp); + var lat=undefined; + var long=undefined; + + var param=[]; + + p.forEach( + function(v){ + if( eval(v) != undefined ){ + var pp=eval(v); + } else { + var pp=getQueryVariable(v); + } + if( pp != undefined ){ + if( pp != '' ){ + param.push(v + '='+pp); + } + } } - } - } - ); - ChangeUrl( '', (( param != '' ) ? '?' : '' )+param.join('&') ); + ); + ChangeUrl( '', (( param != '' ) ? '?' : '' )+param.join('&') ); + + setTimeout(function(){ + $('.orderlist-div.hide').toggleClass('hide',false); + },100 ); + + },500 ); + + + } + + + } function getDistancesTags(){ @@ -79,7 +98,7 @@ function getDistancesTags(){ var tag = url.searchParams.get('tag'); var subtag = url.searchParams.get('subtag'); - getByTag([ tag, subtag ]); + getByTag([ tag, subtag ], false ); if( lat == null || long == null ){ lat=-100; @@ -176,3 +195,13 @@ function ChangeUrl(page, query ) { alert("Browser does not support HTML5."); } } + +function GetValues(){ + $.each( $('.order-form'), + function(i,v){ + if( getQueryVariable(v.id) != undefined ){ + $(v).val( decodeURI( getQueryVariable(v.id) ) ); + } + } + ); +} diff --git a/css/main.scss b/css/main.scss index 2fe1de6..1e2b81f 100644 --- a/css/main.scss +++ b/css/main.scss @@ -25,6 +25,12 @@ $baseurl: '{{ site.baseurl }}'; opacity: 0.9; background-color: inherit; padding: 0.2rem; + i { + a { + color: lightgrey; + } + color: lightgrey; + } } .orderlist-date { @@ -48,12 +54,29 @@ $baseurl: '{{ site.baseurl }}'; } } +.fairex { + tags { + opacity: 0.2; + transition: opacity 0.5s ease; + } + tags.active { + opacity: 0.8; + transition: opacity 0.5s ease; + } +} + +tags.active { + opacity: 1; + z-index:5; +} + .orderlist-title { float: left; width:calc( 100vw - 16rem - 10rem ); position:relative; height: 0; line-height: 1rem; + @media screen and (max-width: 900px) { height: 0; left: 5rem; @@ -72,7 +95,15 @@ $baseurl: '{{ site.baseurl }}'; } } +.orderlist-title.fairex { + @media screen and (max-width: 900px) { + height: 0; + left: 0rem; + } +} + .orderlist-div { + height: 4rem; font-size: 0.9rem; min-height: 160px; @@ -92,7 +123,13 @@ $baseurl: '{{ site.baseurl }}'; &.orderlist-ex { height: 2rem; - min-height: 80px; + min-height: 60px; + } + + transition: opacity 0.5s ease; + + &.hide { + opacity: 0; } } @@ -177,7 +214,8 @@ $baseurl: '{{ site.baseurl }}'; .overview { height: 55vh; min-height: 20rem; - overflow: auto; + overflow-x: hidden; + overflow-y: auto; } .d-none { @@ -255,3 +293,89 @@ label { width:100%; height: 15rem; } + +.navm { + text-align: right; +} + +.back-to-site-text { + font-size:0.7em; +} + +.fairex-orders { + + width: calc( 50vw - 13px ); + min-width: 14rem; + left: 6px; + margin-top: 0px; + + @media screen and (max-width: 800px) { + width: calc( 100vw - 2rem ); + left: 1rem; + min-width: 90vw; + } + + float:left; + padding: 0.5rem; + border: 0px solid grey; + margin-bottom:1rem; + z-index:2; + margin:1px; + position: relative; + +} + +.fairex-tags { + + @media screen and (max-width: 640px) { + display:none; + } + + width: 99%; + min-width: 13rem; + float:left; + background: whitesmoke; + padding:0.1rem; + border: 1px solid grey; + font-size:0.8rem; + margin-bottom:0.1rem; + margin-right:0.1rem; + position: fixed; + top: 4.2rem; + left: 0.5%; + z-index:3; + transition: all 0.4s ease; + + ul { + list-style: none; + } + + li { + float:left; margin-left: 0.3rem; + } + + li:hover { + color: darkgoldenrod; + } + + &:hover { + cursor: pointer; + } + + .active { + color: darkgoldenrod !important; + } + +} + +.readonly { + pointer-events:none; +} + +ask { + color: darkgreen; +} + +bid { + color: darkred; +} diff --git a/de/ex.html b/de/fairex.html similarity index 71% rename from de/ex.html rename to de/fairex.html index ea35683..a4ec27e 100644 --- a/de/ex.html +++ b/de/fairex.html @@ -1,10 +1,11 @@ --- layout: default ln: de +forward: fairex.html --- <div class="content-post"> - <div class="size margin"> + <div class="margin"> {% include fairex.html ln='de' %} </div> </div> diff --git a/de/form-fairex.md b/de/form-fairex.md new file mode 100644 index 0000000..a95b530 --- /dev/null +++ b/de/form-fairex.md @@ -0,0 +1,10 @@ +--- +layout: default +ln: de +footer: false +--- +<div class="content-post"> + <div class="size margin"> + {% include form-fairex.html ln='de' %} + </div> +</div> diff --git a/en/ex.html b/en/fairex.html similarity index 71% rename from en/ex.html rename to en/fairex.html index 48248b6..6c023e6 100644 --- a/en/ex.html +++ b/en/fairex.html @@ -1,10 +1,11 @@ --- layout: default ln: en +forward: fairex.html --- <div class="content-post"> - <div class="size margin"> + <div class="margin"> {% include fairex.html ln='en' %} </div> </div> diff --git a/en/form-fairex.md b/en/form-fairex.md new file mode 100644 index 0000000..6dcc1d9 --- /dev/null +++ b/en/form-fairex.md @@ -0,0 +1,10 @@ +--- +layout: default +ln: en +footer: false +--- +<div class="content-post"> + <div class="size margin"> + {% include form-fairex.html ln='en' %} + </div> +</div> -- GitLab