Skip to content

Commit c3569b1

Browse files
committed
feat: add thumbnail styles for displaying screenshots
1 parent f3d436b commit c3569b1

File tree

3 files changed

+99
-17
lines changed

3 files changed

+99
-17
lines changed

css/style.css

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,65 @@ a:hover {
4747
}
4848

4949
.img {
50-
max-width: 100%;
50+
max-width: 250px;
5151
height: auto;
5252
border-radius: 8px;
53+
transition: transform 0.3s;
54+
cursor: pointer;
55+
}
56+
57+
.img:hover {
58+
transform: scale(1.1);
59+
}
60+
61+
.thumbnail {
62+
object-fit: contain;
63+
width: 33%;
64+
height: auto;
65+
border-radius: 8px;
66+
cursor: pointer;
67+
transition: transform 0.3s;
68+
}
69+
70+
.thumbnail:hover {
71+
transform: scale(1.1);
72+
}
73+
74+
.modal {
75+
display: none;
76+
position: fixed;
77+
z-index: 1000;
78+
left: 0;
79+
top: 0;
80+
width: 100%;
81+
height: 100%;
82+
overflow: auto;
83+
background-color: rgba(0, 0, 0, 0.8);
84+
}
85+
86+
.modal-content {
87+
display: block;
88+
margin: auto;
89+
max-width: 90%;
90+
max-height: 90%;
91+
border-radius: 8px;
92+
}
93+
94+
.close {
95+
position: absolute;
96+
top: 20px;
97+
right: 30px;
98+
color: #fff;
99+
font-size: 40px;
100+
font-weight: bold;
101+
cursor: pointer;
102+
}
103+
104+
.close:hover,
105+
.close:focus {
106+
color: #f00;
107+
text-decoration: none;
108+
cursor: pointer;
53109
}
54110

