Skip to content

ScifiDecoPrism

WASM Powered
Star

ScifiDecoPrism (Prism/棱镜) is a warning-type/directional badge component in the TechUI Scifi Deco series.

It focuses on the visual interpretation of "Triangular Mechanics". Unlike the harmony of circles or the stability of hexagons, triangles naturally possess strong "visual tension" and "aggressiveness".

To avoid the thinness of simple geometric shapes, B3 utilizes Chamfered Edges and mechanically reinforced frames. This construction provides a "sharp" temperament, making it ideal for Hazard Warnings, special attribute markers (such as high voltage, radiation, or fire elements), or as a priority target locking mark to instantly alert the user.

Tip: This component can be invoked via ScifiDecoB3 or its semantic alias ScifiDecoPrism.

Basic Usage

Default Form

By default (appearance="A"), B3 renders as an isosceles triangle container with the base facing downwards. The default slot automatically centers content horizontally and vertically.

Note: Because triangles are narrower at the top, pay attention to the visual center of gravity when placing square icons.

vue
<template>
  <div class="alert-group">
    <ScifiDecoPrism>
      <icon name="bi-exclamation-triangle" />
    </ScifiDecoPrism>
    
    <ScifiDecoPrism>
      <span class="code">39</span>
    </ScifiDecoPrism>
  </div>
</template>

Appearance

B3 provides four triangular structure variants, ranging from minimalist lines to heavy armored styles.

Mode Comparison

  • Type A (Default): Standard Warning. Features a classic triangular border with corner reinforcement; suitable for general warnings.
  • Type B: Hollow Force Field. Features line breaks or dual-layer hollow designs for a more transparent visual; suitable for floating UIs.
  • Type C: Armored. Features thicker borders and prominent mechanical structures at the corners; suitable for emphasizing "defense" or "physical" attributes.
  • Type D: Core Reaction. Features the strongest internal fill, often used for high-energy reactions or core target marking.
vue
<template>
  <div class="grid">
    <ScifiDecoPrism appearance="A">Standard</ScifiDecoPrism>
    <ScifiDecoPrism appearance="B">Hollow</ScifiDecoPrism>
    <ScifiDecoPrism appearance="C">Armored</ScifiDecoPrism>
    <ScifiDecoPrism appearance="D">Core</ScifiDecoPrism>
  </div>
</template>

Size & Layout

Fixed Size and Scaling (Scale)

The ScifiDeco series is drawn based on an 80px x 80px coordinate system. Since the visual area of a triangle is typically smaller than a circle or square of the same size, you may need to increase the scale for visual balance in mixed layouts.

  • scale="1": 80px (Default)
  • scale="1.3": 104px (Recommended for emphasis)
  • scale="0.8": 64px
vue
<template>
  <ScifiDecoPrism :scale="1.1">
    <icon name="high-voltage" />
  </ScifiDecoPrism>
</template>

Visual

Glow & Atmosphere

  • glow: Enables the glow filter. The three sharp corners of the triangle appear very sharp and penetrative when glowing.
  • backgroundOpacity: Adjusts the transparency of the background fill inside the triangle.

Color Variants (Color Alt)

  • decorationColorAlt: Swaps the highlight color and focus color.
  • Triangles are often used to express "danger"; switching to an orange or red color scheme using decorationColorAlt is highly effective.
vue
<template>
  <ScifiDecoPrism 
    appearance="C" 
    :decorationColorAlt="true" 
    className="deco-alert"
  >
    <span class="text">!</span>
  </ScifiDecoPrism>
</template>

CSS Variable

Using CSS variables, you can customize B3 into "Radioactive Warning" or "Crimson Strike" styles.

Case Study: Radioactive Orange

This example defines an orange-toned triangular warning style.

vue
<template>
  <ScifiDecoPrism 
    appearance="A" 
    className="deco-hazard"
    :scale="1.2"
  >
    <icon name="radiation" />
  </ScifiDecoPrism>
</template>

<style lang="less">
.deco-hazard {
  /* Base Colors */
  --sf-deco-hlite: #fb923c;  /* Warning Orange Highlight */
  --sf-deco-bd: #9a3412;     /* Dark Brown Border */
  --sf-deco-bg: rgba(67, 20, 7, 0.5); /* Orange-Brown Background */
  
  /* Content Text */
  --sf-deco-fc: #fed7aa;     /* Light Orange Text */
  
  /* Glow Enhancement */
  --sf-deco-glow: #f97316;   /* Orange Halo */
  --sf-deco-glowop: 0.8;
}
</style>

Variable Dictionary

Major CSS variables supported by ScifiDecoPrism:

Variable NameDescriptionDefault Value
Base Appearance
--sf-deco-sizeComponent base size (Fixed)80px
--sf-deco-bgBackground fill color inside the trianglevar(--scifi-bg)
--sf-deco-bgopBackground opacity1
--sf-deco-bdBorder line colorvar(--scifi-bd)
Decoration & Highlight
--sf-deco-hlitePrimary triangle color (SVG stroke)var(--scifi-hlite)
--sf-deco-focusAuxiliary corner/reinforcement colorvar(--scifi-focus)
--sf-deco-glowGlow filter colorvar(--scifi-hlite)
Content Slot
--sf-deco-fcText/Icon color in slotvar(--font-strong)
--sf-deco-fzDefault text size in slot24px

API Reference

Props

PropertyDescriptionTypeDefault
appearanceAppearance Variant: 'A', 'B', 'C', 'D'String'A'
scaleScaling Ratio (based on 80px)Number1
glowGlow Switch: Toggles filter haloBooleantrue
glowRangeGlow rangeNumber10
glowOpacityGlow opacityNumber
borderdWhether to display border linesBooleantrue
decorationColorAltDecoration Variant: Swaps highlight and focus colorsBooleanfalse
backgroundOpacityBackground opacityNumber
classNameCustom class nameString

Slots

Slot NameDescription
defaultComponent content; automatically absolutely centered.

Released under the MIT License.