mastodon wall style

This commit is contained in:
Tykayn 2023-05-19 22:31:29 +02:00 committed by tykayn
parent b94d2d303d
commit 0315defb21
3 changed files with 51 additions and 28 deletions

View File

@ -11,12 +11,9 @@
</component>
<component name="ChangeListManager">
<list default="true" id="f0e1128e-d3f4-4b56-88a7-ef7c80dc164c" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/php.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/sf-webapp.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Controller/DefaultController.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/templates/default/index.html.twig" afterDir="false" />
<change beforePath="$PROJECT_DIR$/composer.json" beforeDir="false" afterPath="$PROJECT_DIR$/composer.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/composer.lock" beforeDir="false" afterPath="$PROJECT_DIR$/composer.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Controller/DefaultController.php" beforeDir="false" afterPath="$PROJECT_DIR$/src/Controller/DefaultController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/templates/default/index.html.twig" beforeDir="false" afterPath="$PROJECT_DIR$/templates/default/index.html.twig" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -202,7 +199,7 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1684327639044</updated>
<workItem from="1684327640262" duration="7261000" />
<workItem from="1684327640262" duration="8472000" />
</task>
<servers />
</component>

View File

@ -12,8 +12,10 @@ class DefaultController extends AbstractController
public function index(): Response
{
// TODO merge all these post list and deduplicate them
$url = "https://mastodon.cipherbliss.com/api/v1/timelines/public?remote=false&allow_local_only=true&only_media=true";
// $url = "https://mastodon.cipherbliss.com/api/v1/timelines/tag/art&only_media=true";
$url = "https://mastodon.cipherbliss.com/api/v1/timelines/tag/art";
$url = "https://mastodon.cipherbliss.com/api/v1/timelines/tag/mastoart";
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', $url );

View File

@ -6,52 +6,76 @@
<style>
.example-wrapper {
margin: 1em auto;
max-width: 800px;
max-width: 1600px;
width: 95%;
font: 18px/1.5 sans-serif;
}
.example-wrapper img {
width: 100%;
float:left;
}
.example-wrapper strong {
float: left;
margin-top: -4em;
position: relative;
padding: 0.5em;
background: rgba(0, 0, 0, .7);
color: #fff;
width: 100%;
text-align: right;
}
.example-wrapper code {
background: #F5F5F5;
padding: 2px 6px;
}
a{
float:left;
width: 50%;
}
a:hover strong{
color: #ddd;
background: rgba(0, 0, 0, .7);
}
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
le truc par défaut
<h1>Découverte d'artistes sur mastodon</h1>
<h2>
{{ data | length }} Images
</h2>
{{ (data) | length }}
{# {{ (data) | length }}#}
<fieldset>
<h2> liste des images</h2>
{% for img in (data) %}
{# {{ img }}#}
{{ img.media_attachments | length }}
{# {{ img }}#}
{# {{ img.media_attachments | length }}#}
{% for media in img.media_attachments %}
<a href="{{ img.url }}">
<figure>
<img src="{{ media.preview_url }}" alt="image" class="gallery_img">
<img src="{{ media.preview_url }}" alt="image" class="gallery_img /">
<strong>
{{ img.account.acct }}
</strong>
</figure>
</a>
{% endfor %}
{% endfor %}
</fieldset>
<h2>debug</h2>
{{ dump(data) }}
{# <h2>debug</h2>#}
{# {{ dump(data) }}#}
</div>
<style>
img{
img {
max-width: 90vw;
margin-right: 1em;
margin-bottom: 1em;