-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
249 lines (236 loc) · 7.01 KB
/
index.html
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html>
<html>
<head>
<title>Chat UI kit</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<style type="text/css">
:root {
--font-primary: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
--text-primary: rgba(0, 0, 0, 1);
--text-secondary: rgba(0, 0, 0, .5);
--bg-primary: #ffffff;
--bg-secondary: #f5f5f5;
--border: rgba(0, 0, 0, 0.1);
--font-size-regular: 16px;
--font-size-large: 20px;
--font-size-small: 14px;
}
:root body.dark-mode {
--text-primary: rgba(255, 255, 255, 1);
--text-secondary: rgba(255, 255, 255, .5);
--bg-primary: #161616;
--bg-secondary: #1c1c1c;
--border: rgba(255, 255, 255, 0.1);
}
*, *::before, *::after {
box-sizing: border-box;
list-style: none;
font-synthesis: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
line-height: 1.4;
letter-spacing: -.03em;
padding: 0;
margin: 0;
scroll-behavior: smooth;
-webkit-text-size-adjust: 100%;
font-family: var(--font-primary);
background: var(--bg-primary);
color: var(--text-primary);
}
.container {
max-width: 460px;
padding: 0 20px;
width: 100%;
margin: 20vh auto 6vh auto;
}
.message-group {
display: flex;
flex-direction: column;
gap: 4px;
}
.bubble {
border-radius: 24px;
padding: 12px 20px;
width: fit-content;
font-size: var(--font-size-regular);
background: var(--bg-secondary);
opacity: 0;
transition: opacity 1s ease;
}
.bubble.left {
margin-left: 0;
margin-right: auto;
border-top-left-radius: 0;
}
.bubble.right {
border-top-left-radius: 24px;
border-top-right-radius: 0;
}
.bubble.right + .bubble.right, .bubble.left + .bubble.left {
border-radius: 24px;
}
.bubble.right {
margin-left: auto;
margin-right: 0;
background: #1c1c1c;
color: #ffffff;
}
.avatar {
display: flex;
gap: 10px;
align-items; center;
margin: 10px 0;
}
.avatar__img {
height: 24px;
width: 24px;
border-radius: 24px;
overflow: hidden;
}
.avatar__name {
font-size: var(--font-size-small);
color: var(--text-secondary);
line-height: 24px;
}
a {
text-decoration: none;
color: #06c;
}
.single-image {
width: 70%;
display: block;
padding: 16px 0;
margin: 0;
position: relative;
opacity: 0;
transition: opacity 1s ease;
}
.single-image img {
width: 100%;
display: block;
height: auto;
border-radius: 24px;
overflow: hidden;
}
.single-image figcaption {
width: 100%;
display: block;
margin-top: 8px;
font-size: var(--font-size-small);
color: var(--text-secondary);
padding-left:24px;
position: relative;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.single-image figcaption:before {
content: "";
height: 2px;
width: 16px;
border-radius: 2px;
background: var(--border);
left: 0;
top: 10px;
position: absolute;
}
.single-image__link {
position: absolute;
top: 45%;
right: -50px;
height: 40px;
width: 40px;
border-radius: 40px;
border: 1px solid var(--border);
text-align: center;
line-height: 38px;
transition: border ease 0.2s;
}
.single-image__link:hover {
border-color: #06c;
}
.interstitial {
font-size: var(--font-size-small);
color: var(--text-secondary);
margin: 32px 0;
text-align: center;
opacity: 0;
transition: opacity 1s ease;
}
.visible {
opacity: 1;
}
</style>
</head>
<!-- BODY -->
<body class="">
<div class="container">
<div class="avatar">
<img src="https://avatars.githubusercontent.com/u/10632534?v=4" class="avatar__img">
<div class="avatar__name">Nicolas</div>
</div>
<div class="message-group">
<div class="bubble left">👋 Hi there</div>
<div class="bubble left">it's weird but hear me out...</div>
<div class="bubble left">I've designed lots of conversational UI over the years</div>
<div class="bubble left">mimicking mobile native UI on the web is not new. Nowadays there is a ton of ultra sophisticated frontend tools that allow you to build this, and a million other things. Dependencies, complex setup, hard to truly customize... overkill.</div>
<div class="bubble left">that's why I made this tiny thing</div>
</div>
<div class="interstitial">3 min ago</div>
<div class="message-group">
<div class="bubble right">Yeah but what actually is the thing?</div>
<div class="bubble right">TLDR plz</div>
<div class="bubble left">one file 🖖</div>
<div class="bubble left">just HTML and CSS</div>
<div class="bubble left">Dark mode</div>
<div class="bubble left">Text, emojis, links</div>
<div class="bubble left">Images</div>
<figure class="single-image">
<img src="https://slrncl.com/moments/photos/201803-sf-2.jpg">
<figcaption>Ocean Beach, San Francisco, CA</figcaption>
<a href="https://slrncl.com/moments/" class="single-image__link" target="_blank">↗</a>
</figure>
<div class="bubble left">it even has a scroll reveal effect</div>
<div class="bubble right">That's it?</div>
<div class="bubble left">Yep</div>
<div class="bubble left">The idea is to simply tell a story like if you were texting a friend, on a webpage</div>
<div class="bubble left">I think it's cool</div>
<div class="bubble left">(of course it's responsive)</div>
<div class="bubble left">more philosophically, I believe that most websites are just people and company trying to put their voice out there. The web has weird standards and websites are trying to seduce us. What if you told your story in this format instead. What would it look like? Would it be convincing?</div>
<div class="bubble left">You can try it in 2min</div>
<div class="bubble left">there is something to this format, it's familiar and creates an instictive kind of storytelling, like a text thread</div>
<div class="bubble left">Now you can text the whole internet</div>
<div class="bubble right">How can I get it?</div>
<div class="bubble left">It's Open Source <a href="https://github.com/nsolerieu/text-the-internet">on github</a></div>
<div class="bubble right">How do I set this up?</div>
<div class="bubble right">(I hope it's easy)</div>
<div class="bubble left">Yep.</div>
<div class="bubble left">download the index.html, change the content, open in a browser...</div>
<div class="bubble left">Tada 🎉</div>
</div>
<div class="interstitial">10 sec ago</div>
<div class="message-group">
<div class="bubble left">Remember: with great power comes great responsabilities</div>
<div class="bubble left">Cheers</div>
<div class="bubble left">🤙</div>
</div>
</div>
</div>
</body>
<script type="text/javascript">
const targets = document.querySelectorAll('.bubble, .interstitial, .single-image');
const observer = new IntersectionObserver(
entries => {
entries.forEach(entry => {
entry.target.classList.toggle("visible", entry.isIntersecting)
})
},
{ threshold: .2}
);
targets.forEach( target => {
observer.observe(target)
});
</script>