Compare commits

..

18 Commits
main ... main

Author SHA1 Message Date
fred d24375598f WAN GW 2023-04-16 23:42:45 +02:00
fred bbbfc5d365 keygen no 2023-03-16 04:17:19 +01:00
fred a713afd017 push 2023-03-16 04:12:48 +01:00
fred af4777df69 try 2023-03-15 05:35:44 +01:00
fred f724941cfb go 2023-03-14 22:10:36 +01:00
fred 096f77073f regexp 2023-03-14 19:30:28 +01:00
fred db97da79af delay 2023-03-14 18:23:25 +01:00
fred faf145c006 slurp loop is the problem ? 2023-03-14 18:19:27 +01:00
fred dcca204d7a slow down API call 2023-03-14 18:11:51 +01:00
fred b8ddf3108b url refactor 2023-03-14 18:07:15 +01:00
fred 5ab3381d5f loop on PORT 2023-03-14 17:47:33 +01:00
fred e25914e36b arrange 2023-03-14 17:28:35 +01:00
fred baf37c70b9 libra 2023-03-14 17:23:04 +01:00
fred 1cfaa42905 port 2023-03-14 17:06:22 +01:00
fred 0bfcb61063 using "Le Claude" 2023-03-14 15:31:12 +01:00
fred 32432e93ee Merge branch 'fred' into main 2023-03-14 14:37:32 +01:00
fred af5a905f79 Updating with (1234 API ) https://git.p2p.legal/STI/Astroport.ONE/src/branch/master/API/SALT.sh 2023-03-14 14:19:36 +01:00
fred b613f8a917 $_SESSION['player_ipns'] 2022-11-15 21:36:40 +01:00
194 changed files with 1061 additions and 4206 deletions

3
.gitignore vendored
View File

@ -1,6 +1,3 @@
.env
cache/
tests/
minelife.html
vendors/keygen/__pycache__
erreurs/

View File

@ -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

View File

