画像カルーセル
このページはコンポーネントページです
Wiki内で使用されているコンポーネントページです。このページを編集することはできません。
編集が必要だと思われる場合は、このページのディスカッションか、サイトスタッフまでご連絡ください。
評価: 0+x
blank.png

これは何

ページの機能を改良するCSSを集めたものであり、非常に便利なため、CroquemboucheCroquembouche自身が多くのページで使用しています。

このコンポーネントは本当に軽微な変更を行うもので、執筆や、(私1がよくしている)コンポーネント/テーマの記述をしやすくします。これはあくまで文章を書きやすくするものであり、ページの見た目などを変えるものではありません。

私は、翻訳者がこのコンポーネントを気に入っていて、尚且つ使いたいわけでもなければ、このコンポーネントを使った記事において、その翻訳版でもこのコンポーネントが使われているとは思っていません。

このコンポーネントが他のコンポーネントやテーマと被ることはおそらくないだろうし、もし被ってしまってもそこまで問題ではないだろうと思っています。

使い方

どんなウィキでも:

[[include :scp-jp:component:croqstyle]]

このコンポーネントは、他のコンポーネントで使用されることを想定して設計されています。他のコンポーネントで使用する場合は、必ずそのコンポーネントの[[iftags]]ブロックの中に上記のコードを追加してください。これは、そのコンポーネントの使用者がCroqstyleの使用を強制されないようにするために重要なことです。

関連しているコンポーネント

スタイリングユーザーコンポーネント(数箇所を変更します):

スタイリングテーマ(見た目を細かく変更します):

CSS変更

適度なサイズの脚注

脚注の幅が100万マイルになるのを防ぎ2、実際に読みやすくします。

.hovertip { max-width: 400px; }

等幅編集/コード

編集テキストボックスを等幅にし、全ての等幅テキストのフォントを通常よりも明らかに優れたFira Codeに変更します。

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&display=swap');
 
:root { --mono-font: "Fira Code", Cousine, monospace; }
#edit-page-textarea, .code pre, .code p, .code, tt, .page-source { font-family: var(--mono-font); }
.code pre * { white-space: pre; }
.code *, .pre * { font-feature-settings: unset; }

テレタイプのバックグラウンド

<tt>要素({{text}})に薄い灰色の背景を追加し、コードスニペットをより目立たせます。

