diff --git a/contract/.gitignore b/contract/.gitignore new file mode 100644 index 0000000..378b0b4 --- /dev/null +++ b/contract/.gitignore @@ -0,0 +1 @@ +*.pk diff --git a/contract/build/.gitkeep b/contract/build/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/contract/build/boc/.gitkeep b/contract/build/boc/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/contract/fift/.gitkeep b/contract/fift/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/contract/fift/data.fif b/contract/fift/data.fif new file mode 100644 index 0000000..212f06e --- /dev/null +++ b/contract/fift/data.fif @@ -0,0 +1,12 @@ +"TonUtil.fif" include +"Asm.fif" include + +"build/contract.pk" load-generate-keypair // generate key pair +constant private_key // save private to constant +constant public_key // save public to constant + + \ No newline at end of file diff --git a/contract/fift/examples/parse_get_cell.fif b/contract/fift/examples/parse_get_cell.fif new file mode 100644 index 0000000..3775312 --- /dev/null +++ b/contract/fift/examples/parse_get_cell.fif @@ -0,0 +1,21 @@ +"Color.fif" include +.s // prints stack + +// you will see that integer and cell slice are in stack + +// print seqno (it is just int in stack) +."🤗 Seqno as int from " ^green ."GET" ^reset ." method is: " + +swap // get seqno as int on top of stack +(dump) // dump to string +type // print it to output +cr // print endline + + [-x *] [-n|-b] [-t] [-B ] [-C ] []" +cr +tab + +"Creates a request to advanced wallet created by new-wallet-v3.fif, with private key loaded from file .pk " + +"and address from .addr, and saves it into .boc ('wallet-query.boc' by default)" + disable-digit-options generic-help-setopt + "n" "--no-bounce" { false =: allow-bounce } short-long-option + "Clears bounce flag" option-help + "b" "--force-bounce" { true =: force-bounce } short-long-option + "Forces bounce flag" option-help + "x" "--extra" { $>xcc extra-cc+! } short-long-option-arg + "Indicates the amount of extra currencies to be transfered" option-help + "t" "--timeout" { parse-int =: timeout } short-long-option-arg + "Sets expiration timeout in seconds (" timeout (.) $+ +" by default)" option-help + "B" "--body" { =: body-fift-file } short-long-option-arg + "Sets the payload of the transfer message" option-help + "C" "--comment" { =: comment } short-long-option-arg + "Sets the comment to be sent in the transfer message" option-help + "m" "--mode" { parse-int =: send-mode } short-long-option-arg + "Sets transfer mode (0..255) for SENDRAWMSG (" send-mode (.) $+ +" by default)" + option-help + "h" "--help" { usage } short-long-option + "Shows a help message" option-help +parse-options + +$# dup 5 < swap 6 > or ' usage if +6 :$1..n + +true constant bounce +$1 =: file-base +$2 bounce parse-load-address force-bounce or allow-bounce and =: bounce 2=: dest_addr +$3 parse-int =: subwallet_id +$4 parse-int =: seqno +$5 $>cc extra-cc+! extra-currencies @ 2=: amount +$6 "wallet-query" replace-if-null =: savefile +subwallet_id (.) 1 ' $+ does : +subwallet + +file-base +subwallet +".addr" dup file-exists? { drop file-base +".addr" } ifnot +load-address +2dup 2constant wallet_addr +."INFO: 👀 Source wallet address = " 2dup 6 .Addr cr +file-base +".pk" load-keypair nip constant wallet_pk + +def? body-fift-file { @' body-fift-file include } { comment simple-transfer-body } cond +constant body-cell + +."INFO: 👋 Send " dest_addr 2dup bounce 7 + .Addr ." = " +."subwallet_id=0x" subwallet_id x. +."seqno=0x" seqno x. ."bounce=" bounce . cr +."INFO: 🧟 Body of transfer message is " body-cell + + + +dup hashu wallet_pk ed25519_sign_uint + + +2 boc+>B + +saveboc // it is defined in build/cli.fif (or /tmp if in script mode) +// it is project-specific lib from tlcli thats specify needed locations diff --git a/contract/func/code.func b/contract/func/code.func new file mode 100644 index 0000000..e69de29 diff --git a/contract/project.yaml b/contract/project.yaml new file mode 100644 index 0000000..1e4f834 --- /dev/null +++ b/contract/project.yaml @@ -0,0 +1,4 @@ +contract: + data: fift/data.fif + func: + - func/code.func diff --git a/contract/tests/.gitkeep b/contract/tests/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/generated/merge.png b/generated/merge.png new file mode 100644 index 0000000..92c7805 Binary files /dev/null and b/generated/merge.png differ diff --git a/generated/merge_bp.png b/generated/merge_bp.png new file mode 100644 index 0000000..625591c Binary files /dev/null and b/generated/merge_bp.png differ diff --git a/generated/random.png b/generated/random.png new file mode 100644 index 0000000..88b9e76 Binary files /dev/null and b/generated/random.png differ diff --git a/generated/random_bp.png b/generated/random_bp.png new file mode 100644 index 0000000..b3d1cc8 Binary files /dev/null and b/generated/random_bp.png differ diff --git a/generator.py b/generator.py new file mode 100644 index 0000000..ac52308 --- /dev/null +++ b/generator.py @@ -0,0 +1,88 @@ +import cv2 +import numpy as np + +def create_blank(width, height, rgb_color=(0, 0, 0)): + # Create black blank image + image = np.zeros((height, width, 3), np.uint8) + + # Since OpenCV uses BGR, convert the color first + color = tuple(reversed(rgb_color)) + # Fill image with color + image[:] = color + + return image + +# Create new blank 300x300 red image + +def randomize(): + width, height = 1024, 1024 + image = create_blank(width, height, rgb_color=(0, 0, 0)) + for i in range(0, width): + for j in range(0, height): + b = np.random.randint(-10, 10) + g = np.random.randint(-10, 10) + r = np.random.randint(-10, 10) + image[i, j] = image[i-1, j-1] + [b, g, r] + return image + +def generate_content(frame, type): + if type == 'random': + for i in range(384, 640): + for j in range(384, 640): + b = np.random.randint(0, 255) + g = np.random.randint(0, 255) + r = np.random.randint(0, 255) + frame[i, j] = [b, g, r] + return frame + elif type == 'merge': + for i in range(384, 640): + for j in range(384, 640): + frame[i, j] = (frame[i-1, j] + frame[i, j-1]) / 2 + return frame + elif type == 'random_bp': + for i in range(384, 640, 8): + for j in range(384, 640, 8): + b = np.random.randint(0, 255) + g = np.random.randint(0, 255) + r = np.random.randint(0, 255) + for k in range(i, i+8): + for l in range(j, j+8): + frame[k, l] = [b, g, r] + return frame + elif type == 'merge_bp': + for i in range(384, 640, 8): + for j in range(384, 640, 8): + for k in range(i, i+8): + for l in range(j, j+8): + frame[k, l] = (frame[i-1, j] + frame[i, j-1]) / 2 + return frame + + +''' +out = cv2.VideoWriter('output.avi', cv2.VideoWriter_fourcc(*'XVID'), 20.0, (640,480)) + +for i in range(0, 100): + frame = randomize() + frame = generate_content(frame) + out.write(frame) + cv2.imshow('frame',frame) + if cv2.waitKey(1) & 0xFF == ord('q'): + break +out.release() +''' + +frame = randomize() +frame = generate_content(frame, 'random') +cv2.imwrite('generated/random.png', frame) + +frame = randomize() +frame = generate_content(frame, 'merge') +cv2.imwrite('generated/merge.png', frame) + +frame = randomize() +frame = generate_content(frame, 'random_bp') +cv2.imwrite('generated/random_bp.png', frame) + +frame = randomize() +frame = generate_content(frame, 'merge_bp') +cv2.imwrite('generated/merge_bp.png', frame) \ No newline at end of file diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..c2dea68 --- /dev/null +++ b/web/index.html @@ -0,0 +1,31 @@ + + + + + + + + AR-NFT + + + + + + + + + + + + +
+ +
absolutely random NFT generator
+
about
+
+ + \ No newline at end of file diff --git a/web/main.js b/web/main.js new file mode 100644 index 0000000..de452ea --- /dev/null +++ b/web/main.js @@ -0,0 +1,87 @@ +var deviceWidth = window.screen.width; + +fonts = ["'Andada Pro', serif", "'Anton', sans-serif", "'Archivo', sans-serif", "'BioRhyme', serif", "'Cormorant', serif", "'Encode Sans', sans-serif", "'Epilogue', sans-serif", "'Hahmlet', serif", "'Inter', sans-serif", "'JetBrains Mono', monospace", "'Lato', sans-serif", "'Lora', serif", "'Manrope', sans-serif", "'Montserrat', sans-serif", "'Nunito', sans-serif", "'Old Standard TT', serif", "'Open Sans', sans-serif", "'Oswald', sans-serif", "'Oxygen', sans-serif", "'Playfair Display', serif", "'Poppins', sans-serif", "'Raleway', sans-serif", "'Roboto', sans-serif", "'Sora', sans-serif", "'Source Sans Pro', sans-serif", "'Spectral', serif", "'Work Sans', sans-serif"] + +const generate_header = () => { + var img = Array(deviceWidth) + var tmp = Array(100) + for (var i = 0; i < deviceWidth; i++) { + img[i] = tmp + for (var j = 0; j < 100; j++) { + b = Math.floor(Math.random() * 256); + g = Math.floor(Math.random() * 256); + r = Math.floor(Math.random() * 256); + img[i][j] = [b, g, r] + } + } + cv.imwrite("header.png", img); + console.log("header.png generated"); +} + +const shuffle = (array) => { + let i = array.length + let j; + + while (i != 0) { + j = Math.floor(Math.random() * i); + i--; + [array[i], array[j]] = [array[j], array[i]]; + } + + return array; + } + +const main_load = async () => { + + // change title coloure + document.getElementsByClassName("title")[0].style.color = "rgb(255, 255, 255)"; + // change title font + document.getElementsByClassName("title")[0].style.fontFamily = "Comic Sans MS"; + // generate array of 20 random colours (colour is an array of 3 numbers) + var colours = Array(27) + for (var i = 0; i < 27; i++) { + colours[i] = Array(3) + for (var j = 0; j < 3; j++) { + colours[i][j] = Math.floor(Math.random() * 256); + } + } + shuffle(fonts) + for (var i = 0; i < 26; i++) { + document.getElementsByClassName("title")[0].style.color = "rgb(" + colours[i][0] + ", " + colours[i][1] + ", " + colours[i][2] + ")"; + document.getElementsByClassName("title")[0].style.fontFamily = fonts[i]; + await new Promise(r => setTimeout(r, 100)); + console.log("font: " + fonts[i]); + } + +} + + +/* +font-family: 'Andada Pro', serif; +font-family: 'Anton', sans-serif; +font-family: 'Archivo', sans-serif; +font-family: 'BioRhyme', serif; +font-family: 'Cormorant', serif; +font-family: 'Encode Sans', sans-serif; +font-family: 'Epilogue', sans-serif; +font-family: 'Hahmlet', serif; +font-family: 'Inter', sans-serif; +font-family: 'JetBrains Mono', monospace; +font-family: 'Lato', sans-serif; +font-family: 'Lora', serif; +font-family: 'Manrope', sans-serif; +font-family: 'Montserrat', sans-serif; +font-family: 'Nunito', sans-serif; +font-family: 'Old Standard TT', serif; +font-family: 'Open Sans', sans-serif; +font-family: 'Oswald', sans-serif; +font-family: 'Oxygen', sans-serif; +font-family: 'Playfair Display', serif; +font-family: 'Poppins', sans-serif; +font-family: 'Raleway', sans-serif; +font-family: 'Roboto', sans-serif; +font-family: 'Sora', sans-serif; +font-family: 'Source Sans Pro', sans-serif; +font-family: 'Spectral', serif; +font-family: 'Work Sans', sans-serif; +*/ \ No newline at end of file diff --git a/web/style.css b/web/style.css new file mode 100644 index 0000000..4edf302 --- /dev/null +++ b/web/style.css @@ -0,0 +1,27 @@ +@import url('https://fonts.googleapis.com/css2?family=Andada+Pro&family=Anton&family=Archivo&family=BioRhyme&family=Cormorant&family=Encode+Sans&family=Epilogue&family=Hahmlet&family=Inter&family=JetBrains+Mono&family=Lato&family=Lora&family=Manrope&family=Montserrat&family=Nunito&family=Old+Standard+TT&family=Open+Sans&family=Oswald&family=Oxygen&family=Playfair+Display&family=Poppins&family=Raleway&family=Roboto&family=Sora&family=Source+Sans+Pro&family=Spectral&family=Work+Sans&display=swap'); + + + + +header { + height: 35px; + display: flex; + justify-content: space-around; + align-items: center; +} + +.logo { + width: 200px; + align-items: center; +} + +.title { + width: 500px; + text-align: center; + font-size: 20px; +} + +.about { + width: 200px; + text-align: center; +} \ No newline at end of file