Compare commits
No commits in common. "main" and "main" have entirely different histories.
|
@ -1,6 +1,3 @@
|
|||
.env
|
||||
cache/
|
||||
tests/
|
||||
minelife.html
|
||||
vendors/keygen/__pycache__
|
||||
erreurs/
|
2
Makefile
|
@ -3,5 +3,3 @@ MYOS_REPOSITORY ?= https://github.com/aynicos/myos
|
|||
-include $(MYOS)/make/include.mk
|
||||
$(MYOS):
|
||||
-@git clone $(MYOS_REPOSITORY) $(MYOS)
|
||||
|
||||
ENV_VARS += DOCKER_INTERNAL_DOCKER_HOST
|
||||
|
|
|
@ -8,7 +8,7 @@ error_reporting(E_ALL);
|
|||
|
||||
session_start();
|
||||
|
||||
define('DEFAULT_SEARCH_RADIUS', 50);
|
||||
define('DEFAULT_RADIUS', 50);
|
||||
|
||||
define('TAILLE_SPRITE', 32);
|
||||
define('DEMI_TAILLE_SPRITE', (TAILLE_SPRITE/2));
|
||||
|
@ -56,6 +56,12 @@ $players = [
|
|||
new Player('8PTThXiUSwwuPoqQWw3tuAn4MpvzQzpKhs6LMuiozS7Z', 'kimamila')
|
||||
];
|
||||
|
||||
if (!isset($_SESSION['radius'])) {
|
||||
|
||||
$_SESSION['radius'] = DEFAULT_RADIUS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
=====================
|
||||
|
|
|
@ -38,14 +38,14 @@ RUN apk add --no-cache --virtual .build-deps \
|
|||
python3-dev \
|
||||
swig \
|
||||
&& mkdir -p /usr/local/src/jaklis \
|
||||
&& wget -qO - https://github.com/aynicos/jaklis/archive/master.tar.gz \
|
||||
&& wget -qO - https://git.p2p.legal/axiom-team/jaklis/archive/master.tar.gz \
|
||||
|tar --strip-components 1 -C /usr/local/src/jaklis -xzf - \
|
||||
&& pip3 install -r /usr/local/src/jaklis/requirements.txt \
|
||||
&& ln -s /usr/local/src/jaklis/jaklis.py /usr/local/bin/jaklis \
|
||||
&& chmod 0755 /usr/local/bin/jaklis \
|
||||
&& /usr/local/bin/jaklis --help >/dev/null \
|
||||
&& mkdir -p /usr/local/src/dpgpid \
|
||||
&& wget -qO - https://github.com/aynicos/dpgpid/archive/wip.tar.gz \
|
||||
&& wget -qO - https://git.p2p.legal/aya/dpgpid/archive/master.tar.gz \
|
||||
|tar --strip-components 1 -C /usr/local/src/dpgpid -xzf - \
|
||||
&& pip3 install -r /usr/local/src/dpgpid/requirements.txt \
|
||||
&& ln -s /usr/local/src/dpgpid/keygen /usr/local/bin/keygen \
|
||||
|
@ -93,6 +93,3 @@ RUN [ "$UID" -eq "$UID" ] 2>/dev/null \
|
|||
|
||||
ENV SHELL=${SHELL}
|
||||
WORKDIR /var/www
|
||||
|
||||
RUN rm /etc/php7/conf.d/00_opcache.ini
|
||||
RUN sed -i 's/^;php_flag[display_errors] = off/php_flag[display_errors] = on/' /etc/php7/php-fpm.d/www.conf
|
||||
|
|
|
@ -12,9 +12,6 @@ services:
|
|||
networks:
|
||||
- private
|
||||
- public
|
||||
extra_hosts:
|
||||
- astroport.localhost:${DOCKER_INTERNAL_DOCKER_HOST}
|
||||
|
||||
|
||||
networks:
|
||||
private:
|
||||
|
|
|
@ -7,24 +7,17 @@ $gchange = new Gchange();
|
|||
|
||||
$javascripts['header'][] = 'lib/js/farfetched.js';
|
||||
|
||||
$bodyIds = 'farfetched';
|
||||
include_once('header.php');
|
||||
|
||||
?>
|
||||
|
||||
<section id="shippable">
|
||||
|
||||
<h2>Envoi possible</h2>
|
||||
<ul id="shippable-offers" class="offers-list">
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section id="immaterial">
|
||||
<h2>Offres immatérielles</h2>
|
||||
<ul id="immaterial-offers" class="offers-list">
|
||||
</ul>
|
||||
</section>
|
||||
<h2>Envoi possible</h2>
|
||||
<ul id="shippable">
|
||||
</ul>
|
||||
|
||||
<h2>Offres immatérielles</h2>
|
||||
<ul id="immaterial">
|
||||
</ul>
|
||||
<?php
|
||||
|
||||
include_once('footer.php');
|
36
home.php
|
@ -2,43 +2,21 @@
|
|||
|
||||
require_once('config.php');
|
||||
require_once('lib/Gchange.class.php');
|
||||
require_once('lib/Keygen.class.php');
|
||||
require_once('lib/Fred.class.php');
|
||||
|
||||
$bodyIds = 'home';
|
||||
include_once('header.php');
|
||||
|
||||
$gchange = new Gchange();
|
||||
|
||||
$keygen = new Keygen();
|
||||
|
||||
// $ipfsHost = 'http://astroport.localhost:8080';
|
||||
$ipfsHost = 'http://libra.copylaradio.com:8080';
|
||||
|
||||
|
||||
try {
|
||||
|
||||
$player = $gchange->getUser($_SESSION['player_pubkey']);
|
||||
|
||||
$player = $gchange->getUser($_SESSION['player_pubkey']);
|
||||
|
||||
} catch (Exception $errMsg) {
|
||||
|
||||
ErrorsHandler::kaput($errMsg);
|
||||
ErrorsHandler::kaput($errMsg);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
$twLink = $ipfsHost . '/ipns/' . $keygen->getIPNSPub($_SESSION['salt'], $_SESSION['pepper']);
|
||||
|
||||
} catch (Exception $errMsg) {
|
||||
|
||||
$twLink = '#';
|
||||
$fred = new Fred();
|
||||
$twLink = $ipfsHost . '/ipns/' . $fred->donneMoiLaPutainDeClefIPNS($_SESSION['salt'], $_SESSION['pepper']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo '
|
||||
<header>
|
||||
Bienvenue '. $player->getUserName() . ' !
|
||||
|
@ -72,20 +50,12 @@ echo '
|
|||
</li>
|
||||
|
||||
<li id="dashboard-minelife">
|
||||
<a href="minelife/index.html">
|
||||
<a href="minelife.html">
|
||||
<span>
|
||||
Manuel
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li id="dashboard-tiddlywiki">
|
||||
<a href="'. $twLink .'">
|
||||
<span>
|
||||
'. ('Mon TiddlyWiki') .'
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
|
|
@ -115,8 +115,8 @@ class DAO {
|
|||
if (!in_array($unit, $this->units)) {
|
||||
|
||||
$out = [];
|
||||
$out[] = 'L\'unité renseignée n\'existe pas.';
|
||||
$out[] = 'Vérifiez votre synthaxe.';
|
||||
$out[] = _('L\'unité renseignée n\'existe pas.');
|
||||
$out[] = _('Vérifiez votre synthaxe.');
|
||||
|
||||
$this->decease($out);
|
||||
|
||||
|
@ -205,7 +205,7 @@ class DAO {
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>'. ('Erreur critique') . '</title>
|
||||
<title>'. _('Erreur critique') . '</title>
|
||||
|
||||
<style>
|
||||
|
||||
|
@ -251,16 +251,16 @@ class DAO {
|
|||
|
||||
if ($this->displayType == 'img') {
|
||||
|
||||
return ('DUĞ1');
|
||||
return _('DUĞ1');
|
||||
|
||||
} else {
|
||||
|
||||
return ('DU<sub>Ğ1</sub>');
|
||||
return _('DU<sub>Ğ1</sub>');
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
return ('Ğ1');
|
||||
return _('Ğ1');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -476,16 +476,16 @@ class DAO {
|
|||
if (empty($json)) {
|
||||
|
||||
$out = [];
|
||||
$out[] = ('Aucun noeud '. $nodeType .' n\'a été trouvé ou la requête n\'a pas abouti.');
|
||||
$out[] = ('Noeud interrogés : ');
|
||||
$out[] = _('Aucun noeud '. $nodeType .' n\'a été trouvé ou la requête n\'a pas abouti.');
|
||||
$out[] = _('Noeud interrogés : ');
|
||||
|
||||
$out = array_merge($out, $nodes);
|
||||
|
||||
$out[] = ('URI: ' . $uri);
|
||||
$out[] = _('URI: ' . $uri);
|
||||
|
||||
if (isset($queryParams)) {
|
||||
|
||||
$out[] = ('Paramètres de la requête : ');
|
||||
$out[] = _('Paramètres de la requête : ');
|
||||
$out[] = '<pre>'. print_r($queryParams, true) . '<pre>';
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ class ErrorsHandler {
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Erreur critique</title>
|
||||
<title>'. _('Erreur critique') . '</title>
|
||||
|
||||
<style>
|
||||
|
||||
|
|
|
@ -1,84 +1,47 @@
|
|||
<?php
|
||||
|
||||
class Fred {
|
||||
|
||||
|
||||
private $gatewayProtocol = 'http';
|
||||
|
||||
private $gatewayDomain = 'libra.copylaradio.com';
|
||||
// private $gatewayDomain = 'aries.copylaradio.com';
|
||||
// private $gatewayDomain = 'astroport.localhost';
|
||||
|
||||
private $gatewayPort = '1234';
|
||||
|
||||
private $gatewayDelay = 3;
|
||||
|
||||
private $gatewayMaxRounds = 20;
|
||||
|
||||
public function __construct () {
|
||||
|
||||
}
|
||||
|
||||
public function donneMoiLAdresseIPDuServeurQuiHebergeMonTiddlyWiki ($salt, $pepper) {
|
||||
|
||||
}
|
||||
|
||||
public function donneMoiLaPutainDeClefIPNS ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday) {
|
||||
|
||||
$salt = $prenomNom;
|
||||
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
|
||||
|
||||
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper) . '&getipns=on';
|
||||
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper);
|
||||
|
||||
$page1 = file_get_contents($this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query);
|
||||
|
||||
|
||||
if (empty($page1)) {
|
||||
|
||||
throw new Exception("J'ai pas pû récupérer la putain de première page.");
|
||||
throw new Exception("J'ai pas pû récupérer la putain de première page.");
|
||||
}
|
||||
|
||||
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
||||
|
||||
$url = $matches[1];
|
||||
$url .= '/?'. $query;
|
||||
|
||||
// die($url);
|
||||
$opts2 = array(
|
||||
'http'=>array(
|
||||
'method'=>"GET",
|
||||
'header'=>"Accept-language: fr\r\n",
|
||||
'follow_location' => 0
|
||||
)
|
||||
);
|
||||
|
||||
// echo 'fred 2';
|
||||
|
||||
$context2 = stream_context_create($opts2);
|
||||
|
||||
$page2 = false;
|
||||
$rounds = 0;
|
||||
|
||||
while (($page2 === false) and $rounds < $this->gatewayMaxRounds) {
|
||||
|
||||
sleep($this->gatewayDelay);
|
||||
// echo "\n\n\nround n°" . $rounds . "\n";
|
||||
|
||||
$page2 = @file_get_contents($url, false, $context2);
|
||||
|
||||
// echo '<pre>'. print_r(htmlspecialchars($page2), true) . '</pre>';
|
||||
|
||||
$rounds++;
|
||||
}
|
||||
|
||||
if ($page2 === false) {
|
||||
sleep($this->gatewayDelay);
|
||||
|
||||
throw new Exception("J'ai pas pû me connecter à ". $url ." pour récupérer la putain de deuxième page.");
|
||||
|
||||
} else if (empty($page2)) {
|
||||
$page2 = file_get_contents($url);
|
||||
|
||||
if (empty($page2)) {
|
||||
|
||||
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
|
||||
}
|
||||
|
||||
preg_match("`/ipns/(.+)`is", $page2, $matches);
|
||||
preg_match("`url='.*/ipns/([^']+)'`isU", $page2, $matches);
|
||||
|
||||
$ipnsKey = $matches[1];
|
||||
|
||||
|
@ -115,12 +78,10 @@ class Fred {
|
|||
$page2 = '';
|
||||
$rounds = 0;
|
||||
|
||||
while (empty($page2) and $rounds < $this->gatewayMaxRounds) {
|
||||
while (empty($page2) and $rounds < 10) {
|
||||
|
||||
sleep($this->gatewayDelay);
|
||||
$page2 = file_get_contents($url);
|
||||
|
||||
$rounds++;
|
||||
}
|
||||
|
||||
if (empty($page2)) {
|
||||
|
@ -171,8 +132,8 @@ class Fred {
|
|||
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
||||
|
||||
// die(
|
||||
// '<pre>' . htmlspecialchars($page1) . '</pre>' .
|
||||
// '<pre>' . print_r($matches, true) . '</pre>'
|
||||
// '<pre>' . htmlspecialchars($page1) . '</pre>' .
|
||||
// '<pre>' . print_r($matches, true) . '</pre>'
|
||||
// );
|
||||
|
||||
$url = $matches[1];
|
||||
|
@ -193,13 +154,11 @@ class Fred {
|
|||
|
||||
$rounds = 0;
|
||||
|
||||
while (empty($page2) and $rounds < $this->gatewayMaxRounds) {
|
||||
while (empty($page2) and $rounds < 10) {
|
||||
|
||||
sleep($this->gatewayDelay);
|
||||
|
||||
$page2 = file_get_contents($url, false, $context2);
|
||||
|
||||
$rounds++;
|
||||
}
|
||||
|
||||
if (empty($page2)) {
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
|
||||
trait Locatable {
|
||||
|
||||
private $lat = null;
|
||||
|
||||
private $lon = null;
|
||||
|
||||
public function getLat () {
|
||||
|
||||
return $this->lat;
|
||||
}
|
||||
|
||||
public function getLon () {
|
||||
|
||||
return $this->lon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
trait Avatarable {
|
||||
|
||||
private $avatarImgSrc = null;
|
||||
|
||||
public function getAvatarImgSrc () {
|
||||
|
||||
return $this->avatarImgSrc;
|
||||
}
|
||||
}
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
class GchangeRecord {
|
||||
|
||||
use Locatable, Avatarable;
|
||||
|
||||
private $gchangeId;
|
||||
|
||||
private $title;
|
||||
|
@ -12,6 +10,8 @@ class GchangeRecord {
|
|||
|
||||
private $type;
|
||||
|
||||
private $imgSrc = null;
|
||||
|
||||
|
||||
public function __construct ($gchangeObject) {
|
||||
|
||||
|
@ -26,7 +26,7 @@ class GchangeRecord {
|
|||
if (isset($gchangeObject->_source->avatar->_content) and
|
||||
!empty($gchangeObject->_source->avatar->_content)) {
|
||||
|
||||
$this->avatarImgSrc = 'data:'. $gchangeObject->_source->avatar->_content_type .';base64,' . $gchangeObject->_source->avatar->_content;
|
||||
$this->imgSrc = 'data:'. $gchangeObject->_source->avatar->_content_type .';base64,' . $gchangeObject->_source->avatar->_content;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,6 +52,6 @@ class GchangeRecord {
|
|||
|
||||
public function getImgSrc () {
|
||||
|
||||
return $this->getAvatarImgSrc();
|
||||
return $this->imgSrc;
|
||||
}
|
||||
}
|
|
@ -1,15 +1,17 @@
|
|||
<?php
|
||||
|
||||
require_once('Gchange.traits.php');
|
||||
|
||||
class GchangeUser {
|
||||
|
||||
use Locatable, Avatarable;
|
||||
|
||||
public $userGchangeId;
|
||||
|
||||
public $userName;
|
||||
|
||||
private $lat = null;
|
||||
|
||||
private $lon = null;
|
||||
|
||||
private $avatarImgSrc = null;
|
||||
|
||||
|
||||
public function __construct ($gchangeObject) {
|
||||
|
||||
|
@ -30,7 +32,7 @@ class GchangeUser {
|
|||
}
|
||||
|
||||
if (isset($gchangeObject->_source->geoPoint->lat, $gchangeObject->_source->geoPoint->lon)) {
|
||||
|
||||
|
||||
$this->lat = $gchangeObject->_source->geoPoint->lat;
|
||||
$this->lon = $gchangeObject->_source->geoPoint->lon;
|
||||
}
|
||||
|
@ -44,13 +46,6 @@ class GchangeUser {
|
|||
}
|
||||
}
|
||||
|
||||
static public function constructVoidUser ($pubkey) {
|
||||
|
||||
$this->userGchangeId = $pubkey;
|
||||
|
||||
$this->userName = substr($this->userGchangeId, 0, 8);
|
||||
}
|
||||
|
||||
public function getUserGchangeId () {
|
||||
|
||||
return $this->userGchangeId;
|
||||
|
@ -61,6 +56,21 @@ class GchangeUser {
|
|||
return $this->userName;
|
||||
}
|
||||
|
||||
public function getLat () {
|
||||
|
||||
return $this->lat;
|
||||
}
|
||||
|
||||
public function getLon () {
|
||||
|
||||
return $this->lon;
|
||||
}
|
||||
|
||||
public function getAvatarImgSrc () {
|
||||
|
||||
return $this->avatarImgSrc;
|
||||
}
|
||||
|
||||
public function jsonify () {
|
||||
|
||||
return $this->gchangeObject;
|
||||
|
|
|
@ -7,8 +7,6 @@ class Jaklis {
|
|||
private $mode;
|
||||
|
||||
private $jaklisPath = __DIR__ . '/../vendors/jaklis/jaklis';
|
||||
|
||||
// private $jaklisPath = 'jaklis'; // if you use Docker
|
||||
|
||||
private $nodes = [
|
||||
|
||||
|
@ -62,7 +60,7 @@ class Jaklis {
|
|||
$cmd .= ' read';
|
||||
$cmd .= ' --number ' . $this->msgLimit;
|
||||
$cmd .= ' --json';
|
||||
|
||||
|
||||
$output=null;
|
||||
$result_code=null;
|
||||
exec($cmd, $output, $result_code);
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
class Keygen {
|
||||
|
||||
private $keygenPath = __DIR__ . '/../vendors/keygen/keygen';
|
||||
|
||||
// private $keygenPath = 'keygen'; // if you use Docker
|
||||
|
||||
private $pubsecDir = __DIR__ .'/../cache/pubsec/';
|
||||
|
||||
|
@ -23,8 +21,8 @@ class Keygen {
|
|||
$cmd .= ' -f pubsec';
|
||||
$cmd .= ' -t duniter';
|
||||
$cmd .= ' "'. $salt .'"';
|
||||
$cmd .= ' -p "'. $pepper .'"';
|
||||
|
||||
$cmd .= ' "'. $pepper .'"';
|
||||
|
||||
$output=null;
|
||||
$result_code=null;
|
||||
exec($cmd, $output, $result_code);
|
||||
|
@ -39,30 +37,6 @@ class Keygen {
|
|||
return $output[0];
|
||||
}
|
||||
|
||||
public function getIPNSPub ($salt, $pepper) {
|
||||
|
||||
$salt = str_replace('"', '\"', $salt);
|
||||
$pepper = str_replace('"', '\"', $pepper);
|
||||
|
||||
$cmd = $this->keygenPath;
|
||||
$cmd .= ' -t b36mf';
|
||||
$cmd .= ' "'. $salt .'"';
|
||||
$cmd .= ' -p "'. $pepper .'"';
|
||||
|
||||
$output=null;
|
||||
$result_code=null;
|
||||
exec($cmd, $output, $result_code);
|
||||
|
||||
// die($cmd . '<br />'. print_r($output, true) . '<br />'. print_r($result_code, true));
|
||||
|
||||
if (empty($output) or empty($output[0])) {
|
||||
|
||||
throw new Exception('Keygen me calcule pas (la pub IPNS) :<br />' . $cmd . '<br />');
|
||||
}
|
||||
|
||||
return $output[0];
|
||||
}
|
||||
|
||||
public function generatePubsec ($salt, $pepper) {
|
||||
|
||||
$salt = str_replace('"', '\"', $salt);
|
||||
|
@ -76,25 +50,22 @@ class Keygen {
|
|||
|
||||
}
|
||||
|
||||
if (!file_exists($this->pubsecDir . $userPubkey . '.dunikey')) {
|
||||
$cmd = $this->keygenPath;
|
||||
$cmd .= ' -f pubsec';
|
||||
$cmd .= ' -t duniter';
|
||||
$cmd .= ' "'. $salt .'"';
|
||||
$cmd .= ' "'. $pepper .'"';
|
||||
$cmd .= ' -o '. $this->pubsecDir . $userPubkey . '.dunikey';
|
||||
|
||||
$cmd = $this->keygenPath;
|
||||
$cmd .= ' -f pubsec';
|
||||
$cmd .= ' -t duniter';
|
||||
$cmd .= ' "'. $salt .'"';
|
||||
$cmd .= ' -p "'. $pepper .'"';
|
||||
$cmd .= ' -o '. $this->pubsecDir . $userPubkey . '.dunikey';
|
||||
$output=null;
|
||||
$result_code=null;
|
||||
exec($cmd, $output, $result_code);
|
||||
|
||||
$output=null;
|
||||
$result_code=null;
|
||||
exec($cmd, $output, $result_code);
|
||||
// die($cmd . '<br />'. print_r($result_code, true));
|
||||
|
||||
// die($cmd . '<br />'. print_r($result_code, true));
|
||||
if ($result_code != 0) {
|
||||
|
||||
if ($result_code != 0) {
|
||||
|
||||
throw new Exception('Keygen me calcule pas (la dunikey)');
|
||||
}
|
||||
throw new Exception('Keygen me calcule pas (la dunikey)');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,16 +81,7 @@ class Messenger {
|
|||
|
||||
if (!isset($users[$penpalPubkey])) {
|
||||
|
||||
try {
|
||||
|
||||
$user = $this->gchange->getUser($penpalPubkey);
|
||||
|
||||
$this->users[$penpalPubkey] = $user;
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
$this->users[$penpalPubkey] = GchangeUser::constructVoidUser($penpalPubkey);
|
||||
}
|
||||
$this->users[$penpalPubkey] = $this->gchange->getUser($penpalPubkey);
|
||||
}
|
||||
}
|
||||
public function getConversation ($penpalGchangeId) {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
const nodes = {
|
||||
gchange: [
|
||||
'https://data.gchange.fr'
|
||||
'http://data.gchange.fr'
|
||||
]
|
||||
}
|
||||
|
||||
let gameId = 'spationaute'
|
||||
|
||||
async function fetchShippable (n) {
|
||||
|
||||
|
@ -18,8 +17,6 @@ async function fetchShippable (n) {
|
|||
'title'
|
||||
, 'description'
|
||||
, 'id'
|
||||
, 'picturesCount'
|
||||
, 'pictures'
|
||||
]
|
||||
, query: {
|
||||
bool: {
|
||||
|
@ -66,6 +63,24 @@ async function fetchShippable (n) {
|
|||
|
||||
}
|
||||
|
||||
function displayShippable (records) {
|
||||
|
||||
let shippableElt = document.getElementById('shippable');
|
||||
|
||||
for (record of records) {
|
||||
|
||||
offerLi = document.createElement('li')
|
||||
|
||||
offerLink = document.createElement('a')
|
||||
|
||||
offerLink.innerHTML = record._source.title
|
||||
offerLink.href = 'https://www.gchange.fr/#/app/market/view/' + record._id + '/'
|
||||
|
||||
offerLi.append(offerLink)
|
||||
shippableElt.append(offerLi)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function fetchImmaterial (n) {
|
||||
|
||||
|
@ -79,8 +94,6 @@ async function fetchImmaterial (n) {
|
|||
'title'
|
||||
, 'description'
|
||||
, 'id'
|
||||
, 'picturesCount'
|
||||
, 'pictures'
|
||||
]
|
||||
, query: {
|
||||
nested: {
|
||||
|
@ -124,7 +137,7 @@ async function fetchImmaterial (n) {
|
|||
if (r.ok === true) {
|
||||
|
||||
var obj = r.json()
|
||||
// storeAtFreds(obj)
|
||||
storeAtFreds(obj)
|
||||
return obj
|
||||
}
|
||||
|
||||
|
@ -216,45 +229,9 @@ function storeAtFreds (json) {
|
|||
// JSON.stringify(json)
|
||||
}
|
||||
|
||||
function displayShippable (records) {
|
||||
|
||||
let offersElt = document.getElementById('shippable-offers');
|
||||
|
||||
for (record of records) {
|
||||
|
||||
offerLi = document.createElement('li')
|
||||
|
||||
offerLink = document.createElement('a')
|
||||
|
||||
offerSpan = document.createElement('span')
|
||||
|
||||
offerImg = document.createElement('img')
|
||||
|
||||
if (record._source.picturesCount > 0) {
|
||||
|
||||
offerImg.src = 'data:' + (record._source.pictures[0].file._content_type) + ';base64,' + (record._source.pictures[0].file._content)
|
||||
|
||||
} else {
|
||||
|
||||
offerImg.src = 'themes/' + gameId + '/default-shippable.256.png'
|
||||
}
|
||||
|
||||
offerImg.alt = record._source.title
|
||||
offerImg.title = record._source.title
|
||||
|
||||
// offerLink.innerHTML = record._source.title
|
||||
offerLink.href = 'https://www.gchange.fr/#/app/market/view/' + record._id + '/'
|
||||
|
||||
offerSpan.append(offerImg)
|
||||
offerLink.append(offerSpan)
|
||||
offerLi.append(offerLink)
|
||||
offersElt.append(offerLi)
|
||||
}
|
||||
}
|
||||
|
||||
function displayImmaterial (records) {
|
||||
|
||||
let offersElt = document.getElementById('immaterial-offers');
|
||||
let shippableElt = document.getElementById('immaterial');
|
||||
|
||||
for (record of records) {
|
||||
|
||||
|
@ -262,33 +239,15 @@ function displayImmaterial (records) {
|
|||
|
||||
offerLink = document.createElement('a')
|
||||
|
||||
offerSpan = document.createElement('span')
|
||||
|
||||
offerImg = document.createElement('img')
|
||||
|
||||
if (record._source.picturesCount > 0) {
|
||||
|
||||
offerImg.src = 'data:' + (record._source.pictures[0].file._content_type) + ';base64,' + (record._source.pictures[0].file._content)
|
||||
|
||||
} else {
|
||||
|
||||
offerImg.src = 'themes/' + gameId + '/default-immaterial.256.png'
|
||||
}
|
||||
|
||||
offerImg.alt = record._source.title
|
||||
offerImg.title = record._source.title
|
||||
|
||||
// offerLink.innerHTML = record._source.title
|
||||
offerLink.innerHTML = record._source.title
|
||||
offerLink.href = 'https://www.gchange.fr/#/app/market/view/' + record._id + '/'
|
||||
|
||||
offerSpan.append(offerImg)
|
||||
offerLink.append(offerSpan)
|
||||
offerLi.append(offerLink)
|
||||
offersElt.append(offerLi)
|
||||
shippableElt.append(offerLi)
|
||||
}
|
||||
}
|
||||
|
||||
fetchImmaterial(18)
|
||||
fetchImmaterial(30)
|
||||
.then(records => {
|
||||
|
||||
displayImmaterial(records.hits.hits)
|
||||
|
@ -300,7 +259,7 @@ fetchImmaterial(18)
|
|||
console.error(error)
|
||||
})
|
||||
|
||||
fetchShippable(18)
|
||||
fetchShippable(30)
|
||||
.then(records => {
|
||||
|
||||
displayShippable(records.hits.hits)
|
||||
|
|
36
login.php
|
@ -12,30 +12,38 @@ $playerG1Id = null;
|
|||
|
||||
if (isset($_POST['salt'], $_POST['pepper'])) {
|
||||
|
||||
$fred = new Fred();
|
||||
$keygen = new Keygen();
|
||||
|
||||
try {
|
||||
|
||||
$keygen = new Keygen();
|
||||
|
||||
$playerG1Id = $keygen->getG1Pub($_POST['salt'], $_POST['pepper']);
|
||||
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
|
||||
$keygen->generatePubsec($_POST['salt'], $_POST['pepper']);
|
||||
|
||||
} catch (Exception $errMsg) {
|
||||
|
||||
try {
|
||||
|
||||
$fred = new Fred();
|
||||
|
||||
$playerG1Id = $fred->donneMoiSaPutainDeG1Pub($_POST['salt'], $_POST['pepper']);
|
||||
|
||||
} catch (Exception $errMsg) {
|
||||
|
||||
ErrorsHandler::kaput($errMsg);
|
||||
}
|
||||
ErrorsHandler::kaput($errMsg);
|
||||
}
|
||||
|
||||
$_SESSION['player_pubkey'] = $playerG1Id;
|
||||
|
||||
$gchange = new Gchange();
|
||||
|
||||
try {
|
||||
|
||||
$player = $gchange->getUser($_SESSION['player_pubkey']);
|
||||
|
||||
} catch (Exception $errMsg) {
|
||||
|
||||
ErrorsHandler::kaput($errMsg);
|
||||
}
|
||||
|
||||
$_SESSION['player_lat'] = $player->_source->geoPoint->lat;
|
||||
$_SESSION['player_lon'] = $player->_source->geoPoint->lon;
|
||||
$_SESSION['radius'] = DEFAULT_RADIUS;
|
||||
|
||||
$_SESSION['salt'] = $_POST['salt'];
|
||||
$_SESSION['pepper'] = $_POST['pepper'];
|
||||
$_SESSION['player_pubkey'] = $playerG1Id;
|
||||
|
||||
header('Location:home.php');
|
||||
|
||||
|
|
13
map.php
|
@ -12,18 +12,13 @@ if (!isset($_SESSION['player_pubkey'])) {
|
|||
|
||||
if (isset($_GET['r']) and in_array($_GET['r'], $radiuses)) {
|
||||
|
||||
$_SESSION['searchRadius'] = $_GET['r'];
|
||||
|
||||
} else if (!isset($_SESSION['searchRadius'])) {
|
||||
|
||||
$_SESSION['searchRadius'] = DEFAULT_SEARCH_RADIUS;
|
||||
$_SESSION['radius'] = $_GET['r'];
|
||||
}
|
||||
|
||||
function getThemeScriptsFullPath ($themeScript) {
|
||||
|
||||
return GAME_JS_DIR . '/' . $themeScript;
|
||||
}
|
||||
|
||||
$gameScripts = array_map('getThemeScriptsFullPath', array_slice(scandir(GAME_JS_DIR), 2));
|
||||
|
||||
|
||||
|
@ -31,8 +26,10 @@ $javascripts['footer'] = array_merge($javascripts['footer'], $gameScripts);
|
|||
$bodyIds = 'sonar';
|
||||
include_once('header.php');
|
||||
|
||||
|
||||
$gchange = new Gchange();
|
||||
|
||||
|
||||
$player = $gchange->getUser($_SESSION['player_pubkey']);
|
||||
|
||||
// die('<pre>' . print_r($player, true) . '</pre>');
|
||||
|
@ -82,7 +79,7 @@ echo '
|
|||
id="map"
|
||||
data-orig-lat="'. $origLat .'"
|
||||
data-orig-lon="'. $origLon .'"
|
||||
data-radius="'. $_SESSION['searchRadius'] .'"
|
||||
data-radius="'. $_SESSION['radius'] .'"
|
||||
>
|
||||
<div id="map-deco"></div>
|
||||
';
|
||||
|
@ -104,7 +101,7 @@ echo '
|
|||
';
|
||||
*/
|
||||
|
||||
$places = $gchange->getPlacesNearUser($player, $_SESSION['searchRadius'], MAX_NEARBY_PLACES);
|
||||
$places = $gchange->getPlacesNearUser($player, $_SESSION['radius'], MAX_NEARBY_PLACES);
|
||||
|
||||
$selectedPlace = NULL;
|
||||
|
||||
|
|
|
@ -7,8 +7,6 @@ require_once('lib/Gchange.class.php');
|
|||
require_once('lib/Jaklis.class.php');
|
||||
require_once('lib/ErrorsHandler.class.php');
|
||||
|
||||
$javascripts['header'][] = 'lib/js/messenger.js';
|
||||
|
||||
$gchange = new Gchange();
|
||||
$messenger = new Messenger($gchange);
|
||||
$fred = new Fred();
|
||||
|
@ -42,14 +40,7 @@ try {
|
|||
// echo '<pre>'; var_dump($msgOut); echo '</pre>';
|
||||
// die();
|
||||
|
||||
try {
|
||||
|
||||
$messenger->addMessages($msgIn, $msgOut);
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
// L'utilisateur {...} n'a été trouvé nulle part.
|
||||
}
|
||||
$messenger->addMessages($msgIn, $msgOut);
|
||||
|
||||
// echo '<pre>'; var_dump($messenger->getConversations()); echo '</pre>';
|
||||
|
||||
|
@ -155,16 +146,14 @@ if (isset($_GET['penpal'])) {
|
|||
|
||||
echo '
|
||||
<form method="post" action="">
|
||||
<label for="message">'. 'Message' .'</label>
|
||||
<label for="message">'. _('Message') .'</label>
|
||||
<textarea name="message" rows="1" cols="30"></textarea>
|
||||
|
||||
<input type="hidden" name="to" value="'. htmlspecialchars($_GET['penpal']) .'" />
|
||||
|
||||
<input type="hidden" name="title" value="'. htmlspecialchars($displayedConv->getConvTitle()) .'" />
|
||||
|
||||
<p class="submit-button-wrapper">
|
||||
<input type="submit" value="'. 'Envoyer' .'" />
|
||||
</p>
|
||||
<input type="submit" value="'. _('Envoyer') .'" />
|
||||
</form>
|
||||
';
|
||||
}
|
||||
|
|
393
minelife/app.js
|
@ -1,393 +0,0 @@
|
|||
|
||||
async function getCrafts() {
|
||||
|
||||
const res = await fetch("./data/crafts.json");
|
||||
const data = await res.json();
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
async function getCollections() {
|
||||
|
||||
const res = await fetch("./data/collections.json");
|
||||
const data = await res.json();
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
function updateSelectedCollection (selected = 0) {
|
||||
|
||||
var previouslySelectedCollection = document.querySelector('#collections nav ul li.selected');
|
||||
|
||||
if (previouslySelectedCollection != null) {
|
||||
|
||||
previouslySelectedCollection.classList.remove('selected');
|
||||
}
|
||||
|
||||
|
||||
var collections = document.querySelectorAll('#collections nav ul li');
|
||||
|
||||
console.log(collections);
|
||||
|
||||
var newlySelectedCollection = collections[selected];
|
||||
|
||||
console.log(newlySelectedCollection);
|
||||
|
||||
newlySelectedCollection.classList.add('selected');
|
||||
|
||||
}
|
||||
|
||||
async function printCollections (crafts, collections) {
|
||||
|
||||
var collectionsElt = document.getElementById('collections');
|
||||
var collectionsNavElt = collectionsElt.querySelector('nav ul');
|
||||
|
||||
collectionsNavElt.innerHTML = '';
|
||||
|
||||
var cssClass = '';
|
||||
|
||||
collections.forEach(function (collection, index) {
|
||||
|
||||
if (collection.items != undefined) {
|
||||
|
||||
cssClass = '';
|
||||
|
||||
collectionsNavElt.innerHTML +=
|
||||
'<li' + cssClass + '>' +
|
||||
'<a href="#" ' +
|
||||
'title="' + collection.name + '" ' +
|
||||
'>' +
|
||||
|
||||
'<img src="data/img/' + collection.img + '" ' +
|
||||
'alt="' + collection.name + '" ' +
|
||||
'/>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
}
|
||||
});
|
||||
|
||||
displayCollection(crafts, collections);
|
||||
|
||||
collectionsElt.querySelectorAll('li').forEach(function (elt, index) {
|
||||
|
||||
elt.addEventListener('click', function () {
|
||||
|
||||
console.log(index);
|
||||
|
||||
displayCollection(crafts, collections, index);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async function displayCollection (crafts, collections, collectionId = 0) {
|
||||
|
||||
updateSelectedCollection(collectionId);
|
||||
|
||||
itemsListElt = document.querySelector('#collections .items-list');
|
||||
|
||||
itemsListElt.innerHTML = '';
|
||||
|
||||
collections[collectionId].items.forEach(function (itemId){
|
||||
|
||||
itemsListElt.innerHTML +=
|
||||
'<li>' +
|
||||
'<a href="#" ' +
|
||||
'onclick="displayRecipe('+ itemId + ', 0)" ' +
|
||||
'title="' + crafts[itemId].name + '" ' +
|
||||
'>' +
|
||||
|
||||
'<img src="data/img/' + crafts[itemId].img + '" ' +
|
||||
'alt="' + crafts[itemId].name + '" ' +
|
||||
'/>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async function printItemsList () {
|
||||
|
||||
crafts = await getCrafts();
|
||||
|
||||
itemsListElt = document.getElementById('items-list');
|
||||
|
||||
crafts.forEach(function (item, index) {
|
||||
|
||||
if (item.recipes != undefined) {
|
||||
|
||||
itemsListElt.innerHTML +=
|
||||
'<li>' +
|
||||
'<a href="#" ' +
|
||||
'onclick="displayRecipe('+ index + ', 0)" ' +
|
||||
'title="' + item.name + '" ' +
|
||||
'>' +
|
||||
|
||||
'<img src="data/img/' + item.img + '" ' +
|
||||
'alt="' + item.name + '" ' +
|
||||
'/>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function padIngredient (nbIngredients, str) {
|
||||
|
||||
if (nbIngredients <= 1 ||
|
||||
nbIngredients == 4 ||
|
||||
nbIngredients == 9 ||
|
||||
nbIngredients == 16) {
|
||||
|
||||
return '';
|
||||
|
||||
} else if (nbIngredients < 4) {
|
||||
|
||||
return str.repeat(4 - nbIngredients);
|
||||
|
||||
} else if (nbIngredients < 9) {
|
||||
|
||||
return str.repeat(9 - nbIngredients);
|
||||
|
||||
} else if (nbIngredients < 16) {
|
||||
|
||||
return str.repeat(16 - nbIngredients);
|
||||
|
||||
} else if (nbIngredients < 25) {
|
||||
|
||||
return str.repeat(25 - nbIngredients);
|
||||
}
|
||||
}
|
||||
|
||||
async function displayRecipe (itemId, recipeId = 0, elementId = 'recipe-main', bc_item = null, bc_recipe = null) {
|
||||
|
||||
crafts = await getCrafts();
|
||||
|
||||
recipeElt = document.getElementById(elementId);
|
||||
ingredientsElt = recipeElt.querySelector('.ingredients');
|
||||
actionElt = recipeElt.querySelector('.action');
|
||||
resultElt = recipeElt.querySelector('.result');
|
||||
itemNameElt = recipeElt.querySelector('.item-name');
|
||||
otherRecipesElt = recipeElt.querySelector('.other-recipes ul');
|
||||
detailsElt = recipeElt.querySelector('.recipe-details');
|
||||
detailsContentElt = detailsElt.querySelector('div');
|
||||
|
||||
actionElt.innerHTML = '<a href="#"> </a>';
|
||||
resultElt.innerHTML = " ";
|
||||
otherRecipesElt.innerHTML = "";
|
||||
detailsContentElt.innerHTML = "";
|
||||
|
||||
recipeElt.style.visibility = 'visible';
|
||||
detailsElt.style.visibility = 'hidden';
|
||||
|
||||
itemNameElt.innerHTML = '' + crafts[itemId].name + '';
|
||||
|
||||
resultElt_content =
|
||||
'<img src="data/img/' + crafts[itemId].img + '" ' +
|
||||
'alt="' + crafts[itemId].name + '" ' +
|
||||
'title="' + crafts[itemId].name + '" ' +
|
||||
'/>';
|
||||
|
||||
if (elementId == 'recipe-aux' && bc_item != null) {
|
||||
|
||||
resultElt_content =
|
||||
'<a href="#" ' +
|
||||
'onclick="displayRecipe(' + bc_item + ', ' + bc_recipe +', \'recipe-aux\')" ' +
|
||||
'>' +
|
||||
resultElt_content +
|
||||
'</a>';
|
||||
}
|
||||
|
||||
resultElt.innerHTML = resultElt_content;
|
||||
|
||||
blackHoleStr = '<li class="ingredient"><img src="data/img/black-hole.png" /></li>';
|
||||
|
||||
|
||||
|
||||
if (crafts[itemId].recipes == undefined) {
|
||||
|
||||
ingredientsElt.innerHTML = blackHoleStr;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
recipes = crafts[itemId].recipes;
|
||||
|
||||
ingredients = recipes[recipeId].ingredients;
|
||||
|
||||
if (ingredients == undefined) {
|
||||
|
||||
ingredientsElt.innerHTML = blackHoleStr;
|
||||
|
||||
} else {
|
||||
|
||||
ingredientsElt.innerHTML = '';
|
||||
|
||||
nbIngredients = ingredients.length;
|
||||
|
||||
ingredientsElt.className = 'ingredients ';
|
||||
|
||||
if (nbIngredients > 16) {
|
||||
|
||||
ingredientsElt.className += "grid-25";
|
||||
|
||||
} else if (nbIngredients > 9) {
|
||||
|
||||
ingredientsElt.className += "grid-16";
|
||||
|
||||
} else if (nbIngredients > 4) {
|
||||
|
||||
ingredientsElt.className += "grid-9";
|
||||
|
||||
} else if (nbIngredients > 1) {
|
||||
|
||||
ingredientsElt.className += "grid-4";
|
||||
|
||||
} else {
|
||||
|
||||
ingredientsElt.className += "";
|
||||
|
||||
}
|
||||
|
||||
var i = 1;
|
||||
|
||||
console.log(ingredients);
|
||||
|
||||
ingredients.forEach (function (ingredient) {
|
||||
|
||||
unit = (ingredient.unit != undefined) ? (' ' + ingredient.unit) : '';
|
||||
|
||||
qty = (ingredient.qty == undefined) ? '' : '<span class="qty">' + ingredient.qty + '</span>';
|
||||
|
||||
title =
|
||||
(ingredient.qty == undefined) ?
|
||||
crafts[ingredient.ref].name : (
|
||||
(ingredient.unit == undefined) ?
|
||||
ingredient.qty + ' ' + crafts[ingredient.ref].name :
|
||||
ingredient.qty + ' ' + ingredient.unit + ' de ' + crafts[ingredient.ref].name
|
||||
);
|
||||
|
||||
|
||||
// displayOn = (elementId == 'recipe-main') ? 'recipe-aux' : 'recipe-main';
|
||||
displayOn = 'recipe-aux';
|
||||
|
||||
if (elementId == 'recipe-aux') {
|
||||
|
||||
bc_item = itemId;
|
||||
bc_recipe = recipeId;
|
||||
|
||||
} else {
|
||||
|
||||
bc_item = null;
|
||||
bc_recipe = null;
|
||||
}
|
||||
|
||||
ingredientsElt.innerHTML +=
|
||||
'<li class="ingredient">' +
|
||||
qty +
|
||||
'<a href="#" ' +
|
||||
'onclick="displayRecipe('+ ingredient.ref + ', 0, \'' + displayOn + '\', '+ bc_item +', '+ bc_recipe + ')"' +
|
||||
'title="' + title + '"' +
|
||||
'>' +
|
||||
'<img src="data/img/' + crafts[ingredient.ref].img + '" ' +
|
||||
'alt="' + crafts[ingredient.ref].name + '" ' +
|
||||
'/>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
|
||||
i++;
|
||||
});
|
||||
|
||||
|
||||
ingredientsElt.innerHTML += padIngredient(nbIngredients, '<li class="ingredient"></li>');
|
||||
}
|
||||
|
||||
|
||||
|
||||
action = (recipes[recipeId].action == undefined) ? '' : recipes[recipeId].action;
|
||||
|
||||
if (recipes[recipeId].details != undefined) {
|
||||
|
||||
actionElt.className += ' has-details';
|
||||
}
|
||||
|
||||
actionElt.innerHTML =
|
||||
'<a href="#" ' +
|
||||
'onclick="showDetails(\'' + elementId + '\', \'' + recipeId + '\')" ' +
|
||||
'>'+
|
||||
action +
|
||||
'</a>';
|
||||
|
||||
|
||||
if ((details = crafts[itemId].recipes[recipeId].details) != undefined) {
|
||||
|
||||
detailsContentElt.innerHTML = details;
|
||||
}
|
||||
|
||||
nbRecipes = recipes.length;
|
||||
|
||||
if (nbRecipes == 1) {
|
||||
|
||||
if (recipes[0].name != undefined) {
|
||||
|
||||
otherRecipesElt.innerHTML +=
|
||||
'<li>' +
|
||||
'<strong>' +
|
||||
recipes[0].name +
|
||||
'</strong>' +
|
||||
'</li>';
|
||||
|
||||
}
|
||||
|
||||
} else if (nbRecipes > 1) {
|
||||
|
||||
for (i = 0; i < nbRecipes; i++) {
|
||||
|
||||
otherRecipeName = (recipes[i].name != undefined) ?
|
||||
recipes[i].name :
|
||||
"recette n°" + (i + 1);
|
||||
|
||||
if (i == recipeId) {
|
||||
|
||||
otherRecipesElt.innerHTML +=
|
||||
'<li>' +
|
||||
'<strong>' +
|
||||
otherRecipeName +
|
||||
'</strong>' +
|
||||
'</li>';
|
||||
|
||||
} else {
|
||||
|
||||
otherRecipesElt.innerHTML +=
|
||||
'<li>' +
|
||||
'<a href="#" ' +
|
||||
'onclick="displayRecipe(' + itemId + ', ' + i + ', \''+ elementId + '\')">' +
|
||||
otherRecipeName +
|
||||
'</a>'
|
||||
'</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
showDetails = function (elementId) {
|
||||
|
||||
detailsElt = document.querySelector('#' + elementId + ' .recipe-details');
|
||||
detailsElt.style.visibility = "visible";
|
||||
}
|
||||
|
||||
// printItemsList();
|
||||
|
||||
window.addEventListener('load', async function () {
|
||||
|
||||
const crafts = await getCrafts();
|
||||
|
||||
const collections = await getCollections();
|
||||
|
||||
printCollections(crafts, collections);
|
||||
});
|
|
@ -1,93 +0,0 @@
|
|||
Copyright 2014 The Comic Neue Project Authors (https://github.com/crozynski/comicneue)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@ -1,93 +0,0 @@
|
|||
Copyright (c) 2010, Kimberly Geswein (kimberlygeswein.com)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@ -1,93 +0,0 @@
|
|||
Copyright (c) 2010-2012 Patrick Wagesreiter (mail@patrickwagesreiter.at)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@ -1,499 +0,0 @@
|
|||
:root {
|
||||
|
||||
--item-size: 32px;
|
||||
|
||||
--marron: hsl(350, 20%, 25%);
|
||||
--marron-medium: hsl(30, 50%, 50%);
|
||||
--marron-clair: hsl(30, 70%, 66%);
|
||||
--marron-transparent: hsla(350, 20%, 25%, 0.80);
|
||||
--blanc: hsl(0, 100%, 100%);
|
||||
--noir: hsl(0, 100%, 0%);
|
||||
--vert-pomme: hsl(100, 70%, 90%);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@font-face {
|
||||
font-family: 'Comic Neue';
|
||||
src: url("../../fonts/Comic_Neue/ComicNeue-Regular.ttf") format('truetype');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Comic Neue';
|
||||
src: url("../../fonts/Comic_Neue/ComicNeue-Bold.ttf") format('truetype');
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Patrick Hand';
|
||||
src: url("../../fonts/Patrick_Hand/PatrickHand-Regular.ttf") format('truetype');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'MinecraftFifty';
|
||||
src: url("../../fonts/MinecraftFifty-Solid.otf") format('opentype');
|
||||
}
|
||||
|
||||
body {
|
||||
|
||||
font-family: 'Comic Neue', fantasy;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: 'MinecraftFifty', 'Comic Neue', fantasy;
|
||||
}
|
||||
|
||||
#usp {
|
||||
font-family: 'Patrick Hand', fantasy;
|
||||
}
|
||||
|
||||
q:after {
|
||||
|
||||
content: " »";
|
||||
}
|
||||
|
||||
q:before {
|
||||
|
||||
content: "« ";
|
||||
}
|
||||
|
||||
body > footer {
|
||||
|
||||
margin-top: 10rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
body > footer blockquote {
|
||||
|
||||
font-family: cursive;
|
||||
font-size: 1.5rem;
|
||||
color: hsl(30, 15%, 90%);
|
||||
}
|
||||
|
||||
body > footer blockquote cite {
|
||||
|
||||
display: block;
|
||||
text-align: right;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
body > footer blockquote cite:before {
|
||||
|
||||
content: "― ";
|
||||
}
|
||||
|
||||
iframe {
|
||||
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.recipe-name:before {
|
||||
|
||||
content: "« ";
|
||||
}
|
||||
|
||||
.recipe-name:after {
|
||||
|
||||
content: " »";
|
||||
}
|
||||
|
||||
|
||||
main {
|
||||
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
#recipe-main,
|
||||
#recipe-aux {
|
||||
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 39.999rem) {
|
||||
|
||||
main {
|
||||
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#recipe-main {
|
||||
|
||||
order: 1;
|
||||
}
|
||||
|
||||
#recipe-aux {
|
||||
|
||||
order: 2;
|
||||
}
|
||||
|
||||
#collections {
|
||||
|
||||
order: 3;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 40rem) {
|
||||
|
||||
.recipe {
|
||||
|
||||
width: 48%;
|
||||
padding: 0% 2% 0% 0%;
|
||||
}
|
||||
|
||||
#collections {
|
||||
|
||||
width: 100%;
|
||||
padding: 0% 0% 0% 2%;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 60rem) {
|
||||
|
||||
.recipe {
|
||||
|
||||
width: 31.333%;
|
||||
padding: 0% 2% 0% 0%;
|
||||
}
|
||||
|
||||
#collections {
|
||||
|
||||
width: 31.334%;
|
||||
padding: 0% 0% 0% 2%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.recipe > .recipe-signature {
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
@keyframes blinking {
|
||||
0% {
|
||||
|
||||
text-shadow: 0 0 0px transparent;
|
||||
}
|
||||
|
||||
50% {
|
||||
|
||||
text-shadow: 0 0 5px var(--vert-pomme),
|
||||
0 0 10px var(--vert-pomme),
|
||||
0 0 15px var(--vert-pomme),
|
||||
0 0 20px var(--vert-pomme),
|
||||
0 0 25px var(--vert-pomme);
|
||||
}
|
||||
|
||||
100% {
|
||||
|
||||
text-shadow: 0 0 0px transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.recipe .action {
|
||||
|
||||
padding: 0 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.recipe .action a,
|
||||
.recipe .action a:visited {
|
||||
|
||||
text-decoration: none;
|
||||
color: var(--noir);
|
||||
background-color: var(--blanc);
|
||||
transition: text-shadow 0.666s;
|
||||
}
|
||||
|
||||
.recipe .action.has-details a,
|
||||
.recipe .action.has-details a:visited {
|
||||
|
||||
animation: blinking 3s infinite;
|
||||
}
|
||||
|
||||
.recipe .action:hover a,
|
||||
.recipe .action:hover a:before {
|
||||
|
||||
}
|
||||
|
||||
.recipe .action *:before {
|
||||
|
||||
content: "⇒";
|
||||
display: block;
|
||||
font-size: 2rem;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.recipe .ingredients {
|
||||
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: grid;
|
||||
grid-gap: 0;
|
||||
border: 2px solid var(--marron);
|
||||
}
|
||||
|
||||
|
||||
.recipe .ingredients.grid-4 {
|
||||
|
||||
grid-template-columns: 50% 50%;
|
||||
max-width: calc(2 * (var(--item-size) + 24px + 4px * 2));
|
||||
|
||||
}
|
||||
|
||||
.recipe .ingredients.grid-9 {
|
||||
|
||||
grid-template-columns: 33.333% 33.333% 33.333%;
|
||||
max-width: calc(3 * (var(--item-size) + 24px + 4px * 2));
|
||||
|
||||
}
|
||||
|
||||
.recipe .ingredients.grid-16 {
|
||||
|
||||
grid-template-columns: 25% 25% 25% 25%;
|
||||
max-width: calc(4 * (var(--item-size) + 24px + 4px * 2));
|
||||
|
||||
}
|
||||
|
||||
.recipe .ingredients.grid-25 {
|
||||
|
||||
grid-template-columns: 20% 20% 20% 20% 20%;
|
||||
max-width: calc(5 * (var(--item-size) + 24px + 4px * 2));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.result {
|
||||
|
||||
border: 4px solid var(--marron);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#items-list,
|
||||
.items-list,
|
||||
#collections nav ul {
|
||||
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
#collections nav {
|
||||
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#collections nav ul {
|
||||
|
||||
margin-bottom: 1rem;
|
||||
border: 0.25rem solid var(--marron);
|
||||
border-radius: 1rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#collections nav ul li.selected {
|
||||
|
||||
background-color: var(--marron-clair);
|
||||
}
|
||||
|
||||
/*
|
||||
#collections nav ul li {
|
||||
|
||||
border-left: 0.5rem solid var(--marron);
|
||||
border-right: 0.5rem solid var(--marron);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
#collections nav ul li:first-child {
|
||||
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
#collections nav ul li:last-child {
|
||||
|
||||
border-right: 0;
|
||||
}
|
||||
*/
|
||||
|
||||
.recipe .ingredients .ingredient,
|
||||
#items-list li,
|
||||
.items-list li {
|
||||
|
||||
border: 2px solid var(--marron);
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
#items-list li,
|
||||
.items-list li,
|
||||
#collections nav ul li {
|
||||
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
|
||||
}
|
||||
|
||||
.recipe .ingredients .ingredient a,
|
||||
#items-list li a,
|
||||
.items-list li a,
|
||||
#collections nav ul li a {
|
||||
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.recipe .ingredients .ingredient:hover a,
|
||||
#items-list li:hover a,
|
||||
.items-list li:hover a,
|
||||
#collections nav ul li:hover a {
|
||||
|
||||
background-color: var(--marron-clair);
|
||||
}
|
||||
|
||||
.recipe .ingredients .ingredient:hover a {
|
||||
|
||||
border: 2px solid var(--marron-medium);
|
||||
}
|
||||
|
||||
|
||||
.recipe .ingredients .ingredient,
|
||||
.recipe .result,
|
||||
#items-list li,
|
||||
#collections nav ul li {
|
||||
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.recipe .ingredients .ingredient {
|
||||
}
|
||||
|
||||
.recipe .ingredients .ingredient img {
|
||||
|
||||
flex-basis: var(--item-size);
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.recipe .ingredients .ingredient .qty {
|
||||
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 100;
|
||||
font-weight: bold;
|
||||
font-size: 1.25rem;
|
||||
background-color: var(--marron-transparent);
|
||||
color: var(--blanc);
|
||||
padding-left: 0.375rem;
|
||||
padding-right: 0.125rem;
|
||||
padding-top: 0.25rem;
|
||||
border-top-left-radius: 0.33em;
|
||||
}
|
||||
|
||||
|
||||
.recipe .ingredients .ingredient,
|
||||
.recipe .result {
|
||||
|
||||
height: 64px;
|
||||
width: 64px;
|
||||
|
||||
}
|
||||
|
||||
.other-recipes ul {
|
||||
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
padding-top: 0px;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.other-recipes ul {
|
||||
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
height: 2.5rem;
|
||||
padding-top: 1rem;
|
||||
width: auto;
|
||||
width: auto;
|
||||
overflow-y: hidden;
|
||||
overflow-x: visible;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.other-recipes li {
|
||||
|
||||
margin: 0;
|
||||
margin-right: 0.5rem;
|
||||
padding: 0;
|
||||
display: inline;
|
||||
flex-basis: auto;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.other-recipes li > * {
|
||||
|
||||
width: 2rem;
|
||||
text-align: center;
|
||||
height: 2rem;
|
||||
display: inline;
|
||||
|
||||
padding: 0.25rem 0.5em;
|
||||
|
||||
border-radius: 1rem;
|
||||
text-decoration: none;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
|
||||
|
||||
border-color: var(--marron);
|
||||
background-color: var(--blanc);
|
||||
color: var(--marron);
|
||||
|
||||
}
|
||||
|
||||
.other-recipes li *:not(a) {
|
||||
|
||||
border-color: var(--marron);
|
||||
color: var(--blanc);
|
||||
background-color: var(--marron);
|
||||
|
||||
}
|
||||
|
||||
.recipe-details {
|
||||
|
||||
visibility: hidden;
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
[
|
||||
|
||||
{
|
||||
"name": "habitat",
|
||||
"img": "carpenter.png",
|
||||
"items": [
|
||||
4,
|
||||
0,
|
||||
1,
|
||||
12,
|
||||
7,
|
||||
11,
|
||||
13,
|
||||
58
|
||||
]
|
||||
}
|
||||
|
||||
,{
|
||||
"name": "culture",
|
||||
"img": "farmer.png",
|
||||
"items": [
|
||||
28,
|
||||
36,
|
||||
57,
|
||||
56,
|
||||
42,
|
||||
43,
|
||||
3,
|
||||
59,
|
||||
35,
|
||||
49,
|
||||
86
|
||||
]
|
||||
}
|
||||
|
||||
,{
|
||||
"name": "cuisine",
|
||||
"img": "chef.png",
|
||||
"items": [
|
||||
33,
|
||||
17,
|
||||
44,
|
||||
87
|
||||
]
|
||||
}
|
||||
|
||||
,{
|
||||
"name": "vêtement",
|
||||
"img": "sewing.png",
|
||||
"items": [
|
||||
54
|
||||
]
|
||||
}
|
||||
|
||||
,{
|
||||
"name": "soin",
|
||||
"img": "arm-plaster.png",
|
||||
"items": [
|
||||
101,
|
||||
83,
|
||||
67,
|
||||
68,
|
||||
69,
|
||||
70,
|
||||
71,
|
||||
72,
|
||||
73,
|
||||
74,
|
||||
75,
|
||||
77,
|
||||
100
|
||||
|
||||
]
|
||||
}
|
||||
]
|
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 675 B |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 965 B |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 870 B |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.4 KiB |