summaryrefslogtreecommitdiffstats
path: root/assets/css/components/_project.scss
blob: 6fac0473f3da2d9bf75875de05d5947185a6443c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@include namespace('project') {
    @include store((
        --colors: (
            --bg: prop(--colors --bg-hi, $global: true),
        )
    ));

    @include component(namespace()) {
        position: relative;

        &::before {
            content:          '';
            display:          block;
            padding-top:      12em;
            padding-bottom:   25%;
            background-color: prop(--colors --bg);
        }

        &:link,
        &:visited {
            color:           currentColor;
            text-decoration: none;

            &:hover {
                @include element('picture') {
                    opacity: .75;
                }

                @include element('card') {
                    transform:        translateY(#{prop(--card --dims --hover-offset, $global: true)});
                    background-color: prop(--card --colors --hover --bg, $global: true);
                    color:            prop(--card --colors --hover --fg, $global: true);

                    small,
                    strong {
                        color: prop(--card --colors --hover --fg, $global: true);
                    }
                }
            }
        }

        @include multi('element' 'picture') {
            display:          block;
            position:         absolute;
            z-index:          10;
            top:              0;
            left:             0;
            width:            100%;
            height:           100%;
            object-fit:       cover;
            object-position:  center center;
        }

        @include element('card') {
            position:   absolute;
            z-index:    20;
            right:      1em;
            bottom:     1em;
            min-width:  15em;
            max-width:  calc(100% - 2em);
            box-shadow: 0 .3em 1em rgba(#000, .15);
        }

        @include element('picture') {
            transition: opacity .2s;
            mask-image: iro-easing-gradient(linear, 340deg, rgba(#000, .75) 7em, ease, #000 26em);
        }

        @include media('<=sm') {
            @include element('picture') {
                mask-image: iro-easing-gradient(linear, to top, rgba(#000, .75) 2em, ease, #000 17em);
            }
        }
    }
}