rework tilt award

master
Aevann 2023-08-11 15:40:14 +03:00
parent 856fda413d
commit d674390f1a
5 changed files with 57 additions and 19 deletions

View File

@ -144,17 +144,60 @@
100% {transform: translateX(-15vw) rotate(180deg); top: 0; bottom: unset;} 100% {transform: translateX(-15vw) rotate(180deg); top: 0; bottom: unset;}
} }
@keyframes tilt {
0% {transform: rotate(0deg);}
25% {transform: rotate(1deg);}
75% {transform: rotate(-1deg);}
100% {transform: rotate(0deg);}
}
.tilt {
animation-duration: 60s !important;
.tilt-post {
animation-duration: 200s !important;
animation-iteration-count: infinite !important; animation-iteration-count: infinite !important;
animation-direction: alternate !important; animation-direction: alternate !important;
animation-timing-function: linear !important; animation-timing-function: linear !important;
animation-name: tilt; animation-name: tilt-post;
}
@media (max-width: 768px) {
@keyframes tilt-post {
0% {transform: rotate(0deg);}
25% {transform: rotate(0.3deg);}
75% {transform: rotate(-0.3deg);}
100% {transform: rotate(0deg);}
}
}
@media (min-width: 768px) {
.tilt-post {
animation-duration: 500s !important;
}
@keyframes tilt-post {
0% {transform: rotate(0deg);}
25% {transform: rotate(0.8deg);}
75% {transform: rotate(-0.8deg);}
100% {transform: rotate(0deg);}
}
}
.tilt-post > * {
padding-left: 3rem !important;
padding-right: 3rem !important;
}
@keyframes tilt-comment {
0% {transform: rotate(0deg);}
100% {transform: rotate(360deg);}
}
.tilt-comment {
animation-duration: 3000s !important;
animation-iteration-count: infinite !important;
animation-timing-function: linear !important;
animation-name: tilt-comment;
}
@media (max-width: 768px) {
.tilt-comment {
animation-duration: 6000s !important;
}
} }

View File

@ -248,11 +248,6 @@ class Post(Base):
def award_count(self, kind, v): def award_count(self, kind, v):
if v and v.poor: if v and v.poor:
return 0 return 0
elif self.distinguish_level:
if SITE_NAME == 'rDrama' and kind in {'glowie', 'tilt',}:
return 0
elif SITE_NAME == 'WPD':
return 0
num = len([x for x in self.awards if x.kind == kind]) num = len([x for x in self.awards if x.kind == kind])
if num > 4 and kind not in {"shit", "fireflies", "gingerbread"}: if num > 4 and kind not in {"shit", "fireflies", "gingerbread"}:

View File

@ -438,7 +438,7 @@ AWARDS = {
"description": "Tilts the post or comment", "description": "Tilts the post or comment",
"icon": "fas fa-car-tilt", "icon": "fas fa-car-tilt",
"color": "text-blue", "color": "text-blue",
"price": 500, "price": 300,
"deflectable": False, "deflectable": False,
"cosmetic": True, "cosmetic": True,
"ghost": True, "ghost": True,

View File

@ -29,7 +29,7 @@
<span class="comment-collapse-desktop" style="border-color: #{{c.author.name_color}}" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span> <span class="comment-collapse-desktop" style="border-color: #{{c.author.name_color}}" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span>
<div class="comment-body"> <div class="comment-body">
<div id="comment-{{c.id}}-only" class="{% if c.award_count('tilt', v) %}tilt{% endif %} {% if c.award_count('glowie', v) %}glow{% endif %} comment-{{c.id}}-only"> <div id="comment-{{c.id}}-only" class="{% if c.award_count('tilt', v) %}tilt-comment{% endif %} {% if c.award_count('glowie', v) %}glow{% endif %} comment-{{c.id}}-only">
<div class="user-info"> <div class="user-info">
<span class="comment-collapse-icon" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span> <span class="comment-collapse-icon" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span>
{% if standalone and c.over_18 %}<span class="badge badge-danger">+18</span> {% endif %} {% if standalone and c.over_18 %}<span class="badge badge-danger">+18</span> {% endif %}
@ -119,7 +119,7 @@
{% endif %} {% endif %}
<div class="comment-body"> <div class="comment-body">
<div id="{% if comment_info and comment_info.id == c.id %}context{%else%}comment-{{c.id}}-only{% endif %}" class="{% if c.award_count('tilt', v) %}tilt{% endif %} {% if c.unread %}unread{% endif %} {% if c.award_count('glowie', v) %}glow{% endif %} comment-{{c.id}}-only comment-anchor {% if comment_info and comment_info.id == c.id %}context{%endif%}{% if c.is_banned %} banned{% endif %}{% if c.deleted_utc %} deleted{% endif %}"> <div id="{% if comment_info and comment_info.id == c.id %}context{%else%}comment-{{c.id}}-only{% endif %}" class="{% if c.award_count('tilt', v) %}tilt-comment{% endif %} {% if c.unread %}unread{% endif %} {% if c.award_count('glowie', v) %}glow{% endif %} comment-{{c.id}}-only comment-anchor {% if comment_info and comment_info.id == c.id %}context{%endif%}{% if c.is_banned %} banned{% endif %}{% if c.deleted_utc %} deleted{% endif %}">
<div class="user-info"> <div class="user-info">
<span class="comment-collapse-icon" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span> <span class="comment-collapse-icon" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span>

View File

@ -60,10 +60,10 @@
<div class="row mb-3"> <div class="row mb-3">
<div id="post-root" class="col-12 {% if p.award_count('tilt', v) %}tilt{% endif %}"> <div id="post-root" class="col-12 {% if p.award_count('tilt', v) %}tilt-post{% endif %}">
<div class="card border-0 mt-3 {% if p.stickied %}stickied{% endif %} {% if voted==1 %}upvoted{% elif voted==-1 %} downvoted{% endif %}"> <div class="card border-0 mt-3 {% if p.stickied %}stickied{% endif %} {% if voted==1 %}upvoted{% elif voted==-1 %} downvoted{% endif %}">
<div id="post-{{p.id}}" class="actual-post {% if p.ghost %}ghost-post{% endif %} {% if p.is_banned %}banned{% endif %} {% if p.deleted_utc %}deleted {% endif %} {% if p.award_count('tilt', v) %}p-3{% endif %} {% if p.award_count('glowie', v) %}glow{% endif %} d-flex flex-row-reverse flex-nowrap justify-content-end"> <div id="post-{{p.id}}" class="actual-post {% if p.ghost %}ghost-post{% endif %} {% if p.is_banned %}banned{% endif %} {% if p.deleted_utc %}deleted {% endif %} {% if p.award_count('glowie', v) %}glow{% endif %} d-flex flex-row-reverse flex-nowrap justify-content-end">
{% if not p.is_image and p.thumb_url and not p.embed and not p.deleted_utc %} {% if not p.is_image and p.thumb_url and not p.embed and not p.deleted_utc %}
<div class="card-header bg-transparent border-0 d-none d-md-flex flex-row flex-nowrap pl-3 p-0"> <div class="card-header bg-transparent border-0 d-none d-md-flex flex-row flex-nowrap pl-3 p-0">