You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/index.astro
+81-12Lines changed: 81 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,11 @@ import Gallery from "../components/Gallery.astro";
27
27
</a>
28
28
</div>
29
29
30
-
<ahref="/cal"class="contact-btn">Contact</a>
30
+
<divclass="contact-section">
31
+
<p>
32
+
hey i'm <inputtype="text"id="contact-name"placeholder="steve jobs"size="1" /> and my email is <inputtype="email"id="contact-email"placeholder="sjobs@apple.com"size="1" />. i'd love to <ahref="/cal"id="chat-btn"class="btn">chat</a> !
33
+
</p>
34
+
</div>
31
35
32
36
<Gallery />
33
37
</Base>
@@ -45,17 +49,82 @@ import Gallery from "../components/Gallery.astro";
45
49
.social a:hover {
46
50
color: #1a1a1a;
47
51
}
48
-
.contact-btn {
49
-
display: inline-block;
50
-
margin-top: 1rem;
51
-
padding: 0.5rem 1rem;
52
-
background: #1a1a1a;
53
-
color: #fff;
54
-
border-radius: 4px;
55
-
text-decoration: none;
56
-
transition: background 0.2s;
52
+
.contact-section {
53
+
margin-top: 1.5rem;
54
+
padding-top: 1.5rem;
55
+
border-top: 1px solid #eee;
56
+
}
57
+
.contact-section p {
58
+
margin: 0;
59
+
line-height: 2;
60
+
}
61
+
.contact-section input {
62
+
border: none;
63
+
border-bottom: 1px solid #ccc;
64
+
padding: 0;
65
+
font-size: inherit;
66
+
font-family: inherit;
67
+
font-weight: 500;
68
+
background: transparent;
69
+
}
70
+
.contact-section .btn {
71
+
padding: 0.1rem 0.35rem;
72
+
font-size: 0.85rem;
73
+
vertical-align: middle;
74
+
line-height: 1.2;
75
+
position: relative;
76
+
top: -2px;
57
77
}
58
-
.contact-btn:hover {
59
-
background: #333;
78
+
.contact-section input:focus {
79
+
outline: none;
80
+
}
81
+
.contact-section input::placeholder {
82
+
color: #999;
60
83
}
61
84
</style>
85
+
86
+
<script>
87
+
const nameInput = document.getElementById('contact-name') as HTMLInputElement;
88
+
const emailInput = document.getElementById('contact-email') as HTMLInputElement;
89
+
const chatBtn = document.getElementById('chat-btn') as HTMLAnchorElement;
90
+
91
+
function updateChatLink() {
92
+
const params = new URLSearchParams();
93
+
if (nameInput.value) params.set('name', nameInput.value);
94
+
if (emailInput.value) params.set('email', emailInput.value);
0 commit comments