Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TeDomum
Prismo
Commits
3628263d
Commit
3628263d
authored
Feb 05, 2019
by
kaiyou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitlab.com/mbajur/prismo
parents
26a5df83
ef322ac8
Pipeline
#109
passed with stages
Changes
72
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
72 changed files
with
1014 additions
and
607 deletions
+1014
-607
app/controllers/admin/accounts_controller.rb
app/controllers/admin/accounts_controller.rb
+2
-1
app/controllers/admin/domain_blocks_controller.rb
app/controllers/admin/domain_blocks_controller.rb
+41
-0
app/controllers/api/ujs/comments_controller.rb
app/controllers/api/ujs/comments_controller.rb
+9
-0
app/controllers/api/ujs/stories_controller.rb
app/controllers/api/ujs/stories_controller.rb
+10
-1
app/controllers/static_controller.rb
app/controllers/static_controller.rb
+5
-0
app/interactions/activitypub/domain_blocks/create.rb
app/interactions/activitypub/domain_blocks/create.rb
+44
-0
app/interactions/comments/delete.rb
app/interactions/comments/delete.rb
+33
-0
app/interactions/stories/delete.rb
app/interactions/stories/delete.rb
+33
-0
app/javascript/css/application.scss
app/javascript/css/application.scss
+2
-0
app/javascript/css/application_tailwind.css
app/javascript/css/application_tailwind.css
+0
-64
app/javascript/css/components/_jumpbox.scss
app/javascript/css/components/_jumpbox.scss
+1
-1
app/javascript/css/components/_story_row.scss
app/javascript/css/components/_story_row.scss
+4
-0
app/javascript/css/n/_mixins.scss
app/javascript/css/n/_mixins.scss
+2
-2
app/javascript/css/n/_variables.scss
app/javascript/css/n/_variables.scss
+4
-3
app/javascript/css/n/components/_buttons.scss
app/javascript/css/n/components/_buttons.scss
+2
-5
app/javascript/css/n/components/_menu.scss
app/javascript/css/n/components/_menu.scss
+65
-0
app/javascript/css/n/components/_popover.scss
app/javascript/css/n/components/_popover.scss
+7
-0
app/javascript/css/vendor/tippy/_mixins.scss
app/javascript/css/vendor/tippy/_mixins.scss
+0
-189
app/javascript/css/vendor/tippy/_vars.scss
app/javascript/css/vendor/tippy/_vars.scss
+0
-4
app/javascript/css/vendor/tippy/tippy.scss
app/javascript/css/vendor/tippy/tippy.scss
+0
-208
app/javascript/packs/application.js
app/javascript/packs/application.js
+0
-3
app/javascript/packs/controllers/comment_controller.js
app/javascript/packs/controllers/comment_controller.js
+13
-0
app/javascript/packs/controllers/dropdown_controller.js
app/javascript/packs/controllers/dropdown_controller.js
+23
-18
app/javascript/packs/controllers/popover_controller.js
app/javascript/packs/controllers/popover_controller.js
+66
-0
app/javascript/packs/controllers/story_controller.js
app/javascript/packs/controllers/story_controller.js
+13
-0
app/jobs/accounts/silence_job.rb
app/jobs/accounts/silence_job.rb
+11
-0
app/jobs/comments/delete_job.rb
app/jobs/comments/delete_job.rb
+7
-0
app/jobs/stories/delete_job.rb
app/jobs/stories/delete_job.rb
+7
-0
app/models/activitypub.rb
app/models/activitypub.rb
+5
-0
app/models/activitypub/domain_block.rb
app/models/activitypub/domain_block.rb
+12
-0
app/models/story.rb
app/models/story.rb
+1
-1
app/nulls/removed_story_null.rb
app/nulls/removed_story_null.rb
+69
-0
app/policies/activitypub/domain_block_policy.rb
app/policies/activitypub/domain_block_policy.rb
+19
-0
app/policies/comment_policy.rb
app/policies/comment_policy.rb
+4
-0
app/policies/story_policy.rb
app/policies/story_policy.rb
+8
-2
app/presenters/comment_presenter.rb
app/presenters/comment_presenter.rb
+4
-0
app/presenters/story_presenter.rb
app/presenters/story_presenter.rb
+30
-3
app/queries/stories_query.rb
app/queries/stories_query.rb
+1
-1
app/serializers/activitypub/delete_serializer.rb
app/serializers/activitypub/delete_serializer.rb
+26
-0
app/services/silence_account_service.rb
app/services/silence_account_service.rb
+5
-0
app/views/admin/accounts/index.html.slim
app/views/admin/accounts/index.html.slim
+2
-0
app/views/admin/domain_blocks/_form.html.slim
app/views/admin/domain_blocks/_form.html.slim
+7
-0
app/views/admin/domain_blocks/index.html.slim
app/views/admin/domain_blocks/index.html.slim
+25
-0
app/views/admin/domain_blocks/new.html.slim
app/views/admin/domain_blocks/new.html.slim
+5
-0
app/views/comments/_comment.html.slim
app/views/comments/_comment.html.slim
+7
-0
app/views/layouts/settings.html.slim
app/views/layouts/settings.html.slim
+2
-0
app/views/shared/_navbar/_jumpbox.html.slim
app/views/shared/_navbar/_jumpbox.html.slim
+9
-5
app/views/shared/_navbar/_profile.html.slim
app/views/shared/_navbar/_profile.html.slim
+9
-10
app/views/static/design.html.slim
app/views/static/design.html.slim
+91
-0
app/views/stories/_story.html+phone.slim
app/views/stories/_story.html+phone.slim
+3
-3
app/views/stories/_story.html.slim
app/views/stories/_story.html.slim
+7
-9
app/views/stories/_story/_meta_primary.html.slim
app/views/stories/_story/_meta_primary.html.slim
+5
-2
app/views/stories/_story/_meta_secondary.html.slim
app/views/stories/_story/_meta_secondary.html.slim
+14
-9
config/initializers/simple_form_bootstrap.rb
config/initializers/simple_form_bootstrap.rb
+1
-29
config/locales/en.yml
config/locales/en.yml
+3
-1
config/routes.rb
config/routes.rb
+5
-1
config/sidekiq.yml
config/sidekiq.yml
+6
-0
db/migrate/20190124171510_create_activitypub_domain_blocks.rb
...igrate/20190124171510_create_activitypub_domain_blocks.rb
+11
-0
db/migrate/20190127153311_remove_not_null_constraint_from_story_title.rb
...0127153311_remove_not_null_constraint_from_story_title.rb
+1
-1
db/structure.sql
db/structure.sql
+1
-0
package.json
package.json
+1
-1
spec/factories/stories.rb
spec/factories/stories.rb
+4
-0
spec/interactions/activitypub/domain_blocks/create_spec.rb
spec/interactions/activitypub/domain_blocks/create_spec.rb
+50
-0
spec/interactions/comments/delete_spec.rb
spec/interactions/comments/delete_spec.rb
+39
-10
spec/interactions/stories/delete_spec.rb
spec/interactions/stories/delete_spec.rb
+45
-0
spec/models/activitypub/domain_block_spec.rb
spec/models/activitypub/domain_block_spec.rb
+5
-0
spec/policies/comment_policy_spec.rb
spec/policies/comment_policy_spec.rb
+6
-0
spec/policies/story_policy_spec.rb
spec/policies/story_policy_spec.rb
+10
-1
spec/presenters/story_presenter_spec.rb
spec/presenters/story_presenter_spec.rb
+19
-0
spec/serializers/activitypub/delete_serializer_spec.rb
spec/serializers/activitypub/delete_serializer_spec.rb
+11
-0
spec/services/suspend_account_service_spec.rb
spec/services/suspend_account_service_spec.rb
+18
-8
yarn.lock
yarn.lock
+4
-11
No files found.
app/controllers/admin/accounts_controller.rb
View file @
3628263d
...
...
@@ -18,6 +18,7 @@ module Admin
authorize
@account
Accounts
::
SuspendJob
.
perform_later
(
@account
.
id
)
redirect_back
(
fallback_location:
admin_accounts_path
,
notice:
'Account sheduled for suspension'
...
...
@@ -28,7 +29,7 @@ module Admin
@account
=
find_account
authorize
@account
@account
.
update
(
silenced:
true
)
SilenceAccountService
.
new
.
call
(
@account
)
redirect_back
(
fallback_location:
admin_accounts_path
,
...
...
app/controllers/admin/domain_blocks_controller.rb
0 → 100644
View file @
3628263d
module
Admin
class
DomainBlocksController
<
ApplicationController
layout
'settings'
def
index
authorize
ActivityPub
::
DomainBlock
@domain_blocks
=
ActivityPub
::
DomainBlock
.
all
end
def
new
authorize
ActivityPub
::
DomainBlock
@domain_block
=
ActivityPub
::
DomainBlocks
::
Create
.
new
end
def
create
authorize
ActivityPub
::
DomainBlock
@domain_block
=
ActivityPub
::
DomainBlocks
::
Create
.
run
(
domain_block_params
)
if
@domain_block
.
valid?
redirect_to
admin_domain_blocks_path
,
notice:
'Domain successfully blocked'
else
render
:new
end
end
def
destroy
domain_block
=
ActivityPub
::
DomainBlock
.
find
(
params
[
:id
])
authorize
domain_block
domain_block
.
destroy!
redirect_to
admin_domain_blocks_path
,
notice:
'Domain successfully unblocked'
end
private
def
domain_block_params
params
.
require
(
:activitypub_domain_block
).
permit
(
:domain
,
:severity
)
end
end
end
app/controllers/api/ujs/comments_controller.rb
View file @
3628263d
...
...
@@ -73,6 +73,15 @@ class Api::Ujs::CommentsController < Api::Ujs::BaseController
render
'comments/_comment'
,
layout:
false
,
locals:
{
comment:
outcome
.
result
.
likeable
}
end
def
destroy
comment
=
find_comment
authorize
comment
Comments
::
DeleteJob
.
perform_later
(
comment
.
id
)
head
:ok
end
private
def
find_comment
...
...
app/controllers/api/ujs/stories_controller.rb
View file @
3628263d
...
...
@@ -12,13 +12,22 @@ class Api::Ujs::StoriesController < Api::Ujs::BaseController
def
scrap
story
=
find_story
authorize
story
,
:scrap?
authorize
story
Stories
::
Rescrap
.
run
(
story:
story
,
user:
current_user
)
head
:no_content
end
def
destroy
story
=
find_story
authorize
story
Stories
::
DeleteJob
.
perform_later
(
story
.
id
)
head
:ok
end
private
def
find_story
...
...
app/controllers/static_controller.rb
0 → 100644
View file @
3628263d
class
StaticController
<
ApplicationController
layout
'application'
def
design
;
end
end
app/interactions/activitypub/domain_blocks/create.rb
0 → 100644
View file @
3628263d
module
ActivityPub
module
DomainBlocks
class
Create
<
ActiveInteraction
::
Base
string
:domain
string
:severity
interface
:suspend_job
,
default:
Accounts
::
SuspendJob
interface
:silence_job
,
default:
Accounts
::
SilenceJob
def
execute
@domain_block
=
ActivityPub
::
DomainBlock
.
new
@domain_block
.
domain
=
domain
@domain_block
.
severity
=
severity
if
domain_block
.
save
resolve_or_suspend_accounts
else
errors
.
merge!
(
domain_block
.
errors
)
end
domain_block
end
private
attr_reader
:domain_block
def
resolve_or_suspend_accounts
accounts_for_domain
.
each
do
|
account
|
case
domain_block
.
severity
when
'suspend'
suspend_job
.
perform_later
(
account
.
id
)
when
'silence'
silence_job
.
perform_later
(
account
.
id
)
end
end
end
def
accounts_for_domain
::
Account
.
remote
.
where
(
domain:
domain
)
end
end
end
end
app/interactions/comments/delete.rb
View file @
3628263d
...
...
@@ -2,6 +2,9 @@ class Comments::Delete < ActiveInteraction::Base
object
:comment
def
execute
return
false
if
comment
.
removed?
@account
=
comment
.
account
comment
.
update
(
account:
nil
,
body:
nil
,
...
...
@@ -12,6 +15,36 @@ class Comments::Delete < ActiveInteraction::Base
removed:
true
)
distribute_delete_comment!
if
comment
.
local?
comment
end
private
attr_reader
:account
def
distribute_delete_comment!
delivery_inboxes
.
each
do
|
inbox_url
|
ActivityPub
::
DeliveryJob
.
perform_later
(
signed_payload
,
account
.
id
,
inbox_url
)
end
end
def
signed_payload
@signed_payload
||=
begin
Oj
.
dump
(
ActivityPub
::
LinkedDataSignature
.
new
(
payload
).
sign!
(
account
)
)
end
end
def
payload
ActivityPub
::
DeleteSerializer
.
new
(
comment
,
with_context:
true
).
as_json
end
def
delivery_inboxes
Account
.
inboxes
.
reject
(
&
:empty?
)
end
end
app/interactions/stories/delete.rb
View file @
3628263d
...
...
@@ -2,6 +2,9 @@ class Stories::Delete < ActiveInteraction::Base
object
:story
def
execute
return
false
if
story
.
removed?
@account
=
story
.
account
story
.
update!
(
account:
nil
,
title:
nil
,
...
...
@@ -14,6 +17,36 @@ class Stories::Delete < ActiveInteraction::Base
removed:
true
)
distribute_delete_story!
if
story
.
local?
story
end
private
attr_reader
:account
def
distribute_delete_story!
delivery_inboxes
.
each
do
|
inbox_url
|
ActivityPub
::
DeliveryJob
.
perform_later
(
signed_payload
,
account
.
id
,
inbox_url
)
end
end
def
signed_payload
@signed_payload
||=
begin
Oj
.
dump
(
ActivityPub
::
LinkedDataSignature
.
new
(
payload
).
sign!
(
account
)
)
end
end
def
payload
ActivityPub
::
DeleteSerializer
.
new
(
story
,
with_context:
true
).
as_json
end
def
delivery_inboxes
Account
.
inboxes
.
reject
(
&
:empty?
)
end
end
app/javascript/css/application.scss
View file @
3628263d
...
...
@@ -12,6 +12,8 @@
@import
'./n/components/box'
;
@import
'./n/components/form'
;
@import
'./n/components/label'
;
@import
'./n/components/menu'
;
@import
'./n/components/popover'
;
@import
'./helpers/shortcuts'
;
@import
'./helpers/animations'
;
...
...
app/javascript/css/application_tailwind.css
deleted
100644 → 0
View file @
26a5df83
@import
'components_t/box'
;
/**
* This injects Tailwind's base styles, which is a combination of
* Normalize.css and some additional base styles.
*
* You can see the styles here:
* https://github.com/tailwindcss/tailwindcss/blob/master/css/preflight.css
*
* If using `postcss-import`, use this import instead:
*
* @import "tailwindcss/preflight";
*/
@tailwind
preflight
;
/**
* This injects any component classes registered by plugins.
*
* If using `postcss-import`, use this import instead:
*
* @import "tailwindcss/components";
*/
@tailwind
components
;
/**
* Here you would add any of your custom component classes; stuff that you'd
* want loaded *before* the utilities so that the utilities could still
* override them.
*
* Example:
*
* .btn { ... }
* .form-input { ... }
*
* Or if using a preprocessor or `postcss-import`:
*
* @import "components/buttons";
* @import "components/forms";
*/
/**
* This injects all of Tailwind's utility classes, generated based on your
* config file.
*
* If using `postcss-import`, use this import instead:
*
* @import "tailwindcss/utilities";
*/
@tailwind
utilities
;
/**
* Here you would add any custom utilities you need that don't come out of the
* box with Tailwind.
*
* Example :
*
* .bg-pattern-graph-paper { ... }
* .skew-45 { ... }
*
* Or if using a preprocessor or `postcss-import`:
*
* @import "utilities/background-patterns";
* @import "utilities/skew-transforms";
*/
app/javascript/css/components/_jumpbox.scss
View file @
3628263d
...
...
@@ -29,7 +29,7 @@
text-overflow
:
ellipsis
;
}
&
:hover
{
&
:hover
,
&
:active
,
&
:focus
{
background
:
rgba
(
#fff
,
0
.3
);
color
:
#fff
;
}
...
...
app/javascript/css/components/_story_row.scss
View file @
3628263d
...
...
@@ -156,6 +156,10 @@
animation
:
none
;
}
}
&
--removed
{
opacity
:
0
.5
;
}
}
.story-row--phone
{
...
...
app/javascript/css/n/_mixins.scss
View file @
3628263d
...
...
@@ -20,7 +20,7 @@
color
:
n-color
(
$textColor
);
border-color
:
n-color
(
$accent
);
&
:hover
{
&
:hover
,
&
:visited
,
&
:active
,
&
:focus
{
@include
n-transition
;
background-color
:
n-color
(
#{
$accent
}
-
light
);
...
...
@@ -36,7 +36,7 @@
border-color
:
n-color
(
$accent
);
color
:
n-color
(
#{
$accent
}
-
dark
);
&
:hover
,
&
:visited
{
&
:hover
,
&
:visited
,
&
:active
,
&
:focus
{
@include
n-transition
;
color
:
n-color
(
#{
$accent
}
-
dark
);
...
...
app/javascript/css/n/_variables.scss
View file @
3628263d
...
...
@@ -5,7 +5,7 @@ $spaces: (
3
:
0
.75rem
,
4
:
1rem
,
5
:
1
.25rem
,
6
:
1
.
2
5rem
,
6
:
1
.5rem
,
8
:
2rem
,
10
:
2
.5rem
,
12
:
3rem
,
...
...
@@ -113,6 +113,7 @@ $borderWidths: (
$borderRadius
:
(
none
:
0
,
2sm
:
.1rem
,
sm
:
.125rem
,
default
:
.25rem
,
lg
:
.5rem
,
...
...
@@ -122,8 +123,8 @@ $borderRadius: (
$shadows
:
(
default
:
0
2px
4px
0
rgba
(
0
,
0
,
0
,
0
.10
)
,
sm
:
0
1px
2px
rgba
(
0
,
0
,
0
,
0
.05
)
,
md
:
'
0
4
px 8px 0 rgba(0,0,0,0.12), 0
2
px 4px 0 rgba(0,0,0,0.08)
'
,
lg
:
'
0 15px 30px 0 rgba(0,0,0,0.11), 0 5px 15px 0 rgba(0,0,0,0.08)
'
,
md
:
#{
0
2
px
8px
0
rgba
(
0
,
0
,
0
,
0
.12
)
,
0
1
px
4px
0
rgba
(
0
,
0
,
0
,
0
.08
)
}
,
lg
:
#{
0
15px
30px
0
rgba
(
0
,
0
,
0
,
0
.11
)
,
0
5px
15px
0
rgba
(
0
,
0
,
0
,
0
.08
)
}
,
inner
:
inset
0
2px
4px
0
rgba
(
0
,
0
,
0
,
0
.06
)
,
outline
:
0
0
0
3px
rgba
(
52
,
144
,
220
,
0
.5
)
,
none
:
none
,
...
...
app/javascript/css/n/components/_buttons.scss
View file @
3628263d
...
...
@@ -15,17 +15,14 @@
font-weight
:
n-font-weight
(
semibold
);
text-decoration
:
none
;
&
:hover
{
&
:hover
,
&
:visited
,
&
:active
,
&
:focus
{
text-decoration
:
none
;
}
&
:visited
{
color
:
n-color
(
white
);
}
}
.btn-n-lg
{
font-size
:
n-text-size
(
base
);
font-size
:
n-text-size
(
xs
);
height
:
2rem
;
line-height
:
2rem
;
}
...
...
app/javascript/css/n/components/_menu.scss
0 → 100644
View file @
3628263d
$menu-space-base
:
n-space
(
2
)
*
.8
;
$menu-space-h
:
.4rem
;
.menu-n
{
background
:
n-color
(
white
);
border-radius
:
n-border-radius
(
2sm
);
list-style
:
none
;
margin
:
0
;
padding
:
$menu-space-base
;
transform
:
translateY
(
n-space
(
1
));
z-index
:
300
;
box-shadow
:
n-shadow
(
md
);
display
:
none
;
&
__item
{
margin-top
:
0
;
padding
:
0
$menu-space-base
;
position
:
relative
;
text-decoration
:
none
;
a
{
border-radius
:
n-border-radius
(
2sm
);
color
:
inherit
;
text-decoration
:
none
;
display
:
block
;
margin
:
0
(
$menu-space-h
*
-1
);
padding
:
.2rem
$menu-space-h
;
}
>
a
.active
,
>
a
:active
,
>
a
:hover
{
color
:
n-color
(
indigo
);
background
:
rgba
(
n-color
(
indigo-lightest
)
,
0
.6
);
}
&
+
.menu-n__item
{
margin-top
:
n-space
(
2
)
*
.5
;
}
}
&
__divider
{
border-top
:
n-border-width
(
default
)
solid
n-color
(
grey-lighter
);
height
:
n-border-width
(
default
);
margin
:
$menu-space-base
0
;
&
[
data-content
]
{
margin
:
.8rem
0
;
}
&
::after
{
background
:
n-color
(
white
);
color
:
n-color
(
grey
);
content
:
attr
(
data-content
);
display
:
inline-block
;
font-size
:
n-text-size
(
xs
);
padding
:
0
$menu-space-h
;
transform
:
translateY
(
-.65rem
);
}
}
&
--opened
{
display
:
inline-block
;
}
}
app/javascript/css/n/components/_popover.scss
0 → 100644
View file @
3628263d
.popover-n
{
display
:
none
;
&
--opened
{
display
:
inline-block
;
}
}
app/javascript/css/vendor/tippy/_mixins.scss
deleted
100644 → 0
View file @
26a5df83
@mixin
enter-transform
(
$placement
,
$animation
)
{
@if
(
$animation
==
'perspective'
)
{
@if
(
$placement
==
'top'
)
{
transform
:
translateY
(
-10px
)
rotateX
(
0
);
}
@else
if
(
$placement
==
'bottom'
)
{
transform
:
translateY
(
10px
)
rotateX
(
0
);
}
@else
if
(
$placement
==
'left'
)
{
transform
:
translateX
(
-10px
)
rotateY
(
0
);
}
@else
if
(
$placement
==
'right'
)
{
transform
:
translateX
(
10px
)
rotateY
(
0
);
}
}
@else
if
(
$animation
==
'fade'
)
{
@if
(
$placement
==
'top'
)
{
transform
:
translateY
(
-10px
);
}
@else
if
(
$placement
==
'bottom'
)
{
transform
:
translateY
(
10px
);
}
@else
if
(
$placement
==
'left'
)
{
transform
:
translateX
(
-10px
);
}
@else
if
(
$placement
==
'right'
)
{
transform
:
translateX
(
10px
);
}
}
@else
if
(
$animation
==
'scale'
)
{
@if
(
$placement
==
'top'
)
{
transform
:
translateY
(
-10px
)
scale
(
1
);
}
@else
if
(
$placement
==
'bottom'
)
{
transform
:
translateY
(
10px
)
scale
(
1
);
}
@else
if
(
$placement
==
'left'
)
{
transform
:
translateX
(
-10px
)
scale
(
1
);
}
@else
if
(
$placement
==
'right'
)
{
transform
:
translateX
(
10px
)
scale
(
1
);
}
}
}
@mixin
leave-transform
(
$placement
,
$animation
)
{
@if
(
$animation
==
'perspective'
)
{
@if
(
$placement
==
'top'
)
{
transform
:
translateY
(
0
)
rotateX
(
60deg
);
}
@else
if
(
$placement
==
'bottom'
)
{
transform
:
translateY
(
0
)
rotateX
(
-60deg
);
}
@else
if
(
$placement
==
'left'
)
{
transform
:
translateX
(
0
)
rotateY
(
-60deg
);
}
@else
if
(
$placement
==
'right'
)
{
transform
:
translateX
(
0
)
rotateY
(
60deg
);
}
}
@else
if
(
$animation
==
'shift-away'
)
{
@if
(
$placement
==
'top'
)
{
transform
:
translateY
(
0
);
}
@else
if
(
$placement
==
'bottom'
)
{
transform
:
translateY
(
0
);
}
@else
if
(
$placement
==
'left'
)
{
transform
:
translateX
(
0
);
}
@else
if
(
$placement
==
'right'
)
{
transform
:
translateX
(
0
);
}
}
@else
if
(
$animation
==
'scale'
)
{
@if
(
$placement
==
'top'
)
{
transform
:
translateY
(
0
)
scale
(
0
.5
);
}
@else
if
(
$placement
==
'bottom'
)
{
transform
:
translateY
(
0
)
scale
(
0
.5
);
}
@else
if
(
$placement
==
'left'
)
{
transform
:
translateX
(
0
)
scale
(
0
.5
);
}
@else
if
(
$placement
==
'right'
)
{
transform
:
translateX
(
0
)
scale
(
0
.5
);
}
}
@else
if
(
$animation
==
'shift-toward'
)
{
@if
(
$placement
==
'top'
)
{
transform
:
translateY
(
-20px
);
}
@else
if
(
$placement
==
'bottom'
)
{
transform
:
translateY
(
20px
);
}
@else
if
(
$placement
==
'left'
)
{
transform
:
translateX
(
-20px
);
}
@else
if
(
$placement
==
'right'
)
{
transform
:
translateX
(
20px
);
}
}
}
@mixin
backdrop-transform-enter
(
$placement
)
{
$scale
:
1
;
@if
(
$placement
==
'top'
)
{
transform
:
scale
(
$scale
)
translate
(
-50%
,
-55%
);
}
@else
if
(
$placement
==
'bottom'
)
{
transform
:
scale
(
$scale
)
translate
(
-50%
,
-45%
);
}
@else
if
(
$placement
==
'left'
)
{
transform
:
scale
(
$scale
)
translate
(
-50%
,
-50%
);
}
@else
if
(
$placement
==
'right'
)
{
transform
:
scale
(
$scale
)
translate
(
-50%
,
-50%
);
}
}
@mixin
backdrop-transform-leave
(
$placement
)
{
$scale
:
0
.2
;
@if
(
$placement
==
'top'
)
{
transform
:
scale
(
$scale
)
translate
(
-50%
,
-45%
);