tt {
  background-color: var(--swatch-something-bhl-idk-will-fix-later, #f4f4f4);
  font-size: 85%;
  padding: 0.2em 0.4em;
  margin: 0;
  border-radius: 6px;
}

もうでかい顔には困らない

誰かのアバター画像にカーソルを合わせたときに、アバターの画像が大きく表示されないようにしました。あれは本当にくだらなくて、何より邪魔でした。大きなバージョンを見たいなら、クリックすれば良い話ですよね?

.avatar-hover { display: none !important; }

いくらでも改行すればいい

nobreakクラスを待つdiv内のテキストはどんな文字の間でも改行されます。3

.nobreak { word-break: break-all; }

コードの色

自分のターミナルのコードの色分けを変数として追加します。Maybe I'll change this to a more common terminal theme like Monokai or something at some point, but for now it's just my personal theme, which is derived from Tomorrow Night Eighties.

また、[[div class="code terminal"]]として偽のコードブロックに.terminalクラスを追加することで、黒い背景の擬似ターミナルとして使うことができます。Doesn't work with [[code]], because Wikidot inserts a bunch of syntax highlighting that you can't change yourself without a bunch of CSS. Use it for non-[[code]] code snippets only.

Quick tool to colourise a 'standard' Wikidot component usage example with the above vars: link

:root {
  --c-bg: #393939;
  --c-syntax: #e0e0e0;
  --c-comment: #999999;
  --c-error: #f2777a;
  --c-value: #f99157;
  --c-symbol: #ffcc66;
  --c-string: #99cc99;
  --c-operator: #66cccc;
  --c-builtin: #70a7df;
  --c-keyword: #cc99cc;
}
 
.terminal, .terminal > .code {
  color: var(--c-syntax);
  background: var(--c-bg);
  border: 0.4rem solid var(--c-comment);
  border-radius: 1rem;
}

デバッグモード

Draw lines around anything inside .debug-mode. The colour of the lines is red but defers to CSS variable --debug-colour.

You can also add div.debug-info.over and div.debug-info.under inside an element to annotate the debug boxes — though you'll need to make sure to leave enough vertical space that the annotation doesn't overlap the thing above or below it.

…like this!

.debug-mode, .debug-mode *, .debug-mode *::before, .debug-mode *::after {
  outline: 1px solid var(--debug-colour, red);
  position: relative;
}
.debug-info {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  white-space: nowrap;
}
.debug-info.over { top: -2.5rem; }
.debug-info.under { bottom: -2.5rem; }
.debug-info p { margin: 0; }

これは何

What this is

1 つの画像だけではなく、複数の画像をループ表示する画像カルーセルコンポーネント。
An image carousel component that, instead of showing just one image, cycles through many.

使い方

Usage

Wherever you want your Image Carousel, slap in this code instead of your standard image block.

Make sure that any images you want are already uploaded to your page. If you chose to ignore that sage advice and only upload your images after setting up the Carousel, then your images won't work until you Hard Refresh the page (Ctrl+Shift+R).

[[include :scp-wiki:component:carousel
| images=photograph.png,old-map.png,jumpscare.gif
| caption=A selection of images.
| interval=5
| wiki=scp-wiki
| page=SCP-173
| width=300px
| height=240px
| position=right
| no-caption=false
| background=white
| options=yes
]]

Using an image carousel presents certain accessibility concerns - the constant motion can be very distracting for some users. It is also not a great idea to force your reader to wait to see your article's images. This component is also a great way to irritate your reader by forcing interactivity onto them in an otherwise non-interactive context. If possible, I would recommend not using this component. Use a series of standard image blocks instead.

What each option is

Anything in italics is optional. Everything else you gotta have.

If you omit an optional option, then it will have its default value. If you omit a non-optional option, then don't expect the carousel to work properly.

images: A list of images, separated by commas. Be sure that each one of these images is uploaded to the page. You can also specify images by URL.
These images will appear in the carousel in the order that you list them.
links:
(Optional)
A list of URLs for each image to link to, separated by commas. If provided, there must be the same number of URLs as there are images.
caption:
(Optional)
The caption that goes underneath the carousel.
If you have no caption, make sure you set no-caption to true.
Default value: "{$caption}"
interval:
(Optional)
If you set this to a non-zero number, then the carousel will automatically move onto the next image after this number of seconds.
If the user has clicked an arrow to manually change the image, or if they are currently hovering their mouse over the carousel, then the image will not rotate.
Default value: "0"
wiki: The name of the wiki that the page that you want the carousel to be on, is on. For example, scp-wiki (NOT "scpwiki") or scp-sandbox-3.
page: The slug of the page that you want the carousel to be on. Include the category, if any. (The 'slug' is the name of the page as seen in the URL - for example, for scp-botnik-j the slug is scp-botnik-j.)
width:
(Optional)
The width of the widest image in the carousel.
Default value: "300px"
height:
(Optional)
The height of the tallest image in the carousel.
Default value depends on browser
position:
(Optional)
The horizontal position of the carousel on the page. "left", "right" or "center".
Default value: "right"
no-caption:
(Optional)
Set this to "true" if you don't want a caption. Otherwise, leave it blank , or set it to "false", or get rid of it completely.
Default value: "false"
background:
(Optional)
The background colour behind the images.
Default value: "transparent"
options:
(Optional)
Do you want the detailed options (play/pause button and the row of little circles) to display? If not, set to anything but "yes".
Default value: "yes"

I want the carousel to spread across the whole page!
Set width to "100%" and position to "center".

I set width/height to the size of my biggest image but it's way too big!
Pick a smaller number, or make your images smaller.

Accessibility note

This component was not made with accessibility in mind, and violates several basic principles. For an accessible experience for your readers, do not use this component.


特に明記しない限り、このページのコンテンツは次のライセンスの下にあります: Creative Commons Attribution-ShareAlike 3.0 License