Тема Turbo Vision


Примечание:

Эта страница содержит визуальную тему, используемую на данной вики.

Подключение темы к другим страницам осуществляется с помощью следующего кода (указывается в начале страницы) Нажмите на блок, чтобы скопировать код:

[[include theme:turbo-vision]]

Страница, объединяющая все визуальные темы в единый список, расположена по ссылке: Хаб визуальных тем.

рейтинг: 
0/0%

Это тема Turbo Vision за авторством jakdragonx и Croquembouche. Это чисто эстетическая тема, не основанная на чём-либо из вселенной, но имитирующая ретро-атмосферу.

Для подключения темы, вставьте следующий код в статью:

[[include theme:turbo-vision]]

Это подключает Turbo Vision в "режиме темы".


Если вас интересуют только стилизованные блоки, но не вся тема целиком, передайте параметр "blocks=a":

[[include theme:turbo-vision blocks=a]]

Это подключает Turbo Vision в "режиме компонента". Он совместим с Тема Black Highlighter.


"Режим темы" и "режим компонента" ещё будут упомянуты далее, поэтому перепроверьте какой из них использует ваша страница.

Тема Turbo Vision имитирует DOS-терминал из 90-ых — её элементы будто сделаны из множества ASCII-символов. Поэтому границы и тени элементов выглядят неуклюже и ассиметрично — они имитируют символы для отрисовки линий, где цвет задаётся цветом шрифта и фона каждого отдельного символа.

Несмотря на это, мы не дотошно следовали этому правилу и позволили себе внести несколько творческих изменений чтобы сделать опыт чуть менее болезненным.

В эту тему по умолчанию встроен компонент Визуальный элемент Toggle Sidebar ,освобождающий горизонтальное пространство под блоки с смещениями. Так как на маленьких экранах горизонтального пространства в принципе мало, эти блоки автоматически будут смещены в центр страницы — читатели с мобильных устройств ничего не пропустят.

Эта тема блочная, неуклюжая и цветастая. Страницы с ней могут выглядеть как кучка окон в нагромождённом интерфейсе, но в этом часть её шарма. Или нет — решать вам. Далее на этой странице есть инструкции как настроить тему по своему усмотрению.


Приведённые ниже вкладки содержат примеры FTML-разметки в данной теме.

Учтите, что оформление цитат и таблиц доступно в "режиме компонента", но оформление вкладок доступно только в "режиме темы".

Горизонтальная линия может быть создана при помощи 5 дефисов "-----" и проходит через всю страницу, если он не находится внутри чего-либо  (например, цитат). Линии, разделяющие разделы этой страницы, представляют собой горизонтальные линии.

Это полужирный текст.

Это текст курсивом.

Это моноширный текст.


А теперь небольшая демонстрация работы Turbo Блоков…


Дальнейшее содержимое страницы может выглядеть или казаться ужасающим. Однако не стоит беспокоиться — всё можно разбить на простые кусочки.


scpimage.png

Ага привет это текст

ОБЪЕКТ №

SCP-NUMBER

КЛАСС ОБЪЕКТА

LIGMA

ОСОБЫЕ УСЛОВИЯ СОДЕРЖАНИЯ

johnsmith12: а ты вообще понимаешь, что делаешь?

вы: Нет, лмао. Мне просто надо написать чё-нить для этой чёртовой темы.

SCP-NUMBER is currently uncontained. Whether this can be attributed to its unidentified writing or if it's just too fucking annoying to hassle with remains unknown.

In the event that one observes SCP-NUMBER for any reason — which, doesn't really make much sense when you think about it — affected subjects must refer back to their on-site therapist for Treatment #104321. Such treatment may last upwards of several hours and may be excruciatingly painful to the affected subject. Because no one wants to go to the nurse's office, for some fuck-all reason.

так а что я собирался съесть на обед?

ОПИСАНИЕ

SCP-NUMBER is nothing. Absolutely nothing at all. In fact, it is a lie. Just like you. You too are indeed a lie. Do not feel hurt or upset, as this applies to everyone universally. We condemn discrimination here at the Foundation.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

In fact, what can we describe as truth? Perhaps perception is a lie. A lie perpetrated amongst men upon other men, perhaps? Indeed, reality cannot be the same for you and me. We all have different truths and lies. We are, of course, three-dimensional creatures. We crave understanding. We desire knowledge and will seek it out despite some of our best intentions.