@ -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;
}
/*
=====================

View File

@ -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

View File

@ -12,9 +12,6 @@ services:
networks:
- private
- public
extra_hosts:
- astroport.localhost:${DOCKER_INTERNAL_DOCKER_HOST}
networks:
private:

View File

@ -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');

101
home.php
View File

@ -2,90 +2,67 @@
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() . ' !
<!-- ('. substr($player->getUserGchangeId(), 0, 8) . ') -->
Bienvenue '. $player->getUserName() . ' !
<!-- ('. substr($player->getUserGchangeId(), 0, 8) . ') -->
</header>
<nav>
<ul>
<li id="dashboard-map">
<a href="map.php">
<span>
Carte
</span>
</a>
</li>
<li id="dashboard-map">
<a href="map.php">
<span>
Carte
</span>
</a>
</li>
<li id="dashboard-messenger">
<a href="messenger.php">
<span>
Messagerie
</span>
</a>
</li>
<li id="dashboard-messenger">
<a href="messenger.php">
<span>
Messagerie
</span>
</a>
</li>
<li id="dashboard-farfetched">
<a href="farfetched.php">
<span>
À distance ou en livraison
</span>
</a>
</li>
<li id="dashboard-farfetched">
<a href="farfetched.php">
<span>
À distance ou en livraison
</span>
</a>
</li>
<li id="dashboard-minelife">
<a href="minelife/index.html">
<span>
Manuel
</span>
</a>
</li>
<li id="dashboard-tiddlywiki">
<a href="'. $twLink .'">
<span>
'. ('Mon TiddlyWiki') .'
</span>
</a>
</li>
<li id="dashboard-minelife">
<a href="minelife.html">
<span>
Manuel
</span>
</a>
</li>
<li id="dashboard-TW">
<a href="/ipns/'. $_SESSION['player_ipns'].'">
<span>
TW
</span>
</a>
</li>
</ul>

View File

@ -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>';
}

View File

@ -2,63 +2,63 @@
class ErrorsHandler {
public function __construct () {
public function __construct () {
}
}
static public function kaput ($errorMsgs) {
static public function kaput ($errorMsgs) {
ob_get_clean(); // to prevent error message to display inside an HTML container (case of error generated by get method calls)
ob_get_clean(); // to prevent error message to display inside an HTML container (case of error generated by get method calls)
if (!is_array($errorMsgs)) {
if (!is_array($errorMsgs)) {
$errorMsgs = explode("\n", $errorMsgs);
}
$errorMsgs = explode("\n", $errorMsgs);
}
echo '<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Erreur critique</title>
echo '<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>'. ('Erreur critique') . '</title>
<style>
<style>
div {
div {
overflow: auto;
word-wrap: break-word;
background-color: hsl(0, 100%, 69%);
color: hsl(0, 100%, 19%);
margin: 1em;
padding: 1em;
border-radius: 1em;
position: fixed;
top: 0;
left: 0;
width: calc(100% - 4em);
max-height: calc(100vh - 4em);
}
</style>
</head>
overflow: auto;
word-wrap: break-word;
background-color: hsl(0, 100%, 69%);
color: hsl(0, 100%, 19%);
margin: 1em;
padding: 1em;
border-radius: 1em;
position: fixed;
top: 0;
left: 0;
width: calc(100% - 4em);
max-height: calc(100vh - 4em);
}
</style>
</head>
<body>
<div>';
<body>
<div>';
foreach ($errorMsgs as $msg) {
foreach ($errorMsgs as $msg) {
echo '<pre>' . print_r($msg, true) . '</pre>';
}
echo '<pre>' . print_r($msg, true) . '</pre>';
}
echo '
</div>
</body>
</html>';
echo '
</div>
</body>
</html>';
die;
}
die;
}
}
}

View File

@ -2,215 +2,158 @@
class Fred {
private $gatewayProtocol = 'http';
private $gatewayProtocol = 'https';
private $gatewayDomain = 'libra.copylaradio.com';
// private $gatewayDomain = 'aries.copylaradio.com';
// private $gatewayDomain = 'astroport.localhost';
private $gatewayDomain = 'astroport.copylaradio.com';
private $gatewayPort = '1234';
private $gatewayPort = ''; // :1234
private $gatewayDelay = 3;
private $gatewayDelay = 6;
private $gatewayMaxRounds = 20;
public function __construct () {
public function __construct () {
}
}
public function donneMoiLaPutainDeClefIPNS ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday) {
public function donneMoiLAdresseIPDuServeurQuiHebergeMonTiddlyWiki ($salt, $pepper) {
$salt = $prenomNom;
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
}
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper) .'&getipns=yes';
public function donneMoiLaPutainDeClefIPNS ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday) {
$page1 = file_get_contents($this->gatewayProtocol . '://'. $this->gatewayDomain . $this->gatewayPort . '/?' . $query);
$salt = $prenomNom;
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
if (empty($page1)) {
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper) . '&getipns=on';
throw new Exception("J'ai pas pû récupérer la putain de première page.");
}
$page1 = file_get_contents($this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query);
preg_match("`url='([^']+)'`isU", $page1, $matches);
if (empty($page1)) {
$urlipns = $matches[1];
throw new Exception("J'ai pas pû récupérer la putain de première page.");
}
$page2 = '';
$rounds = 0;
preg_match("`url='([^']+)'`isU", $page1, $matches);
while (empty($page2) and $rounds < 10) {
$url = $matches[1];
$url .= '/?'. $query;
sleep($this->gatewayDelay);
$page2 = file_get_contents($urlipns);
}
// die($url);
$opts2 = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: fr\r\n",
'follow_location' => 0
)
);
if (empty($page2)) {
// echo 'fred 2';
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
}
$context2 = stream_context_create($opts2);
$ClearText = preg_replace( "/\n\s+/", "\n", rtrim(html_entity_decode(strip_tags($page2))) );
preg_match("`url='([^']+)'`isU", $ClearText, $matches);
$page2 = false;
$rounds = 0;
$ipnsKey = $matches[1];
while (($page2 === false) and $rounds < $this->gatewayMaxRounds) {
return $ipnsKey;
}
sleep($this->gatewayDelay);
// echo "\n\n\nround n°" . $rounds . "\n";
public function donneMoiSesPutainDeMessagesGchange ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday, $gchangeName) {
$page2 = @file_get_contents($url, false, $context2);
// echo '<pre>'. print_r(htmlspecialchars($page2), true) . '</pre>';
$salt = $prenomNom;
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
$rounds++;
}
if ($page2 === false) {
$query = 'salt='. $salt .'&pepper='. $pepper . '&messaging=' . $gchangeName;
throw new Exception("J'ai pas pû me connecter à ". $url ." pour récupérer la putain de deuxième page.");
} else if (empty($page2)) {
$page1 = file_get_contents($this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query);
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
}
if (empty($page1)) {
preg_match("`/ipns/(.+)`is", $page2, $matches);
throw new Exception("J'ai pas pû récupérer la putain de première page.");
}
$ipnsKey = $matches[1];
// echo '<pre>'; var_dump(htmlspecialchars($page1)); echo '</pre>';
return $ipnsKey;
}
preg_match("`url='([^']+)'`isU", $page1, $matches);
public function donneMoiSesPutainDeMessagesGchange ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday, $gchangeName) {
$urlmessages = $matches[1];
// echo '<pre>'; var_dump($urli); echo '</pre>';
$salt = $prenomNom;
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
$page2 = '';
$rounds = 0;
$query = 'salt='. $salt .'&pepper='. $pepper . '&messaging=' . $gchangeName;
while (empty($page2) and $rounds < 10) {
$url = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query;
sleep($this->gatewayDelay);
$page2 = file_get_contents($urlmessages);
}
// echo '<pre>'; var_dump(htmlspecialchars($url)); echo '</pre>';
if (empty($page2)) {
$page1 = file_get_contents($url);
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
}
if (empty($page1)) {
// echo '<pre>'; var_dump(htmlspecialchars($page2)); echo '</pre>';
throw new Exception("J'ai pas pû récupérer la putain de première page.");
}
$json = $page2;
// echo '<pre>'; var_dump(htmlspecialchars($page1)); echo '</pre>';
return json_decode($json);
preg_match("`url='([^']+)'`isU", $page1, $matches);
}
$url = $matches[1];
// echo '<pre>'; var_dump($url); echo '</pre>';
public function donneMoiSaPutaindeG1Pub ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday) {
$page2 = '';
$rounds = 0;
while (empty($page2) and $rounds < $this->gatewayMaxRounds) {
$salt = $prenomNom;
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
sleep($this->gatewayDelay);
$page2 = file_get_contents($url);
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper) . '&getg1pub=yes';
$rounds++;
}
$urlj = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query;
if (empty($page2)) {
// echo '<pre>'; var_dump(htmlspecialchars($urlj)); echo '</pre>';
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
}
// echo '<pre>'; var_dump(htmlspecialchars($page2)); echo '</pre>';
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: fr\r\n",
'follow_location' => 0
)
);
$json = $page2;
return json_decode($json);
$context = stream_context_create($opts);
}
public function donneMoiSaPutaindeG1Pub ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday) {
$page1 = file_get_contents($urlj, false, $context);
$salt = $prenomNom;
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
if (empty($page1)) {
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper) . '&g1pub=on';
throw new Exception("J'ai pas pû récupérer la putain de première page.");
}
$url = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query;
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
// echo '<pre>'; var_dump(htmlspecialchars($url)); echo '</pre>';
preg_match("`url='([^']+)'`isU", $page1, $matches);
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: fr\r\n",
'follow_location' => 0
)
);
// die(
// '<pre>' . htmlspecialchars($page1) . '</pre>' .
// '<pre>' . print_r($matches, true) . '</pre>'
// );
$context = stream_context_create($opts);
$urlg1pub = $matches[1];
$page1 = file_get_contents($url, false, $context);
$page2 = '';
sleep($this->gatewayDelay);
$page2 = file_get_contents($urlg1pub);
if (empty($page2)) {
if (empty($page1)) {
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
}
throw new Exception("J'ai pas pû récupérer la putain de première page.");
}
$ClearText = preg_replace( "/\n\s+/", "\n", rtrim(html_entity_decode(strip_tags($page2))) );
preg_match("`url='([^']+)'`isU", $ClearText, $matches);
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
$gchangeId = $matches[1];
preg_match("`url='([^']+)'`isU", $page1, $matches);
// die(
// '<pre>' . htmlspecialchars($page1) . '</pre>' .
// '<pre>' . print_r($matches, true) . '</pre>'
// );
$url = $matches[1];
// die('<pre>' . var_dump($url, true) . '</pre>');
$opts2 = array(
'http'=>array(
'method'=>"GET",
'header'=>"Accept-language: fr\r\n",
'follow_location' => 0
)
);
$context2 = stream_context_create($opts2);
$page2 = '';
$rounds = 0;
while (empty($page2) and $rounds < $this->gatewayMaxRounds) {
sleep($this->gatewayDelay);
$page2 = file_get_contents($url, false, $context2);
$rounds++;
}
if (empty($page2)) {
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
}
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);
$gchangeId = $matches[1];
return $gchangeId;
}
}
return $gchangeId;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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);

View File

@ -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)');
}
}
}

View File

@ -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) {

View File

@ -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)

102
login.php
View File

@ -12,68 +12,80 @@ $playerG1Id = null;
if (isset($_POST['salt'], $_POST['pepper'])) {
try {
$fred = new Fred();
$keygen = new Keygen();
$keygen = new Keygen();
try {
$playerG1Id = $keygen->getG1Pub($_POST['salt'], $_POST['pepper']);
$keygen->generatePubsec($_POST['salt'], $_POST['pepper']);
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
sleep(3);
$playerIPNS = $fred->donneMoiLaPutainDeClefIPNS($_POST['salt'], $_POST['pepper']);
} catch (Exception $errMsg) {
// $keygen->generatePubsec($_POST['salt'], $_POST['pepper']);
try {
} catch (Exception $errMsg) {
$fred = new Fred();
ErrorsHandler::kaput($errMsg);
}
$playerG1Id = $fred->donneMoiSaPutainDeG1Pub($_POST['salt'], $_POST['pepper']);
$_SESSION['player_pubkey'] = $playerG1Id;
$_SESSION['player_ipns'] = $playerIPNS;
} catch (Exception $errMsg) {
$gchange = new Gchange();
ErrorsHandler::kaput($errMsg);
}
}
try {
$_SESSION['salt'] = $_POST['salt'];
$_SESSION['pepper'] = $_POST['pepper'];
$_SESSION['player_pubkey'] = $playerG1Id;
$player = $gchange->getUser($_SESSION['player_pubkey']);
header('Location:home.php');
} 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'];
header('Location:home.php');
} else {
$bodyIds = 'login-page';
$webpageTitle = $games[$_SESSION['gameId']]['title'];
include_once('header.php');
$bodyIds = 'login-page';
$webpageTitle = $games[$_SESSION['gameId']]['title'];
echo '
<form method="post" action="">
include_once('header.php');
<fieldset>
<legend>Identification par Ğchange</legend>
echo '
<form method="post" action="">
<p>
<label>
Identifiant :
<input type="text" name="salt" />
</label>
</p>
<fieldset>
<legend>Identification par Ğchange</legend>
<p>
<label>
Mot de passe :
<input type="password" name="pepper" />
</label>
</p>
<p>
<label>
Identifiant :
<input type="text" name="salt" />
</label>
</p>
<p>
<input type="submit" value="Jouer" />
</p>
</fieldset>
</form>
';
include_once('footer.php');
<p>
<label>
Mot de passe :
<input type="password" name="pepper" />
</label>
</p>
<p>
<input type="submit" value="Jouer" />
</p>
</fieldset>
</form>
';
include_once('footer.php');
}

13
map.php
View File

@ -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;

View File

@ -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>
';
}

View File

@ -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="#">&nbsp;</a>';
resultElt.innerHTML = "&nbsp;";
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);
});

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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;
}

View File

@ -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
]
}
]

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 965 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Some files were not shown because too many files have changed in this diff Show More