Changes for page Academy

Last modified by Erik Bakker on 2024/09/24 16:12

From version 26.1
edited by Erik Bakker
on 2022/04/21 15:41
Change comment: Added object
To version 37.1
edited by Erik Bakker
on 2022/04/21 15:54
Change comment: Added object

Summary

Details

XWiki.GadgetClass[1]
content
... ... @@ -1,48 +1,113 @@
1 1  {{html}}
2 -<section class="info">
3 - <img src="https://codetheweb.blog/assets/img/icon2.png">
4 - <h1>Learn HTML &mdash; <a href="https://codetheweb.blog/" target="_blank">Code The Web</a></h1>
5 -</section>
6 -<section class="cards-wrapper">
7 - <div class="card-grid-space">
8 - <div class="num">01</div>
9 - <a class="card" href="https://codetheweb.blog/2017/10/06/html-syntax/" style="--bg-img: url(https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?container=focus&resize_w=1500&url=https://codetheweb.blog/assets/img/posts/html-syntax/cover.jpg)">
10 - <div>
11 - <h1>HTML Syntax</h1>
12 - <p>The syntax of a language is how it works. How to actually write it. Learn HTML syntax…</p>
13 - <div class="date">6 Oct 2017</div>
14 - <div class="tags">
15 - <div class="tag">HTML</div>
16 - </div>
17 - </div>
18 - </a>
2 +<!DOCTYPE html>
3 +<html>
4 +<head>
5 +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
6 +<style>
7 +* {
8 + box-sizing: border-box;
9 +}
10 +
11 +/* Create two equal columns that floats next to each other */
12 +.column {
13 + float: left;
14 + width: 50%;
15 + padding: 10px;
16 +}
17 +
18 +/* Clear floats after the columns */
19 +.row:after {
20 + content: "";
21 + display: table;
22 + clear: both;
23 +}
24 +/* Style the buttons */
25 +.btn {
26 + border: none;
27 + outline: none;
28 + padding: 12px 16px;
29 + background-color: #f1f1f1;
30 + cursor: pointer;
31 +}
32 +
33 +.btn:hover {
34 + background-color: #ddd;
35 +}
36 +
37 +.btn.active {
38 + background-color: #666;
39 + color: white;
40 +}
41 +</style>
42 +</head>
43 +<body>
44 +
45 +<h2>List View or Grid View</h2>
46 +
47 +<p>Click on a button to choose list view or grid view.</p>
48 +
49 +<div id="btnContainer">
50 + <button class="btn" onclick="listView()"><i class="fa fa-bars"></i> List</button>
51 + <button class="btn active" onclick="gridView()"><i class="fa fa-th-large"></i> Grid</button>
52 +</div>
53 +<br>
54 +
55 +<div class="row">
56 + <div class="column" style="background-color:#aaa;">
57 + <h2>Column 1</h2>
58 + <p>Some text..</p>
19 19   </div>
20 - <div class="card-grid-space">
21 - <div class="num">02</div>
22 - <a class="card" href="https://codetheweb.blog/2017/10/09/basic-types-of-html-tags/" style="--bg-img: url('https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?container=focus&resize_w=1500&url=https://codetheweb.blog/assets/img/posts/basic-types-of-html-tags/cover.jpg')">
23 - <div>
24 - <h1>Basic types of HTML tags</h1>
25 - <p>Learn about some of the most common HTML tags…</p>
26 - <div class="date">9 Oct 2017</div>
27 - <div class="tags">
28 - <div class="tag">HTML</div>
29 - </div>
30 - </div>
31 - </a>
60 + <div class="column" style="background-color:#bbb;">
61 + <h2>Column 2</h2>
62 + <p>Some text..</p>
32 32   </div>
33 - <div class="card-grid-space">
34 - <div class="num">03</div>
35 - <a class="card" href="https://codetheweb.blog/2017/10/14/links-images-about-file-paths/" style="--bg-img: url('https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?container=focus&resize_w=1500&url=https://codetheweb.blog/assets/img/posts/links-images-about-file-paths/cover.jpg')">
36 - <div>
37 - <h1>Links, images and about file paths</h1>
38 - <p>Learn how to use links and images along with file paths…</p>
39 - <div class="date">14 Oct 2017</div>
40 - <div class="tags">
41 - <div class="tag">HTML</div>
42 - </div>
43 - </div>
44 - </a>
64 +</div>
65 +
66 +<div class="row">
67 + <div class="column" style="background-color:#ccc;">
68 + <h2>Column 3</h2>
69 + <p>Some text..</p>
45 45   </div>
46 - <!-- https://images.unsplash.com/photo-1520839090488-4a6c211e2f94?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=38951b8650067840307cba514b554ba5&auto=format&fit=crop&w=1350&q=80 -->
47 -</section>
71 + <div class="column" style="background-color:#ddd;">
72 + <h2>Column 4</h2>
73 + <p>Some text..</p>
74 + </div>
75 +</div>
76 +
77 +<script>
78 +// Get the elements with class="column"
79 +var elements = document.getElementsByClassName("column");
80 +
81 +// Declare a loop variable
82 +var i;
83 +
84 +// List View
85 +function listView() {
86 + for (i = 0; i < elements.length; i++) {
87 + elements[i].style.width = "100%";
88 + }
89 +}
90 +
91 +// Grid View
92 +function gridView() {
93 + for (i = 0; i < elements.length; i++) {
94 + elements[i].style.width = "50%";
95 + }
96 +}
97 +
98 +/* Optional: Add active class to the current button (highlight it) */
99 +var container = document.getElementById("btnContainer");
100 +var btns = container.getElementsByClassName("btn");
101 +for (var i = 0; i < btns.length; i++) {
102 + btns[i].addEventListener("click", function() {
103 + var current = document.getElementsByClassName("active");
104 + current[0].className = current[0].className.replace(" active", "");
105 + this.className += " active";
106 + });
107 +}
108 +</script>
109 +
110 +</body>
111 +</html>
112 +
48 48  {{/html}}