Perhaps you believe that I'm only typing nonsense because I just want to lengthen this more for an extra colored box? Perhaps, but regardless of such meager wishes, I only want to allow you the moment of self-reflection. Are you, in fact, real? No. As I've already said prior, you are just a false image. A false image of the world you're currently living on. That is all.


КАК ИСПОЛЬЗОВАТЬ

To create a chunky shadowed Turbo Block like the one this text is in, create a div with the following classes:

  • "turbo-block"
  • a class that sets the background color
  • a class that sets the border color
  • a class that sets the text color

This theme provides all of these classes.

БЛОК

The "turbo-block" class creates the Turbo Block itself. You can use it by itself without any of the other classes, but it'll probably look weird (it won't have a background, for example).

[[div class="turbo-block"]]
Тут мог быть ваш текст
[[/div]]

ЦВЕТ ФОНА

This theme provides a bunch of background color utility classes, of the form "bg-[color]". Here are all of them:

[[div class="turbo-block bg-red"]]

[[div class="turbo-block bg-grey"]]

[[div class="turbo-block bg-green"]]

[[div class="turbo-block bg-cyan"]]

[[div class="turbo-block bg-orange"]]

[[div class="turbo-block bg-yellow"]]

[[div class="turbo-block bg-purple"]]

[[div class="turbo-block bg-black"]]

[[div class="turbo-block bg-white"]]

ЦВЕТ ГРАНИЦЫ

There are two border color classes: "border-black" and "border-white". Turbo Blocks doesn't come with a border by default, so you'll have to pick one for each turbo-block.

Note that all divs created with the "turbo-block" class have a double-lined border. Blockquotes, tables and tabviews have a single-lined border.

ЦВЕТ ТЕКСТА

There are two text color classes: "text-black" and "text-white". They make the default text color in the turbo-block black and white respectively.

Each Turbo Block can have a title and a bunch of headings. The title is the text that appears right at the top — the title of this one is "HEADINGS". Do that by adding a "data-title" attribute to the block div:

[[div class="turbo-block …" data-title="ВПИШИТЕ СЮДА ЗАГОЛОВОК"]]

To match the original Turbo Vision program, block titles should be in capitals, but this isn't enforced — you can put any text there you like.

However, do try to keep them short, because they look weird if they overflow:

Видите, что я имею ввиду?

The source code for that:

[[div class="turbo-block bg-grey border-black text-black" data-title="О, смотрите! Я слишком длинный заголовок!"]]
Видите, что я имею ввиду?
[[/div]]

Think of the poor mobile readers — keep your titles short.

ЗАГОЛОВКИ

Within a Turbo Block, you can create a subsection heading with the "heading" class — here's the code for the above one:

[[div class="heading"]]
ЗАГОЛОВКИ
[[/div]]

If you want to add a line like a heading but without any text in it, just add a horizontal rule with 4 or 5 hyphens:


↑ Just like that.

You can put anything you like inside a Turbo Block, including images. To add an image, the best way is to make a Turbo Block div and put the standard image block component inside it.

Here's the one for the image turbo-block used in the example earlier in this page:

[[div class="turbo-block bg-orange border-white text-white" data-title="ИЗОБРАЖЕНИЕ"]]
[[include component:image-block
| name=scpimage.png
| caption=Ага привет это текст
]]
[[/div]]

So far, these instructions have covered how to create Turbo Blocks. You can put a Turbo Block inside another Turbo Block, but just doing that won't create a cluttered feel, like a messy pile of notes on a disorganized researcher's desk — to do that, some of them need to be moved to the left and right.

That can be done using offset classes. The Turbo Vision theme provides classes for moving something to the left:

  • "offset-left"
  • "left-1"
  • "left-2"
  • "left-3"
  • "left-4"
  • "left-5"

…and to the right:

  • "offset-right"
  • "right-1"
  • "right-2"
  • "right-3"
  • "right-4"
  • "right-5"

To move something to the left, wrap it in a div with two classes: "offset-left", and then one of "left-1" through "left-5", depending on how far to the left you want it moved. "left-1" will only move it a little bit, but "left-5" will move it a lot — all the way to the left-hand side of the screen.

To move something to the right, it's exactly the same, but swap out "left" for "right".

СМЕЩЕНИЯ НА МОБИЛЬНЫХ УСТРОЙСТВАХ

If you've worked with CSS before, you're probably thinking that using up too much horizontal screen space is a very dangerous game — these offset divs are going to look terrible on mobile.

Have no fear! On small screen sizes, offset divs will be placed closer to the middle of the page, and on very small screen sizes, the offset will be turned off altogether.

