Skip to content

Commit 761b278

Browse files
committed
Added hover effects and updated design
1 parent 4d0b076 commit 761b278

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

src/pages/activities/getDefinition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const SearchWord = () => {
5656
{definition.map((def, index) => (
5757
<div className="word-definition">
5858
<div key={index}><em>Definition: </em>{def.definition}</div>
59-
<div key={index} style={{marginTop: '10px'}}><em>Example: </em>{def.example}</div>
59+
<div key={index}><em>Example: </em>{def.example}</div>
6060
</div>
6161
))}
6262
</div>

src/styles/pages/activities/getDefinition.css

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,54 @@
1313

1414
.word-definition{
1515
font-family: "Fira Code Light";
16-
font-style: italic;
16+
background: rgb(174,171,213);
17+
background: linear-gradient(90deg, rgba(174,171,213,1) 0%, rgba(255,255,255,1) 51%, rgba(152,238,255,1) 100%); font-style: italic;
1718
font-size: 20px;
19+
text-wrap: wrap;
20+
overflow: hidden;
1821
margin: 1rem auto;
1922
border: 2px solid black;
2023
border-radius: 10px;
24+
transition: 0.5s all;
25+
cursor: pointer;
26+
-ms-overflow-style: none; /* Internet Explorer 10+ */
27+
scrollbar-width: none; /* Firefox */
28+
animation: 2s anim-lineUp ease-out;
29+
}
30+
31+
.word-definition em{
32+
color: #0773ff;
33+
}
34+
35+
.word-definition div{
36+
margin: 1rem;
37+
}
38+
39+
.word-definition::-webkit-scrollbar {
40+
display: none; /* Safari and Chrome */
41+
}
42+
43+
.word-definition:hover {
44+
transform: scale(1.1);
45+
overflow: auto;
46+
}
47+
48+
@keyframes anim-lineUp {
49+
0% {
50+
opacity: 0;
51+
transform: translateY(80%);
52+
}
53+
20% {
54+
opacity: 0;
55+
}
56+
50% {
57+
opacity: 1;
58+
transform: translateY(0%);
59+
}
60+
100% {
61+
opacity: 1;
62+
transform: translateY(0%);
63+
}
2164
}
2265

2366
.word-content {

0 commit comments

Comments
 (0)