Update content of files

This commit is contained in:
GitHub Action 2022-04-09 12:27:34 +00:00
parent 719d02940c
commit 1bfe1f41dc
31 changed files with 131 additions and 82 deletions

View file

@ -198,9 +198,9 @@
<script src="/js/main-aj.js?57"></script> <script src="/js/main-aj.js?57"></script>
<script src="/js/contest.js?25"></script> <script src="/js/contest.js?25"></script>
<script src="/js/jquery-ui.min.js?1"></script> <script src="/js/jquery-ui.min.js?1"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>ajInit({"version":387,"apiUrl":"\/api?hash=telegram-crawler","unauth":true});</script> <script>ajInit({"version":388,"apiUrl":"\/api?hash=telegram-crawler","unauth":true});</script>
<script id="aj_script">Aj._useScrollHack=true; <script id="aj_script">Aj._useScrollHack=true;
Aj.onLoad(function(state) { Aj.onLoad(function(state) {
function requestConfirmation(event) { function requestConfirmation(event) {

View file

@ -271,7 +271,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitRetinaVideos(); <script>mainInitRetinaVideos();
mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":3,"unsupportedURL":"\/?notgs=1"}); mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":3,"unsupportedURL":"\/?notgs=1"});

View file

@ -271,7 +271,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitRetinaVideos(); <script>mainInitRetinaVideos();
mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":3,"unsupportedURL":"\/?notgs=1"}); mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":3,"unsupportedURL":"\/?notgs=1"});

View file

@ -288,7 +288,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -285,7 +285,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -283,7 +283,7 @@ This way you can quickly see how to [start a Secret Chat](/) on iOS or show one
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -298,7 +298,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -247,7 +247,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -250,7 +250,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -271,7 +271,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -270,7 +270,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -305,7 +305,7 @@ you can also download our Android app directly from [telegram.org](https://teleg
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -268,7 +268,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -264,7 +264,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -301,7 +301,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -310,7 +310,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -286,7 +286,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -329,7 +329,7 @@ TEST
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -340,7 +340,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -220,7 +220,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -259,7 +259,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -261,7 +261,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -297,7 +297,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4}); <script>mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":4});
initScrollVideos(true); initScrollVideos(true);

View file

@ -50,13 +50,9 @@
window.Telegram.WebApp.MainButton.setParams({}); window.Telegram.WebApp.MainButton.setParams({});
} }
} }
document.write('<style>#tg-fixed-container{position:fixed;left:0;right:0;top:0;transform:translateY(100vh)}</style>');
function onViewportChanged(eventType, eventData) { function onViewportChanged(eventType, eventData) {
var el = document.getElementById('tg-fixed-container'); if (eventData.height) {
if (el && eventData.height) { setViewportHeight(eventData.height);
el.style.transform = 'translateY(' + eventData.height + 'px)';
} }
} }
@ -192,24 +188,46 @@
eventHandlers[eventType].splice(index, 1); eventHandlers[eventType].splice(index, 1);
}; };
function setCssProperty(name, value) {
var root = document.documentElement;
if (root && root.style && root.style.setProperty) {
root.style.setProperty('--tg-' + name, value);
}
}
var themeParams = {}; var themeParams = {};
function setThemeParams(theme_params) { function setThemeParams(theme_params) {
var root = document.documentElement, color; var color;
if (root && root.style && root.style.setProperty) {
for (var key in theme_params) { for (var key in theme_params) {
if (color = parseColorToHex(theme_params[key])) { if (color = parseColorToHex(theme_params[key])) {
themeParams[key] = color; themeParams[key] = color;
if (key == 'bg_color') { if (key == 'bg_color') {
var color_scheme = isColorDark(color) ? 'dark' : 'light' var color_scheme = isColorDark(color) ? 'dark' : 'light'
themeParams.color_scheme = color_scheme; themeParams.color_scheme = color_scheme;
root.style.setProperty('--tg-theme-color-scheme', color_scheme); setCssProperty('theme-color-scheme', color_scheme);
} }
key = '--tg-theme-' + key.split('_').join('-'); key = 'theme-' + key.split('_').join('-');
root.style.setProperty(key, color); setCssProperty(key, color);
} }
} }
} }
var viewportHeight = false;
function setViewportHeight(height) {
if (typeof height !== 'undefined') {
viewportHeight = height;
} }
var css_height;
if (viewportHeight !== false) {
css_height = (viewportHeight - mainButtonHeight) + 'px';
} else if (mainButtonHeight) {
css_height = 'calc(100vh - ' + mainButtonHeight + 'px)';
} else {
css_height = '100vh';
}
setCssProperty('viewport-height', css_height);
}
function parseColorToHex(color) { function parseColorToHex(color) {
color += ''; color += '';
@ -260,6 +278,7 @@
return false; return false;
} }
var mainButtonHeight = 0;
var MainButton = (function() { var MainButton = (function() {
var isVisible = false; var isVisible = false;
var isActive = true; var isActive = true;
@ -302,7 +321,7 @@
onEvent('main_button_pressed', onMainButtonPressed); onEvent('main_button_pressed', onMainButtonPressed);
var debugBtn = null, debugBodyBottom, debugBtnStyle = {}; var debugBtn = null, debugBtnStyle = {};
if (initParams.tgWebAppDebug) { if (initParams.tgWebAppDebug) {
debugBtn = document.createElement('tg-main-button'); debugBtn = document.createElement('tg-main-button');
debugBtnStyle = { debugBtnStyle = {
@ -328,8 +347,6 @@
document.addEventListener('DOMContentLoaded', function onDomLoaded(event) { document.addEventListener('DOMContentLoaded', function onDomLoaded(event) {
document.removeEventListener('DOMContentLoaded', onDomLoaded); document.removeEventListener('DOMContentLoaded', onDomLoaded);
document.body.appendChild(debugBtn); document.body.appendChild(debugBtn);
debugBodyBottom = window.getComputedStyle ? window.getComputedStyle(document.body).marginBottom : document.body.style.marginBottom;
debugBodyBottom = parseInt(debugBodyBottom) || 0;
debugBtn.addEventListener('click', onMainButtonPressed, false); debugBtn.addEventListener('click', onMainButtonPressed, false);
}); });
} }
@ -361,11 +378,11 @@
debugBtn.style.backgroundColor = color; debugBtn.style.backgroundColor = color;
debugBtn.style.color = text_color; debugBtn.style.color = text_color;
var fixedContainer = document.getElementById('tg-fixed-container'); mainButtonHeight = (isVisible ? 48 : 0);
if (fixedContainer) { if (document.documentElement) {
fixedContainer.style.top = isVisible ? '-48px' : '0'; document.documentElement.style.marginBottom = mainButtonHeight + 'px';
} }
document.body.style.marginBottom = (debugBodyBottom + (isVisible ? 48 : 0)) + 'px'; setViewportHeight();
} }
} }
@ -586,9 +603,10 @@
if (webAppData.theme_params) { if (webAppData.theme_params) {
setThemeParams(webAppData.theme_params); setThemeParams(webAppData.theme_params);
} }
setViewportHeight();
onEvent('theme_changed', onThemeChanged); onEvent('theme_changed', onThemeChanged);
onEvent('viewport_changed', onViewportChanged); onEvent('viewport_changed', onViewportChanged);
postEvent('web_app_request_viewport'); postEvent('web_app_request_viewport');
// For Windows Phone app // For Windows Phone app

View file

@ -199,6 +199,7 @@ var RLottie = (function () {
curWorkerNum = 0; curWorkerNum = 0;
} }
rlPlayer.options = options; rlPlayer.options = options;
rlPlayer.isVisible = true;
rlPlayer.paused = options.noAutoPlay || false; rlPlayer.paused = options.noAutoPlay || false;
rlPlayer.forcePlayFrames = 0; rlPlayer.forcePlayFrames = 0;
rlPlayer.times = []; rlPlayer.times = [];
@ -225,6 +226,7 @@ var RLottie = (function () {
var focused = window.isFocused ? isFocused() : document.hasFocus(); var focused = window.isFocused ? isFocused() : document.hasFocus();
if (!focused || if (!focused ||
rlPlayer.paused || rlPlayer.paused ||
!rlPlayer.isVisible ||
!rlPlayer.frameCount) { !rlPlayer.frameCount) {
return false; return false;
} }
@ -366,6 +368,12 @@ var RLottie = (function () {
} }
} }
rlottie.setVisible = function(el, visible) {
if (el && el.rlPlayer) {
el.rlPlayer.isVisible = visible;
}
}
rlottie.destroyWorkers = function() { rlottie.destroyWorkers = function() {
destroyWorkers(); destroyWorkers();
} }

View file

@ -271,7 +271,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitRetinaVideos(); <script>mainInitRetinaVideos();
mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":3,"unsupportedURL":"\/?notgs=1"}); mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":3,"unsupportedURL":"\/?notgs=1"});

