File size: 3,637 Bytes
646794f
 
 
 
 
1113aa2
646794f
 
 
 
 
 
 
1113aa2
 
 
646794f
 
 
1113aa2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
646794f
 
 
1113aa2
 
 
 
 
 
 
 
 
f752bd8
1113aa2
443f404
 
 
 
1113aa2
 
 
 
 
646794f
 
 
1113aa2
 
 
 
 
 
 
 
 
 
 
 
 
2ba5b44
646794f
 
b50fb29
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Software Testing — Playground</title>
<style>
  :root {
    --bg: #1e1e2e; --panel: #252535; --border: #353550;
    --accent: #89b4fa; --accent-hover: #74a0f0;
    --text: #cdd6f4; --muted: #7f849c;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; }
  body {
    display: flex; height: 100vh; overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg); color: var(--text);
  }
  /* ===== Left sidebar ===== */
  nav.sidebar {
    width: 210px; flex: 0 0 210px; background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 14px 10px; gap: 4px;
  }
  .sidebar .brand {
    font-size: 13px; font-weight: 700; color: var(--text);
    padding: 6px 10px 14px; letter-spacing: .02em;
  }
  .sidebar .brand small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; margin-top: 3px; }
  .sidebar .nav-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted); padding: 10px 10px 4px;
  }
  .sidebar button.item {
    display: block; width: 100%; text-align: left;
    background: transparent; color: var(--text); border: none;
    padding: 9px 12px; border-radius: 7px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background .12s, color .12s;
  }
  .sidebar button.item:hover { background: var(--border); }
  .sidebar button.item.active { background: var(--accent); color: #11111b; }
  .sidebar button.item .sub { display: block; font-size: 11px; font-weight: 500; opacity: .8; margin-top: 2px; }
  .sidebar .spacer { flex: 1; }
  .sidebar .foot { font-size: 10px; color: var(--muted); padding: 8px 10px; line-height: 1.5; }
  /* ===== Content frame ===== */
  .content { flex: 1; min-width: 0; }
  .content iframe { width: 100%; height: 100%; border: none; display: block; }
</style>
</head>
<body>
  <nav class="sidebar">
    <div class="brand">Software Testing<small>UNSW · Playground</small></div>
    <div class="nav-label">Assignments</div>
    <button class="item active" data-src="assignment1.html">
      Assignment 1
      <span class="sub">Black-box testing playground</span>
    </button>
    <button class="item" data-src="assignment2.html">
      Assignment 2
      <span class="sub">Decision tables · CFG · loops</span>
    </button>
    <button class="item" data-src="assignment3.html">
      Assignment 3
      <span class="sub">Scaffolding · combinatorial · mutation</span>
    </button>
    <div class="spacer"></div>
    <div class="foot">Pick an assignment on the left.<br>Assignment 2 has an interactive Q4 and a JSON export.</div>
  </nav>
  <div class="content">
    <iframe id="frame" src="assignment1.html" title="assignment"></iframe>
  </div>

<script>
  const frame = document.getElementById("frame");
  const items = [...document.querySelectorAll(".sidebar button.item")];
  // restore last-selected assignment
  const last = localStorage.getItem("st_last_assignment");
  if (last) {
    const btn = items.find(b => b.dataset.src === last);
    if (btn) { items.forEach(i => i.classList.remove("active")); btn.classList.add("active"); frame.src = last; }
  }
  items.forEach(btn => btn.onclick = () => {
    items.forEach(i => i.classList.remove("active"));
    btn.classList.add("active");
    frame.src = btn.dataset.src;
    localStorage.setItem("st_last_assignment", btn.dataset.src);
  });
</script>
</body>
</html>