Skip to content

Space Portal

Click to open a dimensional portal — the button warps into a spinning vortex, sucks in an object, then delivers it

Space Portal

by FreeCsStyles Dev's

StatefulPortal Warp
🌐🎨⚛️💚🅰️🔥☁️
#portal#space#teleport#warp#vortex#dimensional

Embed this component

Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/space-portal-button.

<iframe src="/embed/space-portal-button" sandbox="allow-scripts" loading="lazy" title="Space Portal" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Space Portal, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.

HTML
<button class="btn-portal" id="portalBtn" onclick="triggerPortal()">
  <span class="text">Teleport</span>
  <span class="portal-ring"></span>
  <span class="object-icon">📦</span>
</button>
<script>
function triggerPortal() {
  const btn=document.getElementById('portalBtn');
  if(btn.classList.contains('is-opening')) return;
  btn.classList.add('is-opening');
  setTimeout(()=>{btn.classList.remove('is-opening');btn.querySelector('.text').innerText='Delivered';},2500);
  setTimeout(()=>{btn.querySelector('.text').innerText='Teleport';},5000);
}
</script>
CSS
.btn-portal{width:160px;height:50px;border-radius:12px;border:none;background:#8b5cf6;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:visible;transition:all .4s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 15px rgba(139,92,246,.4);font-family:system-ui,sans-serif}.btn-portal .portal-ring{position:absolute;width:60px;height:60px;border:4px dashed #c4b5fd;border-radius:50%;opacity:0;pointer-events:none}.btn-portal .object-icon{position:absolute;font-size:24px;opacity:0}.btn-portal.is-opening{width:80px;height:80px;border-radius:50%;background:#0f0a2e;box-shadow:0 0 60px #8b5cf6,0 0 120px rgba(139,92,246,.3),inset 0 0 40px #c4b5fd}.btn-portal.is-opening .text{opacity:0}.btn-portal.is-opening .portal-ring{opacity:1;animation:spin-portal 2s linear infinite}.btn-portal.is-opening .object-icon{opacity:1;animation:get-sucked-in 1.8s ease-in .3s forwards}@keyframes spin-portal{100%{transform:rotate(360deg)}}@keyframes get-sucked-in{0%{transform:scale(2.5) rotate(0);opacity:0}30%{transform:scale(1.2) rotate(360deg);opacity:1}70%{transform:scale(.3) rotate(720deg);opacity:.5}100%{transform:scale(0) rotate(1080deg);opacity:0}}
Tailwind CSS
<button class="w-[160px] h-[50px] rounded-xl border-none bg-violet-500 text-white text-base font-bold cursor-pointer relative flex items-center justify-center overflow-visible transition-all duration-400 shadow-[0_4px_15px_rgba(139,92,246,0.4)] [&.is-opening]:w-[80px] [&.is-opening]:h-[80px] [&.is-opening]:rounded-full [&.is-opening]:bg-[#0f0a2e] [&.is-opening]:shadow-[0_0_60px_#8b5cf6,0_0_120px_rgba(139,92,246,0.3),inset_0_0_40px_#c4b5fd] [&.is-opening]:text-transparent" id="tw-portal">
  <span class="text">Teleport</span>
  <span class="portal-ring absolute w-[60px] h-[60px] border-4 border-dashed border-violet-300 rounded-full opacity-0 pointer-events-none"></span>
  <span class="object-icon absolute text-2xl opacity-0">📦</span>
</button>
React
import React from 'react';
import { motion } from 'framer-motion';

function SpacePortalButton() {
  const [state, setState] = React.useState('idle');
  const handleClick = () => {
    if (state !== 'idle') return;
    setState('opening');
    setTimeout(() => setState('delivered'), 2500);
    setTimeout(() => setState('idle'), 5000);
  };
  const open = state === 'opening';
  const done = state === 'delivered';
  return (
    <motion.button onClick={handleClick}
      style={{ width: open ? 70 : 160, height: open ? 70 : 50, borderRadius: open ? '50%' : 12, border: 'none', cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', position: 'relative', fontSize: 16, fontWeight: 700, color: open ? 'transparent' : '#fff', background: open ? '#1e1b4b' : '#8b5cf6', boxShadow: open ? '0 0 30px #8b5cf6, inset 0 0 20px #c4b5fd' : '0 4px 15px rgba(139,92,246,0.4)', transition: 'all 0.4s cubic-bezier(0.4,0,0.2,1)', overflow: 'hidden', fontFamily: 'system-ui, sans-serif' }}
      whileTap={state === 'idle' ? { scale: 0.95 } : {}} disabled={state !== 'idle'}>
      <span style={{ position: 'relative', zIndex: 2 }}>{done ? 'Delivered' : ''}</span>
      <motion.div style={{ position: 'absolute', width: 60, height: 60, border: '4px dashed #c4b5fd', borderRadius: '50%', pointerEvents: 'none', opacity: 0 }}
        animate={open ? { opacity: 1, rotate: 360 } : { opacity: 0 }} transition={open ? { rotate: { duration: 3, repeat: Infinity, ease: 'linear' } } : {}} />
      <motion.span style={{ position: 'absolute', fontSize: 24, opacity: 0 }}
        animate={open ? { scale: [2, 1, 0], rotate: [0, 720], opacity: [0, 1, 0] } : {}}
        transition={{ duration: 1.5, ease: 'easeIn', delay: 0.5 }}>📦</motion.span>
    </motion.button>
  );
}
Vue
<template>
  <button class="btn-portal" :class="{'is-opening':state==='opening'}" @click="handleClick" :disabled="state!=='idle'">
    <span class="text">{{ state==='delivered' ? 'Delivered' : '' }}</span>
    <span class="portal-ring"></span>
    <span class="object-icon">📦</span>
  </button>
</template>
<script setup>
import { ref } from 'vue';
const state = ref('idle');
function handleClick() {
  if (state.value !== 'idle') return;
  state.value = 'opening';
  setTimeout(() => state.value = 'delivered', 2500);
  setTimeout(() => state.value = 'idle', 5000);
}
</script>
<style scoped>
.btn-portal{width:160px;height:50px;border-radius:12px;border:none;background:#8b5cf6;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .4s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 15px rgba(139,92,246,.4);font-family:system-ui,sans-serif}.btn-portal .portal-ring{position:absolute;width:60px;height:60px;border:4px dashed #c4b5fd;border-radius:50%;opacity:0;pointer-events:none}.btn-portal .object-icon{position:absolute;font-size:24px;opacity:0}.btn-portal.is-opening{width:70px;height:70px;border-radius:50%;background:#1e1b4b;box-shadow:0 0 30px #8b5cf6,inset 0 0 20px #c4b5fd}.btn-portal.is-opening .text{opacity:0}.btn-portal.is-opening .portal-ring{opacity:1;animation:spin-portal 3s linear infinite}.btn-portal.is-opening .object-icon{opacity:1;animation:get-sucked-in 1.5s forwards ease-in;animation-delay:.5s}@keyframes spin-portal{100%{transform:rotate(360deg)}}@keyframes get-sucked-in{0%{transform:scale(2) rotate(0);opacity:0}20%{transform:scale(1) rotate(0);opacity:1}100%{transform:scale(0) rotate(720deg);opacity:0}}
</style>
Svelte
<script>
  let state = 'idle';
  function handleClick() {
    if (state !== 'idle') return;
    state = 'opening';
    setTimeout(() => state = 'delivered', 2500);
    setTimeout(() => state = 'idle', 5000);
  }
</script>
<button class="btn-portal" class:is-opening={state==='opening'} on:click={handleClick} disabled={state!=='idle'}>
  <span class="text">{state==='delivered' ? 'Delivered' : ''}</span>
  <span class="portal-ring"></span>
  <span class="object-icon">📦</span>
</button>
<style>
.btn-portal{width:160px;height:50px;border-radius:12px;border:none;background:#8b5cf6;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .4s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 15px rgba(139,92,246,.4)}.btn-portal .portal-ring{position:absolute;width:60px;height:60px;border:4px dashed #c4b5fd;border-radius:50%;opacity:0;pointer-events:none}.btn-portal .object-icon{position:absolute;font-size:24px;opacity:0}.btn-portal.is-opening{width:70px;height:70px;border-radius:50%;background:#1e1b4b;box-shadow:0 0 30px #8b5cf6,inset 0 0 20px #c4b5fd}.btn-portal.is-opening .text{opacity:0}.btn-portal.is-opening .portal-ring{opacity:1;animation:spin-portal 3s linear infinite}.btn-portal.is-opening .object-icon{opacity:1;animation:get-sucked-in 1.5s forwards ease-in;animation-delay:.5s}@keyframes spin-portal{100%{transform:rotate(360deg)}}@keyframes get-sucked-in{0%{transform:scale(2) rotate(0);opacity:0}20%{transform:scale(1) rotate(0);opacity:1}100%{transform:scale(0) rotate(720deg);opacity:0}}
</style>
Angular
import { Component } from '@angular/core';
@Component({
  selector: 'app-space-portal-button',
  template: `<button class="btn-portal" [class.is-opening]="state==='opening'" (click)="handleClick()" [disabled]="state!=='idle'">
    <span class="text">{{ state==='delivered' ? 'Delivered' : '' }}</span>
    <span class="portal-ring"></span>
    <span class="object-icon">📦</span>
  </button>`,
  styles: [`.btn-portal{width:160px;height:50px;border-radius:12px;border:none;background:#8b5cf6;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .4s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 15px rgba(139,92,246,.4)}.btn-portal .portal-ring{position:absolute;width:60px;height:60px;border:4px dashed #c4b5fd;border-radius:50%;opacity:0;pointer-events:none}.btn-portal .object-icon{position:absolute;font-size:24px;opacity:0}.btn-portal.is-opening{width:70px;height:70px;border-radius:50%;background:#1e1b4b;box-shadow:0 0 30px #8b5cf6,inset 0 0 20px #c4b5fd}.btn-portal.is-opening .text{opacity:0}.btn-portal.is-opening .portal-ring{opacity:1;animation:spin-portal 3s linear infinite}.btn-portal.is-opening .object-icon{opacity:1;animation:get-sucked-in 1.5s forwards ease-in;animation-delay:.5s}@keyframes spin-portal{100%{transform:rotate(360deg)}}@keyframes get-sucked-in{0%{transform:scale(2) rotate(0);opacity:0}20%{transform:scale(1) rotate(0);opacity:1}100%{transform:scale(0) rotate(720deg);opacity:0}}`]
})
export class SpacePortalButtonComponent { state='idle';handleClick(){if(this.state!=='idle')return;this.state='opening';setTimeout(()=>this.state='delivered',2500);setTimeout(()=>this.state='idle',5000);}}
LWC — HTML template
<template><button class="btn-portal" onclick={handleClick} disabled={disabled}>
  <span class="text">{label}</span>
  <span class="portal-ring"></span>
  <span class="object-icon">📦</span>
</button></template>
LWC — JavaScript
import { LightningElement } from 'lwc';
export default class SpacePortalButton extends LightningElement {
  state = 'idle';
  get disabled() { return this.state !== 'idle'; }
  get label() { return this.state === 'delivered' ? 'Delivered' : ''; }
  handleClick() {
    if (this.state !== 'idle') return;
    this.state = 'opening';
    const btn = this.template.querySelector('button');
    btn.classList.add('is-opening');
    setTimeout(() => { btn.classList.remove('is-opening'); this.state = 'delivered'; }, 2500);
    setTimeout(() => { this.state = 'idle'; }, 5000);
  }
}
LWC — CSS
.btn-portal{width:160px;height:50px;border-radius:12px;border:none;background:#8b5cf6;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .4s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 15px rgba(139,92,246,.4)}.btn-portal .portal-ring{position:absolute;width:60px;height:60px;border:4px dashed #c4b5fd;border-radius:50%;opacity:0;pointer-events:none}.btn-portal .object-icon{position:absolute;font-size:24px;opacity:0}.btn-portal.is-opening{width:70px;height:70px;border-radius:50%;background:#1e1b4b;box-shadow:0 0 30px #8b5cf6,inset 0 0 20px #c4b5fd}.btn-portal.is-opening .text{opacity:0}.btn-portal.is-opening .portal-ring{opacity:1;animation:spin-portal 3s linear infinite}.btn-portal.is-opening .object-icon{opacity:1;animation:get-sucked-in 1.5s forwards ease-in;animation-delay:.5s}@keyframes spin-portal{100%{transform:rotate(360deg)}}@keyframes get-sucked-in{0%{transform:scale(2) rotate(0);opacity:0}20%{transform:scale(1) rotate(0);opacity:1}100%{transform:scale(0) rotate(720deg);opacity:0}}
LWC — Configuration
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
  <apiVersion>59.0</apiVersion>
  <isExposed>true</isExposed>
  <targets><target>lightning__AppPage</target><target>lightning__RecordPage</target><target>lightning__HomePage</target></targets>
</LightningComponentBundle>

Where Space Portal fits

  • Teleport
  • Transport
  • Portal
  • Delivery
  • Warp

Interaction states & animations

  • Portal Open
  • Spin Vortex
  • Suck In
  • Warp Effect

Topics

  • #portal
  • #space
  • #teleport
  • #warp
  • #vortex
  • #dimensional

Accessibility notes

Spinning portal may cause dizziness — respect prefers-reduced-motion. Announce state changes.

Browser support

  • All modern browsers