log-file-reader-template.html 2.28 KB
Newer Older
1
<!-- Copyright 2021 the V8 project authors. All rights reserved.
zeynepCankara's avatar
zeynepCankara committed
2 3 4
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->

5
<head>
6
  <link href="./index.css" rel="stylesheet" />
7
</head>
zeynepCankara's avatar
zeynepCankara committed
8 9 10 11 12 13 14
<style>
  #fileReader {
    height: 100px;
    line-height: 100px;
    text-align: center;
    cursor: pointer;
    transition: all 0.5s ease-in-out;
15
    background-color: var(--surface-color);
16 17
    border: solid 1px var(--file-reader-border-color);
    border-radius: 5px;
zeynepCankara's avatar
zeynepCankara committed
18
  }
19

20 21 22 23
  #fileReader:hover {
    background-color: var(--primary-color);
    color: var(--on-primary-color);
  }
zeynepCankara's avatar
zeynepCankara committed
24

25
  .done #fileReader {
26
    display: none;
zeynepCankara's avatar
zeynepCankara committed
27 28
  }

29 30
  .fail #fileReader {
    background-color: var(--error-color);
zeynepCankara's avatar
zeynepCankara committed
31 32 33 34 35 36
  }

  .loading #fileReader {
    cursor: wait;
  }

37
  #fileReader > input {
zeynepCankara's avatar
zeynepCankara committed
38 39 40 41 42
    display: none;
  }

  #loader {
    display: none;
43
    will-change: rotate;
zeynepCankara's avatar
zeynepCankara committed
44 45 46 47 48
  }

  .loading #loader {
    display: block;
    position: fixed;
49
    z-index: 9999;
zeynepCankara's avatar
zeynepCankara committed
50 51 52 53
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
54
    background-color: var(--file-reader-background-color);
zeynepCankara's avatar
zeynepCankara committed
55
  }
56

57
  #spinner, #progress, #progressText {
zeynepCankara's avatar
zeynepCankara committed
58
    position: absolute;
59 60
    width: 120px;
    height: 120px;
zeynepCankara's avatar
zeynepCankara committed
61 62
    top: 40%;
    left: 50%;
63
    margin-left: calc(-60px - 10px);
zeynepCankara's avatar
zeynepCankara committed
64
    border-radius: 50%;
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
  }
  #spinner {
    border: 20px solid var(--surface-color);
    border-top: 20px solid var(--primary-color);
    animation: spin 1s linear infinite;
    will-change: transform;
    transform: scale(1.1);
  }

  #progress, #progressText {
    padding: 20px;
  }

  #progress {
    transition: all 0.5s ease-in-out;
  }

  #progressText {
    line-height: 120px;
    font-size: 28px;
    transform: scale(0.55);
    text-align: center;
    vertical-align: middle;
    background-color:  var(--surface-color);
zeynepCankara's avatar
zeynepCankara committed
89 90
  }

91 92 93 94
  #label {
    user-select: none;
  }

zeynepCankara's avatar
zeynepCankara committed
95
  @keyframes spin {
96
    0% {
zeynepCankara's avatar
zeynepCankara committed
97
      transform: rotate(0deg);
98 99 100
    }

    100% {
zeynepCankara's avatar
zeynepCankara committed
101
      transform: rotate(360deg);
102
    }
zeynepCankara's avatar
zeynepCankara committed
103 104
  }
</style>
105
<div id="root">
106
  <div id="fileReader" class="panel" tabindex="1">
107 108 109
    <span id="label">
      Drag and drop a v8.log file into this area, or click to choose from disk.
    </span>
110
    <input id="file" type="file" name="file" />
111 112
  </div>
  <div id="loader">
113
    <div id="progress"></div>
114
    <div id="spinner"></div>
115
    <div id="progressText"></div>
116
  </div>
117
</div>