add adaptive tilt padding

master
Aevann 2024-01-11 00:15:07 +02:00
parent df8e8d239c
commit e5bedb5760
2 changed files with 4 additions and 2 deletions

View File

@ -246,7 +246,8 @@
{% endif %} {% endif %}
{% set realbody = c.realbody(v) %} {% set realbody = c.realbody(v) %}
<div id="comment-text-{{c.id}}" class="{{c.award_classes(v)}} comment-text mb-0" {% if c.award_count('tilt', v) %}style="transform: rotate({{c.award_count('tilt', v)}}deg)"{% endif %}> {% set tilt = c.award_count('tilt', v) %}
<div id="comment-text-{{c.id}}" class="{{c.award_classes(v)}} comment-text mb-0" {% if tilt %}style="transform: rotate({{tilt}}deg);padding-right: {{tilt*10}}px;padding-left: {{tilt*10}}px"{% endif %}>
{{realbody | safe}} {{realbody | safe}}
</div> </div>

View File

@ -104,7 +104,8 @@
</h1> </h1>
{% if not v_forbid_deleted %} {% if not v_forbid_deleted %}
<div id="post-body" class="post-body mt-3" {% if p.award_count('tilt', v) %}style="transform: rotate({{p.award_count('tilt', v)}}deg)"{% endif %}> {% set tilt = p.award_count('tilt', v) %}
<div id="post-body" class="post-body mt-3" {% if tilt %}style="transform: rotate({{tilt}}deg);padding-right: {{tilt*10}}px;padding-left: {{tilt*10}}px"{% endif %}>
{% if p.realurl(v) and not p.is_image and not p.is_video and not p.is_audio %} {% if p.realurl(v) and not p.is_image and not p.is_video and not p.is_audio %}
<a rel="noopener" href="{{p.realurl(v)}}" {% if not v or v.newtabexternal %}target="_blank"{% endif %}> <a rel="noopener" href="{{p.realurl(v)}}" {% if not v or v.newtabexternal %}target="_blank"{% endif %}>
<div class="d-flex justify-content-between align-items-center border rounded p-2 mb-3"> <div class="d-flex justify-content-between align-items-center border rounded p-2 mb-3">