repl.it
@mat1/

minecraft paintings

HTML, CSS, JS

No description

fork
loading
Files
  • index.html
  • minecraft
  • original
  • style.css
index.html
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Minecraft paintings</title>
    <link href="/style.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
		<p>Original artist: <a href="https://zetterstrand.com">Kristoffer Zetterstrand</a></p>
    <div id="paintings">

		</div>
		<script>
			const paintings = [
				{
					'minecraft': 'alban.png',
					'original': 'alban.jpeg',
					'size': '1x1'
				},
				{
					'minecraft': 'aztec.png',
					'original': 'aztbig.jpg',
					'size': '1x1'
				},
				{
					'minecraft': 'aztec2.png',
					'original': 'de_aztec.jpg',
					'size': '1x1'
				},
				{
					'minecraft': 'bomb.png',
					'original': 'bomb.jpg',
					'size': '1x1'
				},
				{
					'minecraft': 'burning_skull.png',
					'original': 'skull_on_fire_700.jpg',
					'size': '4x4'
				},
				{
					'minecraft': 'bust.png',
					'original': 'bust.jpg',
					'size': '2x2'
				},
				{
					'minecraft': 'courbet.png',
					'original': 'bonjourmonsieurcourbet.jpg',
					'size': '2x1'
				},
				{
					'minecraft': 'creebet.png',
					'original': 'SeaSide.jpg',
					'size': '2x1'
				},
				{
					'minecraft': 'donkey_kong.png',
					'original': 'kong.jpg',
					'size': '4x3',
				},
				{
					'minecraft': 'fighters.png',
					'original': 'fighters.jpg',
					'size': '4x2',
				},
				{
					'minecraft': 'graham.png',
					'original': 'graham.jpg',
					'size': '1x2',
				},
				{
					'minecraft': 'kebab.png',
					'original': 'kebab2.jpg',
					'size': '1x1',
				},
				{
					'minecraft': 'match.png',
					'original': 'Match_rgb.jpg',
					'size': '2x2',
				},
				{
					'minecraft': 'pigscene.png',
					'original': 'rgb.jpg',
					'size': '4x4',
				},
				{
					'minecraft': 'plant.png',
					'original': 'paradistrad.jpeg',
					'size': '1x1',
				},
				{
					'minecraft': 'pointer.png',
					'original': 'pointer750.jpg',
					'size': '4x4',
				},

				{
					'minecraft': 'sea.png',
					'original': 'SeaSide.jpg',
					'size': '2x1',
				},
				{
					'minecraft': 'skeleton.png',
					'original': 'mortal_coil.jpg',
					'size': '4x3',
				},
				{
					'minecraft': 'skull_and_roses.png',
					'original': 'moonlight_installation.jpg',
					'size': '2x2',
				},
				{
					'minecraft': 'stage.png',
					'original': 'The_stage_is_set.jpg',
					'size': '2x2',
				},
				{
					'minecraft': 'pool.png',
					'original': 'thepool.jpg',
					'size': '2x1',
				},
				{
					'minecraft': 'wanderer.png',
					'original': 'wanderer.jpg',
					'size': '1x2',
				},
				{
					'minecraft': 'wasteland.png',
					'original': 'wasteland.jpg',
					'size': '1x1',
				},
			]
			const paintingsEl = document.getElementById('paintings')
			for (painting of paintings) {
				var minecraftContainerEl = document.createElement('span')
				var minecraftEl = document.createElement('img')
				minecraftContainerEl.classList.add('minecraftContainer')
				minecraftEl.classList.add('minecraft')
				minecraftEl.src = '/minecraft/' + painting.minecraft
				
				minecraftContainerEl.append(minecraftEl)

				

				var originalEl = document.createElement('img')
				originalEl.src = '/original/' + painting.original
				originalEl.classList.add('original')

				var paintingEl = document.createElement('div')
				paintingEl.classList.add('painting')

				paintingEl.append(minecraftContainerEl)
				paintingEl.append(originalEl)
				paintingEl.classList.add('size-'+painting.size)
				const namespaceId = painting.minecraft.split('.')[0]
				paintingEl.id = namespaceId

				paintingsEl.append(paintingEl)
			}
		</script>
  </body>
</html>
result
console