Grając na rynkach lewarowanych z matematycznego punktu widzenia jesteśmy na przegranej pozycji . Są jednak gracze którzy potrafią zwiększyć swoje szanse na wygraną i ostatecznie wyjąć z giełdy więcej niż włożyli .
Oto plan gry:
- napisać dziennik do analizowania historii swoich transakcji i szukania błędów
- nauczyć się obiektowości
- podszkolić się w GitHubie
Startuję od tego kodu
* {
margin: 0;
padding: 0;
}
.headers{
margin-left: auto;
margin-right: auto;
max-width: 1000px;
text-align: center;
align-items: center;
justify-content: center;
display: flex;
flex-direction: row;
gap: .5rem;
}
html, body {
padding: .5rem;
}
.container {
max-width: 1000px;
margin: .5rem auto;
background-color: green;
}
.container1 {
width: 30%;
background-color: green;
}
.container2 {
width: 69%;
background-color: green;
}
header, main, footer {
width: 100%;
}
header nav ul {
display: flex;
gap: .5rem;
list-style-type: none;
}
header nav ul div {
display: block;
text-decoration: none;
padding: .5rem;
color: white;
cursor: pointer;
}
header nav.horizontal ul {
flex-direction: row;
}
header nav.vertical ul {
flex-direction: column;
}
main .content {
display: flex;
justify-content: center;
align-items: center;
min-height: 50dvh;
}
footer {
display: flex;
justify-content: center;
}
footer div {
padding: 1rem;
min-height: 40dvh;
}
<?php
//////////////////////// LAYOUT /////////////////////////////
echo '<div class="headers">';
$text = 'PANEL';
$main = new MainModule('container1', 'content', $text);
echo $main->getHtml();
$text = 'WYKRES';
$main = new MainModule('container2', 'content', $text);
echo $main->getHtml();
echo '</div>';
$menu = [
[
"id" => "strategy",
"text" => "Strategia",
"href" => "https://www.google.com"
],
[
"id" => "transactions",
"text" => "Transakcję",
"href" => "https://www.facebook.com"
],
[
"id" => "history",
"text" => "Historia",
"href" => "https://www.twitter.com"
]
];
$header = new HeaderModule('container', 'horizontal', $menu);
echo $header->getHtml();
$text = 'STATYSTYKA';
$footer = new FooterModule('container', null, $text);
echo $footer->getHtml();
?>
<?php
////////////////////// MODEL //////////////////////////
abstract class BodyModul {
public $containerClass;
public $contentClass;
public $content;
function __construct($containerClass, $contentClass, $content) {
$this->containerClass = $containerClass;
$this->contentClass = $contentClass;
$this->content = $content;
}
protected function generateHtml($innerHtml, $parentTag='div', $innerTag='div') {
return '<' . $parentTag . ' class="' . $this->containerClass . '">
<' . $innerTag . ' class="' . $this->contentClass . '">' . $innerHtml . '</' . $innerTag . '>
</'.$parentTag.'>';
}
abstract function getHtml();
}
//////////////////////// LOGIC ///////////////////////////
class HeaderModule extends BodyModul {
// public $id; DODAWANIE WARTOŚCI DO KONSTRUKTORA DZIECKA
// public function __construct($containerClass, $contentClass, $content, $id) {
// parent::__construct($containerClass, $contentClass, $content);
// $this->id = $id;
// }
function getHtml() {
if (is_array($this->content)) {
$menu = array_map(function($item) {
return '<div onclick="'.$item['id'].'()">'.$item['text'].'</div>';
}, $this->content);
return $this->generateHtml('<ul>'.implode('', $menu).'</ul>', 'header', 'nav');
} else {
return $this->generateHtml($this->content, 'header');
}
}
}
class MainModule extends BodyModul {
function getHtml() {
return $this->generateHtml($this->content, 'main');
}
}
class FooterModule extends BodyModul {
function getHtml() {
return $this->generateHtml($this->content, 'footer');
}
}
?>
function strategy(){
alert('ok');
}
Przygotuję bazę z historią która będzie dynamicznie wczytywana w segmencie statystyka poprzez pasek nawigacyjny nad nią. Jakby ktoś Chciał dołączyć do projektu to bardzo chętnie potrenuję w większym gronie.