Update layout UI

This commit is contained in:
cuom1999 2023-02-07 23:14:48 -06:00
parent 993309d56b
commit 2ee279098f
11 changed files with 193 additions and 135 deletions

View file

@ -36,7 +36,7 @@ img {
} }
* { * {
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
} }
.full { .full {
@ -327,7 +327,7 @@ nav {
a { a {
color: black !important; color: black !important;
} }
a, button { a, button {
padding: 8px 20px 8px 8px !important; padding: 8px 20px 8px 8px !important;
font-size: 0.8em; font-size: 0.8em;
@ -377,7 +377,7 @@ hr {
} }
#content { #content {
margin: 4.5em auto 1em auto; margin: 3.2em auto 1em auto;
// Header // Header
width: 90%; width: 90%;
@ -390,6 +390,12 @@ hr {
} }
} }
#content.wrapper {
background: white;
padding: 2em;
border-radius: 1em;
}
footer { footer {
text-align: center; text-align: center;
height: 40px; height: 40px;
@ -558,7 +564,7 @@ noscript #noscript {
margin: 0 auto; margin: 0 auto;
border-right: 1px solid $border_gray; border-right: 1px solid $border_gray;
border-left: 1px solid $border_gray; border-left: 1px solid $border_gray;
background: white; background: #f1f2f2;
} }
// border-bottom: 1px solid rgb(204, 204, 204) // border-bottom: 1px solid rgb(204, 204, 204)

View file