View file

@ -271,7 +271,7 @@
</div> </div>
</div> </div>
<script src="/js/main.js?44"></script> <script src="/js/main.js?44"></script>
<script src="/js/tgsticker.js?26"></script> <script src="/js/tgsticker.js?27"></script>
<script>mainInitRetinaVideos(); <script>mainInitRetinaVideos();
mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":3,"unsupportedURL":"\/?notgs=1"}); mainInitTgStickers({"maxDeviceRatio":2,"cachingModulo":3,"unsupportedURL":"\/?notgs=1"});

View file

@ -9,7 +9,7 @@
<meta name="MobileOptimized" content="176" /> <meta name="MobileOptimized" content="176" />
<meta name="HandheldFriendly" content="True" /> <meta name="HandheldFriendly" content="True" />
<meta name="robots" content="noindex, nofollow" /> <meta name="robots" content="noindex, nofollow" />
<script src="https://tg.dev/js/telegram-webview.js?7"></script> <script src="https://tg.dev/js/telegram-webview.js?8"></script>
<script> <script>
function setThemeClass() { function setThemeClass() {
document.documentElement.className = document.documentElement.style.getPropertyValue('--tg-theme-color-scheme'); document.documentElement.className = document.documentElement.style.getPropertyValue('--tg-theme-color-scheme');
@ -17,7 +17,7 @@
Telegram.WebView.onEvent('theme_changed', setThemeClass); Telegram.WebView.onEvent('theme_changed', setThemeClass);
setThemeClass(); setThemeClass();
</script> </script>
<link href="/css/cafe.css?13" rel="stylesheet"> <link href="/css/cafe.css?14" rel="stylesheet">
</head> </head>
<body style="display:none"> <body style="display:none">
<section class="cafe-page cafe-items"> <section class="cafe-page cafe-items">
@ -436,12 +436,12 @@
</div> </div>
</div> </div>
</section> </section>
<div id="tg-fixed-container"> <div class="cafe-status-wrap">
<div class="cafe-status js-status"></div> <div class="cafe-status js-status"></div>
</div> </div>
<script src="https://tg.dev/js/jquery.min.js"></script> <script src="https://tg.dev/js/jquery.min.js"></script>
<script src="https://tg.dev/js/tgsticker.js?26"></script> <script src="https://tg.dev/js/tgsticker.js?27"></script>
<script src="/js/cafe.js?13"></script> <script src="/js/cafe.js?14"></script>
<script>Cafe.init({"apiUrl":"\/cafe\/api","userId":0,"userHash":null});</script> <script>Cafe.init({"apiUrl":"\/cafe\/api","userId":0,"userHash":null});</script>
</body> </body>
</html> </html>

View file

@ -1,20 +1,5 @@
@font-face {
font-display: swap;
font-family: 'SF-Pro-Rounded';
src: local('SF Pro Rounded Medium'),
url('fonts/SF-Pro-Rounded-Medium.otf') format('opentype');
font-weight: 500;
}
@font-face {
font-display: swap;
font-family: 'SF-Pro-Rounded';
src: local('SF Pro Rounded Bold'),
url('fonts/SF-Pro-Rounded-Bold.otf') format('opentype');
font-weight: 700;
}
body { body {
font-family: 'SF-Pro-Rounded', sans-serif; font-family: var(--default-font);
font-size: 13px; font-size: 13px;
line-height: 16px; line-height: 16px;
font-weight: 500; font-weight: 500;
@ -26,10 +11,12 @@ body {
width: 1px; width: 1px;
min-width: 100%; min-width: 100%;
--default-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
--block-bg-color: var(--tg-theme-bg-color); --block-bg-color: var(--tg-theme-bg-color);
--bg-color: #ebedf0; --bg-color: #ebedf0;
--animation: .15s ease; --animation: .15s ease;
--page-animation: .3s ease; --page-animation-duration: .3s;
--page-animation: var(--page-animation-duration) ease;
--status-height: 48px; --status-height: 48px;
--accent-color: #31b545; --accent-color: #31b545;
--main-color: #f8a917; --main-color: #f8a917;
@ -79,11 +66,12 @@ body.closed .cafe-page {
max-width: 480px; max-width: 480px;
justify-content: space-around; justify-content: space-around;
align-content: flex-end; align-content: flex-end;
transition: -webkit-filter var(--animation), max-height var(--page-animation); transition: max-height var(--page-animation), opacity var(--page-animation);
background-color: var(--block-bg-color); background-color: var(--block-bg-color);
} }
body.order-mode .cafe-items { body.order-mode .cafe-items {
max-height: 0 !important; max-height: 0 !important;
opacity: 0 !important;
} }
.cafe-items:after { .cafe-items:after {
content: ''; content: '';
@ -166,7 +154,7 @@ button {
button, button,
.cafe-item-counter { .cafe-item-counter {
display: inline-block; display: inline-block;
font-family: 'SF-Pro-Rounded', sans-serif; font-family: var(--default-font);
font-weight: 700; font-weight: 700;
font-size: 14px; font-size: 14px;
line-height: 18px; line-height: 18px;
@ -257,6 +245,13 @@ button,
height: 14px; height: 14px;
} }
.cafe-status-wrap {
position: fixed;
left: 0;
right: 0;
top: 0;
transform: translateY(var(--tg-viewport-height, 100vh));
}
.cafe-status { .cafe-status {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@ -287,8 +282,8 @@ button,
} }
.cafe-order-overview { .cafe-order-overview {
display: none; /*temp*/ display: none;
font-family: 'SF-Pro-Rounded', sans-serif; font-family: var(--default-font);
background-color: var(--bg-color); background-color: var(--bg-color);
transition: opacity var(--page-animation); transition: opacity var(--page-animation);
opacity: 0; opacity: 0;
@ -367,7 +362,7 @@ body.order-mode .cafe-order-overview {
margin-top: 14px; margin-top: 14px;
} }
.cafe-text-field { .cafe-text-field {
font-family: 'SF-Pro-Rounded', sans-serif; font-family: var(--default-font);
font-size: 17px; font-size: 17px;
line-height: 21px; line-height: 21px;
font-weight: 500; font-weight: 500;
@ -404,7 +399,7 @@ body.order-mode .cafe-order-overview {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.cafe-text-field-hint { .cafe-text-field-hint {
font-family: 'SF-Pro-Rounded', sans-serif; font-family: var(--default-font);
font-size: 14px; font-size: 14px;
line-height: 18px; line-height: 18px;
font-weight: 500; font-weight: 500;

View file

@ -8,7 +8,7 @@
<meta name="MobileOptimized" content="176" /> <meta name="MobileOptimized" content="176" />
<meta name="HandheldFriendly" content="True" /> <meta name="HandheldFriendly" content="True" />
<meta name="robots" content="noindex,nofollow" /> <meta name="robots" content="noindex,nofollow" />
<script src="https://telegram.org/js/telegram-webview.js?7"></script> <script src="https://telegram.org/js/telegram-webview.js?8"></script>
<script> <script>
function setThemeClass() { function setThemeClass() {
document.documentElement.className = document.documentElement.style.getPropertyValue('--tg-theme-color-scheme'); document.documentElement.className = document.documentElement.style.getPropertyValue('--tg-theme-color-scheme');

View file

@ -193,8 +193,25 @@ var Cafe = {
}, },
toggleMode: function(mode_order) { toggleMode: function(mode_order) {
Cafe.modeOrder = mode_order; Cafe.modeOrder = mode_order;
var anim_duration, match;
try {
anim_duration = window.getComputedStyle(document.body).getPropertyValue('--page-animation-duration');
if (match = /([\d\.]+)(ms|s)/.exec(anim_duration)) {
anim_duration = +match[1];
if (match[2] == 's') {
anim_duration *= 1000;
}
} else {
anim_duration = 400;
}
} catch (e) {
anim_duration = 400;
}
if (mode_order) { if (mode_order) {
var height = $('.cafe-items').height(); var height = $('.cafe-items').height();
$('.js-item-lottie').each(function() {
RLottie.setVisible(this, false);
});
$('.cafe-order-overview').show(); $('.cafe-order-overview').show();
$('.cafe-items').css('maxHeight', height).redraw(); $('.cafe-items').css('maxHeight', height).redraw();
$('body').addClass('order-mode'); $('body').addClass('order-mode');
@ -202,12 +219,23 @@ var Cafe = {
autosize.update(this); autosize.update(this);
}); });
Telegram.WebApp.expand(); Telegram.WebApp.expand();
setTimeout(function() {
$('.js-item-lottie').each(function() {
RLottie.setVisible(this, true);
});
}, anim_duration);
} else { } else {
$('.js-item-lottie').each(function() {
RLottie.setVisible(this, false);
});
$('body').removeClass('order-mode'); $('body').removeClass('order-mode');
setTimeout(function() { setTimeout(function() {
$('.cafe-items').css('maxHeight', ''); $('.cafe-items').css('maxHeight', '');
$('.cafe-order-overview').hide(); $('.cafe-order-overview').hide();
}, 400); $('.js-item-lottie').each(function() {
RLottie.setVisible(this, true);
});
}, anim_duration);
} }
Cafe.updateMainButton(); Cafe.updateMainButton();
}, },