|
2 | 2 | --letter__txt--2: blueviolet; |
3 | 3 | --spelling__txt--3: palevioletred; |
4 | 4 | --steps: 10; |
| 5 | + --steps-desc: 30; |
5 | 6 | } |
6 | 7 |
|
7 | 8 | .container__typing { |
8 | 9 | display: grid; |
9 | 10 | grid-template-columns: repeat(2, 1fr); |
10 | 11 | grid-template-rows: 35% auto auto; |
11 | 12 | grid-template-areas: |
12 | | - "letter content-display" |
| 13 | + "letter content__display" |
13 | 14 | "spelling spelling" |
14 | 15 | "description description"; |
15 | 16 | grid-auto-flow: row; |
|
26 | 27 | padding: 0; |
27 | 28 | transition: color 0.5s ease-in; |
28 | 29 | text-align: center; |
29 | | - width: 100%; |
30 | 30 | line-height: 1; |
| 31 | + width: 100%; |
31 | 32 | } |
32 | 33 |
|
33 | 34 | & .content__display { |
34 | | - grid-area: content-display; |
| 35 | + grid-area: content__display; |
35 | 36 | display: flex; |
36 | 37 | justify-content: center; |
37 | 38 | align-items: center; |
|
48 | 49 | & .image__container { |
49 | 50 | width: 100%; |
50 | 51 | height: 100%; |
51 | | - display: flex; |
| 52 | + display: none; |
52 | 53 | justify-content: center; |
53 | 54 | align-items: center; |
54 | 55 | overflow: hidden; |
55 | | - display: none; |
56 | 56 | } |
57 | 57 |
|
58 | 58 | & .image__container img { |
|
65 | 65 |
|
66 | 66 | & .animation { |
67 | 67 | animation: |
68 | | - typing 1.5s steps(var(--steps, 10)), |
| 68 | + typing 1.5s steps(var(--steps, 10)) forwards, |
69 | 69 | blink 0.5s step-end infinite alternate; |
| 70 | + width: 0; |
| 71 | + overflow: hidden; |
| 72 | + white-space: nowrap; |
70 | 73 | } |
71 | 74 |
|
72 | 75 | & .spelling { |
73 | 76 | grid-area: spelling; |
74 | 77 | grid-column: 1/3; |
75 | 78 | grid-row: 2/3; |
76 | | - width: clamp(6ch, 50vw, 12ch); |
| 79 | + width: 0; |
| 80 | + max-width: fit-content; |
77 | 81 | white-space: nowrap; |
78 | 82 | overflow: hidden; |
79 | 83 | border-right: 3px solid; |
80 | 84 | font-family: monospace; |
81 | 85 | font-size: clamp(4em, 10vw, 12em); |
82 | 86 | transition: all 0.5s ease-in-out; |
83 | 87 | color: var(--spelling__txt--3); |
84 | | - max-width: fit-content; |
85 | 88 | margin: 0 auto; |
86 | 89 | } |
87 | 90 |
|
| 91 | + & .spelling:not(.animation) { |
| 92 | + width: auto; |
| 93 | + } |
| 94 | + |
88 | 95 | & .description { |
89 | 96 | grid-area: description; |
90 | 97 | width: 100%; |
|
95 | 102 | margin-top: 2rem; |
96 | 103 | color: var(--spelling__txt--3); |
97 | 104 | min-height: 2em; |
| 105 | + overflow: hidden; |
98 | 106 | } |
99 | 107 |
|
100 | 108 | & .description.animation { |
| 109 | + width: 0; |
101 | 110 | display: inline-block; |
| 111 | + max-width: fit-content; |
| 112 | + margin: 0 auto; |
| 113 | + border-right: 3px solid; |
102 | 114 | animation: |
103 | 115 | typing 2s steps(var(--steps-desc, 30)) forwards, |
104 | 116 | blink 0.5s step-end infinite alternate; |
105 | | - white-space: nowrap; |
106 | | - overflow: hidden; |
107 | | - width: 0; |
108 | | - border-right: 3px solid; |
109 | | - max-width: fit-content; |
110 | | - margin: 0 auto; |
| 117 | + } |
| 118 | + |
| 119 | + & .description:not(.animation) { |
| 120 | + width: auto; |
| 121 | + border-right: none; |
111 | 122 | } |
112 | 123 |
|
113 | 124 | & .description:empty { |
|
0 commit comments