Index.vue 1.71 KB
<script setup>
</script>

<template>
  <div class="content-wrapper">
    <div class="container">
      <h1>自助报警系统</h1>
      <button class="alarm-btn" onclick="window.location.href='chat.html'">我要报案</button>
      <div class="image-container">
        <img src="@/assets/output.webp" alt="示例图片">
      </div>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    goToChat() {
      window.location.href = '/chat';
    }
  }
}
</script>

<style scoped>
.content-wrapper {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url('@/assets/bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  gap: 40px;

  .container {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 30px;
    border-radius: 15px;
    width: 500px;
    height: 400px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;

    h1 {
      color: #2175df;
      margin-bottom: 30px;
      font-size: 48px;
    }

    .alarm-btn {
      background-color: #2175df;
      color: white;
      border: none;
      padding: 25px 30px;
      font-size: 32px;
      cursor: pointer;
      margin-top: 20px;
      transition: all 0.3s;

      &:hover {
        transform: scale(1.05);
      }
    }

    .image-container {
      width: 320px;
      height: 672px;
      border-radius: 15px;
      overflow: hidden;
      position: absolute;
      left: -320px;
      top: 50%;
      transform: translateY(-50%);

      img {
        width: 100%;
      }
    }
  }
}
</style>