For authors, this means that while mobile users will always see all of the content you put into offset divs, it might not look as cluttered as you intended it. Always test your design on mobile before you publish it to check that the reading experience is solid for everyone.

СОЗДАНИЕ БЛОКОВ СО СМЕЩЕНИЕМ

To create an offset block, combine two of the above classes, to determine the offset direction and intensity:

[[div class="offset-left left-3"]]

[[/div]]

If you want to offset a Turbo Block, put it inside the offset block (don't add the offset classes to the Turbo Block directly):

[[div class="offset-left left-3"]]
[[div class="turbo-block bg-white border-black text-black"]]
привет!
[[/div]]
[[/div]]

привет!

If you're on a wide browser (e.g. desktop), the above example is on the left. If you're on a thin browser (e.g. mobile), the above example is above this text.

Because the offset block is a different element to the Turbo Block, this means that you can actually offset anything you like, just by putting it inside a div with offset classes. Try offsetting an image turbo-block!

ОЧИСТКА FLOAT

Offset blocks work using the CSS "float" property. When a HTML element is floating, stuff underneath it is pulled upwards to fill the space that it leaves behind.

This isn't always desirable. Maybe you want a floating offset block, but you want the text underneath it to appear where it would be if the offset block wasn't floating. This would leave a big gap for you to put something else there, if you like.

You can do this using the CSS "clear" property — a practice that's commonly referred to as a "clearfix". Wikidot lets you do this with 4 tilde characters (~~~~):

[[div class="offset-left left-3"]]
[[div class="turbo-block bg-white border-black text-black"]]
привет!
[[/div]]
[[/div]]

~~~~

привет!

This text isn't pulled upwards to fill the space, resulting in a big gap on desktop. On mobile, of course, there is no change.

ПРИМЕРЫ

Here are examples for all the different offset combinations.

Your browser has a wide screen (or at least CSS says so), so take a look at the examples below and adjust your window size to see how the offset divs react.

Your browser has a thin screen (or at least CSS says so), which means you're likely on a mobile device. The offset examples below will appear as a bunch of boring, center-aligned divs. Try looking at this page in a wider browser later to see the offsets.

[[div class="offset-left left-5"]]

[[div class="offset-left left-4"]]

[[div class="offset-left left-3"]]

[[div class="offset-left left-2]]

[[div class="offset-left left-1"]]

[[div class="offset-right right-1"]]

[[div class="offset-right right-2"]]

[[div class="offset-right right-3"]]

[[div class="offset-right right-4"]]

[[div class="offset-right right-5"]]

There are certain circumstances in which you shouldn't use some of the offset classes. You still can, of course, but it will have an adverse effect on your page.

Which classes are available to you depends on the position of the sidebar and whether or not the page content is center-aligned with respect to the browser viewport. It also depends on whether you are using this theme in 'theme mode' or 'component mode' — please review the usage instructions at the very top of the page for a reminder of which is which.

РЕЖИМ ТЕМЫ

If you are using the Turbo Vision theme in 'theme mode', it comes with Визуальный элемент Toggle Sidebar , which center-aligns the page content and frees up as much horizontal space as possible. You may freely use all of the offset classes.

РЕЖИМ КОМПОНЕНТА

If you are using the Turbo Vision theme in 'component mode', it does not come with Визуальный элемент Toggle Sidebar by default. This limits the horizontal space.

If you are using Toggle Sidebar anyway, your page body is center-aligned. You may freely use all of the offset classes.

If you are not using Toggle Sidebar, the page body is on the right-hand side of the page. You should avoid using any of the right-hand offset classes, as they may go off the edge of the screen. You should also avoid using any left-hand offset classes near the start of the page, as they may overlap with the sidebar.

If you are using Тема Black Highlighter, the page body is centered, so you may freely use the right-hand offset classes. However, the sidebar is present throughout the entire document, so you should avoid using any of the left-hand offset classes.

If you are using BHL and BHL Toggle Sidebar, this frees up the space on the left, so you may freely use the left-hand offset classes as well.

TL;DR

In short: avoid offsetting to the left if there is a sidebar, and avoid offsetting to the right if the page content is not centered.

Вот и вся тема.

Структурные: визуальная_тема
Филиал: en
версия страницы: 11, Последняя правка: 19 Ноя. 2024, 09:42 (32 дня назад)
Пока не указано иное, содержимое этой страницы распространяется по лицензии Creative Commons Attribution-ShareAlike 3.0 License.