Skip to content

Commit 1057476

Browse files
committed
feat:BlogBox1 finish
1 parent ca1fb38 commit 1057476

File tree

4 files changed

+66
-13
lines changed

4 files changed

+66
-13
lines changed

app/globals.css

+34
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242
font-style: normal;
4343
}
4444

45+
@font-face {
46+
font-family: TT;
47+
src: url(/fonts/TT.ttf);
48+
font-weight: normal;
49+
font-style: normal;
50+
}
51+
4552
@keyframes fade-in {
4653
from {
4754
opacity: 0;
@@ -55,3 +62,30 @@
5562
animation: fade-in 0.5s ease forwards;
5663
}
5764

65+
@keyframes triangle {
66+
0% {
67+
border-radius: 0px;
68+
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
69+
}
70+
25% {
71+
border-radius: 20px;
72+
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
73+
}
74+
50% {
75+
border-radius: 0px;
76+
clip-path: polygon(0 0, 100% 0, 50% 50%, 0 0);
77+
}
78+
75% {
79+
border-radius: 20px;
80+
clip-path: polygon(0 30%, 0 0, 30% 0,80% 80%);
81+
}
82+
}
83+
84+
.animate-triangle {
85+
width: 100px;
86+
height: 100px;
87+
background-color: #fff;
88+
border-radius: 0px;
89+
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
90+
animation: triangle 12s ease forwards infinite;
91+
}

app/layout.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export default function RootLayout({
3838
font-style: normal;
3939
font-display: swap
4040
}
41+
42+
@font-face {
43+
font-family: TT;
44+
src: url(./fonts/TT.ttf);
45+
font-weight: normal;
46+
font-style: normal;
47+
font-display: swap
48+
}
4149
`}</style>
4250
{children}
4351
</body>

app/page.tsx

+24-13
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ const IndexBox = () =>{
1212
const handleResize = () => {
1313
setIsMobile(window.innerWidth <= 768); // 判断屏幕宽度是否小于等于768px
1414
};
15-
1615
window.addEventListener("resize", handleResize);
1716
handleResize(); // 初始检查设备类型
18-
1917
return () => {
2018
window.removeEventListener("resize", handleResize);
2119
};
@@ -63,13 +61,13 @@ const IndexBox = () =>{
6361
>
6462

6563
<div
66-
className='text-[#eee] text-[clamp(48px,6vw,120px)] select-none flex flex-col justify-center mt-[5vw]'
64+
className='text-[#eee] text-[clamp(48px,6vw,120px)] select-none flex flex-col justify-center mt-[5vw] items-center md:items-start'
6765
style={{
6866
fontFamily:'SuperLobster',
6967
}}
7068
>
71-
<div className='flex flex-wrap mx-[5rem]'>Hi <div className='hover:rotate-60 transition'>👋</div> Here,</div>
72-
<div className='flex flex-wrap mx-[5rem]'>
69+
<div className='flex flex-wrap mx-[5rem] justify-center'>Hi <div className='transition-all hover:rotate-[60deg]'>👋</div> Here,</div>
70+
<div className='flex flex-wrap mx-[5rem] justify-center'>
7371
<div>Task</div>
7472
<div>Manager</div>
7573
<div>OL.</div>
@@ -92,23 +90,36 @@ const IndexBox = () =>{
9290
const BlogBox = () => {
9391
return (
9492
<div
95-
className="w-4/5 my-[3rem] bg-[#a9a9a9] relative flex flex-wrap"
93+
className="w-4/5 mt-[5rem] mb-[20rem] bg-[#a9a9a9] relative flex flex-wrap justify-center"
9694
>
9795
<div
98-
className='absolute top-[-6rem] left-2 text-[100px] font-bold'
96+
className='absolute top-[-4.5rem] md:top-[-6rem] left-2 text-[70px] md:text-[100px] font-bold z-50'
9997
style={{
10098
fontFamily:'KGPerfectPenmanship'
10199
}}
102100
>
103101
Blog.
104102
</div>
105-
<div
106-
className='w-1/2 min-w-[300px] h-[600px] bg-[#616161]'
103+
<a
104+
className='w-full h-[500px] md:h-[700px] bg-[#314964] flex justify-center items-center lg:w-1/2 flex-col group overflow-hidden relative'
105+
href='https://taskmanagerol.github.io/Blog/2023/06/24/CSS/#CSS%E4%B8%89%E8%A7%92%E5%BD%A2%E7%BB%98%E5%88%B6'
106+
target='_blank'
107107
>
108-
109-
</div>
108+
<div
109+
className=' w-4/5 text-[#fff] text-[34px] md:text-[46px] font-black tracking-[-0.3px] font-[TT] transition-all group-hover:mb-2 flex flex-wrap justify-center items-center break-words text-center mt-[40px]'
110+
>
111+
Drawing a triangle or even a polygon with CSS
112+
</div>
113+
<div className='h-[175px] md:h-[250px] flex justify-center items-center'>
114+
<div className='animate-triangle'></div>
115+
</div>
116+
<div className='w-4/5 text-[#f4f5f6] tracking-[-0.3px] transition-all group-hover:mt-2 text-center mb-[40px]'>Stop using symbols.Complete a standard polygon by modifying the border, background attributes and other options</div>
117+
<div className='absolute bg-black w-[80px] md:w-[120px] h-[40px] md:h-[60px] right-[10px] md:right-[40px] top-[-60px] transition-all ease-in-out duration-200 text-[#fff] flex justify-center items-center group-hover:top-0'>
118+
<div className='mb-[20px] opacity-0 transition-all duration-200 ease-in group-hover:opacity-100 group-hover:mb-0 text-[12px] tracking-[-0.3px]'>Read more</div>
119+
</div>
120+
</a>
110121
<div
111-
className='w-1/2 min-w-[300px] h-[600px] bg-[#616161]'
122+
className='w-full min-w-[300px] h-[600px] bg-[#2b2f3c] lg:w-1/2'
112123
>
113124

114125
</div>
@@ -122,7 +133,7 @@ const ProjectBox = () => {
122133
className="w-4/5 h-[700px] my-[3rem] bg-[#a9a9a9] relative flex flex-wrap"
123134
>
124135
<div
125-
className='absolute top-[-6rem] left-2 text-[100px] font-bold'
136+
className='absolute top-[-5rem] left-2 text-[80px] font-bold md:text-[100px] md:top-[-6rem]'
126137
style={{
127138
fontFamily:'KGPerfectPenmanship'
128139
}}

public/fonts/TT.ttf

103 KB
Binary file not shown.

0 commit comments

Comments
 (0)