55111
.pre {

index.html

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878

7979
<!-- Main content -->
8080
<div class="main-content">
81+
<div id="modal" class="modal" onclick="closeModal()">
82+
<span class="close">&times;</span>
83+
<img id="modal-image" class="modal-content" alt="Full size image">
84+
</div>
8185
<h1 class="h1">How to connect to WebTrit demo environment to jump-start the development of your WebRTC voice
8286
or
8387
video chat application</h1>
@@ -96,8 +100,7 @@ <h2 class="h2">Sign up for WebTrit demo account</h2>
96100
other
97101
parameters, so it makes sense to follow there. 🙂</p>
98102
<div class="image-container">
99-
<img src="images/developer_access_1.png" alt="code example" class="img">
100-
<img src="images/developer_access_2.png" alt="code example" class="img">
103+
<img src="images/developer_access_1.png" class="thumbnail" onclick="openModal(this.src)">
101104
</div>
102105
<p class="Paragraph">In the examples in the rest of this document we will use <code>{CORE_HOST}</code>
103106
as the API server, but please use the actual API server address provided in the
@@ -124,24 +127,29 @@ <h3 class="h3">Test using WebDialer</h3>
124127
https://dialer.demo.webtrit.com/login?tenant={TENANT_ID}&email={USERNAME}.
125128
</a> A one-time password (OTP) will be sent to your email.
126129
</p>
127-
<img src="images/one_time_password.png" alt="WebTrit dialer" class="img">
130+
<div class="image-container">
131+
<img src="images/one_time_password.png" class="thumbnail" onclick="openModal(this.src)">
132+
</div>
128133
<p class="Paragraph">Once logged in you can call WebTrit contact center</p>
129-
<img src="images/contact_center_1.png" alt="WebTrit contact center" class="img">
134+
<div class="image-container">
135+
<img src="images/contact_center_1.png" class="thumbnail" onclick="openModal(this.src)">
136+
</div>
130137
<p class="Paragraph">The great thing about the WebTrit Dialer is that you can explore <a
131138
href="https://bit.ly/WebDialerSourceCode" target="_blank">the source code</a> and monitor the
132139
communication
133140
between the application and WebTrit back-end, so you can use it as an example for your own application.
134141
</p>
135-
<img src="images/contact_center_2.png" alt="WebTrit contact center" class="img">
142+
<div class="image-container">
143+
<img src="images/contact_center_2.png" alt="WebTrit contact center" class="thumbnail"
144+
onclick="openModal(this.src)">
145+
</div>
136146
<p class="Paragraph">Alternatively, you download the WebTrit app for smartphones and test the functionality
137-
on
138-
a mobile device:</p>
147+
on a mobile device:</p>
139148
<div class="image-container">
140149
<a href="https://bit.ly/WebTritDemoIphone" target="_blank">
141150
<img src="https://webtrit.com/wp-content/uploads/2023/10/WebTrit-button-IOS.png"
142151
alt="WebTrit iOS mobile app" class="img">
143152
</a>
144-
145153
<a href="https://bit.ly/WebTritDemoAndroid" target="_blank">
146154
<img src="https://webtrit.com/wp-content/uploads/2023/10/WebTrit-button-Android.png"
147155
alt="Android WebTrit mobile app" class="img">
@@ -153,9 +161,7 @@ <h2 class="h2">Authenticate with WebTrit back-end and obtain a session token</h2
153161
WebTrit back-end - this is done by sending an HTTP POST request to the <samp>/session</samp> endpoint of
154162
<a href="https://bit.ly/WebTritCoreAPI" target="_blank">WebTrit core API</a>. Make sure you insert the
155163
appropriate values into tenant_id, username and password. Also, create your own name for your
156-
application
157-
and
158-
use it as the value for the identifier parameter.
164+
application and use it as the value for the identifier parameter.
159165
</p>
160166
<pre class="pre">
161167
curl -X 'POST' \
@@ -171,7 +177,9 @@ <h2 class="h2">Authenticate with WebTrit back-end and obtain a session token</h2
171177
"user_ref": "<span style="color: red;">{USERNAME}</span>"
172178
}'</pre>
173179
<p class="Paragraph">Example:</p>
174-
<img src="images/curl_example_1.png" alt="code example" class="img">
180+
<div class="image-container">
181+
<img src="images/curl_example_1.png" alt="code example" class="thumbnail" onclick="openModal(this.src)">
182+
</div>
175183
<p class="Paragraph">When authentication is successful, you will receive the access token to be used to
176184
authenticate further requests to the Core API - as well as requests to Signaling API.</p>
177185
<h2 class="h2">Test the core API
@@ -197,7 +205,9 @@ <h2 class="h2">Test the core API
197205
'https://<span style="color: red;">{CORE_HOST}</span>/tenant/<span style="color: red;">{TENANT_ID}</span>/api/v1/user/contacts' \
198206
-H 'accept: application/json' \
199207
-H 'Authorization: Bearer <span style="color: red;">&lt;token&gt;</span>'</pre>
200-
<img src="images/curl_example_2.png" alt="code example" class="img">
208+
<div class="image-container">
209+
<img src="images/curl_example_2.png" alt="code example" class="thumbnail" onclick="openModal(this.src)">
210+
</div>
201211
<h2 class="h2">Jump-start your development using the WebTrit dialer</h2>
202212
<p class="Paragraph">
203213
If you want to develop a web application for WebRTC voice/video calling - you do not have to start from
@@ -237,7 +247,9 @@ <h2 class="h2">Connect to WebTrit signaling API
237247
</p>
238248
<pre class="pre">
239249
wss://<span style="color: red;">{CORE_HOST}</span>/tenant/<span style="color: red;">{TENANT_ID}</span>/signaling/v1?token=XCP.fzEQZz8Ni_sElW5JWQOW09XNmvG8r5lqZoTOh0N9O_z0lLWdK6Gi-CDsQUo07-yeKu8vzjdDPxKKIhgQJp5Nij-4BQIDn4O-lygCDdWBqmN49kvR70J3e0HgICth7FgttuQ</pre>
240-
<img src="images/signaling_example.png" alt="code example" class="img">
250+
<div class="image-container">
251+
<img src="images/signaling_example.png" alt="code example" class="thumbnail" onclick="openModal(this.src)">
252+
</div>
241253
<h2 class="h2">Initiate a phone call</h2>
242254
<p class="Paragraph">After the session to <a
243255
href="https://github.com/WebTrit/webtrit_docs/blob/main/signaling/index.md" target="_blank">WebTrit
@@ -260,8 +272,10 @@ <h2 class="h2">Initiate a phone call</h2>
260272
right corner of the app.
261273
</p>
262274
<div class="image-container">
263-
<img src="images/app_screenshot_1.jpg" alt="WebTrit screenshot" class="img">
264-
<img src="images/app_screenshot_2.jpg" alt="WebTrit screenshot" class="img">
275+
<img src="images/app_screenshot_1.jpg" alt="WebTrit screenshot" class="thumbnail"
276+
onclick="openModal(this.src)">
277+
<img src="images/app_screenshot_2.jpg" alt="WebTrit screenshot" class="thumbnail"
278+
onclick="openModal(this.src)">
265279
</div>
266280
<h2 class="h2">Logging out</h2>
267281
<p class="Paragraph">When you are finished, it is strongly recommended to explicitly close the session -

scripts/main.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ document.addEventListener('DOMContentLoaded', () => {
1717
replacePlaceholder('{TENANT_ID}', getQueryParam('tenant_id', DEFAULT_TENANT_ID));
1818
replacePlaceholder('{USERNAME}', getQueryParam('username', DEFAULT_USERNAME));
1919
});
20+
21+
function openModal(imageSrc) {
22+
const modal = document.getElementById('modal');
23+
const modalImage = document.getElementById('modal-image');
24+
modal.style.display = 'block';
25+
modalImage.src = imageSrc;
26+
}
27+
28+
function closeModal() {
29+
const modal = document.getElementById('modal');
30+
modal.style.display = 'none';
31+
}

0 commit comments

Comments
 (0)