@ -257,6 +257,12 @@
} }
} }
.middle-right-content.wrapper {
padding: 1em 0;
background: white;
border-radius: 1em;
}
@media (max-width: 799px) { @media (max-width: 799px) {
.actionbar-box { .actionbar-box {
@ -332,14 +338,15 @@
.left-sidebar { .left-sidebar {
width: 11%; width: 11%;
max-width: 11%;
min-width: 11%;
position: fixed; position: fixed;
height: 100%; height: 100%;
margin-top: -4em; margin-top: -4em;
padding-top: 4em; padding-top: 4em;
} border-right: 1px solid lightgray;
box-shadow: 0px -10px 2px 0px rgb(0 0 0 / 50%);
.left-sidebar-item { background: white;
border-radius: 0 0.5em 0.5em 0;
} }
.feed-table { .feed-table {

View file

@ -1,3 +1,6 @@
.chat {
background: white;
}
#chat-log p { #chat-log p {
margin: 0; margin: 0;
padding-top: 0.1em; padding-top: 0.1em;
@ -101,7 +104,7 @@
margin-bottom: 1.5px; margin-bottom: 1.5px;
} }
.info-circle { .info-circle {
position: absolute; position: absolute;
cx: 86%; cx: 86%;
cy: 80%; cy: 80%;
r: 6px; r: 6px;
@ -146,8 +149,8 @@
display: inline-flex; display: inline-flex;
} }
.status-circle { .status-circle {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
right: 0; right: 0;
cx: 18px; cx: 18px;
cy: 18px; cy: 18px;

View file

@ -1622,6 +1622,10 @@ hr {
#content .title { #content .title {
color: rgb(199, 194, 187); color: rgb(199, 194, 187);
} }
#content.wrapper {
background-image: initial;
background-color: rgb(24, 26, 27);
}
footer { footer {
border-top-color: rgb(62, 68, 70); border-top-color: rgb(62, 68, 70);
background-image: initial; background-image: initial;
@ -1687,7 +1691,7 @@ noscript #noscript {
border-right-color: rgb(62, 68, 70); border-right-color: rgb(62, 68, 70);
border-left-color: rgb(62, 68, 70); border-left-color: rgb(62, 68, 70);
background-image: initial; background-image: initial;
background-color: rgb(24, 26, 27); background-color: rgb(32, 34, 36);
} }
.MathJax:focus { .MathJax:focus {
outline-color: initial; outline-color: initial;
@ -1803,6 +1807,10 @@ noscript #noscript {
background-image: initial; background-image: initial;
background-color: rgb(29, 31, 32); background-color: rgb(29, 31, 32);
} }
.table.striped tr:nth-child(2n+1) {
background-image: initial;
background-color: rgb(24, 26, 27);
}
.table td:first-child { .table td:first-child {
border-color: rgb(62, 68, 70); border-color: rgb(62, 68, 70);
} }
@ -1919,6 +1927,9 @@ noscript #noscript {
border-top-color: rgb(60, 65, 68); border-top-color: rgb(60, 65, 68);
background-color: rgb(24, 26, 27); background-color: rgb(24, 26, 27);
} }
.blog-box:hover {
border-color: rgb(81, 88, 91);
}
.problem-feed-name a { .problem-feed-name a {
color: rgb(102, 177, 250); color: rgb(102, 177, 250);
} }
@ -1939,11 +1950,22 @@ noscript #noscript {
color: rgb(232, 230, 227); color: rgb(232, 230, 227);
} }
.show-more { .show-more {
color: white; color: rgb(232, 230, 227);
background: linear-gradient(rgba(0, 0, 0, 0), rgb(24, 26, 27)); background-image: linear-gradient(rgba(0, 0, 0, 0),
rgb(24, 26, 27));
background-color: initial;
}
.middle-right-content.wrapper {
background-image: initial;
background-color: rgb(24, 26, 27);
} }
@media (min-width: 800px) { @media (min-width: 800px) {
.left-sidebar {
border-right-color: rgb(60, 65, 68);
box-shadow: rgba(0, 0, 0, 0.5) 0px -10px 2px 0px;
background-image: initial;
background-color: rgb(24, 26, 27);
}
.blog-box { .blog-box {
border-left-color: rgb(60, 65, 68); border-left-color: rgb(60, 65, 68);
border-right-color: rgb(60, 65, 68); border-right-color: rgb(60, 65, 68);
@ -2570,6 +2592,8 @@ a.close:hover {
border-bottom-color: rgb(62, 68, 70); border-bottom-color: rgb(62, 68, 70);
border-left-color: rgb(62, 68, 70); border-left-color: rgb(62, 68, 70);
border-top-color: initial; border-top-color: initial;
background-image: initial;
background-color: rgb(24, 26, 27);
} }
.sidebox-content.sidebox-table { .sidebox-content.sidebox-table {
border-color: initial; border-color: initial;
@ -2732,7 +2756,7 @@ a.voted {
} }
#submissions-table { #submissions-table {
background-image: initial; background-image: initial;
background-color: rgba(0, 0, 0, 0.01); background-color: rgb(24, 26, 27);
} }
.submission-row { .submission-row {
border-left-color: rgb(62, 68, 70); border-left-color: rgb(62, 68, 70);
@ -2971,6 +2995,10 @@ a.voted {
background-color: rgba(204, 0, 0, 0.8); background-color: rgba(204, 0, 0, 0.8);
color: rgb(232, 230, 227); color: rgb(232, 230, 227);
} }
.chat {
background-image: initial;
background-color: rgb(24, 26, 27);
}
#emoji-button { #emoji-button {
color: rgb(204, 200, 193); color: rgb(204, 200, 193);
} }

View file

@ -5,7 +5,7 @@
} }
#submissions-table { #submissions-table {
background: rgba(0, 0, 0, .01); background: white;
} }
.submission-row { .submission-row {
@ -212,8 +212,8 @@ label[for="language"], label[for="status"] {
} }
// .batch-cases .case-row td b { // .batch-cases .case-row td b {
// font-weight: 500; // font-weight: 500;
// } // }
.case-info { .case-info {
margin: 0; margin: 0;
@ -252,7 +252,7 @@ label[for="language"], label[for="status"] {
td { td {
padding: 0.6em 0.8em; padding: 0.6em 0.8em;
width: 18.75%; width: 18.75%;
} }
.case-row td:nth-child(2) { .case-row td:nth-child(2) {
@ -288,7 +288,7 @@ label[for="language"], label[for="status"] {
} }
.overall-result-WA { .overall-result-WA {
background: linear-gradient(45deg, yellow, red); background: linear-gradient(45deg, yellow, red);
} }
.overall-result-TLE { .overall-result-TLE {

View file

@ -12,6 +12,10 @@
background: #f7f7f7; background: #f7f7f7;
} }
&.striped tr:nth-child(odd) {
background: white;
}
td:first-child { td:first-child {
border-color: $border_gray; border-color: $border_gray;
border-width: 1px 1px 0 1px; border-width: 1px 1px 0 1px;

View file

@ -495,6 +495,7 @@ ul.select2-selection__rendered {
border-top: none; border-top: none;
margin: 0 -5px; margin: 0 -5px;
padding: 1px 0.5em 3px; padding: 1px 0.5em 3px;
background: white;
&.sidebox-table { &.sidebox-table {
border: none; border: none;
@ -591,7 +592,7 @@ ul.select2-selection__rendered {
.control-button { .control-button {
background: lightgray; background: lightgray;
color: black !important; color: black !important;
border: 0; border: 0;
} }
.control-button:hover { .control-button:hover {
@ -701,7 +702,7 @@ ul.select2-selection__rendered {
} }
#login-panel { #login-panel {
display: inline-block; display: inline-block;
position: relative; position: relative;
margin: 5em auto auto -10em; margin: 5em auto auto -10em;

View file

@ -332,7 +332,7 @@
<div id="noscript">{{ _('This site works best with JavaScript enabled.') }}</div> <div id="noscript">{{ _('This site works best with JavaScript enabled.') }}</div>
</noscript> </noscript>
<br> <br>
<main id="content"> <main id="content" class="{{'wrapper' if layout != 'no_wrapper'}}">
{% block title_row %} {% block title_row %}
<h2 class="title-row"> <h2 class="title-row">
{% block content_title %} {% block content_title %}

View file

@ -1,3 +1,4 @@
{% set layout = "no_wrapper" %}
{% extends "base.html" %} {% extends "base.html" %}
{% block title_row %}{% endblock %} {% block title_row %}{% endblock %}
{% block title_ruler %}{% endblock %} {% block title_ruler %}{% endblock %}

View file

@ -1,143 +1,150 @@
{% set layout = 'no_wrapper' %}
{% extends "base.html" %} {% extends "base.html" %}
{% block title_row %}{% endblock %} {% block title_row %}{% endblock %}
{% block title_ruler %}{% endblock %} {% block title_ruler %}{% endblock %}
{% block media %} {% block media %}
<style> <style>
@media(min-width: 800px) { @media(min-width: 800px) {
#content { #content {
width: 98%; width: 98%;
margin-left: 0; margin-left: 0;
}
.middle-right-content {
margin-left: 13%;
display: inline-flex;
}
} }
.middle-right-content { @media(max-width: 799px) {
margin-left: 13%; #content {
display: inline-flex; width: 100%;
} margin-left: 0;
} }
@media(max-width: 799px) { .middle-right-content {
#content { display: block;
width: 100%; }
margin-left: 0;
} }
</style>
.middle-right-content {
display: block;
}
}
</style>
{% endblock %} {% endblock %}
{% block js_media %} {% block js_media %}
<script type="text/javascript"> <script type="text/javascript">
function activateBlogBoxOnClick() { function activateBlogBoxOnClick() {
$('.blog-box').on('click', function () { $('.blog-box').on('click', function () {
var $description = $(this).children('.blog-description'); var $description = $(this).children('.blog-description');
var max_height = $description.css('max-height'); var max_height = $description.css('max-height');
if (max_height !== 'fit-content') { if (max_height !== 'fit-content') {
$description.css('max-height', 'fit-content'); $description.css('max-height', 'fit-content');
$(this).css('cursor', 'auto'); $(this).css('cursor', 'auto');
$(this).removeClass('pre-expand-blog'); $(this).removeClass('pre-expand-blog');
$(this).children().children('.show-more').hide(); $(this).children().children('.show-more').hide();
} }
}); });
$('.blog-box').each(function () { $('.blog-box').each(function () {
var $precontent = $(this).children('.blog-description').height(); var $precontent = $(this).children('.blog-description').height();
var $content = $(this).children().children('.content-description').height(); var $content = $(this).children().children('.content-description').height();
if ($content == undefined) { if ($content == undefined) {
$content = $(this).children().children('.md-typeset').height() $content = $(this).children().children('.md-typeset').height()
} }
if ($content > $precontent - 30) { if ($content > $precontent - 30) {
$(this).addClass('pre-expand-blog'); $(this).addClass('pre-expand-blog');
$(this).css('cursor', 'pointer'); $(this).css('cursor', 'pointer');
} else { } else {
$(this).children().children('.show-more').hide(); $(this).children().children('.show-more').hide();
} }
}); });
}
function navigateTo($elem, update_sidebar = false) {
var url = $elem.attr('data-href') || $elem.attr('href');
if (url === '#') return;
if (update_sidebar) {
$('.left-sidebar-item').removeClass('active');
$elem.addClass('active');
} }
$('.middle-right-content').html(loading_page);
$.get(url, function (data) {
var reload_content = $(data).find('.middle-right-content');
if (reload_content.length) { function navigateTo($elem, update_sidebar = false) {
window.history.pushState("", "", url); var url = $elem.attr('data-href') || $elem.attr('href');
$('.middle-right-content').html(reload_content.first().html());
$(document).prop('title', $(data).filter('title').text());
MathJax.typeset($('.middle-right-content')[0]);
onWindowReady();
activateBlogBoxOnClick();
$('.xdsoft_datetimepicker').hide();
registerNavigation();
}
else {
window.location.href = url;
}
});
}
function registerNavigation() { if (url === '#') return;
const links = ['.pagination a', '.tabs li a', '.problem-feed-option a']; if (update_sidebar) {
for (link of links) { $('.left-sidebar-item').removeClass('active');
$(link).on('click', function (e) { $elem.addClass('active');
e.preventDefault(); }
navigateTo($(this)); $('.middle-right-content').html(loading_page);
}) $.get(url, function (data) {
var reload_content = $(data).find('.middle-right-content');
if (reload_content.length) {
window.history.pushState("", "", url);
$('.middle-right-content').html(reload_content.first().html());
if (reload_content.hasClass("wrapper")) {
$('.middle-right-content').addClass("wrapper");
}
else {
$('.middle-right-content').removeClass("wrapper");
}
$(document).prop('title', $(data).filter('title').text());
MathJax.typeset($('.middle-right-content')[0]);
onWindowReady();
activateBlogBoxOnClick();
$('.xdsoft_datetimepicker').hide();
registerNavigation();
}
else {
window.location.href = url;
}
});
} }
}
$(function () { function registerNavigation() {
window.addEventListener('popstate', (e) => { const links = ['.pagination a', '.tabs li a', '.problem-feed-option a'];
window.location.href = e.currentTarget.location.href; for (link of links) {
}); $(link).on('click', function (e) {
activateBlogBoxOnClick(); e.preventDefault();
navigateTo($(this));
})
}
}
$('.left-sidebar-item').on('click', function () { $(function () {
navigateTo($(this), true); window.addEventListener('popstate', (e) => {
window.location.href = e.currentTarget.location.href;
});
activateBlogBoxOnClick();
$('.left-sidebar-item').on('click', function () {
navigateTo($(this), true);
});
registerNavigation();
}); });
registerNavigation(); </script>
});
</script>
{% endblock %} {% endblock %}
{% macro make_tab_item(name, fa, url, text) %} {% macro make_tab_item(name, fa, url, text) %}
<div class="left-sidebar-item {% if page_type == name %}active{% endif %}" data-href="{{ url }}" id="{{ name }}-tab"> <div class="left-sidebar-item {% if page_type == name %}active{% endif %}" data-href="{{ url }}" id="{{ name }}-tab">
<span class="sidebar-icon"><i class="{{ fa }}"></i></span> <span class="sidebar-icon"><i class="{{ fa }}"></i></span>
<span>{{ text }}</span> <span>{{ text }}</span>
</div> </div>
{% endmacro %} {% endmacro %}
{% block body %} {% block body %}
{% block before_posts %}{% endblock %} {% block before_posts %}{% endblock %}
<div id="three-col-container"> <div id="three-col-container">
{% block left_sidebar %}{% endblock %} {% block left_sidebar %}{% endblock %}
<div class="middle-right-content"> <div class="middle-right-content {{'wrapper' if is_two_column}}">
{% block three_col_media %}{% endblock %} {% block three_col_media %}{% endblock %}
{% block three_col_js %}{% endblock %} {% block three_col_js %}{% endblock %}
<div class="middle-content"> <div class="middle-content">
{% block middle_title %}{% endblock %} {% block middle_title %}{% endblock %}
{% block middle_content %}{% endblock %} {% block middle_content %}{% endblock %}
</div>
{% block right_sidebar %}{% endblock %}
</div> </div>
{% block right_sidebar %}{% endblock %}
</div> </div>
</div> {% block after_posts %}{% endblock %}
{% block after_posts %}{% endblock %}
{% endblock %} {% endblock %}
{% block bodyend %} {% block bodyend %}
{{ super() }} {{ super() }}
{% if REQUIRE_JAX %} {% if REQUIRE_JAX %}
{% include "mathjax-load.html" %} {% include "mathjax-load.html" %}
{% endif %} {% endif %}
{% include "comments/math.html" %} {% include "comments/math.html" %}
{% endblock %} {% endblock %}

View file

@ -1,3 +1,4 @@
{% set is_two_column = true %}
{% extends "three-column-content.html" %} {% extends "three-column-content.html" %}
{% block three_col_js %} {% block three_col_js %}